~gpanders/dotfiles

ref: 2da1dde5ea566f82ebe6532bc6d3b8670fd77ce8 dotfiles/bash/.bash_aliases -rw-r--r-- 616 bytes
2da1dde5Greg Anders Note 'open' subcommand opens editor in NOTES_DIR when no argument given 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
alias l="ls -lh"
alias ll="ls -Alh"

alias g="git"

if command -v nvim >/dev/null; then
    alias vi="nvim"
    alias vim="nvim"
fi

if [ -n "$EDITOR" ]; then
    alias e="$EDITOR"
fi

if [ -n "$BROWSER" ]; then
    alias b="$BROWSER"
fi

alias d="dirs -v"

mkdcd() {
    mkdir -p "$1" && cd "$1"
}

__cd() {
    builtin cd "$@"
    if [ $? -eq 0 ]; then
        pushd -n "$(pwd)" >/dev/null
    fi
}
alias cd=__cd

for i in $(seq 1 9)
do
    alias "$i"="builtin cd ~$i"
done

alias tmux="tmux -f ${XDG_CONFIG_HOME:-$HOME/.config}/tmux/tmux.conf"
alias weechat="weechat -d ${XDG_CONFIG_HOME:-$HOME/.config}/weechat"