Meino Christian Cramer wrote:
Hi,
I am using vim 7.0.42 on a Linux system.
I want copy a complete line of text *without+ the final LF at the
end, so it is possible to insert it elsewhere in the midth of text.
With
Shift-V
I get the line *with* the LF at the end -- so I can not use that.
With
y/<last character of the line><RET>
I get the line without the LF but the last character is also missing.
With
y/$<RET>
I get the line without the LF but the last character is missing again.
:set selection<RET>
gives me the default ("inclusive").
What did I wrong ?
Kind regards,
mcc
IIRC, in addition to all the suggestions made so far, to change a
register from linewise (with NL or null at the end) to characterwise
(without it) you can use (for instance with the default register):
:call setreg('"', @", 'c')
or even
if setreg('"', @", 'c')
echoerr 'Couldn''t set @" to characterwise'
endif
(the function return zero for success). Use setreg('x', @x, 'c') to use
register "x instead.
Best regards,
Tony.