forked from jmhobbs/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_aliases.symlink
55 lines (47 loc) · 976 Bytes
/
bash_aliases.symlink
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
43
44
45
46
47
48
49
50
51
52
53
54
55
############
# todo.txt #
############
alias todo="$HOME/opt/bin/todo.sh -d $HOME/.todo.cfg"
source "$HOME/.todo_completion"
complete -F _todo todo
##########
# Remaps #
##########
type gzcat > /dev/null 2>&1
if [ $? != 0 ]; then
alias gzcat='gunzip -c'
fi
which gvim > /dev/null 2>&1
if [ $? != 0 ]; then
alias gvim='mvim'
fi
###########
# Helpers #
###########
alias quickserve="php -S localhost:6060"
# cd, but relative to closest .git root
function gcd {
GIT_ROOT="$(git root)"
if [ "0" != "$?" ]; then
echo "Not in a git repo!"
else
cd "$GIT_ROOT/$1"
fi
}
# Better man pages
which most > /dev/null 2>&1
if [ $? == "0" ]; then
export MANPAGER="most"
else
man() {
env \
LESS_TERMCAP_mb=$'\e[1;31m' \
LESS_TERMCAP_md=$'\e[1;31m' \
LESS_TERMCAP_me=$'\e[0m' \
LESS_TERMCAP_se=$'\e[0m' \
LESS_TERMCAP_so=$'\e[1;44;33m' \
LESS_TERMCAP_ue=$'\e[0m' \
LESS_TERMCAP_us=$'\e[1;32m' \
man "$@"
}
fi