From The Compiler, 6 Years ago, written in Bash.
Embed
  1. ### General options ###
  2. # Report time if command runs >2s
  3. REPORTTIME=2
  4. # Ask for corrections for misspelled commands
  5. setopt correctall
  6. # display PID when suspending processes
  7. setopt longlistjobs
  8. # report status of background jobs
  9. setopt notify
  10. # don't kill background jobs
  11. setopt nohup
  12.  
  13. ### History ###
  14. # Path to the history file
  15. HISTFILE=$HOME/.zsh_history
  16. # Size of the history and how much to actually save
  17. HISTSIZE=5000
  18. SAVEHIST=$HISTSIZE
  19. # Ignore duplicate commands in the history
  20. setopt hist_ignore_all_dups
  21. # share history among other zsh sessions
  22. setopt SHARE_HISTORY
  23.  
  24. ### Variables ###
  25. export BROWSER="google-chrome"
  26. export EDITOR="vim"
  27. export VISUAL="$EDITOR"
  28. export PAGER="vimpager"
  29. export MANPAGER="less"
  30. export PATH="$PATH:$HOME/bin"
  31.  
  32. ### Colors for ls ###
  33. [[ -f ~/.dircolors ]] && eval $(dircolors ~/.dircolors) || eval $(dircolors)
  34.  
  35. ### keybindings (rxvt) ###
  36. # vi mode
  37. bindkey -v
  38. # home/end
  39. bindkey "\e[7~" beginning-of-line
  40. bindkey "\e[8~" end-of-line
  41. # Shift=Tab (completion)
  42. bindkey "\e[Z" reverse-menu-complete
  43. # insert
  44. bindkey "\e[2~" overwrite-mode
  45. # delete
  46. bindkey "\e[3~" delete-char
  47. # history search with started command
  48. bindkey "\e[A" up-line-or-search
  49. bindkey "\e[B" down-line-or-search
  50.  
  51. ### aliases ###
  52. alias ls='ls --color --escape --classify'
  53. alias less=$PAGER
  54. alias zless=$PAGER
  55. alias nano='nano --nowrap'
  56. alias scr='screen -U -xRR'
  57. alias s='ssh'
  58. alias m='mosh'
  59.  
  60. ### completion ###
  61. # init completion
  62. autoload -U compinit && compinit
  63. # display menu if there are >5 completions
  64. zstyle ':completion:*' menu select=5
  65. # use colors for file completion
  66. zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
  67. # use groups for completion
  68. zstyle ':completion:*:descriptions' format \
  69.     $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'
  70. zstyle ':completion:*:matches' group 'yes'
  71. zstyle ':completion:*' group-name ''
  72. # warn if there are no matches
  73. zstyle ':completion:*:warnings' format \
  74.     $'%{\e[0;31m%}No matches for:%{\e[0m%} %d'
  75. # display all processes for killall/...
  76. zstyle ':completion:*:processes-names' command \
  77.     'ps c -u ${USER} -o command | uniq'
  78. # group man pages per section
  79. zstyle ':completion:*:manuals' separate-sections true
  80. zstyle ':completion:*:manuals.*' insert-sections true
  81. # match uppercase with lowercase chars
  82. zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  83. # verbose output
  84. zstyle ':completion:*' verbose true
  85. # show file types
  86. setopt listtypes
  87.  
  88. ### Prompt ###
  89.