-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases.sh
150 lines (132 loc) · 3.35 KB
/
.aliases.sh
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#!/bin/sh
#
# Aliases for sh-like shells
#
# Last update: Wed, 2004/03/10, 15:31:16
#
# get rid of the default stuff:
if test -n "$BASH_VERSION"; then
unalias -a
elif test -n "$ZSH_VERSION"; then
unalias -m '*'
fi
xrename() {
# Set the title of an xterm
# echo -n "]0;$1"
echo -n "]1;$1"
echo -n "]2;[$HOST] $1"
}
case "$HOSTTYPE" in
Linux*alpha*)
;;
*alpha*)
case "$OSTYPE" in
*osf1*)
alias gpi='xrename GNUPlot;gnuplot;xrename "Terminal"'
set color=ls-F
alias ls="ls"
alias ll="ls -ali"
alias l.="ls -d .[a-zA-Z]*"
alias n="netscape -install"
alias make="gmake"
alias mc="mc -b"
;;
*linux*)
;;
esac ;;
*[ix3456]86*)
alias ls="ls --color=tty"
alias ll="ls -ali --color=tty"
alias l.="ls -d .[a-zA-Z]* --color=tty"
;;
*HP-UX*)
alias make="gmake"
;;
*)
case "$OSTYPE" in
*linux*)
alias ll="ls --color=tty" # needs GNU style ls
;;
*freebsd*)
;;
esac
alias ll="ls -ali"
alias l.="ls -d .[a-zA-Z]*"
alias make="gmake"
alias mc="mc -b"
echo "*"
;;
esac
if [ -n $ZSH_VERSION ]; then
# history should behave like in all other shells
alias history='history 1'
fi
# The usual bindings
if [ -e `which vim` ]; then
alias vi='vim'
alias gvi='gvim'
alias se='vim -S Session.vim'
alias gse='gvim -S Session.vim'
alias di='vimdiff'
alias gdi='gvimdiff'
alias vr='gvim --remote-silent '
fi
alias 2a4='psnup -pA4 -2 '
alias prn='lp -o media=recycled'
alias 2p='prn -od '
alias help='vim -R $HOME/help'
alias lc='wc -l'
alias uni='unison -auto'
alias ff='locate'
# Create a booklet for duplex printing:
alias book='pstops "4:[email protected](21cm,0)[email protected](21cm,14.85cm),[email protected](21cm,0)[email protected](21cm,14.85cm)"'
# Some aliases for programming
# Note that these require certain tags within the makefile!
alias build='xrename Building...; make clean; make; xrename "Terminal"'
alias run='xrename Running...;make run; xrename "Terminal"'
alias debug='make debug'
alias plot='xrename Plotting...;make plot; xrename "Terminal"'
alias ,b='build'
alias ,r='run'
alias ,m='xrename Compiling...;make;xrename "Terminal"'
alias ftp='lftp'
alias h='history'
alias d='dirs'
alias pd='pushd'
alias d2='pushd +2'
alias po='popd'
# DOS-style aliases
alias rd='rmdir'
alias md='mkdir'
alias ren='mv'
alias dir='ls'
alias cls='clear'
# some vi style
alias :q="exit"
alias :q!="exit"
alias :e="$EDITOR"
alias :Gstatus="git status"
alias :Gdiff="git diff"
alias :Glog="git log"
alias :Gpull="git pull"
alias :Gpush="git push"
# alias xrwho 'xrwho -a -l -bell -snoop root -geometry 800x1000+1024+0 &'
alias un="uname -smr"
alias gi="grep -in "
alias sps="paper hep-ph0201233"
alias cpu="ps aux | awk 'NR == 1 || \$3 > 0'"
alias nav="exo-open "
# programming
alias perllint="perl -Mstrict -Mdiagnostics -cw "
alias mod="git status | grep modified | awk '{print \$2}'"
# Change directories
alias pd..='pd ..'
# Some terminal aliases. It comes in handy to have some terms with
# different colours. Names are just conventions from a project.
alias gitterm='xterm -bg lightgreen -fg black'
alias cdsterm='xterm -bg yellow -fg black'
alias pyterm='xterm -T "iPython [`hostname`]" +sb -fa Monospace -fs 12 -sl 5000 -bg black -fg white -e ipython'
alias perlterm='xterm -T "Perl [`hostname`]" +sb -fa Monospace -fs 12 -sl 5000 -bg black -fg white -e perl -d -e 1'
if [ -e $HOME/.aliases.sh.local ]; then
source $HOME/.aliases.sh.local
fi