配置 Macvim 的文本选择不包含光标下的字符

发布于 2024-08-23 15:17:31 字数 173 浏览 5 评论 0原文

使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿看小鸭子会跑 2024-08-30 15:17:31

看一下选择选项。默认情况下,它设置为 inclusive,但您可以将其更改为 exclusive 以使文本选择按照您想要的方式进行:

:set selection=exclusive

您还可以将其设置为 exclusive code> 与 behave 命令:

:behave mswin

这还会设置其他几个选项,但是,这可能是也可能不是您想要的。具体内容请参阅 Vim 帮助。

:help :behave

:help 'selection'

Take a look at the selection option. By default it's set to inclusive, but you can change it to exclusive to make text selections act the way you want:

:set selection=exclusive

You can also set it to exclusive with the behave command:

:behave mswin

This also sets several other options, however, which may or may not be what you want. See the Vim help for the specifics.

:help :behave

:help 'selection'
余生一个溪 2024-08-30 15:17:31

我猜测下移箭头会激活视觉字符模式,并将光标向下移动一行。如果您尝试选择整行,最好使用可视线模式,通过按 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 the k (or up arrow) and j (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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文