After watching Damian Conway's excellent Instantly Better Vim, I decided to switch Vim's colon and semicolon:
nnoremap ; :
nnoremap : ;
This all works wonderfully, except for one small thing. When I type ;ls
, I get the buffer listing (as expected), with the standard message to "Press ENTER or type command to continue." Often what I want to do is type something like :bd 2 4 9
to delete some buffers.
However, with the new mapping, typing a semicolon doesn't work (it exits to a new blank command line), but neither does typing a colon (it acts as any other keypress, as far as I can tell)! Is there any way to get around this? I do tend to use the default semicolon functionality fairly frequently, so I'd like to keep that mapping if possible. The problem fixes itself if I remove the nnoremap : ;
so that the default colon still works.
I'd say that's an unfortunate consequence of the implementation of the hit-enter prompt. The logic whether to clear the output does not seem to take the mapping into account. You should raise this on the vim_dev mailing list; maybe someone implements a patch, as this swap idiom is rather common.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With