You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.8 KiB

5 years ago
  1. #!/bin/zsh
  2. DEFAULT_USER=marc #für den Promot wird der user ausgeblendet, wenn default erkannt ist
  3. # --------------------------------------
  4. # Environment
  5. # --------------------------------------
  6. export EDITOR=nvim
  7. export VISUAL=nvim
  8. # --------------------------------------
  9. # Prompt
  10. # --------------------------------------
  11. setopt PROMPT_SUBST # erlaubt Funktionen im Prompt
  12. # --------------------------------------
  13. # History
  14. # --------------------------------------
  15. HISTFILE=$ZDOTDIR/zhistory
  16. setopt APPEND_HISTORY # append hostory instead of overwriting
  17. HISTSIZE=1200 # notwendig, damit HIST_EXPIRE_DUPS_FIRST funktioniert
  18. SAVEHIST=1000
  19. setopt HIST_EXPIRE_DUPS_FIRST # entfernt erst Duplikate, wenn SAVEHIST überläuft
  20. setopt EXTENDED_HISTORY # speichert Zeitstempel und Dauer
  21. setopt SHARE_HISTORY # share history across terms
  22. # --------------------------------------
  23. # Keybindings
  24. # --------------------------------------
  25. # create a zkbd compatible hash
  26. # to add other keys to this hash, see: man 5 terminfo
  27. typeset -A key
  28. key[Home]="$terminfo[khome]"
  29. key[End]="$terminfo[kend]"
  30. key[Insert]="$terminfo[kich1]"
  31. key[Backspace]="$terminfo[kbs]"
  32. key[Delete]="$terminfo[kdch1]"
  33. key[Up]="$terminfu[kcuu1]"
  34. key[Down]="$terminfo[kcud1]"
  35. key[Left]="$terminfo[kcub1]"
  36. key[Right]="$terminfo[kcuf1]"
  37. key[PageUp]="$terminfo[kpp]"
  38. key[PageDown]="$terminfo[knp]"
  39. # setup key accordingly
  40. [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
  41. [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
  42. [[ -n "${key[Insert]}" ]] && bindkey "$key[Insert]}" overwrite-mode
  43. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  44. [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
  45. [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
  46. [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
  47. [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
  48. [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
  49. [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
  50. bindkey "^R" history-incremental-search-backward
  51. # Finally, make sure the terminal is in application mode, when zle is
  52. # active. Only then are the values from $erminfo valid.
  53. if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
  54. function zle-line-init () {
  55. echoti smkx
  56. }
  57. function zle-line-finish () {
  58. echoti rmkx
  59. }
  60. zle -N zle-line-init
  61. zle -N zle-line-finish
  62. fi
  63. # --------------------------------------
  64. # Plugins
  65. # --------------------------------------
  66. PLUGINS=$ZDOTDIR/plugins/
  67. for plugin in $PLUGINS*.zsh
  68. do
  69. source $plugin
  70. done
  71. # --------------------------------------
  72. # Themes
  73. # --------------------------------------
  74. source $ZDOTDIR/themes/agnoster.zsh-theme