From f1c53f4ac1b941f4a81c177461bae9236510d41e Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Mon, 21 Oct 2024 21:11:11 +0700 Subject: [PATCH] zsh: added zsh-autocomplete plugin --- home/programs/zsh.nix | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/home/programs/zsh.nix b/home/programs/zsh.nix index 08818ad..ba8b16e 100644 --- a/home/programs/zsh.nix +++ b/home/programs/zsh.nix @@ -24,7 +24,7 @@ in unsetopt GLOBAL_RCS ''; autosuggestion.enable = true; - enableCompletion = true; + enableCompletion = false; defaultKeymap = "emacs"; dirHashes = { docs = "$HOME/Documents"; @@ -59,9 +59,17 @@ in save = 40000; size = 40000; }; - completionInit = lib.mkOrder 9999 (concatStrings [ + syntaxHighlighting.enable = true; + initExtraFirst = lib.mkOrder 9999 (concatStrings [ # bash '' + export ZSH_CACHE_DIR=$HOME/.cache/zsh + + _ZSH_COLOR_SCHEME_FILE=$HOME/.cache/wallust/sequences + if [ -f "$_ZSH_COLOR_SCHEME_FILE" ]; then + (cat "$_ZSH_COLOR_SCHEME_FILE" &) + fi + mkdir -p $ZSH_CACHE_DIR/completions fpath+=$ZSH_CACHE_DIR/completions fpath+=${pkgs.zsh-completions}/share/zsh/site-functions @@ -73,26 +81,7 @@ in fi '' ) - # Value below must be always last in the completionInit - # bash - '' - autoload -U compinit && compinit - '' ]); - syntaxHighlighting.enable = true; - initExtraFirst = # bash - '' - export ZSH_CACHE_DIR=$HOME/.cache/zsh - - # if [ -f $HOME/.config/zsh/.p10k.zsh ]; then - # source $HOME/.config/zsh/.p10k.zsh - # fi - - _ZSH_COLOR_SCHEME_FILE=$HOME/.cache/wallust/sequences - if [ -f "$_ZSH_COLOR_SCHEME_FILE" ]; then - (cat "$_ZSH_COLOR_SCHEME_FILE" &) - fi - ''; initExtra = concatStrings [ # bash '' @@ -154,6 +143,11 @@ in src = pkgs.zsh-history-substring-search; file = "share/zsh-history-substring-search/zsh-history-substring-search.zsh"; } + { + name = "zsh-autocomplete"; + src = pkgs.zsh-autocomplete; + file = "share/zsh-autocomplete/zsh-autocomplete.plugin.zsh"; + } # { # name = "zsh-defer"; # src = pkgs.zsh-defer;