-
Notifications
You must be signed in to change notification settings - Fork 10
/
07_aliases.zsh
46 lines (39 loc) · 1.71 KB
/
07_aliases.zsh
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
# Some handy suffix aliases
alias -s log=less
# Override regular 'clear' with custom one, that puts prompt at bottom
alias clear=clear-screen-soft-bottom
# Prefer nvim when installed
(( ${+commands[nvim]} )) && {
alias nv="nvim"
alias vi="nvim"
alias vim="nvim"
}
# Human file sizes
(( ${+commands[df]} )) && alias df="df --human-readable --print-type"
(( ${+commands[du]} )) && alias du="du --human-readable --total"
# Handy stuff and a bit of XDG compliance
(( ${+commands[grep]} )) && alias grep="grep --color=auto --binary-files=without-match --devices=skip"
(( ${+commands[quilt]} )) && alias quilt="quilt --quiltrc ${DOTFILES}/configs/quiltrc"
(( ${+commands[tmux]} )) && {
alias stmux="tmux new-session 'sudo --login'"
}
(( ${+commands[wget]} )) && alias wget="wget --hsts-file=${XDG_CACHE_HOME}/wget-hsts"
(( ${+commands[ls]} )) && {
alias ls="ls --group-directories-first --color=auto --hyperlink=auto --classify"
alias ll="LC_COLLATE=C ls -l -v --almost-all --human-readable"
}
# History suppression
(( ${+commands[clear]} )) && alias clear=" clear"
alias pwd=" pwd"
alias exit=" exit"
# Safety
(( ${+commands[rm]} )) && alias rm="rm -I --preserve-root=all"
# Suppress suggestions and globbing, enable wrappers
(( ${+commands[find]} )) && alias find="noglob find"
(( ${+commands[touch]} )) && alias touch="nocorrect touch"
(( ${+commands[mkdir]} )) && alias mkdir="nocorrect mkdir"
(( ${+commands[cp]} )) && alias cp="nocorrect cp --verbose"
(( ${+commands[ag]} )) && alias ag="noglob ag"
(( ${+commands[fd]} )) && alias fd="noglob fd"
(( ${+commands[man]} )) && alias man="nocorrect wrap-man"
(( ${+commands[sudo]} )) && alias sudo="noglob wrap-sudo " # trailing space is needed to enable alias expansion