terminal/shell: add transient fish integration
This commit is contained in:
parent
09c34d14a3
commit
c24ff33ed6
2 changed files with 31 additions and 5 deletions
|
@ -1,10 +1,28 @@
|
|||
{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 = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting # Disable greeting
|
||||
fish_vi_key_bindings # Enable Vi mode
|
||||
'';
|
||||
interactiveShellInit =
|
||||
starshipTransient
|
||||
+ ''
|
||||
set fish_greeting # Disable greeting
|
||||
fish_vi_key_bindings # Enable Vi mode
|
||||
|
||||
'';
|
||||
shellAbbrs = {
|
||||
cd = "z";
|
||||
ngc = "sudo nix-collect-garbage -d";
|
||||
|
|
|
@ -2,5 +2,13 @@
|
|||
programs.starship = {
|
||||
enable = true;
|
||||
enableTransience = true;
|
||||
settings = {
|
||||
add_newline = true;
|
||||
|
||||
cmd_duration = {
|
||||
style = "yellow";
|
||||
format = "[ $duration]($style)";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue