From ba4d00d1df7a6c1e5fa034d4f127641c08bb4aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Tue, 9 May 2023 21:25:26 -0300 Subject: [PATCH] fish: add some plugins --- user/fish/default.nix | 13 +++++++++---- user/fish/fish_prompt.fish | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/user/fish/default.nix b/user/fish/default.nix index e51d9f0..9710e55 100644 --- a/user/fish/default.nix +++ b/user/fish/default.nix @@ -4,11 +4,12 @@ in { config = { programs.fish = { enable = true; + shellInit = '' + set -U __accent_color "${accent.color}" + ''; interactiveShellInit = '' set -U fish_features stderr-nocaret qmark-noglob regex-easyesc ampersand-nobg-in-token - set -g __accent_color "${accent.color}" - alias _fish_prompt_accent "_fish_prompt_color '$__accent_color'" set_color red if not test -d "$PASSWORD_STORE_DIR" echo "Password Store not yet setup" @@ -78,9 +79,13 @@ in { }; # programs.command-not-found.enable = true; programs.nix-index.enable = true; - home.packages = with pkgs; [ + home.packages = (with pkgs; [ trash-cli wl-copy-file - ]; + ]) ++ (with pkgs.unstable.fishPlugins; [ + async-prompt + foreign-env + done + ]); }; } diff --git a/user/fish/fish_prompt.fish b/user/fish/fish_prompt.fish index 35cfd32..2cba6be 100644 --- a/user/fish/fish_prompt.fish +++ b/user/fish/fish_prompt.fish @@ -27,6 +27,8 @@ alias _fish_prompt_warn "_fish_prompt_color 'yellow'" alias _fish_prompt_normal "_fish_prompt_color 'normal'" +alias _fish_prompt_accent "_fish_prompt_color '$__accent_color'" + ############################################################ # Git ############################################################ @@ -47,7 +49,7 @@ function _fish_prompt_git_remote_branches end function _fish_prompt_git_unpushed_branches - timeout 1s git log \ + timeout 5s git log \ --branches \ --simplify-by-decoration \ --not \ @@ -78,7 +80,7 @@ function fish_git_prompt set -l git_branch (git branch --show-current 2> /dev/null);or return set -l git_detach (_fish_prompt_git_detached) set -l git_remote_branch (git rev-parse --abbrev-ref (git branch --show-current)@{u} 2> /dev/null) - set -l git_status_s (timeout 1s git status -s | string collect) + set -l git_status_s (timeout 5s git status -s | string collect) set -l git_log_unpushed (_fish_prompt_git_unpushed_branches) _fish_prompt_normal " on "