.zshrc 2.9 KB

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