Advertisement
voyeg3r

zsh-zplug

May 18th, 2019
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.24 KB | None | 0 0
  1. # place on your .zshenv
  2. # export ZPLUG_HOME=~/.dotfiles/zsh
  3. # export EDITOR=/bin/nvim
  4.  
  5. source ${ZPLUG_HOME}/init.zsh
  6.  
  7. setxkbmap -model abnt2 -layout br
  8. # tap to click on touchpad
  9. # synclient TapButton1=1 TapButton2=3 TapButton3=2
  10.  
  11. setopt autocd
  12. setopt complete_in_word
  13.  
  14. # ignore case completion
  15. zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  16.  
  17. bindkey '^ ' autosuggest-accept
  18. bindkey "\e[3~" delete-char
  19.  
  20. # Copy the most recent command to the clipboard
  21. function _pbcopy_last_command(){
  22.   fc -ln -1 | pbcopy
  23. }
  24. zle -N pbcopy-last-command _pbcopy_last_command
  25. bindkey '^x^l' pbcopy-last-command
  26.  
  27. # Edit content of clipboard on vim (scratch buffer)
  28. function _edit_clipboard(){
  29.     pbpaste | vimscratch -
  30. }
  31. zle -N edit-clipboard _edit_clipboard
  32. bindkey '^x^v' edit-clipboard
  33.  
  34. # put the cursor in a subshell $()
  35. function _zle_subshell {
  36.     RBUFFER='$()'"$RBUFFER"
  37.     ((CURSOR=CURSOR+2))
  38. }
  39. zle -N _zle_subshell
  40. bindkey '^J' _zle_subshell
  41.  
  42. fancy-ctrl-z () {
  43.   if [[ $#BUFFER -eq 0 ]]; then
  44.     BUFFER="fg"
  45.     zle accept-line
  46.   else
  47.     zle push-input
  48.     zle clear-screen
  49.   fi
  50. }
  51. zle -N fancy-ctrl-z
  52. bindkey '^Z' fancy-ctrl-z
  53.  
  54. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
  55.  
  56. source $ZPLUG_HOME/aliases
  57.  
  58. ############## ZPLUG STARTS HERE #################
  59. # plugins installation goes below
  60.  
  61. ### Pure prompt
  62. zplug mafredri/zsh-async, from:github
  63. zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme
  64.  
  65. zplug "zsh-users/zsh-autosuggestions"
  66. if zplug check zsh-users/zsh-autosuggestions; then
  67.   ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-substring-search-up history-substring-search-down)
  68.   ZSH_AUTOSUGGEST_CLEAR_WIDGETS=("${(@)ZSH_AUTOSUGGEST_CLEAR_WIDGETS:#(up|down)-line-or-history}")
  69. fi
  70.  
  71. # defer means to load this plugin after all the other plugins
  72. zplug "zdharma/fast-syntax-highlighting", defer:2
  73.  
  74. # command auto-suggestion based on history
  75. zplug "zsh-users/zsh-autosuggestions"
  76.  
  77. # z.lua is plugin which makes directory navigation faster. Install it with zplug:
  78. # 10 times faster than fasd
  79. zplug "skywind3000/z.lua"
  80.  
  81. if ! zplug check --verbose; then
  82.     printf "Install? [y/N]: "
  83.     if read -q; then
  84.         echo; zplug install
  85.     fi
  86. fi
  87.  
  88. # zplug load --verbose
  89. zplug load
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement