From a3e8239fd6ecc2eb74fc35001cd4fec9ced212cc Mon Sep 17 00:00:00 2001 From: finga Date: Mon, 13 Jan 2020 21:29:12 +0100 Subject: [PATCH] add old .aliases --- .gitignore.d/zsh | 1 + .zprofile | 5 --- .zshenv | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 .zshenv diff --git a/.gitignore.d/zsh b/.gitignore.d/zsh index e6d8820..cd34abe 100644 --- a/.gitignore.d/zsh +++ b/.gitignore.d/zsh @@ -2,4 +2,5 @@ !/.gitignore.d !/.gitignore.d/zsh !/.zprofile +!/.zshenv !/.zshrc diff --git a/.zprofile b/.zprofile index 5b84201..7e3076a 100644 --- a/.zprofile +++ b/.zprofile @@ -38,8 +38,3 @@ fi if [ -d "$HOME/.cargo/bin" ] ; then PATH="$HOME/.cargo/bin:$PATH" fi - -# autoloads -if [ -f "$HOME/.autoload" ] ; then - . ~/.aliases -fi diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..20fb464 --- /dev/null +++ b/.zshenv @@ -0,0 +1,91 @@ +# +# Safety Aliases +# + +alias mv='mv -i -v' +alias rm='rm -i -v' +alias cp='cp -i -v' +alias ln='ln -i -v' +alias chown='chown --preserve-root' +alias chmod='chmod --preserve-root' +alias chgrp='chgrp --preserve-root' + +# +# Aliases +# + +alias pgrep='pgrep -a' +alias less='less -r' +alias grep='grep --color=always' +alias mkdir='mkdir -p -v' +alias ping='ping -c 10' +alias ls='ls --color=auto -h -l' +alias df='df -h' +alias em='emacsclient -t -a ""' +alias wicd='wicd-curses' +alias dmesg='dmesg -T' +alias head='head -n 50' +alias tail='tail -n 50' +alias cow='cowsay $(fortune)' +alias da='du --max-depth=1 2> /dev/null | sort -n -r | head -n20' +alias gwc='git ls-files | xargs cat | wc' +alias c2pdf='enscript -r -2 --highlight=c --line-numbers -o - $(git ls-files | grep -v .png | grep -v .xcf | grep -v .map) | ps2pdf -' +alias feh='feh -FZ' +alias white='i3lock' + +# +# Shortcuts +# + +alias la='ls -a' +alias l='la' +alias lsa='la' +alias ..='cd ..' +alias ~='cd ~' +alias a='apropos' +alias p='ping' +alias m='man' +alias s='sudo' +alias d='dirs -v' + +# dirs + +alias 1='cd -1' +alias 2='cd -2' +alias 3='cd -3' +alias 4='cd -4' +alias 5='cd -5' +alias 6='cd -6' +alias 7='cd -7' +alias 8='cd -8' +alias 9='cd -9' +alias 0='cd -10' + +# +# new commands +# + +alias jeopardy='mpv ~/.sounds/jeopardy.mp3 &' +alias wttr='curl https://wttr.in/Salzburg' + +# +# Developing +# + +alias valgrind='valgrind --track-origins=yes --leak-check=full' + +# +# colorized man pages +# + +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;44;33m") \ + LESS_TERMCAP_ue=$(printf "\e[0m") \ + LESS_TERMCAP_us=$(printf "\e[1;32m") \ + man "$@" +}