Saturday, July 2, 2011

Re: newbie put question

On 28/06/11 15:46, Tim Chase wrote:
> (reordering to interleaved reply, the preferred quoting style on
> the vim mailing list, as noted in the footer added by the list)
>
>>> Ctrl-R enter a sub-mode expecting the register-name
>>> following it, so if you want the system-clipboard, you'd
>>> want to use control+R followed by "+".
>>
>> Ahh, that did it! Thanks.
>
> Glad it worked the way you want.
>
>> As an aside, for us newbies, would you recommend this to put
>> yanked content vs p or P?
>
> I use both since they do different things: when I want to paste linewise
> content linewise or paste characterwise content characterwise, I just
> use p/P (or gP, but usually only in vimgolf) in Normal mode. If I want
> to paste linewise content in a characterwise way as you initially
> requested, I use i_CTRL-R (and often curse when I forget about the
> paste/indentation settings, and it ends up stair-stepping; then undo and
> use one of the other sub-sub-modes as documented in my initial reply
> after re-consulting the help to see which one I wanted).
>
> -tim
>
>

...and when I want to force linewise pasting even if the yank was
characterwise, I use the :put ex-command. For example the following
mapping will paste the clipboard, starting on a new line, at the end of
the current file:

:noremap <F4> :$put +<CR>

About stair-stepping: I use gvim, which usually knows the difference
between typing and pasting without the need to set 'paste'.

Best regards,
Tony.
--
If you push the "extra ice" button on the soft drink vending machine,
you won't get any ice. If you push the "no ice" button, you'll get
ice, but no cup.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment