Assigning the value of a register to a variable

0 views
Skip to first unread message

Tim Johnson

unread,
Nov 20, 2008, 9:25:54 PM11/20/08
to vim...@googlegroups.com
Using vim 7.10 kubunut 7.10
I'd like to be able to assign the contents of a register to a variable
example:
let arg = contents_of_unamed_register
let cmd = "!myscript " . arg
exe cmd

Just some examples or references to :help would be sufficient.
thanks again.
tim

David Fishburn

unread,
Nov 20, 2008, 9:39:40 PM11/20/08
to vim...@googlegroups.com
On Thu, Nov 20, 2008 at 9:25 PM, Tim Johnson <t...@johnsons-web.com> wrote:
>
> Using vim 7.10 kubunut 7.10
> I'd like to be able to assign the contents of a register to a variable
> example:
> let arg = contents_of_unamed_register
> let cmd = "!myscript " . arg
> exe cmd

let arg = @" (default register)
let arg = @+ (clipboard)
let arg = @a (when you do a "ayy)

That should get you going.
Dave

Tim Johnson

unread,
Nov 20, 2008, 10:26:03 PM11/20/08
to vim...@googlegroups.com
:-) And I just did
:@
thanks very much!
Tim
Reply all
Reply to author
Forward
0 new messages