Fixed zsh plugin setup

This commit is contained in:
Oystein Kristoffer Tveit 2022-10-13 23:43:58 +02:00
parent 1881cb0bca
commit 01519d9e61
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
1 changed files with 29 additions and 10 deletions

View File

@ -1,10 +1,16 @@
{ pkgs, lib, config, shellOptions, ... }: { pkgs, lib, config, shellOptions, ... }:
{ {
programs.zsh = rec { programs.zsh = {
enable = true; enable = true;
dotDir = ".config/zsh"; dotDir = ".config/zsh";
# enableSyntaxHighlighting = true; # enableSyntaxHighlighting = true;
defaultKeymap = "viins"; defaultKeymap = "viins";
enableCompletion = true;
initExtraBeforeCompInit = ''
fpath+=(${pkgs.zsh-completions}/share/zsh/site-functions)
'';
history = { history = {
extended = true; extended = true;
@ -18,9 +24,20 @@
# name = "nix-zsh-shell-integration"; # name = "nix-zsh-shell-integration";
# src = pkgs.nix-zsh-shell; # src = pkgs.nix-zsh-shell;
# } # }
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.plugin.zsh";
}
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{ {
name = "zsh-fast-syntax-highlighting"; name = "zsh-fast-syntax-highlighting";
src = pkgs.zsh-fast-syntax-highlighting; src = pkgs.zsh-fast-syntax-highlighting;
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
} }
{ {
name = "zsh-completions"; name = "zsh-completions";
@ -29,19 +46,12 @@
{ {
name = "zsh-you-should-use"; name = "zsh-you-should-use";
src = pkgs.zsh-you-should-use; src = pkgs.zsh-you-should-use;
file = "share/zsh/plugins/you-should-use/you-should-use.plugin.zsh";
} }
{ {
name = "zsh-autosuggestions"; name = "zsh-autosuggestions";
src = pkgs.zsh-autosuggestions; src = pkgs.zsh-autosuggestions;
} file = "share/zsh-autosuggestions/zsh-autosuggestions.zsh";
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
} }
]; ];
@ -51,6 +61,15 @@
initExtra = '' initExtra = ''
source ${./p10k.zsh} source ${./p10k.zsh}
enable-fzf-tab
zstyle ':fzf-tab:complete:cd:*' fzf-preview '${pkgs.exa}/bin/exa -1 --color=always $realpath'
# Use tmux buffer if we are inside tmux
if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
fi
''; '';
}; };
} }