Spaceship-prompt: Hide vi_mode section by default

Created on 11 Dec 2018  ·  11Comments  ·  Source: denysdovhan/spaceship-prompt

vi_mode seems to be confusing to users (#584 #470 #463 #440 #325) and there seems to be multiple issues related zle-keymap detection (#414 #157). Personally, I think that section doesn't exactly align with the philosophy of spaceship prompt and clutters with default settings or depend on external frameworks. Like editor module for Prezto and vi-mode plugin for OMZ.

I think @maximbaz might share similar sentiment (https://github.com/denysdovhan/spaceship-prompt/issues/463#issuecomment-394407009)

Since it's repeatedly causing confusion, maybe this is a good candidate for a section that has to be disabled by default

So I propose to hide vi_mode section by default.

breaking proposal under-discussion

Most helpful comment

Guys are confused because they don't know the existence of vi mode. Maybe we could try the prezto way, making the vi_mode indicator less intrusive by merging it into the prompt character.

Display an ordinary prompt like in insert mode, and flip the direction of the prompt char in normal mode as .

Besides, changing the cursor shape between vertical bar and block is another better way to indicate the vi_mode status.

I've tried both of the methods above in my fork.

All 11 comments

What about improving vi-mode detection?

I'm for improving vi-mode detection and have the section ON by default, if it's enabled. Right now I have section stuck in [I] mode (issue #157), which is sad.

If the section gets removed, I think _some_ form of indication, at least, would be good to have, like dual form of prompts, like the sorin prompt from Prezto.

What about improving vi-mode detection?

I'm for improving vi-mode detection and have the section ON by default, if it's enabled.

I don't use vi_mode section personally due to it's inaccuracy and most of the detection methods either depend on external tools or unreliable. Feel free to send us a PR

I don't use vi_mode section personally due to it's inaccuracy and most of the detection methods either depend on external tools or unreliable.

I made my comment while I was trying the prompt with Antibody yesterday but I'm already back to Prezto. It has been some years I use Prezto, throughout Linux, WSL and macOS, all this time I'm using the sorin prompt that does have vi mode detection and that has never been an issue, it's the first time I'm hearing it can be problematic.

Feel free to send us a PR :v:

OK, maybe possibly when I give it + Antibody a try again. I'd probably simply do what sorin does.

Guys are confused because they don't know the existence of vi mode. Maybe we could try the prezto way, making the vi_mode indicator less intrusive by merging it into the prompt character.

Display an ordinary prompt like in insert mode, and flip the direction of the prompt char in normal mode as .

Besides, changing the cursor shape between vertical bar and block is another better way to indicate the vi_mode status.

I've tried both of the methods above in my fork.

Personally I have the vi indicator disabled in insert mode, and change to [V] in normal mode. I do this because I'm in insert mode 90% of the time, and I find the [I] distracting and slightly ugly. I have it enabled for normal mode because I want a strong visual indication in case I hit ESC on accident.
I personally think and might not be an obvious enough indication, but I haven't tried it. I can imagine myself getting confused about why I can't type at my prompt, having not noticed that the chevron is reversed. Maybe that combined with a color change would work nicely if it stands out enough.
In summary, I'm for removing the indicator in insert mode, but NOT in normal mode, because that would be very confusing at times.

@oblitum, i'm using antibody too and adding spaceship_vi_mode_enable in my .zshrc seemed to do the trick for getting the prompt to show the correct status.

@adanilev thanks! I'm giving this a try again now and your tip fixed the issue.

Though I think reversed prompt is much more noticeable than [I] vs [N]. It's what both the sorin (❯❯❯, ❮❮❮) and pure (, ) prompts do.

I also feel that the clunky [I] and [N] don't really do justice to the awesome look of the prompt. I suggest the following default mappings:

SPACESHIP_VI_MODE_INSERT="\uf8ea"
SPACESHIP_VI_MODE_NORMAL="\uf6b5"

Both are from nerdfont-complete and look like this:
image
image

Of course setting up the cursor in zsh-vim-mode also adds flavor by letting you know where you are.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oldchevy picture oldchevy  ·  3Comments

olets picture olets  ·  3Comments

ChadTaljaardt picture ChadTaljaardt  ·  4Comments

tbekaert picture tbekaert  ·  3Comments

maccius picture maccius  ·  3Comments