# Set a nice ans usefull prompt export PROMPT=$'%n@%m [%~]:%(?,%{\e[0;32m%}:%)%{\e[0m%},%{\e[0;31m%}:(%{\e[0m%}) %# ' # Set the size, path and commands to save for the history export HISTSIZE=500 export HISTFILE=~/.zsh_history export SAVEHIST=100 # Set colors for ls. (command from /etc/profile doesn't work correct) eval `dircolors -z` ## Set some aliases from zsh's zshrc example # csh compatibility setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } freload() { while (( $# )) ; do unfunction $1 autoload -U $1 shift done } # Where to look for autoloaded function definitions fpath=($fpath /etc/zsh/4.2.5/functions /etc/zsh/site-functions) # Autoload all shell functions from $fpath for func in $^fpath/*(N-.x:t) ; autoload $func # Remove duplicates from these arrays typeset -U path cdpath fpath manpath ## Stolen code from SuSE's /etc/zshrc # Set/unset shell options setopt globdots nocorrect pushdtohome autolist nopromptcr setopt nocorrectall autocd recexact longlistjobs autoresume setopt histignoredups pushdsilent appendhistory histexpiredupsfirst setopt autopushd pushdminus extendedglob rcquotes unsetopt bgnice autoparamslash hup # Common standard keypad and cursor bindkey "^[[2~" yank bindkey "^[[3~" delete-char # Home and End if [[ "$TERM" == "xterm" ]] then # Normal keypad and cursor of xterm bindkey "^[[1~" history-search-backward bindkey "^[[4~" set-mark-command bindkey "^[[H" beginning-of-line bindkey "^[[F" end-of-line # Home and End of application keypad and cursor of xterm bindkey "^[OH" beginning-of-line bindkey "^[OF" end-of-line bindkey "^[O5H" beginning-of-line bindkey "^[O5F" end-of-line else if [[ "$TERM" == "kvt" ]] then bindkey "^[[1~" history-search-backward bindkey "^[[4~" set-mark-command bindkey "^[OH" beginning-of-line bindkey "^[OF" end-of-line else # TERM=linux or console bindkey "^[[1~" beginning-of-line bindkey "^[[4~" end-of-line fi fi # Application keypad and cursor of xterm if [[ "$TERM" == "xterm" ]] then bindkey "^[OD" backward-char bindkey "^[OC" forward-char bindkey "^[OA" up-history bindkey "^[OB" down-history # DEC keyboard KP_F1 - KP_F4 bindkey -s "^[OP" "^[" bindkey "^[OQ" undo bindkey "^[OR" undefined-key bindkey "^[OS" kill-line fi if [[ "$TERM" == "gnome" ]] then # or gnome terminal F1 - F4 bindkey -s "^[OP" "^[" bindkey "^[OQ" undo bindkey "^[OR" undefined-key bindkey "^[OS" kill-line fi # Function keys F1 - F12 if [[ "$TERM" == "linux" ]] then # On console the first five function keys bindkey "^[[[A" undefined-key bindkey "^[[[B" undefined-key bindkey "^[[[C" undefined-key bindkey "^[[[D" undefined-key bindkey "^[[[E" undefined-key else # The first five standard function keys bindkey "^[[11~" undefined-key bindkey "^[[12~" undefined-key bindkey "^[[13~" undefined-key bindkey "^[[14~" undefined-key bindkey "^[[15~" undefined-key fi bindkey "^[[17~" undefined-key bindkey "^[[18~" undefined-key bindkey "^[[19~" undefined-key bindkey "^[[20~" undefined-key bindkey "^[[21~" undefined-key # Note: F11, F12 are identical with Shift_F1 and Shift_F2 bindkey "^[[23~" undefined-key bindkey "^[[24~" undefined-key # Shift Function keys F1 - F12 # identical with F11 - F22 # # bindkey "^[[23~" undefined-key # bindkey "^[[24~" undefined-key bindkey "^[[25~" undefined-key bindkey "^[[26~" undefined-key # DEC keyboard: F15=^[[28~ is Help bindkey "^[[28~" undefined-key # DEC keyboard: F16=^[[29~ is Menu bindkey "^[[29~" undefined-key bindkey "^[[31~" undefined-key bindkey "^[[32~" undefined-key bindkey "^[[33~" undefined-key bindkey "^[[34~" undefined-key if [[ "$TERM" == "xterm" ]] then # Not common bindkey "^[[35~" undefined-key bindkey "^[[36~" undefined-key fi if [[ "$TERM" == "xterm" ]] then # Application keypad and cursor of xterm # with NumLock ON # # Operators bindkey -s "^[Oo" "/" bindkey -s "^[Oj" "*" bindkey -s "^[Om" "-" bindkey -s "^[Ok" "+" bindkey -s "^[Ol" "," bindkey -s "^[OM" "\n" bindkey -s "^[On" "." # Numbers bindkey -s "^[Op" "0" bindkey -s "^[Oq" "1" bindkey -s "^[Or" "2" bindkey -s "^[Os" "3" bindkey -s "^[Ot" "4" bindkey -s "^[Ou" "5" bindkey -s "^[Ov" "6" bindkey -s "^[Ow" "7" bindkey -s "^[Ox" "8" bindkey -s "^[Oy" "9" fi # EMACS line editing if [[ "$ZSHEDIT" == "emacs" ]] then # ... xterm application cursor if [[ "$TERM" == "xterm" ]] then bindkey "^[^[OD" backward-word bindkey "^[^[OC" forward-word bindkey "^[^[OA" up-history bindkey "^[^[OB" down-history bindkey "^^[OD" backward-char bindkey "^^[OC" forward-char bindkey "^^[OA" up-history bindkey "^^[OB" down-history fi # Standard cursor bindkey "^[^[[D" backward-word bindkey "^[^[[C" forward-word bindkey "^[^[[A" up-history bindkey "^[^[[B" down-history bindkey "^^[[D" backward-char bindkey "^^[[C" forward-char bindkey "^^[[A" up-history bindkey "^^[[B" down-history fi