From 2442490f773dcf7ba6e1f5c4dd6b08cefa4696f6 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Tue, 2 Aug 2022 23:55:59 -0400 Subject: [PATCH] ENH use zsh syntax highlighters directly --- .chezmoiexternal.yaml | 4 ++++ dot_config/zsh/dot_zshrc.tmpl | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.chezmoiexternal.yaml b/.chezmoiexternal.yaml index 9cb51f9..24d6211 100644 --- a/.chezmoiexternal.yaml +++ b/.chezmoiexternal.yaml @@ -19,3 +19,7 @@ type: git-repo url: https://github.com/ndwarshuis/universal-conky.git {{- end }} +.local/share/zsh/plugins/zsh-syntax-highlighting: + type: git-repo + url: https://github.com/zsh-users/zsh-syntax-highlighting.git + clone.args: --branch 0.7.1 diff --git a/dot_config/zsh/dot_zshrc.tmpl b/dot_config/zsh/dot_zshrc.tmpl index b0533d4..dfc6d37 100644 --- a/dot_config/zsh/dot_zshrc.tmpl +++ b/dot_config/zsh/dot_zshrc.tmpl @@ -48,12 +48,10 @@ zstyle ':completion:*:(ssh|scp|rsync):*:hosts' ignored-patterns '*(.|:)*' loopba ## -------------------------------------------------- # syntax highlighting a la fish ## -------------------------------------------------- -for hlpath in zsh/plugins/zsh-syntax-highlighting zsh-syntax-highlighting; do - if [[ -e "/usr/share/$hlpath/zsh-syntax-highlighting.zsh" ]]; then - . "/usr/share/$hlpath/zsh-syntax-highlighting.zsh" - break - fi -done +hlpath="$XDG_DATA_HOME/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" +if [[ -e "$hlpath" ]]; then + . "$hlpath" +fi ## -------------------------------------------------- # history