~gpanders/dotfiles

dotfiles/.bash_aliases -rw-r--r-- 687 bytes View raw
5392594b — Gregory Anders fish: create non-existent venvs upon activation a day 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
40
41
42
alias l='ls -lh'
alias ll='ls -Alh'

alias g='git'

git() {
	if [ "$PWD" = "$HOME" ]; then
		command git --git-dir="$HOME/.dotfiles" --work-tree="$HOME" "$@"
	else
		command git "$@"
	fi
}

if command -v nvim >/dev/null; then
    alias vi='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" || return 1
}

cd() {
    builtin cd "$@" && pushd -n "$PWD" >/dev/null
}

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'