Reputation: 1511
Let's see if I can explain myself.
I use vi-mode in bash, which is really great since I'm used to Vi.
When I'm inside vim and type : (to go to ex mode), since I'm used to the vi-mode from bash, I feel the slowliness of having to use this mode like the "regular" way of using bash.
Question is: is there a way of using vim's ex-mode like bash's (or readline) vi-mode?
Upvotes: 4
Views: 1642
Reputation: 4160
For users that use Vim or vi bindings almost everywhere, including on their shell command line, it really hurts when you leave that environment. If you're used to the vi bindings hyperdrive, going back to chords for skipping words and other manoeuvres is painful and slow. Operating systems also differ on their default bindings so Mac, for instance, supports option-arrow
instead of control-arrow
, adding to the pain.
But there is one place where this also happens where it's really upsetting: in Vim itself. When working in Vim and entering command mode using :
the default readline editing returns. Chords all over again. How to fix this?
Simple: When in "normal" mode, that is, when navigating around, type q:
ENTER
on the line you want to execute:q
as wellESC
leaves the "ex" command line, ESC
in the buffer will not leave the buffer, because it's an actual bufferThe q
prefix is used to introduce macro recording, so the q:
variant is perfectly mnemonic for entering recording of an "ex" command line.
Note that q:
to enter the buffer editing mode is very similar to :q
! You may have hit that by accident sometimes ;-) Now you know how to get out of it!
Zigdon had this answer a long time ago, of course, but it's pretty darn sparse, but then again, so is the question. If Zigdon adds this extra detail to his answer I'll be happy to delete this answer so that there can be one good answer.
Upvotes: -1
Reputation: 15063
Not sure if I understand what you're trying to do, but it might be something like hitting q:
in normal mode?
Upvotes: 3