问题
For example I am editing index.html or index.php in VIM and I have the following code in there:
<div id="header">
// some code
</div>
When I move my cursor to the word header I want to jump to the position in my CSS-file where the tag (id/class) is defined. ctags doesnt work with this. Thx for advise!
回答1:
You could try to patch ctags so that it supports CSS. This guy explains how but I have no idea if it works or not. I'll probably give this solution a try very soon as I think this feature would kick ass.
Also, I should add that I didn't pull this old blog post from my magic bookmarks hat. It was one of the first results of a very simple Google query, did you look around before asking here? And, if you did, what did you found/try?
See also there and there.
edit
This solution doesn't require patching/compiling and works very well.
来源:https://stackoverflow.com/questions/10532019/jump-to-css-definition-when-editing-html-in-vim