On 03/25/2011 02:20 PM, [email protected] wrote:
After the funtino has returned control back to the user
the matched keywords should be highlighted as if
the user her-/himself did the search...

My second function worked for me to do what you describe:

If you want to have the pattern from your function highlighted upon
completion, the following hack worked for me:

   function! Beta()
     " ...
     /pattern/;
     set hls
     let @/ = @/
     " ...
   endfunction

I think the magic is in tricking vim with the ":let". Weird, but it worked for me (Vim7.1) (either setting 'hls' in the function or before it was called)

-tim


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

Reply via email to