Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump to the next tag in vim help file

Tags:

vim

I want to learn the vim documentation given in the standard help file. But I am stuck on a navigating issue - I just cannot go to the next tag without having to position the cursor manually. I think you would agree that it is more productive to:

  1. go to the next tag with some keystroke
  2. press Ctrl-] to read corresponding topic
  3. press Ctrl-o to return
  4. continue reading initial text

PS. while I was writing this question, I tried some ideas on how to resolve this. I found that searching pipe character with /| is pretty close to what I want. But the tag is surrounded with two pipe '|' characters, so it's still not really optimized to use.

like image 708
altern Avatar asked Dec 02 '09 10:12

altern


People also ask

How do I navigate Vim documents?

Simplify help navigationPress Enter to jump to the subject (topic) under the cursor. Press Backspace to return from the last jump. Press s to find the next subject, or S to find the previous subject. Press o to find the next option, or O to find the previous option.

How do I load a tag in Vim?

Using a Specific Tags File To use the tags file, you'll need to open Vim and tell it where it is. Still in the Vim source directory, I ran vim and then typed :set tags+=tags to tell it to use the ./tags file. At this point, Vim knows about the tags file — you don't need to tell it to load the file.


1 Answers

Use the :tn and :tp sequences to navigate between tags.

If you want to look for the next tag on the same help page, try this search:

/|.\{-}| 

This means to search for:

  • The character |
  • Any characters up to the next |, matching as few as possible (that's what \{-} does).
  • Another character |

This identifies the tags in the VIM help file.

like image 135
Nathan Fellman Avatar answered Sep 20 '22 02:09

Nathan Fellman