diff options
| author | 2026-01-18 21:53:18 +0100 | |
|---|---|---|
| committer | 2026-01-18 21:53:18 +0100 | |
| commit | e7e22d34089619349eaed54b213d575742748ce5 (patch) | |
| tree | 532853f56020d0ba1b848c9e41662a1bf2ad7ade /dot_config/zsh/functions/prompt_fish_setup | |
| parent | zsh: ignore local files (diff) | |
zsh: even bigger rewrite
don't... worry about it
I spent basically all day between this and monster hunter.
Diffstat (limited to '')
| -rw-r--r-- | dot_config/zsh/functions/prompt_fish_setup | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dot_config/zsh/functions/prompt_fish_setup b/dot_config/zsh/functions/prompt_fish_setup new file mode 100644 index 0000000..35eaeb9 --- /dev/null +++ b/dot_config/zsh/functions/prompt_fish_setup @@ -0,0 +1,23 @@ +# vim: ft=zsh +# a prompt meant to imitate fish's default prompt +# it's not meant to be too close necessarily, just same feel overall, +# while being a minimal/cheap implementation + +setopt promptsubst +autoload -Uz add-zsh-hook +autoload -Uz vcs_info # make sure you configure yours! + +_prompt_fish_chpwd() { FORCE_RUN_VCS_INFO=1; } +_prompt_fish_precmd() { vcs_info fish; } + +add-zsh-hook chpwd _prompt_fish_chpwd +add-zsh-hook precmd _prompt_fish_precmd + +add-zsh-hook -Uz chpwd vcs_info + +local login='%(!.%F{red}.%F{green})%n%f@%m' +local vcsinfo='${vcs_info_msg_0_:+ $vcs_info_msg_0_}' +local returnc='%(0?.. %F{red}[%?]%f)' +local separator='%(!.#.>)' + +PS1="$login %~$vcsinfo$returnc$separator " |
