# Load system settings source /etc/zsh/zprofile ######################################### # set $fpath before we autoload scripts # ######################################### fpath=( ~/.zsh/functions $fpath ) if [ -d ~/.zen ] then fpath=( $fpath /home/ccx/.zen/zsh/scripts /home/ccx/.zen/zsh/zle ) autoload -U zen #zen update fi ########################## # autoload for functions # ########################## autoload -U compinit promptinit compinit autoload -Uz vcs_info autoload -U edit-command-line zle -N edit-command-line ############### # keybindings # ############### # insert bindkey "^[[2~" overwrite-mode # delete bindkey "^[[3~" delete-char bindkey "^[3~" delete-char # home bindkey "^[[7~" beginning-of-line bindkey "^[[1~" beginning-of-line bindkey "^[[H" beginning-of-line bindkey "^[OH" beginning-of-line # end bindkey "^[[8~" end-of-line bindkey "^[[4~" end-of-line bindkey "^[[F" end-of-line bindkey "^[OF" end-of-line # page up bindkey "^[[5~" history-beginning-search-backward # page down bindkey "^[[6~" history-beginning-search-forward # ctrl-z bindkey '^z' edit-command-line # ctrl-e bindkey ^E menu-expand-or-complete # tab bindkey ^I complete-word # ctrl+arrow bindkey "^[OC" forward-word bindkey "^[OD" backward-word ################## # shell features # ################## unsetopt equals setopt interactivecomments HISTSIZE=100000 SAVEHIST=100000 HISTFILE=~/.zsh-history setopt INC_APPEND_HISTORY ######################### # configuration helpers # ######################### in_path() { [[ -x ${commands[${1}]} ]] } ########### # aliases # ########### alias ls="ls --color" alias ll="ls -lh --color --time-style=long-iso" alias ns="netstat -ltup" #alias ns="sudo netstat -atp" #alias man=w3mman if in_path vim then alias vi=vim export EDITOR=${commands[vim]} fi mkcd(){ mkdir $* && cd ${argv[-1]} } ssh() { TERM=${TERM%-256color} /usr/bin/ssh $@ } ############## # the prompt # ############## promptinit; prompt gentoo yellow PS1="\${vcs_info_msg_0_}%(?..%B%F{yellow}<%?>)%(1j.%B%F{cyan}{%j}.)$PS1" setopt PROMPT_SUBST #if [ "$TERM" = "screen" ] #then # #PS1=$'%{\ek\e\\%}'"${PS1}" # #PS1=$'%{\ek%~\e\\%}'"${PS1}" # PS1=$'%{\ek%n@%m:%~\e\\%}'"${PS1}" #fi PS4='+%B%* %F{cyan}%N%f:%F{yellow}%i%f>%b ' zstyle ':vcs_info:*' enable git svn hg bzr # bzr specific #zstyle ':vcs_info:bzr:*' use-simple true zstyle ':vcs_info:bzr:*' check-for-changes true zstyle ':vcs_info:bzr:*:'${HOME:t} formats '%F{red}%m%f' zstyle ':vcs_info:bzr:*' formats '%F{green}%s: %b %F{cyan}%m%f ' zstyle ':vcs_info:bzr:*' branchformat '%F{yellow}%b %F{green}rev:%r' # git / hg zstyle ':vcs_info:(hg|git):*' formats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f ' zstyle ':vcs_info:(hg|git):*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' precmd(){ vcs_info } ############################## # online syntax highlighting # ############################## if [[ -f ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets cursor) #pattern #cursor source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh #ZSH_HIGHLIGHT_STYLES[cursor]='bg=black,fg=white' ZSH_HIGHLIGHT_STYLES[cursor]='none' ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]='bg=blue' ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=cyan,bold' ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold' ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold' ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold' ZSH_HIGHLIGHT_STYLES[bracket-level-5]='fg=green,bold' ZSH_HIGHLIGHT_STYLES[assign]='fg=cyan' ZSH_HIGHLIGHT_STYLES[builtin]='fg=yellow' ZSH_HIGHLIGHT_STYLES[precommand]='fg=yellow' ZSH_HIGHLIGHT_STYLES[command]='bold' ZSH_HIGHLIGHT_STYLES[hashed-command]='bold' ZSH_HIGHLIGHT_STYLES[globbing]='fg=cyan' ZSH_HIGHLIGHT_STYLES[path]='bold' ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=magenta,bold' ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=magenta,bold' fi ################### # the environment # ################### if [ -e "${HOME}/.gtkrc-2.0" ]; then export GTK2_RC_FILES="${HOME}/.gtkrc-2.0" fi if [ -e "${HOME}/.dircolors" ]; then eval $(dircolors -b "${HOME}/.dircolors") elif [ -e /etc/DIR_COLORS ] then eval $(dircolors -b /etc/DIR_COLORS) fi zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} # Run keychain if available if in_path keychain then keychain -Q -q source ~/.keychain/${HOST}-sh* fi