Created
November 11, 2013 00:02
-
-
Save HoffmannP/7405635 to your computer and use it in GitHub Desktop.
My .zshrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# history | |
HISTFILE=~/.zsh/histfile | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
setopt appendhistory | |
setopt hist_expire_dups_first hist_ignore_space share_history | |
setopt autocd beep extendedglob nomatch notify | |
autoload -Uz up-line-or-beginning-search | |
autoload -Uz down-line-or-beginning-search | |
zle -N up-line-or-beginning-search | |
zle -N down-line-or-beginning-search | |
bindkey -e | |
case "$TERM" in | |
xterm) | |
bindkey ';5D' emacs-backward-word | |
bindkey ';5C' emacs-forward-word | |
bindkey ';3D' emacs-backward-word | |
bindkey ';3C' emacs-forward-word | |
# bindkey '^[[A' up-line-or-beginning-search | |
bindkey '^[[A' history-beginning-search-forward | |
# bindkey '^[[B' down-line-or-beginning-search | |
bindkey '^[[B' history-beginning-search-backward | |
bindkey '^[[2~' overwrite-mode | |
bindkey '\e#' vi-pound-insert | |
bindkey '^[OF' end-of-line | |
bindkey '^[OH' beginning-of-line | |
bindkey '^[[3~' delete-char | |
;; | |
screen) | |
bindkey '^[[1;5D' emacs-backward-word | |
bindkey '^[[1;5C' emacs-forward-word | |
# bindkey '^[[A' up-line-or-beginning-search | |
# bindkey '^[[B' down-line-or-beginning-search | |
bindkey '^[[4~' end-of-line | |
bindkey '^[[1~' beginning-of-line | |
;; | |
esac | |
# wonderfull ls over F1 | |
listdir() { | |
number=$(=ls | wc -l) | |
=ls --color=always --indicator-style=slash --classify --human -l |\ | |
sed '1{s/insgesamt /insgesamt '"$number"'\//}; / -> /{s_'"$HOME"'/_~/_; s_/home/_~_}' | |
} | |
zle -N listdir | |
bindkey '^[OP' listdir | |
# exit options | |
drama-exit() { | |
echo -n "\x1b[1;31m.\x1b[0m" | |
sleep .8s | |
echo -n "\x1b[1;33m.\x1b[0m" | |
sleep .8s | |
echo -n "\x1b[1;32m.\x1b[0m" | |
sleep .9s | |
exit | |
} | |
fast-exit() { | |
exit | |
} | |
zle -N exit-shell | |
bindkey '^[OS' drama-exit | |
bindkey '^[[15~' fast-exit | |
autoload -Uz select-word-style | |
select-word-style bash | |
# COMPLETION SETTINGS | |
# add custom completion scripts | |
fpath=(~/.zsh/completion $fpath) | |
# compsys initialization | |
autoload -Uz compinit | |
compinit | |
# show completion menu when number of options is at least 2 | |
zstyle ':compinstall' filename '/home/ber/.zshrc' | |
zstyle ':completion:*' verbose yes | |
zstyle ':completion:*:descriptions' format '%B%d%b' | |
zstyle ':completion:*:messages' format '%d' | |
zstyle ':completion:*:warnings' format 'No matches for: %d' | |
zstyle ':completion:*' group-name | |
# set tabulator to four spaces | |
tabs 4 > /dev/null | |
# autoload -Uz promptinit | |
# promptinit | |
# prompt adam3 8bit | |
source $HOME/.zsh/git-prompt/git-prompt.sh | |
source $HOME/.zsh/prompt_adam2_setup 8bit | |
# misc alias | |
alias load="cat /proc/loadavg" | |
alias reload="source ~/.zshrc" | |
# better working with grep | |
alias grep="=grep --color" | |
alias topgrep="tee >(sed -n '1{p}') | grep" | |
alias confgrep="egrep -v '^[[:space:]]*(#|$)'" | |
alias psgrep="ps auxf | tee >(sed -n '1{p}') | grep -v ' grep --color ' | grep" | |
# better working with ls | |
alias la="=ls --color=auto --indicator-style=slash" | |
alias ls="la --ignore-backups" | |
alias ll="ls --almost-all -l --classify" | |
alias l="ls -l --human-readable" | |
LS_COLORS='' | |
LS_COLORS="$LS_COLORS"'no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;35:*.cmd=00;32:*.exe=00;32:*.sh=00;32:' | |
LS_COLORS="$LS_COLORS"'*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.t=93:*.pm=00;36:*.pod=00;96:*.conf=00;33:*.off=00;9:*.jpg=00;94:*.png=00;94:' | |
LS_COLORS="$LS_COLORS"'*.gz=00;31:*.xcf=00;94:*.JPG=00;94:*.gif=00;94:*.pdf=00;91:*~=00;30:' | |
export LS_COLORS | |
export GREP_OPTIONS='--color=auto' | |
# GOROOT="/home/ber/Code/go" | |
# export GOROOT | |
# GOBIN=$GOROOT"/bin" | |
# export GOBIN | |
# PATH=$PATH:$HOME/.bin:$GOBIN | |
# export PATH | |
EDITOR="/usr/bin/emacs -nw" | |
export EDITOR | |
alias -g header="tee >(tput smso; head -1 | cat; tput rmso)" | |
alias -s tex=pdflatex | |
alias -s pdf=acroread | |
alias -s mp3="mp3-decoder -q" | |
for movie in avi flv mp4; do | |
alias -s ${movie}=totem | |
done | |
for web in html htm; do | |
alias -s ${web}=chromium-browser | |
done | |
for text in css txt tex md; do | |
alias -s ${text}=sublime | |
done | |
alias sefu-users="chromium-browser --app='http:/admin.sefu-online.de/logged_in_users.php'" | |
alias gpg="gpg --homedir=/home/ber/Dropbox/Schluessel/gpg-conf/" | |
alias signal="beep -f 330 -l 150; sleep 0.15s; beep -f 415 -l 150; sleep 0.15s; beep -f 330 -l 250" | |
md() { | |
markdown $1 | lynx -stdin | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment