matchai / spacefish

🚀🐟 The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
963 stars 77 forks source link

How to customize prompt with Vi mode? #201

Closed Kevin-Mok closed 4 years ago

Kevin-Mok commented 4 years ago

I copied the default prompt order from the docs, but the Vi mode indicator disappears as soon as I put these lines into my config.fish:

set SPACEFISH_PROMPT_ORDER time user dir host git package node docker ruby golang php rust haskell julia aws conda pyenv kubecontext exec_time line_sep battery jobs exit_code char
set SPACEFISH_VI_MODE_SHOW true

If I remove those lines, the indicator comes back. So, how do I customize the prompt while still keeping the indicator?

matchai commented 4 years ago

Hey Kevin! The reason the indicator disappears when you add those lines is because your SPACEFISH_PROMPT_ORDER is missing the vi_mode segment, which is included in the prompt order by default.

From there, you can proceed to modify the following configuration values:

set SPACEFISH_VI_MODE_SHOW true
set SPACEFISH_VI_MODE_PREFIX " "
set SPACEFISH_VI_MODE_SUFFIX $SPACEFISH_PROMPT_DEFAULT_SUFFIX
set SPACEFISH_VI_MODE_INSERT [I]
set SPACEFISH_VI_MODE_NORMAL [N]
set SPACEFISH_VI_MODE_VISUAL [V]
set SPACEFISH_VI_MODE_REPLACE_ONE [R]
set SPACEFISH_VI_MODE_COLOR white