# # ~/.zshrc # executed by zsh for interactive shells # # Florian Fankhauser # florian@web-expires2009.flof.at # http://www.flof.at/ # # last update: # Wed May 12 16:37:27 CEST 2010 #=============================================================================== # # ZSH specific settings # # KEYBINDINGS bindkey -e # PROMPT local RED="%{%}" # http://www.grml.org/zsh/zshrc local NO_COLOUR="%{%}" # http://www.grml.org/zsh/zshrc local GRAY="%{%}" PS1="%(?..$RED%?$NO_COLOUR:)%n@%m:%~ %(!.#.$) " # ? - return value # n - username # m - machine name # ~ - abbreviated pwd # ! - su? RPS1="$GRAY%T$NO_COLOUR" #------------------------------------ # MISC # don't notify when background processes complete setopt NO_NOTIFY # BEEP - (default) beep on error - http://docs.cs.byu.edu/docs/zsh/4.php unsetopt BEEP # CORRECT - try to correct the spelling of commands. unsetopt CORRECT # CORRECT_ALL - try to correct the spelling of all arguments in a line unsetopt CORRECT_ALL # FLOW_CONTROL - disable output flow control (usually ctrl-s, ctrl-q) unsetopt FLOW_CONTROL # delete right prompt when pressing enter, copy&paste gets easier this way setopt transient_rprompt #------------------------------------ # HISTORY HISTSIZE=1000 SAVEHIST=1000 HISTFILE=~/.zsh-history setopt HIST_IGNORE_DUPS # don't save command more than once # when occuring more often setopt NO_HIST_BEEP # don't beep when reaching the end/top # of history list setopt SHARE_HISTORY # Use the same history file for all sessions # http://www.grml.org/zsh/ setopt APPEND_HISTORY # append history list to the history file # (important for multiple parallel zsh # sessions!) - http://www.grml.org/zsh/zshrc #------------------------------------ # COMPLETION # load general completion autoload -U compinit && compinit # thanks to #zsh@irc.freenode.org # reprint prompt after listing completion options # from: http://zsh.sunsite.dk/Guide/zshguide06.html#l148 unsetopt ALWAYS_LAST_PROMPT zle -C complete-file complete-word _generic zstyle ':completion:complete-file::::' completer _files bindkey 't' complete-file # # ssh # adapted from grml's .zshrc [ -f "$HOME/.ssh/config" ] && \ hosts=(`grep ^Host $HOME/.ssh/config | sed -e 's/Host //'`) && \ zstyle ':completion:*:hosts' hosts $hosts # bash like # you have to hit twice to see the list of options # http://docs.cs.byu.edu/docs/zsh/4.php setopt BASH_AUTO_LIST # from grml.org's .zshrc # provide .. as a completion zstyle ':completion:*' special-dirs .. # completion in the middle of a word bindkey '^i' expand-or-complete-prefix # from http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc # press esc-e for editing command line in $EDITOR or $VISUAL # #if autoload edit-command-line && zle -N edit-command-line ; then # #k# Edit the current line in \kbd{\$EDITOR} # bindkey '\ee' edit-command-line #fi # # NOT ZSH specific settings # export GREP_OPTIONS='--color=auto' #export EDITOR='/usr/bin/vim' #alias ls='ls --color=auto' # # #===============================================================================