Keyboard-only column block selection in GVim Win32, or why does Ctrl-Q not emulate Ctrl-V when mswin.vim is included?

后端 未结 3 2179
陌清茗
陌清茗 2021-02-12 13:12

I want to be able to select columnar blocks using only the keyboard when I use GVim on Windows, but I do not seem to be able to do so when using gvim (7.2) on Windows XP. E

相关标签:
3条回答
  • 2021-02-12 13:53

    The best thing to do is to remove these lines from your vimrc. They are totally unecessary and change too many basic Vim features.

    0 讨论(0)
  • 2021-02-12 13:57

    One way to visually select column blocks in GVim on Win32 using only the keyboard is to press Ctrl-Q, release it, then press and hold down the Shift key while using the arrow keys to select the column block.

    Why Ctrl-Q columnar selection behaves this way is not known, but it does not really matter since the goal was to select column blocks using only the keyboard. In Vim, Shift is not used when using Ctrl-V to select blocks.

    :help mswin does not mention this nuance of the CTRL-V alternative.

    0 讨论(0)
  • 2021-02-12 13:57

    The noremap <C-Q> <C-V> in mswin.vim remaps the original command to Ctrl + Q.

    If mswin.vim is included, after pressing Ctrl + Q, the indicated mode should switch to Visual Block, and any movement (e.g. j, l, w) extends the visual selection. If that doesn't work for you, you may have something interfering.

    Are those movement commands itself remapped, or is there an autocmd on CursorMoved?! Try disabling your plugins (vim --noplugin) and most parts of your .vimrc.

    Note that cursor keys do not normally constitute proper movement (and their use in Vim is frowned upon).

    What you perceive as the right (and only) way to extend the selection (with shifted cursor keys) is just a consequence of :set selectmode=key, as done by :behave mswin.

    0 讨论(0)
提交回复
热议问题