1
0

config.zsh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. HISTFILE="${HOME}/.zhistory"
  11. SAVEHIST=10000
  12. setopt inc_append_history
  13. setopt share_history
  14. setopt extended_history
  15. setopt histignorealldups
  16. setopt histignorespace
  17. setopt autocd
  18. setopt autopushd
  19. setopt longlistjobs
  20. setopt nohup
  21. setopt extended_glob
  22. setopt noglobdots
  23. setopt noshwordsplit
  24. bindkey -e
  25. # https://bbs.archlinux.org/viewtopic.php?id=151738
  26. # ensures terminfo is setup properly
  27. if [[ -n ${terminfo[smkx]} ]] && [[ -n ${terminfo[rmkx]} ]]; then
  28. function zle-line-init () {echoti smkx}
  29. function zle-line-finish () {echoti rmkx}
  30. zle -N zle-line-init
  31. zle -N zle-line-finish
  32. fi
  33. # https://bbs.archlinux.org/viewtopic.php?pid=1170080#p1170080
  34. autoload up-line-or-beginning-search
  35. autoload down-line-or-beginning-search
  36. zle -N up-line-or-beginning-search
  37. zle -N down-line-or-beginning-search
  38. bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search
  39. bindkey "${terminfo[kcud1]}" down-line-or-beginning-search
  40. autoload -z edit-command-line
  41. zle -N edit-command-line
  42. bindkey "^X^E" edit-command-line
  43. bindkey '^R' zaw-history
  44. bindkey "${terminfo[khome]}" beginning-of-line
  45. bindkey "${terminfo[kend]}" end-of-line
  46. bindkey "${terminfo[kdch1]}" delete-char # Del
  47. bindkey "${terminfo[kpp]}" backward-word # PageUp
  48. bindkey "${terminfo[knp]}" forward-word # PageDown
  49. alias l="k -h"
  50. alias ssh="TERM=xterm-256color ssh"
  51. export EDITOR=vim