Jump to CSS definition when editing HTML in VIM

∥☆過路亽.° 提交于 2019-12-23 19:26:24

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!