zshrc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # local zsh config
  2. source ~/.zshrc.local
  3. # load antigen if it exists
  4. if [ -h ~/.antigen.zsh ]
  5. then
  6. source ~/.antigen.zsh
  7. # Load oh-my-zsh's library.
  8. antigen use oh-my-zsh
  9. # Bundles from the default repo (robbyrussell's oh-my-zsh).
  10. antigen bundle git
  11. antigen bundle heroku
  12. antigen bundle pip
  13. antigen bundle lein
  14. antigen bundle command-not-found
  15. # Syntax highlighting bundle.
  16. antigen bundle zsh-users/zsh-syntax-highlighting
  17. # Load the theme.
  18. antigen theme bira
  19. # Tell antigen that you're done.
  20. antigen apply
  21. fi
  22. # History
  23. HISTFILE=~/.histfile
  24. HISTSIZE=10000
  25. SAVEHIST=10000
  26. # Instantly write history
  27. setopt -o sharehistory
  28. # Ignore duplicates in history
  29. setopt HIST_IGNORE_DUPS
  30. # Delete old recorded entry if new entry is a duplicate.
  31. setopt HIST_IGNORE_ALL_DUPS
  32. setopt appendhistory autocd extendedglob nomatch
  33. bindkey -e
  34. zstyle :compinstall filename '/home/josh/.zshrc'
  35. autoload -Uz compinit
  36. compinit -u
  37. # List of word delimeters
  38. WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'
  39. # ls pleasantness
  40. alias l='\ls --color=auto'
  41. alias ls='ls --color=auto'
  42. alias la='ls -a --color=auto'
  43. alias lsa='ls -a --color=auto'
  44. alias lls='ls -lh --color=auto'
  45. alias ll='ls -lh --color=auto'
  46. # Custom ls colors
  47. eval $(dircolors ~/.dircolors)
  48. # Use vim as the default text editor
  49. export VISUAL=vim
  50. # eval used by thefuck
  51. if hash fuck 2>/dev/null; then
  52. eval $(thefuck --alias)
  53. fi
  54. # timestamp alias for dates
  55. alias ts='date +%y-%m-%d'
  56. # alias for getting latest file in a folder
  57. alias latest='ls -t | head -n 1'
  58. # Home and End keys jump the the beginning/end of the command
  59. bindkey "^[OH" beginning-of-line
  60. bindkey "^[[H" beginning-of-line
  61. bindkey "^[OF" end-of-line
  62. bindkey "^[[F" end-of-line
  63. # Enable forward search
  64. bindkey "^s" history-incremental-search-forward
  65. # Ctrl-Left and Ctrl-Right keys move between words
  66. bindkey ";5C" forward-word
  67. bindkey ";5D" backward-word
  68. # Editor defaults
  69. export EDITOR=emacs
  70. export VISUAL=emacs
  71. # Vim and vi bindings
  72. # alias for vim muscle memory when quitting
  73. #alias :q='exit'
  74. # vi bindings
  75. #bindkey -v
  76. #export KEYTIMEOUT=1
  77. #
  78. #bindkey '^P' up-history
  79. #bindkey '^N' down-history
  80. #bindkey '^?' backward-delete-char
  81. #bindkey '^h' backward-delete-char
  82. #bindkey '^w' backward-kill-word
  83. #bindkey '^r' history-incremental-search-backward
  84. #
  85. #function zle-line-init zle-keymap-select {
  86. # VIM_PROMPT="%{$fg_bold[yellow]%} [% NORMAL]% %{$reset_color%}"
  87. # RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1"
  88. # zle reset-prompt
  89. #}
  90. #function zle-line-finish {
  91. # VIM_PROMPT=""
  92. # RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1"
  93. # zle reset-prompt
  94. #}
  95. #RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} $EPS1"
  96. #
  97. #zle -N zle-line-init
  98. #zle -N zle-keymap-select