put at end of line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

put at end of line

RICHARD PITMAN
Hi folks,

Is there a quick way to insert the contents of a
buffer at the end of a line without having to move the
cursor there explicitly (equivalent to "ma$p`a")

TIA

Rich
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: put at end of line

Tim Chase-2
> Is there a quick way to insert the contents of a buffer at the
> end of a line without having to move the cursor there
> explicitly (equivalent to "ma$p`a")

Well, it may depend on what type of "buffer" (usually what you
describe as a "buffer" is called a "register"...buffers are more
like files than copies of select text).  If it's characterwise,
you may have to do your little stunt.  Other things that might
work would be

:s/$/\=@"

You might still have to save/restore your position.  However, you
can wrap this in the fairly common

:let c=virtcol(".") | s/$/\=@"/ | exe "norm ".c."|"

As usual, this can be mapped to a single keystroke.  With a
little chicanery, the key to which you map it may be able to take
a register letter as a prefixed parameter.  Dr. Chip or others on
the list may have futher suggestions for doing such convolutions.

-tim





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: put at end of line

James Vega-3
In reply to this post by RICHARD PITMAN
On Wed, May 25, 2005 at 02:50:24PM +0100, RICHARD PITMAN wrote:
> Is there a quick way to insert the contents of a
> buffer at the end of a line without having to move the
> cursor there explicitly (equivalent to "ma$p`a")

You could setup a mapping to do that for you:

:nmap <Leader>p ma$p`a

:help :nmap
:help <Leader>

There's no command (as far as I know) to paste somewhere other than the
cursor, though.

James
--
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[hidden email]>

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: put at end of line

RICHARD PITMAN
> On Wed, May 25, 2005 at 02:50:24PM +0100, RICHARD
> PITMAN wrote:
> > Is there a quick way to insert the contents of a
> > buffer at the end of a line without having to move
> the
> > cursor there explicitly (equivalent to "ma$p`a")
>
> You could setup a mapping to do that for you:
>
> :nmap <Leader>p ma$p`a
>
> :help :nmap
> :help <Leader>
>
> There's no command (as far as I know) to paste
> somewhere other than the
> cursor, though.
>
> James
> --

Many thanks for the help folks - great as usual! :)

Remapped P to ma$p`a for the duration of the session.

Thanks again.

Richard
Loading...