Improve zsh completion

This commit is contained in:
SebastianStork 2024-05-21 15:42:41 +02:00
parent c98192eb68
commit d422206b97

View file

@ -1,4 +1,9 @@
{ config, lib, ... }: {
config,
pkgs,
lib,
...
}:
{ {
imports = [ imports = [
./p10k ./p10k
@ -22,6 +27,14 @@
path = "${config.xdg.dataHome}/zsh/zsh_history"; path = "${config.xdg.dataHome}/zsh/zsh_history";
}; };
plugins = [
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.plugin.zsh";
}
];
initExtraFirst = '' initExtraFirst = ''
(( ''${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)" (( ''${+commands[direnv]} )) && emulate zsh -c "$(direnv export zsh)"
@ -31,6 +44,13 @@
(( ''${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)" (( ''${+commands[direnv]} )) && emulate zsh -c "$(direnv hook zsh)"
''; '';
initExtra = ''
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-Z}'
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath'
'';
}; };
programs.fzf.enable = true; programs.fzf.enable = true;