From 8f3f9f3226a234de8ce7ebdeafd17de35c67304d Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Wed, 30 Mar 2022 11:58:54 +0200 Subject: [PATCH] ZSH modules are now separate. --- .gitmodules | 9 --------- install.sh | 7 +++++++ zsh/.zshrc | 26 +++++++++++--------------- zsh/modules/fast-syntax-highlighting | 1 - zsh/modules/powerlevel10k | 1 - zsh/modules/wd | 1 - 6 files changed, 18 insertions(+), 27 deletions(-) delete mode 160000 zsh/modules/fast-syntax-highlighting delete mode 160000 zsh/modules/powerlevel10k delete mode 160000 zsh/modules/wd diff --git a/.gitmodules b/.gitmodules index af04dc1..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +0,0 @@ -[submodule "zsh/modules/powerlevel10k"] - path = zsh/modules/powerlevel10k - url = https://github.com/romkatv/powerlevel10k.git -[submodule "zsh/modules/wd"] - path = zsh/modules/wd - url = https://github.com/mfaerevaag/wd.git -[submodule "zsh/modules/fast-syntax-highlighting"] - path = zsh/modules/fast-syntax-highlighting - url = https://github.com/zdharma-continuum/fast-syntax-highlighting diff --git a/install.sh b/install.sh index 30702d3..2de0053 100644 --- a/install.sh +++ b/install.sh @@ -45,6 +45,13 @@ for i in ~$XDG_DATA_HOME/repos/dotfiles/_scripts/*; do done ## zsh +### modules +mkdir -p $XDG_DATA_HOME/repos/zsh_modules +rm -rf $XDG_DATA_HOME/repos/zsh_modules/* +for module in mfaerevaag/wd romkatv/powerlevel10k zdharma-continuum/fast-syntax-highlighting; do + git clone https://github.com/${module} $XDG_DATA_HOME/repos/zsh_modules/${module#*/} +done +### config rm -rf ~/.config/zsh ln -sf $XDG_DATA_HOME/repos/dotfiles/zsh ~/.config/ touch ~/.local/config/zsh diff --git a/zsh/.zshrc b/zsh/.zshrc index 18ca5e9..9688eec 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -19,33 +19,29 @@ mkdir -p $XDG_CACHE_HOME/zsh zstyle ':completion:*' menu select zstyle ':completion:*' list-colors '' -# keys -source $ZDOTDIR/keys.zsh - -# aliases source $ZDOTDIR/aliases.zsh - -# ssh +source $ZDOTDIR/keys.zsh source $ZDOTDIR/ssh.zsh -# plugins & addons +# modules [ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ] && source $ZDOTDIR/fzf.zsh -source $ZDOTDIR/modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh +source $XDG_DATA_HOME/repos/zsh_modules/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh +export WD_CONFIG=$XDG_CONFIG_HOME/wd_list +wd () { + . $XDG_DATA_HOME/repos/zsh_modules/wd/wd.sh +} +fpath=($ZDOTDIR/modules/wd $fpath) + # theme source $ZDOTDIR/p10k.zsh -source $ZDOTDIR/modules/powerlevel10k/powerlevel10k.zsh-theme +source $XDG_DATA_HOME/repos/zsh_modules/powerlevel10k/powerlevel10k.zsh-theme if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -export WD_CONFIG=$XDG_CONFIG_HOME/wd_list -wd () { - . $ZDOTDIR/modules/wd/wd.sh -} -fpath=($ZDOTDIR/modules/wd $fpath) - # local settings source ~/.local/config/zsh +# compinit at the very end to avoid duplicates [ ! -e $XDG_DATA_HOME/zsh/zcompdump.zwc ] && autoload -U zrecompile && zrecompile -p -R $XDG_DATA_HOME/zsh/zcompdump autoload -U compinit && compinit -d $XDG_DATA_HOME/zsh/zcompdump diff --git a/zsh/modules/fast-syntax-highlighting b/zsh/modules/fast-syntax-highlighting deleted file mode 160000 index ef8ba84..0000000 --- a/zsh/modules/fast-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ef8ba84c3a76c768f49a0bdd2a620b2f53c2478a diff --git a/zsh/modules/powerlevel10k b/zsh/modules/powerlevel10k deleted file mode 160000 index 30bd946..0000000 --- a/zsh/modules/powerlevel10k +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 30bd9461b3f013bc4c529de0a123db89a92a87c7 diff --git a/zsh/modules/wd b/zsh/modules/wd deleted file mode 160000 index 38afa73..0000000 --- a/zsh/modules/wd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 38afa73ca85a557aef89438ad9fd60b5b41cdbc7