config.zsh 1.7 KB

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