-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaliases
231 lines (169 loc) · 6.32 KB
/
aliases
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# croped version ov mplayer to match aspect ratio of screen
alias mp="mplayer -panscan 1.0"
#open dialog
# alias open="gnome-open"
alias grep="grep --color=auto"
# aura without powerpill
alias auraP="aura --no-pp"
# default parameters
if which lsd >/dev/null; then
my_ls="lsd"
alias tree="lsd --tree"
else
my_ls="ls --color=auto"
fi
alias ls="${my_ls}"
# some more ls aliases
alias ll="${my_ls} -lhF"
# alias lld="${my_ls} -lhFd *(/)" # conflicts with lld program
alias l1="${my_ls} -1"
alias la="${my_ls} -A"
alias lr="${my_ls} -lhF --date relative" # will only work with lsd
# alias l="${my_ls} -CF"
unset my_ls
alias d='dirs -v'
alias dg='dirs -v | grep'
alias wgetcd='wget --content-disposition'
alias mv='mv -iv'
alias rm='rm -v'
alias cp='cp -iv'
alias gsb=git-show-branches
alias cdb=git-cd-branches
# clip board management
alias setclip="xclip -selection c"
alias getclip="xclip -selection c -o"
alias ilab="ipython -ic 'import numpy as np; import pylab as p; import matplotlib as mpl'"
alias ilab2="ipython2 -ic 'import numpy as np; import pylab as p; import matplotlib as mpl'"
alias calc="ipython -ic 'from math import *; from scipy.constants import *'"
alias calc2="ipython2 -ic 'from math import *; from scipy.constants import *'"
# alias ack='ack-grep -H --color --nogroup --column'
# alias ackc='ack -H --color'
alias nixpkgs='xdg-open https://github.com/NixOS/nixpkgs'
alias psg='ps aux | grep'
# open tmux in 256 color mode and attach to running session
# -u for utf8 display
alias tm="tmux -u attach"
# open tmux to attach to session <target>
alias tma="tmux -u attach-session -t"
# restore environment
alias tmu="source <(tmux showenv | grep -v '^-' | sed -E 's:^\s*(.*)=(.*)$:export \1=\"\2\":g')"
alias tmcu="source <(tmux2 showenv | grep -v '^-' | sed -E 's:^\s*(.*)=(.*)$:export \1=\"\2\":g')"
# default parameters for feh
alias fehm="feh -dx. -A 'echo %f' --auto-rotate"
# git update submodules
# alias gsu="git submodule init && git submodule update"
alias gsu="git submodule update --recursive --init"
alias gsur="git submodule update --recursive --init --remote --rebase"
# Make grep more colorful
alias grepc="grep --color"
if which parallel-moreutils &>/dev/null; then
alias -g parallel=parallel-moreutils
fi
# deprecated: use xcopy function
alias copy='xclip -i -selection clipboard'
# Schneller Zugriff auf tief vergrabene Uni Sachen
# Pyhton interactiven interpreter mit startupfile aufrufen
# Advanced Aliases (man zshbuiltins)
# ==================================
# Suffix: .txt -> vim, .com -> $BROWSER
# Global: P V H T G X ZF NE NO DN
# Global aliases
alias -g C=' | wc -l'
alias -g G=' | grep --color'
alias -g H=' | hgrep --term-width "$COLUMNS" | less -R'
alias -g P=' | less'
alias -g T=' | tail'
alias -g V=' | vim -'
alias -g X=' | xargs'
alias -g DN=/dev/null
alias -g NE="2> /dev/null" # No Errors
alias -g NO="1> /dev/null" # No Output
alias -g NA="&> /dev/null" # No Output
# kubernetes
alias k=kubectl
complete -F __start_kubectl k
alias less='less -R'
alias js='j --stat'
# Some intuitive aliases for chmod
alias rw-='chmod 600'
alias rwx='chmod 700'
alias r--='chmod 644'
alias r-x='chmod 755'
# for file navigation
myalias='..'
mycmd='cd ..'
for i in {1..20}; do
eval "alias ${myalias}='${mycmd}'"
myalias="${myalias}."
mycmd="${mycmd}/.."
done
unset mycmd
unset myalias
# reload zsh config
alias zsh_reload='exec zsh'
alias ww='whatwhen'
alias h='find_in_hist'
# List recent directories
alias cdl='cdr -l'
alias kb_intl='setxkbmap us intl -model pc105; xmodmap ~/.xmodmap'
alias kb_us='setxkbmap us -model pc105; xmodmap ~/.xmodmap'
alias tmlac="tmux-launch-and-configure"
alias tmux_reattach_running="/proc/\$(pgrep -u \$USER tmux | head -n 1)/exe detach; /proc/\$(pgrep -u \$USER tmux | head -n 1)/exe attach"
alias tmar="tmux_reattach_running"
alias nvlcc="nvlc --no-color"
# alias mosh_ice='mosh --port=57022 --ssh="ssh -p 7022" gitviz.kip.uni-heidelberg.de'
# alias mosh_hel='mosh --port=61022 --ssh="ssh -p 11022" gitviz.kip.uni-heidelberg.de'
# alias mosh_beli='mosh --port=62022 --ssh="ssh -p 12022" gitviz.kip.uni-heidelberg.de'
alias mosh_ice='mosh --port=57087 --ssh="ssh -p 7022" gitviz.kip.uni-heidelberg.de'
alias mosh_hel='mosh --port=61087 --ssh="ssh -p 11022" gitviz.kip.uni-heidelberg.de'
alias mosh_beli='mosh --port=62087 --ssh="ssh -p 12022" gitviz.kip.uni-heidelberg.de'
alias monoff="xset dpms force off"
# alias diff_lines="diff --unchanged-line-format= --old-line-format= --new-line-format='%L'\" sums =(sha512sum fig/*.svg) | sed -e 's:^[0-9a-f]*\s*::'
alias lp_1="lp -o fit-to-page -o sides=one-sided -o media=A4 -d"
alias lp_2="lp -o fit-to-page -o sides=two-sided-long-edge -o media=A4 -d"
# safe sshfs (no weird file sizes etc)
alias ssshfs="sshfs -o writeback_cache=no,dir_cache=no"
alias susshfs="sshfs -o allow_root,writeback_cache=no,dir_cache=no,idmap=user"
alias keyboard_setup="setxkbmap us\
-variant altgr-intl \
-model pc105 \
-option \
-option compose:menu \
-option compose:prsc \
-option caps:escape \
-option lv3:ralt_switch \
-option eurosign:e \
-option nbsp:level3n"
# xmodmap ~/.Xmodmap"
alias keyboard_setup_lctl="localectl set-x11-keymap us pc105 altgr-intl \
compose:menu,compose:prsc,caps:escape,lv3:ralt_switch,eurosign:e,nbsp:level3n"
# sexecute currently used container (useful for slurm calls)
alias -g sexec="singularity exec \${SINGULARITY_APPNAME:+--app \${SINGULARITY_APPNAME}} \${SINGULARITY_CONTAINER:-/containers/stable/latest}"
alias mpv_no_spoiler="mpv --no-taskbar-progress --no-osc --osd-on-seek=no"
alias tt="task -lt -private"
# vim-fugitive as tig alternative
alias vig="nvim +Git +on"
alias archive_webpage="wget -E -H -k -K -p"
alias clear_color='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"'
alias killbg='kill -KILL ${${(v)jobstates##*:*:}%=*}'
if which rg >/dev/null; then
alias rgi='rg --no-ignore'
fi
if which difft &>/dev/null; then
alias gdt="GIT_EXTERNAL_DIFF=difft git"
alias gdifft="gdt diff"
fi
# strace only file operations
alias stracef='strace -y -e trace=open,openat,close,read,write,connect,accept'
alias rv=revcli
alias nts=neorg-task-sync
alias sc=slack-cli
alias ctl='cd "$(git rev-parse --show-toplevel)"'
alias g=git
alias zq="zoxide query"
alias ndr=nix-direnv-reload
alias nds="nix derivation show"
alias nix="noglob nix"
alias nom="noglob nom"
source "$ZSH_CFG_ROOT/aliases-suffix"
# vim: ft=zsh