fish: add some plugins

This commit is contained in:
Leonardo Eugênio 2023-05-09 21:25:26 -03:00
parent 1c70c3c695
commit ba4d00d1df
2 changed files with 13 additions and 6 deletions

View file

@ -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
]);
};
}

View file

@ -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 "