From 7293bf4e4dc102872ab15f03ca05f93ebc33b801 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 17 Feb 2021 17:08:17 -0500 Subject: [PATCH] Update zsh aliases --- config/zsh/aliases.zsh | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh index e977e223..cf686c87 100644 --- a/config/zsh/aliases.zsh +++ b/config/zsh/aliases.zsh @@ -2,6 +2,7 @@ alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias -- -='cd -' +alias cdg='cd `git rev-parse --show-toplevel`' alias q=exit alias clr=clear @@ -9,22 +10,37 @@ alias sudo='sudo ' alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' -alias mkdir='mkdir -p' +alias mkdir='mkdir -pv' alias wget='wget -c' +alias path='echo -e ${PATH//:/\\n}' +alias ports='netstat -tulanp' alias mk=make -alias rcp='rsync -vaP --delete' -alias rmirror='rsync -rtvu --delete' alias gurl='curl --compressed' +alias shutdown='sudo shutdown' +alias reboot='sudo reboot' + +# A rsync that respects gitignore +rcp() { + rsync -azP --delete --delete-after \ + --delete-excluded \ + --filter=':- .gitignore' \ + --exclude-from="$XDG_CONFIG_HOME/git/ignore" \ + --include=.git \ + "$@" +}; compdef rcp=rsync +rcpd() { rcp "$1/" "$2" } + alias y='xclip -selection clipboard -in' alias p='xclip -selection clipboard -out' +alias jc='journalctl -xe' alias sc=systemctl alias ssc='sudo systemctl' if command -v exa >/dev/null; then - alias exa="exa --group-directories-first"; + alias exa="exa --group-directories-first --git"; alias l="exa -1"; alias ll="exa -lg"; alias la="LC_COLLATE=C exa -la"; @@ -40,6 +56,7 @@ zman() { PAGER="less -g -I -s '+/^ "$1"'" man zshall; } +# Create a reminder with human-readable durations, e.g. 15m, 1h, 40s, etc r() { local time=$1; shift sched "$time" "notify-send --urgency=critical 'Reminder' '$@'; ding";