tags:

views:

49

answers:

3

I've used the Windows version of Vim in the past, but am new to MacVim. In MacVim, when I switch to visual mode, use the $ motion (highlighting from my cursor to the end of the line), and yank, when I paste the copied content, it includes the carriage return, bumping everything after the paste point down to a new line.

This behavior seemed unfamiliar (not to mention annoying) to me. Is there any way to change this behavior to match the Windows version, where the newline is not included in the yank?

+3  A: 

Is just copying the text until the end of the line inappropriate? y$ will just copy from your current cursor until the end of the line, without the newline.

zigdon
That would work, hadn't thought of that, thanks! I'm curious, though, why the different versions of Vim behave differently.
Brian Sullivan
Not having done much with vim on windows, I couldn't tell you :)
zigdon
Actually in my installation of Vim7.2 on WinXP, `vy$` also yanks the newline, so the MacVim behaviour is correct.
too much php
+2  A: 

I discovered that the option that was causing the behavior I'm used to seeing is behave mswin, which I believe is on by default in GVim for Windows.

Brian Sullivan
A: 

You may try Du. Effectively it does exactly what you want and it is more finger-friendly if you intend to use it in raw editing.

diulin