terminal/shell: add transient fish integration

This commit is contained in:
Anthony Rodriguez 2024-12-06 08:55:33 +01:00
parent 09c34d14a3
commit c24ff33ed6
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
2 changed files with 31 additions and 5 deletions

View file

@ -1,9 +1,27 @@
{pkgs, ...}: { {
config,
pkgs,
lib,
...
}: let
starshipTransient = lib.strings.optionalString config.programs.starship.enableTransience ''
function starship_transient_prompt_func
starship module character
end
function starship_transient_rprompt_func
starship module cmd_duration
end
'';
in {
programs.fish = { programs.fish = {
enable = true; enable = true;
interactiveShellInit = '' interactiveShellInit =
starshipTransient
+ ''
set fish_greeting # Disable greeting set fish_greeting # Disable greeting
fish_vi_key_bindings # Enable Vi mode fish_vi_key_bindings # Enable Vi mode
''; '';
shellAbbrs = { shellAbbrs = {
cd = "z"; cd = "z";

View file

@ -2,5 +2,13 @@
programs.starship = { programs.starship = {
enable = true; enable = true;
enableTransience = true; enableTransience = true;
settings = {
add_newline = true;
cmd_duration = {
style = "yellow";
format = "[ $duration]($style)";
};
};
}; };
} }