문제

I am using ctags -R * to generate tags.But its not generating the tags for .haml and .less files. Is there a separate option to generate tags for these files?

도움이 되었습니까?

해결책

I don't think haml is supported in ctags by default. Here are the supported languages: http://ctags.sourceforge.net/languages.html. You could probably add support for it with a bit of googling.

다른 팁

To add support for less, paste this in your ctags file:

--langdef=less
--langmap=less:.less
--regex-less=/^[ \t]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/

The above expressions are ctrl-] friendly. If you're using scripts like kien/ctrlp.vim, use

--langdef=less
--langmap=less:.less
--regex-less=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/
--regex-less=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/

it'll add . before classes and # before ids.

You can query the list of supported languages with

$ ctags --list-languages

There are some patches for Exuberant Ctags that add native support for more languages, but I haven't yet seen anything for haml or less. However, you can add support via regular expression definitions in your ~/.ctags; see the ctags help.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top