From 72cbea45f37a62002c0f7b14b2c3334133eda2ac Mon Sep 17 00:00:00 2001 From: David Morgan Date: Tue, 3 Sep 2024 15:45:26 +0100 Subject: Move fzf variables to programs.zsh.localVariables --- nix-conf/home/includes/zsh.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'nix-conf') diff --git a/nix-conf/home/includes/zsh.nix b/nix-conf/home/includes/zsh.nix index c1fb138..6afcbf2 100644 --- a/nix-conf/home/includes/zsh.nix +++ b/nix-conf/home/includes/zsh.nix @@ -108,6 +108,13 @@ in LSP_USE_PLISTS = true; LESS = "-iRXF"; + + FZF_DEFAULT_COMMAND=''rg --files --no-ignore --hidden --follow -g \"!{.git,node_modules}/*\" 2> /dev/null''; + FZF_CTRL_T_COMMAND="${config.programs.zsh.localVariables.FZF_DEFAULT_COMMAND}"; + FZF_ALT_C_COMMAND=''rg --hidden --files --sort-files --null -g \"!{.git,node_modules}/*\" | xargs -0 dirname | sort -u''; + FZF_ALT_C_OPTS="--preview 'eza --tree {} | head -200'"; + FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind 'ctrl-t:toggle-preview'"; + FZF_DEFAULT_OPTS="--bind=ctrl-t:toggle-all --bind=ctrl-j:jump"; }; initExtraFirst = '' [[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return @@ -128,14 +135,6 @@ in fi fi - # Keep these in initExtra, rather than localVariables, because the order matters - export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow -g "!{.git,node_modules}/*" 2> /dev/null' - export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" - export FZF_ALT_C_COMMAND='rg --hidden --files --sort-files --null -g "!{.git,node_modules}/*" | xargs -0 dirname | sort -u' - export FZF_ALT_C_OPTS="--preview 'eza --tree {} | head -200'" - export FZF_CTRL_R_OPTS="--preview 'echo {}' --preview-window down:3:hidden:wrap --bind 'ctrl-t:toggle-preview'" - export FZF_DEFAULT_OPTS="--bind=ctrl-t:toggle-all --bind=ctrl-j:jump" - eval "$(batpipe)" autopair-init enable-fzf-tab -- cgit 1.4.1-2-gfad0