-
-
Save felipecrv/2657477 to your computer and use it in GitHub Desktop.
--langdef=css \ | |
--langmap=css:.css \ | |
--regex-css='/^[ \t]*\.([A-Za-z0-9_-]+)/#\1/c,class,classes/' \ | |
--regex-css='/^[ \t]*#([A-Za-z0-9_-]+)/.\1/i,id,ids/' \ | |
--regex-css='/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/' \ | |
--regex-css='/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/' \ |
I'm trying to add this but I'm getting error:
$ ctags -R .
ctags: Warning: Unknown language "css:.css \" in "langmap" option
ctags: Warning: unknown language "css" in --regex-css option
ctags: Warning: unknown language "css" in --regex-css option
ctags: Warning: unknown language "css" in --regex-css option
ctags: Warning: unknown language "css" in --regex-css option
It's like it's not seeing the --langdef=css \
line.
Any idea why?
The problem was that I needed to remove the quotes around the regex and the \ in the end of the lines. Works fine now.
I had to the quotes and backslashes cause I've made a script -- ct
-- with the big command in it instead of adding theses line to a .ctagsrc
file.
I tried to include your CSS regex with a modified version of Ctags -> https://github.com/fishman/ctags
the only missing filter in the modded Ctags version above is Media Queries so I tried with your regex but:
your regex just filter the FIRST AND ONLY THE FIRST WORD of the media query string.
for instance I have this media query:
@media only screen and (min-device-width : 768px)
but your regex filter just the FIRST word after @media -> in this case "only".
so what I get is a list of "only" and "screen" under media queries instead of something more useful such as:
"only screen and (min-device-width: 768px)"
I'm not a good regex writer, otherwise I would modify it by myself: would you please help me fix this?
many thanks!
From http://book.abe.free.fr/blog/public/ctags and slightly changed