config.zsh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. if [ -f ~/.dircolors ]; then
  2. eval $(dircolors ~/.dircolors)
  3. fi
  4. alias ls="ls --color=auto --group-directories-first -F --quoting-style literal"
  5. alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
  6. autoload -U compinit && compinit
  7. zstyle ':completion:*' menu select
  8. zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
  9. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
  10. REPORTTIME=5
  11. HISTFILE="${HOME}/.zhistory"
  12. SAVEHIST=10000
  13. setopt inc_append_history
  14. setopt share_history
  15. setopt extended_history
  16. setopt histignorealldups
  17. setopt histignorespace
  18. setopt autocd
  19. setopt autopushd
  20. setopt longlistjobs
  21. setopt nohup
  22. setopt extended_glob
  23. setopt noglobdots
  24. setopt noshwordsplit
  25. bindkey -e
  26. # https://bbs.archlinux.org/viewtopic.php?id=151738
  27. # ensures terminfo is setup properly
  28. if [[ -n ${terminfo[smkx]} ]] && [[ -n ${terminfo[rmkx]} ]]; then
  29. function zle-line-init () {echoti smkx}
  30. function zle-line-finish () {echoti rmkx}
  31. zle -N zle-line-init
  32. zle -N zle-line-finish
  33. fi
  34. # https://bbs.archlinux.org/viewtopic.php?pid=1170080#p1170080
  35. autoload up-line-or-beginning-search
  36. autoload down-line-or-beginning-search
  37. zle -N up-line-or-beginning-search
  38. zle -N down-line-or-beginning-search
  39. bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
  40. bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
  41. autoload -z edit-command-line
  42. zle -N edit-command-line
  43. bindkey "^X^E" edit-command-line
  44. bindkey '^R' zaw-history
  45. bindkey "${terminfo[khome]}" beginning-of-line
  46. bindkey "${terminfo[kend]}" end-of-line
  47. bindkey "${terminfo[kdch1]}" delete-char # Del
  48. bindkey "${terminfo[kpp]}" backward-word # PageUp
  49. bindkey "${terminfo[knp]}" forward-word # PageDown
  50. alias l="k -h"
  51. alias ssh="TERM=xterm-256color ssh"
  52. export EDITOR=vim