haskeline icon indicating copy to clipboard operation
haskeline copied to clipboard

Add vi mode indicator

Open shanemikel opened this issue 8 years ago • 6 comments

Readline has an option: show-mode-in-prompt that works with editing-mode vi to give an indicator of the vi editing mode, in the form of the leftmost prompt character showing a '+' in insert mode, and ':' in normal mode, (it removes the character all-together when doing a search with /, I guess if it supports other command-mode commands, it would do the same thing)

It would be great if I could get this in my ghci.. That being said, just because readline does it this way, doesn't mean it makes more sense than having something customizable in the configuration of the prompt itself. Any thoughts?

shanemikel avatar Mar 01 '16 06:03 shanemikel

That sounds like a reasonable addition to the existing UserPreferences. I probably won't have time to implement it anytime soon, though. Let me know if you're interested in doing it an/or would like pointers around the codebase. (The printing of the prompt is controlled by System.Console.Haskeline.LineState.)

judah avatar Mar 06 '16 20:03 judah

How (i.e. where) are entries from the .haskeline dotfile parsed inside Haskeline?

hgiesel avatar Jul 09 '16 01:07 hgiesel

They're parsed as part of System.Console.Haskeline.Prefs.readPrefs; the full list of prefs is defined here: http://hackage.haskell.org/package/haskeline-0.7.2.3/docs/src/System.Console.Haskeline.Prefs.html#settors

judah avatar Jul 09 '16 03:07 judah

This would be a very useful feature. I'm very used to being able to see what mode fish shell is in and having that in GHCI would be helpful.

neonpixii avatar Feb 19 '19 19:02 neonpixii

Is there a way to change cursor shapes for different vi modes? I have that with zsh like so. For me, this was intuitive enough where you don't need any other indicator.

joshcho avatar Jun 12 '21 01:06 joshcho

Any updates on this?

michalspano avatar Oct 22 '23 13:10 michalspano