Skip to content

Instantly share code, notes, and snippets.

@lauer
Last active October 12, 2015 12:07
Show Gist options
  • Save lauer/4023976 to your computer and use it in GitHub Desktop.
Save lauer/4023976 to your computer and use it in GitHub Desktop.
.zshrc
# PATH=$PATH:~/bin
export TERM=rxvt
HISTSIZE=1000
SAVEHIST=1000
if (( ! EUID )); then
HISTFILE=~/.history_root
else
HISTFILE=~/.history
fi
setopt SHARE_HISTORY
# standard aliasses
alias ltr='ls -ltr'
alias ls='ls -G'
alias l='ls -lh'
alias ll='ls -la'
# Coler
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
(( count = $count + 1 ))
done
PR_NO_COLOR="%{$terminfo[sgr0]%}"
PS1="[$PR_MAGENTA%n$PR_NO_COLOR@$PR_GREEN%U%m%u$PR_NO_COLOR:$PR_RED%2c$PR_NO_COLOR]%(!.#.$) "
RPS1="$PR_MAGENTA(%D{%m-%d %H:%M})$PR_NO_COLOR"
# verbose of gnu fileutils
for c in cp rm chmod chown rename; do
alias $c="$c -v"
done
# Automatic set title in term
case $TERM in
xterm*|rxvt*)
precmd () {print -Pn "\e]0;%n@%m: %~\a"}
;;
esac
alias dkwhois='funcwhois'
funcwhois() { whois $1 | grep -v '#'; }
alias dkwhois='funcdkwhois'
funcdkwhois() { whois -h whois.dk-hostmaster.dk " --show-handles $1" | grep -v '#'; }
alias soa='funcsoa'
funcsoa() { dig @ns1.gratisdns.dk soa $1 | grep ";; ANSWER SECTION:" -A2; }
alias reload="source ~/.zshrc && echo '.zshrc loaded'"
alias ssh-copy-id='funcssh-copy-id'
funcssh-copy-id() { cat ~/.ssh/id_rsa.pub | ssh $1 'umask 0077; mkdir -p .ssh; cat >> .ssh/authorized_keys && echo "Key copied"' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment