completion.zsh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ## fixme - the load process here seems a bit bizarre
  2. setopt noautomenu
  3. setopt complete_in_word
  4. setopt always_to_end
  5. unsetopt flowcontrol
  6. WORDCHARS=''
  7. autoload -U compinit
  8. compinit
  9. zmodload -i zsh/complist
  10. ## case-insensitive (all),partial-word and then substring completion
  11. if [ "x$CASE_SENSITIVE" = "xtrue" ]; then
  12. zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  13. unset CASE_SENSITIVE
  14. else
  15. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  16. fi
  17. zstyle ':completion:*' list-colors ''
  18. zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
  19. unsetopt MENU_COMPLETE
  20. #setopt AUTO_MENU
  21. # should this be in keybindings?
  22. bindkey -M menuselect '^o' accept-and-infer-next-history
  23. zstyle ':completion:*:*:*:*:*' menu yes select
  24. # zstyle ':completion:*:*:*:*:processes' force-list always
  25. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
  26. zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
  27. zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
  28. # Complete on history
  29. # zstyle ':completion:*:history-words' stop yes
  30. # zstyle ':completion:*:history-words' remove-all-dups yes
  31. # zstyle ':completion:*:history-words' list false
  32. # zstyle ':completion:*:history-words' menu yes