-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.aliasrc
More file actions
52 lines (44 loc) · 1.48 KB
/
Copy path.aliasrc
File metadata and controls
52 lines (44 loc) · 1.48 KB
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
##### Renaming core system utilities ######
# Maybe change colors someday https://the.exa.website/docs/colour-themes
alias ls='eza --icons always'
alias l='eza --icons always'
alias ll='eza --icons always -l'
alias la='eza --icons always -a'
alias lla='eza --icons always -la'
alias cat='bat'
###### Git aliases ######
# TODO these should probably just live inside my global .gitconfig
# Git aliases from https://hackernoon.com/lesser-known-git-commands-151a1918a60
# These now live inside my global .gitconfig instead
###### Fancier Functions #####
# Use ^Z instead of typing fg manually
function fg-bg {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER=fg
zle accept-line
else
zle push-input
fi
}
# Bound later as a widget
tar-compress-dir-pipeview() {
if [ -d "$1" ]; then
dir=$(basename "$1")
tar -cf - "$1" | pv -s $(du -sb "$1" | awk '{print $1}') | gzip > "${dir}.tar.gz"
else
echo "'$1' is not a directory"
return 1
fi
}
###### Other aliases ######
alias tmux="tmux -u"
alias -g up='popd'
alias gmake="make" # shim for "compatability"
# TODO should these be functions?
alias git-watch="watch -c -t -n3 git --no-optional-locks -c color.status=always status"
alias git-logwatch="watch -c -t -n5 git --no-optional-locks -c color.ui=always log --decorate --oneline"
alias snl='sticky-note -l'
alias tarc='tar-compress-dir-pipeview'
###### Widgets ######
zle -N fg-bg
bindkey '^z' fg-bg