This question raised my previous question: Vim's (insert) VISUAL 'mode?
In this question, I asked about the " VISUALvs" mode (insert) VISUAL, in which you enter the visual mode directly from the insert mode. I found a display that behaves differently depending on the "subtype" of the visual mode, and I don’t understand why:
vnoremap x <Esc>jjj
vnoremap <A-[> <C-G>ugv
The first display illustrates how Vim goes out of its way to make the displays behave sequentially: pressing xfrom the " VISUAL" mode and pressing xfrom the " (insert) VISUAL" mode will move the cursor down 3 lines. The latter does not go into insert mode and enters three j. Thus, it <Esc>does not behave differently depending on the mode, although outside the display it will differ from these two modes.
The second display illustrates how some cards behave inconsistently. If you select a word and press ALT+ [, then the word will be replaced by ugvif it is executed in " VISUAL" mode , but nothing happens if it is executed from " (insert) VISUAL" mode . Presumably this is because Vim executes normal mode commands ugvfor 'undo' and 'reselect-visual'.
This is a strange inconsistency. This is the minimum example that I came across while debugging my comparisons and would like to know why it works this way.
source
share