On 2011-08-10, sinbad wrote:
> why doesn't the "/ register filled with the current search.
> with the following mapping. should i do something special
> 
> nmap \jj :call Jj()
> 
> fun! Jj()
> let someflag=1
> silent normal! *
> endfun
> 
> thanks

The reason is that Vim saves the / register when calling a function and
restores it on return from a function.  From ":help registers" or ":help
quote/":

    9. Last search pattern register "/                      quote_/ quote/
    Contains the most recent search-pattern.  This is used for "n" and 
'hlsearch'.
    It is writable with ":let", you can change it to have 'hlsearch' highlight
    other matches without actually searching.  You can't yank or delete into 
this
    register.  The search direction is available in v:searchforward.
    Note that the valued is restored when returning from a function
    function-search-undo.
    {not in Vi}

Regards,
Gary

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