forked from majnemer/davesdots
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path10_alias
executable file
·102 lines (86 loc) · 2.34 KB
/
10_alias
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#! /bin/sh
# colors
for dircolors in gdircolors dircolors ; do
if command -v $dircolors >/dev/null 2>&1 ; then
dircolor_text=''
if [ -f "${HOME}/.dir_colors" ] ; then
dircolor_text=`cat "${HOME}/.dir_colors"`
elif [ -f /etc/DIR_COLORS ] ; then
dircolor_text=`cat /etc/DIR_COLORS`
fi
if $dircolors --version 2>/dev/null | grep GNU >/dev/null 2>&1 ; then
dircolor_text="${dircolor_text}\nSTICKY_OTHER_WRITABLE 01;04;34;40"
dircolor_text="${dircolor_text}\nOTHER_WRITABLE 01;34;40"
fi
eval `echo "${dircolor_text}" | $dircolors -b -`
break
fi
done
# gimmie an editor, make it emacs or a nice vi clone
# but you can't find a vi clone keep trying!!
for EDITOR in vimx vim elvis vile nvi vi emacs nano pico; do
command -v $EDITOR >/dev/null 2>&1 && break
done
export EDITOR
# make the history editor the editor we want
FCEDIT=$EDITOR
export FCEDIT
# vimx -> vim
if [ "${EDITOR}" = vimx ] ; then
alias vim=vimx
fi
# aliases
alias cd..='cd ..'
# handles per OS aliases, fixes a few terms
case `uname -s` in
Linux|CYGWIN*)
alias ls="ls -h --color=auto"
alias grep='grep -d skip --color=auto'
;;
FreeBSD|Darwin|DragonFly)
if command -v top >/dev/null 2>&1 ; then
alias top="top -o cpu"
fi
if command -v gls >/dev/null 2>&1 ; then
alias ls="gls -h --color=auto"
elif ls --version 2>/dev/null | grep GNU >/dev/null 2>&1 ; then
alias ls="ls -h --color=auto"
else
LSCOLORS="ExGxFxDxCxDxDxHbaDEaEa"
export LSCOLORS
alias ls="ls -Gh"
fi
alias grep='grep -d skip --color=auto'
;;
Interix)
alias ls="ls --color"
;;
SunOS)
if command -v gls >/dev/null 2>&1 ; then
alias ls="gls -h --color=auto"
elif ls --version 2>/dev/null | grep GNU >/dev/null 2>&1 ; then
alias ls="ls -h --color=auto"
else
alias ls="ls -h"
fi
if command -v ggrep >/dev/null 2>&1 ; then
alias grep='ggrep -d skip --color=auto'
elif grep --version 2>/dev/null | grep GNU >/dev/null 2>&1 ; then
alias grep='grep -d skip --color=auto'
fi
for locate in glocate slocate ; do
command -v $locate >/dev/null 2>&1 && alias locate=$locate
done
;;
esac
if command -v gobjdump >/dev/null 2>&1 ; then
alias objdump=gobjdump
fi
if command -v ack-grep >/dev/null 2>&1 ; then
alias ack=ack-grep
fi
alias rm='rm -ir'
alias df='df -h'
alias du='du -h'
alias ping='ping -c4'
command -v time >/dev/null 2>&1 && alias time='command time'