Hi!
I'm a newbie/wannabe in the software field so feel free to discourage me.
I'm sure that this was done before, but anyways, I was bored.
Quoting lines 1518, 1519 and 1529 from todo.txt:
> 7 Add a help.vim plugin that maps <Tab> to jump to the next tag in || and
> <C-Tab> (and <S-Tab>) to the previous tag.
> - Default mapping for help files: <Tab> to position cursor on next |:tag|.
So I just hacked together this vimscript to do something like that. I guess
it's place would be ftplugin/help.vim, but not sure.
(it works on my computer if I source the file when viewing help files)
" Jumps to the next tag in ||.
" If dir[ection] is nonzero it jumps forwards, if zero backwards.
" It doesn't wrap at the end of the file.
function! GetNextHelpTag(dir)
if a:dir != 0
let flags = "sW"
else
let flags = "bsW"
endif
" Save the original position for the case we didn't find a tag.
let ori_pos = getpos('.')
" For every possible match check if it is a tag for sure
while 1
let [lnum, col] = searchpos('|.\{-1,}|', flags)
if lnum == 0
break
endif
let tag = matchlist(getline('.'), '|\(.\{-1,}\)|', col-1)[1]
if !empty(taglist(tag))
return
endif
endwhile
call setpos('.', ori_pos)
echo "No more tags found."
endfunction
map <buffer> <Tab> :call GetNextHelpTag(1)<CR>
map <buffer> <C-Tab> :call GetNextHelpTag(0)<CR>
map <buffer> <S-Tab> :call GetNextHelpTag(0)<CR>
Without hopes,
Balazs
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---