Add fzf-tab
diff --git a/src/apps/personal/vim.nix b/src/apps/personal/vim.nix
index 9d739ac..f53e536 100644
--- a/src/apps/personal/vim.nix
+++ b/src/apps/personal/vim.nix
@@ -21,6 +21,7 @@
set splitright
set splitbelow
set clipboard=unnamedplus
+ set smartcase
colorscheme onehalfdark
if exists('+termguicolors')
diff --git a/src/apps/personal/zsh.nix b/src/apps/personal/zsh.nix
index 18b275d..9fce4e9 100644
--- a/src/apps/personal/zsh.nix
+++ b/src/apps/personal/zsh.nix
@@ -1,6 +1,7 @@
-{ config, ... }: {
+{ config, fzf-tab, ... }: {
programs.zsh = {
enable = true;
+ plugins = [ { name = "fzf-tab"; src = fzf-tab; } ];
oh-my-zsh = {
enable = true;
plugins = [ "git" ];
@@ -42,10 +43,26 @@
print -n "%{$fg_bold[red]%}^C%{$fg_no_bold[default]%}"
return $(( 128 + $1 ))
}
+
+ # disable sort when completing `git checkout`
+ zstyle ':completion:*:git-checkout:*' sort false
+ # set descriptions format to enable group support
+ zstyle ':completion:*:descriptions' format '[%d]'
+ # set list-colors to enable filename colorizing
+ zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
+ # preview directory's content with exa when completing cd
+ zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 -l --color=always $realpath'
+ # switch group using `,` and `.`
+ zstyle ':fzf-tab:*' switch-group ',' '.'
+ enable-fzf-tab
'';
enableSyntaxHighlighting = true;
enableAutosuggestions = true;
autocd = true;
dotDir = ".local/share/zsh";
};
+
+ home.packages = [
+ pkgs.fzf
+ ];
}