On Aug 10, 1:55 pm, "Christian Brabandt" <[email protected]> wrote:
> On Wed, August 10, 2011 10:39 am, 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()
>
> That should be nnoremap \jj :call Jj()<CR>
>
> > fun! Jj()
> > let someflag=1
>
> Why are you setting this flag, but don't use it?
>
> > silent normal! *
>
> Possibly make this :sil! norm! *
>
> > endfun
>
> So in short, write you mapping like this:
> :nnoremap \jj :sil! norm! *<cr>
>
> But I don't know what you mean with the / register doesn't get filled.
> If I execute your mapping by typing \jj in normal mode and then :echo @/
> Vim correctly returns the search term with '\<' and '\>' wrapped around it.
>
> regards,
> Christian

hi christian,

it works if you map the command directly; like :nnoremap \jj :sil!
norm! *<cr>;
but it doesn't work if you map it to a function and do the search
action inside
the function. basically i want to set the flag, before doing a search
for one of
code browsing shortcut tricks. i couldn't figure out a way to do this
without
mapping this to a function.

thanks

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