Hi Mahurshi!

On Mo, 12 Okt 2009, Mahurshi Akilla wrote:

> Once in a while, we need to open up more than one file and do a set of
> operations.  For e.g., search for A, do something, then search for B,
> do something else, and so on.  Is there a way you can put A, B, C, etc
> in a list and let vim search for these strings in that order whenever
> you press a key in command mode?


let list=['foo', 'bar', 'foobar', '\']
:noremap <F3> :let @/='\V'.join(map(list, "escape(v:val,'\\')"),'\\|')<CR>

which searches for all strings literally. If you'd like to search for 
each string as a regular expression, remove the \V part and possibly the 
map(list…) expression.


regards,
Christian
-- 
:wq

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to