Add sections to ZSH config

This commit is contained in:
Tom Willemse 2016-10-29 09:55:50 +02:00
parent 5d5a506f35
commit bf4fa1fd59

View file

@ -7,75 +7,83 @@ Autoload any ZSH function from =$HOME/.zsh/functions=.
autoload -U $HOME/.zsh/functions/*(:t) autoload -U $HOME/.zsh/functions/*(:t)
#+END_SRC #+END_SRC
Use rlwrap on some less-than-pleasant REPLs that don't have GNU * Aliases
Readline-like features themselves.
#+BEGIN_SRC sh Use rlwrap on some less-than-pleasant REPLs that don't have GNU
alias csi="rlwrap csi" Readline-like features themselves.
alias scsh="rlwrap scsh"
#+END_SRC
Load zplug, a next generation zsh plugin manager. #+BEGIN_SRC sh
alias csi="rlwrap csi"
alias scsh="rlwrap scsh"
#+END_SRC
#+BEGIN_SRC sh * Plug-ins
source /usr/share/zsh/scripts/zplug/init.zsh
#+END_SRC
Add zsh-syntax-highlighting. Load zplug, a next generation zsh plugin manager.
#+BEGIN_SRC sh #+BEGIN_SRC sh
zplug "zsh-users/zsh-syntax-highlighting", nice:10 source /usr/share/zsh/scripts/zplug/init.zsh
#+END_SRC #+END_SRC
Add zsh-autosuggestions. Add zsh-syntax-highlighting.
#+BEGIN_SRC sh #+BEGIN_SRC sh
zplug "zsh-users/zsh-autosuggestions" zplug "zsh-users/zsh-syntax-highlighting", nice:10
#+END_SRC #+END_SRC
Add bgnotify from oh-my-zsh to show when long-running commands finish. Add zsh-autosuggestions.
#+BEGIN_SRC sh #+BEGIN_SRC sh
zplug "plugins/bgnotify", from:oh-my-zsh zplug "zsh-users/zsh-autosuggestions"
#+END_SRC #+END_SRC
Make sure all plugins are installed. Add bgnotify from oh-my-zsh to show when long-running commands finish.
#+BEGIN_SRC sh #+BEGIN_SRC sh
if ! zplug check --verbose; then zplug "plugins/bgnotify", from:oh-my-zsh
printf "Install? [y/N]: " #+END_SRC
if read -q; then
echo; zplug install
fi
fi
#+END_SRC
Load all plugins. Make sure all plugins are installed.
#+BEGIN_SRC sh #+BEGIN_SRC sh
zplug load --verbose if ! zplug check --verbose; then
#+END_SRC printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
#+END_SRC
Make some widgets for interacting with the clipboard. Load all plugins.
#+BEGIN_SRC sh #+BEGIN_SRC sh
zle -N x-copy-region-as-kill zplug load --verbose
zle -N x-kill-region #+END_SRC
zle -N x-yank
#+END_SRC
Bind them to keyboard shortcuts. * X Interaction
#+BEGIN_SRC sh Make some widgets for interacting with the clipboard.
bindkey -e '^[w' x-copy-region-as-kill
bindkey -e '^W' x-kill-region
bindkey -e '^Y' x-yank
#+END_SRC
Initialize completion. This triggers loading of #+BEGIN_SRC sh
zsh-syntax-highlighting as well. zle -N x-copy-region-as-kill
zle -N x-kill-region
zle -N x-yank
#+END_SRC
#+BEGIN_SRC sh Bind them to keyboard shortcuts.
autoload -Uz compinit
compinit #+BEGIN_SRC sh
#+END_SRC bindkey -e '^[w' x-copy-region-as-kill
bindkey -e '^W' x-kill-region
bindkey -e '^Y' x-yank
#+END_SRC
* Completion
Initialize completion. This triggers loading of
zsh-syntax-highlighting as well.
#+BEGIN_SRC sh
autoload -Uz compinit
compinit
#+END_SRC