zshrc 2.7 KB

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