aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/aliases.zsh
blob: 8e4f1a0ad9b4c12445cb7470f490d6fd42e0fbfe (plain)
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
##
# Aliases and functions
#

# Don't have run-help aliased to man
unalias run-help
alias help=run-help

alias '...'='../..'
alias '....'='../../..'

ls_options=('--almost-all' '--classify'  '--color=auto'
            '--human-readable' '--group-directories-first'
            '-v') # Natural sort
alias ls='\ls "${ls_options[@]}"'
alias ll='\ls "${ls_options[@]}" -l'

alias grep='\grep --color'
alias mkdir='mkdir -vp'
alias df='df -h'
alias pt='pstree --highlight-all --long --uid-changes'
alias pb='curl -F c=@- https://ptpb.pw/'

# Colored man
man() {
	env LESS_TERMCAP_mb=$(printf "\e[1;31m") \
	LESS_TERMCAP_md=$(printf "\e[1;31m") \
	LESS_TERMCAP_me=$(printf "\e[0m") \
	LESS_TERMCAP_se=$(printf "\e[0m") \
	LESS_TERMCAP_so=$(printf "\e[1;43m") \
	LESS_TERMCAP_ue=$(printf "\e[0m") \
	LESS_TERMCAP_us=$(printf "\e[1;32m") \
	man "$@"
}

tt() {
	if [[ -n "$@" ]]; then
		print "$@" | ts '[%Y-%m-%d %H:%M:%S]' >> "$HOME"/documents/timetracking
	fi
}