Browse Source

Switch zsh plugin manager to zcomet to improve performances (add missing files and remove useless submodule)

Emmanuel Bouthenot 2 years ago
parent
commit
453c746554
5 changed files with 39 additions and 5 deletions
  1. 3 2
      .gitignore
  2. 0 3
      .gitmodules
  3. 25 0
      .zsh/config/80_nvm.zsh
  4. 7 0
      .zsh/init.zsh
  5. 4 0
      .zshrc

+ 3 - 2
.gitignore

@@ -14,9 +14,10 @@
 .tmux/plugins/
 
 .bash*
+.zcomet/
 .zsh/history/history*
-.zcompdump
-.zcompcache
+.zcompdump*
+.zcompcache*
 *.zwc
 .zshenv.local
 .profile

+ 0 - 3
.gitmodules

@@ -1,6 +1,3 @@
-[submodule ".zplug"]
-	path = .zplug
-	url = https://github.com/zplug/zplug.git
 [submodule "/home/manu/.tmux/plugins/tpm"]
 	path = .tmux/plugins/tpm
 	url = https://github.com/tmux-plugins/tpm

+ 25 - 0
.zsh/config/80_nvm.zsh

@@ -0,0 +1,25 @@
+#
+# NVM settings
+#
+
+NVM_DIR=
+
+if [ -f "${HOME}/.nvm/nvm.sh" ]; then
+    NVM_DIR="${HOME}/.nvm"
+elif [ -f "/usr/local/nvm/nvm.sh" ]; then
+    NVM_DIR="/usr/local/nvm"
+fi
+
+export NVM_DIR
+
+if [ -n "${NVM_DIR}" ]; then
+    if [ "${UID}" = 0 ] && [ -n "${SUDO_UID}" ] ; then
+        export ZSH_DISABLE_COMPFIX=true
+    fi
+    if [ -s "${NVM_DIR}/nvm.sh" ]; then
+        source "${NVM_DIR}/nvm.sh"
+    fi
+    if [ -s "${NVM_DIR}/bash_completion" ]; then
+        source "${NVM_DIR}/bash_completion"
+    fi
+fi

+ 7 - 0
.zsh/init.zsh

@@ -0,0 +1,7 @@
+#
+# sourcing *.zsh files from config/ directory
+#
+
+for i in ${0:a:h}/config/*.zsh ; do
+    source "${i}"
+done

+ 4 - 0
.zshrc

@@ -31,4 +31,8 @@ if [[ -d "${ZSHDOTDIR}/config" ]]; then
     zcomet load "${ZSHDOTDIR}"
 fi
 
+if [ "${UID}" = 0 ] && [ -n "${SUDO_UID}" ] ; then
+    zstyle ':zcomet:compinit' arguments "-u"
+fi
+
 zcomet compinit