pinwheel: Add zsh prompts when in nix shell and/or direnv
This commit is contained in:
@@ -54,6 +54,20 @@ in
|
||||
"bindkey -v '^?' backward-delete-char"
|
||||
"bindkey '^a' beginning-of-line"
|
||||
"bindkey '^e' end-of-line"
|
||||
''
|
||||
function prompt_in_nix_shell() {
|
||||
if [[ -n "$IN_NIX_SHELL" ]]; then
|
||||
p10k segment -f yellow -t "nix";
|
||||
fi
|
||||
}
|
||||
''
|
||||
''
|
||||
function prompt_in_direnv() {
|
||||
if [[ -n "$DIRENV_DIR" ]]; then
|
||||
p10k segment -f yellow -t "direnv"
|
||||
fi
|
||||
}
|
||||
''
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
command_execution_time # previous command duration
|
||||
virtualenv # python virtual environment
|
||||
prompt_char # prompt symbol
|
||||
in_nix_shell
|
||||
in_direnv
|
||||
)
|
||||
|
||||
# Right prompt segments.
|
||||
|
||||
Reference in New Issue
Block a user