This is prompt for zsh designed to be:
- Simple: only shows the information that matters
- Slim: fits on one line, with VCS information on the right and disappearing as needed
- Fast: expensive lookups are minimized and done asynchronously
- Simple implementation: heavily relies on existing libraries
It's likely going to evolve very little (if at all) functionality-wise.
The proper way to use it is to add the plugin to your fpath
and then run:
autoload -U promptinit && promptinit
prompt ssfprompt
If you don't want to do it by hand, you can use a zsh plugin manager, such as Zplugin:
zplugin light https://gitlab.com/hugoh/zsh-ssfprompt.git
- For asynchronous lookups, you will need to install zsh-async.
- One Git status module; by default, it uses posh-git-sh
Again, with Zplugin:
zplugin light mafredri/zsh-async
zplugin ice pick'git-prompt.sh'; zplugin light lyze/posh-git-sh
zplugin light https://gitlab.com/hugoh/zsh-ssfprompt.git
You can of course defined your own PROMPT
variable.
You can also override the Git status function to your liking by overriding prompt_ssfprompt_vcs_status
.
To use Starship, configure the Git information to be in the right prompt and then:
prompt_ssfprompt_vcs_status() { command starship prompt --right }
With zsh-async installed, this will run Starship asynchronously to provide Git status – a workaround for fetching Git status asynchronously with Starship –, assuming to have your right prompt configured as follows:
right_format = """
%F{yellow}\
$git_branch\
$git_commit\
$git_state\
%f\
%F{red}\
$git_status\
%f\
"""
[git_branch]
style = ''
[git_commit]
style = ''
[git_state]
style = ''
[git_status]
style = ''
To use gitHUD:
prompt_ssfprompt_vcs_status() { command githud zsh }
To use git-radar:
prompt_ssfprompt_vcs_status() { command git-radar --zsh }