Vim:反向视觉模式的视角

Pet*_*ter 18 vim

假设您正在使用vim在可视模式下进行选择.你击中了v,然后开始向右移动l.然后,假设您希望将选择范围扩展到左侧,而不更改右侧的点.也就是说,你满意'>但想改变'<.

你如何交换,好像你开始'>并选择向左,改变'<

我有一个模糊的回忆,我以前见过这个,但谷歌很难.

Pet*_*ter 19

哎呀,惊人的发布到stackoverflow可以让阅读(F)手册更容易...

3. Changing the Visual area             *visual-change*

                            *v_o*
o           Go to Other end of highlighted text: The current
            cursor position becomes the start of the highlighted
            text and the cursor is moved to the other end of the
            highlighted text.  The highlighted area remains the
            same.
Run Code Online (Sandbox Code Playgroud)

  • 不要忘记块状(矩形)选择中的大写"O",它不是对角线:`:help v_O`. (3认同)

dec*_*lan 5

o

从文档:

o           Go to Other end of highlighted text: The current
            cursor position becomes the start of the highlighted
            text and the cursor is moved to the other end of the
            highlighted text.  The highlighted area remains the
            same. 
Run Code Online (Sandbox Code Playgroud)