On Sat, Nov 8, 2008 at 7:56 PM, Gary Johnson wrote: > > On 2008-11-08, Hari wrote: >> I'm trying this from a script: >> >> :let a='sometext' >> :put =a >> >> The behavior is that a newline is always created and 'sometext' added there. >> Is there some way to just put text on the current line without automatically >> having a newline inserted? I could use setline, but that is sort of >> inappropriate for my usage. I just wish to dump text and add newlines myself >> if needed. > > How about either of these? > > 1. > :let a='sometext' > :exe "normal a\<C-R>=a\<CR>" > > 2. > :let @a='sometext' > :normal "ap
:let @@='sometext' :normal p That would be identical to 2) above, but with the advantage of clobbering the unnamed register instead of one of the unnamed registers... Sure, it's better to not clobber either one without saving and restoring, but at least users tend not to expect the things in the unnamed register to stick around for long, but often want the lettered registers saved for a long time. ~Matt --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
