John Beckett <[email protected]> [10-02-07 11:24]: > meino wrote: > > when I do a search command with '/' the matches will be > > highlighted. When putting the search string into a function > > and that function into .vimrc and calling the function then, > > nothing is highlighted. > > Yes, it's documented somewhere that functions behave like that. > There are a couple of tips with code that works around that. > See how this tip uses a mapping which finishes by feeding the @/ > register set by some code into a / command: > > http://vim.wikia.com/wiki/Search_for_visually_selected_text > > John > > -- > You received this message from the "vim_use" maillist. > For more information, visit http://www.vim.org/maillist.php >
Hi John, thanks for the link ! :) Basicall I did the following in the function now: func! SearchIt() :let \...@='/pattern' :set hls endfunction This will only highlight /pattern, when I press 'n' after :call SeachIt(). So I changed it to func! SearchIt() :let \...@='/pattern' :set hls :normal n endfunction which does the same: I does not highlight. I added <CR> to the lines, which totally screw up the function. What did I so badly wrong here? best regards, mcc -- Please don't send me any Word- or Powerpoint-Attachments unless it's absolutely neccessary. - Send simply Text. See http://www.gnu.org/philosophy/no-word-attachments.html In a world without fences and walls nobody needs gates and windows. -- You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php
