开发者

Configure Macvim's text selection to not include character under cursor

Using macvim, when I copy a text selec开发者_StackOverflowtion, 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?


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'


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜