Browse Source

Switch zsh plugin manager to zcomet to improve performances

Emmanuel Bouthenot 2 years ago
parent
commit
d80a6761ee

+ 1 - 0
.gitignore

@@ -17,6 +17,7 @@
 .zsh/history/history*
 .zcompdump
 .zcompcache
+*.zwc
 .zshenv.local
 .profile
 .lesshst

+ 0 - 10
.zsh/config/00_zplug.zsh

@@ -1,10 +0,0 @@
-#
-# zplug settings
-#
-
-if [ -n "${ZPLUG_HOME}" ] ; then
-    if ! command -v gawk >/dev/null 2>&1 ; then
-        printf "[zplug] warning: gawk is not installed\n"
-    fi
-fi
-

.zsh/config/02_runasroot.zsh → .zsh/config/01_runasroot.zsh


.zsh/config/06_ulimit.zsh → .zsh/config/09_ulimit.zsh


+ 0 - 7
.zsh/config/01_prezto.zsh

@@ -8,13 +8,6 @@ zstyle ':prezto:*:*' case-sensitive 'no'
 # Color output (auto set to 'no' on dumb terminals).
 zstyle ':prezto:*:*' color 'yes'
 
-# Set syntax highlighters. By default, only the main highlighter is enabled.
-zstyle ':prezto:module:syntax-highlighting' highlighters \
-  'main' \
-  'brackets' \
-  'pattern' \
-  'cursor'
-
 # Auto set the tab and window titles.
 zstyle ':prezto:module:terminal' auto-title 'yes'
 

+ 6 - 0
.zsh/config/31-zsh-syntax-highlighting.zsh

@@ -0,0 +1,6 @@
+#
+# zsh-users/zsh-syntax-highlighting configuration
+#
+
+export ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
+

+ 9 - 0
.zsh/config/32_zsh-history-substring-search.zsh

@@ -0,0 +1,9 @@
+#
+# zsh-users/zsh-history-substring-search configuration
+#
+
+bindkey '^[[A' history-substring-search-up
+bindkey '^[[B' history-substring-search-down
+
+bindkey "$terminfo[kcuu1]" history-substring-search-up
+bindkey "$terminfo[kcud1]" history-substring-search-down

+ 6 - 0
.zsh/config/33_zsh-autosuggestions.zsh

@@ -0,0 +1,6 @@
+#
+# zsh-users/zsh-autosuggestions configuration
+#
+
+export ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=60"
+

+ 19 - 41
.zshrc

@@ -6,51 +6,29 @@
 #  but WITHOUT ANY WARRANTY
 #
 
-### Workaround for https://github.com/zplug/zplug/issues/397
-COMPINIT_ARGS=
-if [ "${UID}" = 0 ] && [ -n "${SUDO_UID}" ] ; then
-    if ! grep -q COMPINIT_ARGS ~/.zplug/base/core/load.zsh ; then
-        sed -i -r 's/^(\s+)compinit -d/\1compinit $COMPINIT_ARGS -d/' ~/.zplug/base/core/load.zsh
-    fi
-    COMPINIT_ARGS="-u"
-fi
-export COMPINIT_ARGS
-###
-
-source ~/.zplug/init.zsh
-
 export ZSHDOTDIR=~/.zsh
 
-zplug "modules/archive", from:prezto
-zplug "modules/completion", from:prezto
-zplug "modules/directory", from:prezto
-zplug "modules/dpkg", from:prezto
-zplug "modules/editor", from:prezto
-zplug "modules/environment", from:prezto
-zplug "modules/terminal", from:prezto, defer:2
-zplug "modules/git", from:prezto
-zplug "modules/history", from:prezto
-zplug "modules/spectrum", from:prezto
-zplug "modules/rsync", from:prezto
-zplug "modules/autosuggestions", from:prezto
-zplug "modules/syntax-highlighting", from:prezto, defer:2
-zplug "modules/history-substring-search", from:prezto
-zplug "mafredri/zsh-async"
-zplug "chrissicool/zsh-256color"
-zplug "spaceship-prompt/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
-
-if [[ -d "${ZSHDOTDIR}/config" ]]; then
-    zplug "${ZSHDOTDIR}/config", from:local, defer:1
-fi
-
-if ! zplug check --verbose; then
-    zplug install
+if [[ ! -f "${HOME}/.zcomet/bin/zcomet.zsh" ]]; then
+    command git clone https://github.com/agkozak/zcomet.git "${HOME}/.zcomet/bin"
 fi
 
-zplug load
+source "${HOME}/.zcomet/bin/zcomet.zsh"
+
+zcomet load sorin-ionescu/prezto modules/directory
+zcomet load sorin-ionescu/prezto modules/dpkg
+zcomet load sorin-ionescu/prezto modules/editor
+zcomet load sorin-ionescu/prezto modules/environment
+zcomet load sorin-ionescu/prezto modules/terminal
+zcomet load sorin-ionescu/prezto modules/history
+zcomet load sorin-ionescu/prezto modules/spectrum
+zcomet load sorin-ionescu/prezto modules/completion
+zcomet load zsh-users/zsh-syntax-highlighting
+zcomet load zsh-users/zsh-history-substring-search
+zcomet load zsh-users/zsh-autosuggestions
+zcomet load spaceship-prompt/spaceship-prompt
 
-# Fixing zplug permissions while using 'sudo zsh'
-if [ "${UID}" = 0 ] && [ -n "${SUDO_UID}" ] ; then
-    find ~/.zplug/ -not -user "${SUDO_UID}" -exec chown -R "${SUDO_UID}:${SUDO_GID}" {} \;
+if [[ -d "${ZSHDOTDIR}/config" ]]; then
+    zcomet load "${ZSHDOTDIR}"
 fi
 
+zcomet compinit