helm/config/zsh/aliases.zsh

75 lines
1.7 KiB
Bash
Raw Permalink Normal View History

alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias -- -='cd -'
2021-02-17 14:08:17 -08:00
alias cdg='cd `git rev-parse --show-toplevel`'
alias q=exit
alias clr=clear
alias sudo='sudo '
2019-08-06 10:56:54 -07:00
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
2021-02-17 14:08:17 -08:00
alias mkdir='mkdir -pv'
2019-08-06 10:56:54 -07:00
alias wget='wget -c'
2021-02-17 14:08:17 -08:00
alias path='echo -e ${PATH//:/\\n}'
alias ports='netstat -tulanp'
2019-08-06 10:56:54 -07:00
2019-11-26 14:04:55 -08:00
alias mk=make
2019-08-06 10:56:54 -07:00
alias gurl='curl --compressed'
2021-02-17 14:08:17 -08:00
alias shutdown='sudo shutdown'
alias reboot='sudo reboot'
# An rsync that respects gitignore
2021-02-17 14:08:17 -08:00
rcp() {
# -a = -rlptgoD
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve mtimes
# -g = preserve owning group
# -o = preserve owner
# -z = use compression
# -P = show progress on transferred file
# -J = don't touch mtimes on symlinks (always errors)
rsync -azPJ \
2021-02-17 20:23:06 -08:00
--include=.git/ \
2021-02-17 14:08:17 -08:00
--filter=':- .gitignore' \
2021-02-17 20:23:06 -08:00
--filter=":- $XDG_CONFIG_HOME/git/ignore" \
2021-02-17 14:08:17 -08:00
"$@"
}; compdef rcp=rsync
alias rcpd='rcp --delete --delete-after'
alias rcpu='rcp --chmod=go='
alias rcpdu='rcpd --chmod=go='
2021-02-17 14:08:17 -08:00
2019-08-06 10:56:54 -07:00
alias y='xclip -selection clipboard -in'
alias p='xclip -selection clipboard -out'
2021-02-17 14:08:17 -08:00
alias jc='journalctl -xe'
alias sc=systemctl
alias ssc='sudo systemctl'
if command -v exa >/dev/null; then
2021-02-17 14:08:17 -08:00
alias exa="exa --group-directories-first --git";
alias l="exa -1";
alias ll="exa -lg";
alias la="LC_COLLATE=C exa -la";
fi
2019-08-06 10:56:54 -07:00
autoload -U zmv
take() {
mkdir "$1" && cd "$1";
}; compdef take=mkdir
zman() {
2020-12-18 20:42:33 -08:00
PAGER="less -g -I -s '+/^ "$1"'" man zshall;
2019-08-06 10:56:54 -07:00
}
2021-02-17 14:08:17 -08:00
# Create a reminder with human-readable durations, e.g. 15m, 1h, 40s, etc
2019-08-06 10:56:54 -07:00
r() {
local time=$1; shift
sched "$time" "notify-send --urgency=critical 'Reminder' '$@'; ding";
}; compdef r=sched