配置 Macvim 的文本选择不包含光标下的字符
使用 macvim,当我复制文本选择时,它总是包含光标下的字符。
例如,如果光标位于最左侧并且我按 Shift-down 箭头,它会选择整行加上下一行的第一个字符(因为光标位于下一行的第一个字符上)特点)。
有没有办法配置 macvim 在文本选择中不包含光标字符?
Using macvim, when I copy a text selection, it always includes the character under the cursor.
For example, if the cursor is at the far left and I press shift-down arrow, it selects the entire line plus the first character of the next line (since the cursor is sitting over the next line's first character).
Is there a way to configure macvim to not include the cursor character in text selections?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看一下
选择
选项。默认情况下,它设置为inclusive
,但您可以将其更改为exclusive
以使文本选择按照您想要的方式进行:您还可以将其设置为
exclusive
code> 与behave
命令:这还会设置其他几个选项,但是,这可能是也可能不是您想要的。具体内容请参阅 Vim 帮助。
Take a look at the
selection
option. By default it's set toinclusive
, but you can change it toexclusive
to make text selections act the way you want:You can also set it to
exclusive
with thebehave
command:This also sets several other options, however, which may or may not be what you want. See the Vim help for the specifics.
我猜测下移箭头会激活视觉字符模式,并将光标向下移动一行。如果您尝试选择整行,最好使用可视线模式,通过按
V
(shift-v) 从正常模式激活该模式。这将完整选择当前行。然后,您可以使用k
(或向上箭头)和j
(或向下箭头)键扩展选择以包括上面和下面的行。在使用 Vim 时,我认为顺其自然比对抗它更好。不要指望它的工作方式与其他文本编辑器相同。接受 Vim 方式的不同。
I am guessing that shift-down arrow activates visual character mode, and moves the cursor down a line. If you are trying to select entire lines, you would be better off using visual line mode, which is activated from normal mode by pressing
V
(shift-v). This will select the current line in its entirety. You can then extend your selection to include the lines above and below using thek
(or up arrow) andj
(or down arrow) keys.When using Vim, I think it is better to go with the grain rather than to fight against it. Don't expect it to work the same way as other text editors. Accept that the Vim way is different.