开发者

Navigate a large HTML file with Vim and ctags

Is it possible to generate a tag file with ctags (5.8) for a single, large HTML file (about 50 MB) so it can be easier开发者_如何学JAVA navigated within Vim?


If you issue the following command you will see what tags are produced for a given language.

ctags --list-kinds=html
a  named anchors
f  JavaScript functions

If those tags were not good enough there is always the possibility to add to more with RegEx.

http://ctags.sourceforge.net/EXTENDING.html


If you want to navigate to tag names (as said in the comment), then I suppose that simple search would work better. An index where you have registered every occurrence of <p>,<span> and so on, would be much larger that the indexed file itself.

To find a tag (for example <p class="x">), just try /<p\>

The sequence \> matches an "end of the word", so it will not match <pre> for example.

If you want to navigate to an ID, you may just press an asterisk * - this will find you the next occurrence of the word under cursor.


As a workaround without ctags I tried this plugin Quick-Filter. It works for me. I imagine a solution with ctags would be nice, too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜