Sunday, June 24, 2012

How to use matcharg(2)[1] to set search register?

2match has been set and is working.

:echo matcharg(2)[1] returns the correct pattern.

Why does this not set the search register?

let @/=matcharg(2)[1]

matcharg({nr}) *matcharg()*
Selects the {nr} match item, as set with a |:match|,
|:2match| or |:3match| command.
Return a |List| with two elements:
The name of the highlight group used
The pattern used.

--
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: