diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fdba5a3..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "zsh-syntax-highlighting"] - path = zsh-syntax-highlighting - url = https://github.com/zsh-users/zsh-syntax-highlighting -[submodule "fzf"] - path = fzf - url = https://github.com/junegunn/fzf diff --git a/README.md b/README.md index 0dd8d94..82fff2c 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ ## Installation 1. Clone this directory as `$HOME/.zsh`. -2. Do `git submodule init` and `git submodule update` in this directory. -3. Put following code in `$HOME/.zshrc: +2. Install `zplug`, preferably from distribution repository, if not, [as described on github](https://github.com/zplug/zplug). +3. Put following code in `$HOME/.zshrc`: ``` source $HOME/.zsh/zshrc ``` diff --git a/fzf b/fzf deleted file mode 160000 index 6654239..0000000 --- a/fzf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6654239c94667fefb38d76cfc47b6abf5ced8149 diff --git a/zsh-syntax-highlighting b/zsh-syntax-highlighting deleted file mode 160000 index a33c72e..0000000 --- a/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a33c72e8389b3d984d25fd556d86878777c76571 diff --git a/zshrc b/zshrc index 91f1e01..cd58ded 100644 --- a/zshrc +++ b/zshrc @@ -640,17 +640,6 @@ for command in find wget git; \ # load zsh extended move autoload -Uz zmv -#---------------------------------- Addons ------------------------------------ - -if [[ -d ${ZDOTDIR:-$HOME}/.zsh/zsh-syntax-highlighting ]]; then - source ${ZDOTDIR:-$HOME}/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -fi -if command-exists fzf && [[ -d ${ZDOTDIR:-$HOME}/.zsh/fzf ]]; then - source ${ZDOTDIR:-$HOME}/.zsh/fzf/shell/completion.zsh - source ${ZDOTDIR:-$HOME}/.zsh/fzf/shell/key-bindings.zsh -fi - - #---------------------------------- Machine specific -------------------------- if [[ -r $HOME/.zlocal ]]; then @@ -681,3 +670,26 @@ if [[ $commands[kubectl] ]]; then source <(kubectl completion zsh); fi + +#---------------------------------- Addons ------------------------------------ + +if [[ -f '/usr/share/zplug/init.zsh' ]]; then + source /usr/share/zplug/init.zsh + zplug "plugins/git", from:oh-my-zsh + zplug "plugins/sudo", from:oh-my-zsh + zplug "plugins/command-not-found", from:oh-my-zsh + zplug "zsh-users/zsh-syntax-highlighting" + zplug "zsh-users/zsh-autosuggestions" + zplug "zsh-users/zsh-history-substring-search" + zplug "zsh-users/zsh-completions" + zplug "junegunn/fzf" +fi + +if ! zplug check --verbose; then + printf "Install? [y/N]: " + if read -q; then + echo; zplug install + fi +fi +zplug load +