On 2006-11-27, DervishD <[EMAIL PROTECTED]> wrote:
> Hi all :)
>
> First of all, please excuse if what I'm going to ask sounds
> stupid, but I have been using vim for less than a week, so I'm afraid
> I'm not very proficient with it ;)
>
> Well, I've done this mapping to be able to jump to the next "tag"
> in the help file using <TAB>:
>
> :nnoremap <silent> <buffer> <TAB> /\|\S\+\|<CR>:nohl<CR>l
>
> The problem is that when I hit <TAB>, the "tags" flash a bit,
> because the search command highlight them and the ":nohl" turns hl
> off. Moreover, this interferes with my searchs, if any.
>
> What I want is to be able to do the above without interfering
> with searches. I've been looking for a way of jumping into a pattern
> without using "search()" or "/", but I haven't found any. I've tried
> ":tag" and friends, too, with no success :( I want to do this because
> I'm spending a lot of time in the help right now, so I want a fast
> way of jumping thru help tags.
>
> Do anybody has any suggestion? Thanks a lot in advance :)
If you execute search() within a function, you won't lose the
previous search pattern. So you could do something like this.
function HelpTagSearch()
call search('|\S\+|')
endfunction
nmap <silent> <buffer> <TAB> :call HelpTagSearch()<CR>
See
:help :endf
and read the immediately-preceding paragraph.
Also note that | is not special in vim regular expressions, so it
should not be escaped.
HTH,
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
| Spokane, Washington, USA