Vim '(insert) VISUAL' mode?

"Mode (insert) VISUAL", you can enter CTRL+ O, vstarting with the insertion mode. This goes into visual mode, but displays as " (insert) VISUAL" from within vim, and clicking Escfrom this mode returns you to insert mode, not normal mode. The mode " (insert) VISUAL" is also entered by the shifted arrows from the insert mode.

Two related questions:

  • In this special mode, there doesn't seem to be much documentation. Is there an easy way to find information about this? (edit: I know what CTRL+ usually does O. Interaction with the visual mode seems special. The first paragraph was the easiest way to refer to what this mode is in the first place, since I don't know the name to search for.)

  • How did you write the vmapmappings reliably? Namely, is there a consistent way to leave the visual mode and end, say, normal mode? Or ends sequentially in insert mode?

+5
source share
4 answers

About the second question: you can switch to normal mode from any other using <C-\><C-n>. There are no commands for reliably switching to visual or plug-in modes in this way, but if you only need to always switch to normal mode after visual, then this is enough. Please note that most displays in visual mode work in a special mode i<C-o>vwithout changes.

+6
source

<C-o> , . Vim (insert). , v , Vim (insert) VISUAL. Vim - , , , , . , , <Esc> , .

- , , , normal insert(normal)visual, , .

:

  • , "" -
  • , .
  • , .
  • .

, <Esc> .

, v <C-o> .

Vim - . <C-o>, , . , , , .

, - , , -, , .

+13

:h Operator-pending :h mode-switching. () . . :h map-modes . vmap , , xmap , , smap , . noremap , .

+1

.

CTRL + O , . . :h i_CTRL-O.

.

I do not think that you have a reliable way to exit this or that mode. The most reliable way, in my opinion, to start in the mode in which you want to end.

0
source

All Articles