From 29225e7f9b221a258b562a4a99a7fafaf362db84 Mon Sep 17 00:00:00 2001 From: Bodaniel Jeanes Date: Sun, 27 Jun 2010 23:36:25 +1000 Subject: [PATCH] Add a whole bunch of options from http://www.scannedinavian.com/~shae/shae.zshrc --- zsh/config | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/zsh/config b/zsh/config index 491d938..11bdb90 100644 --- a/zsh/config +++ b/zsh/config @@ -1,2 +1,55 @@ alias reload="source ~/.zshrc" -setopt extendedglob \ No newline at end of file + +bindkey "\e\e[C" forward-word +bindkey "\e\e[D" backward-word + +# http://www.scannedinavian.com/~shae/shae.zshrc +setopt alwaystoend # when complete from middle, move cursor +setopt autocd # change to dirs without cd +setopt autopushd # automatically append dirs to the push/pop list +setopt cdablevars # avoid the need for an explicit $ +setopt completeinword # not just at the end +setopt correct # spelling correction +setopt extendedglob # weird & wacky pattern matching - yay zsh! +setopt histverify # when using ! cmds, confirm first +setopt interactivecomments # escape commands so i can use them later +setopt listpacked # compact completion lists +setopt listtypes # show types in completion +setopt noautomenu # don't cycle completions +setopt nobeep # i hate beeps +setopt nocheckjobs # don't warn me about bg processes when exiting +setopt nohup # and don't kill them, either +setopt nopromptcr # don't add \n which overwrites cmds with no \n +setopt nullglob +setopt printexitvalue # alert me if something's failed +setopt pushdignoredups # and don't duplicate them +setopt recexact # recognise exact, ambiguous matches + +# jump to each element in a path with m-f m-b, same +# for kill-word, etc. +export WORDCHARS='' + +# +# completion tweaking +# + +# complete hostnames out of ssh's ~/.ssh/known_hosts +autoload -U compinit; compinit +zstyle ':completion:*' use-cache on +zstyle ':completion:*' users resolve +hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*}) +zstyle ':completion:*:hosts' hosts $hosts + +# use dircolours in completion listings +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} + +# allow approximate matching +zstyle ':completion:*' completer _complete _match _approximate +zstyle ':completion:*:match:*' original only +zstyle ':completion:*:approximate:*' max-errors 1 numeric +zstyle ':completion:*' auto-description 'Specify: %d' +zstyle ':completion:*' format 'Completing %d' +zstyle ':completion:*' verbose true +zstyle ':completion:*:functions' ignored-patterns '_*' +zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \ + '*?.(o|c~|zwc)' '*?~'