Skip to content

Instantly share code, notes, and snippets.

@romainl
Last active June 14, 2023 09:19
Show Gist options
  • Star 50 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save romainl/085b4db4a26a06ec7e16 to your computer and use it in GitHub Desktop.
Save romainl/085b4db4a26a06ec7e16 to your computer and use it in GitHub Desktop.
My ctags config
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--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/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss
--langmap=scss:.scss
--regex-scss=/^[ \t]*@mixin ([A-Za-z0-9_-]+)/\1/m,mixin,mixins/
--regex-scss=/^[ \t]*\$([A-Za-z0-9_-]+)/\1/v,variable,variables/
--regex-scss=/^([A-Za-z0-9_-]*)*\.([A-Za-z0-9_-]+) *[,{]/\2/c,class,classes/
--regex-scss=/^[ \t&]+\.([A-Za-z0-9_-]+) *[,{]/\1/c,class,classes/
--regex-scss=/^(.*)*\#([A-Za-z0-9_-]+) *[,{]/\2/i,id,ids/
--regex-scss=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-scss=/(^([A-Za-z0-9_-])*([A-Za-z0-9_-]+)) *[,|\{]/\1/t,tag,tags/
--regex-scss=/(^([^\/\/])*)[ \t]+([A-Za-z0-9_-]+)) *[,|\{]/\3/t,tag,tags/
--regex-scss=/(^(.*, *)([A-Za-z0-9_-]+)) *[,|\{]/\3/t,tag,tags/
--regex-scss=/(^[ \t]+([A-Za-z0-9_-]+)) *[,|\{]/\1/t,tag,tags/
--regex-scss=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/d,media,media/
--regex-scss=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--regex-html=/id="([A-Za-z0-9_-]+)"/\1/i,id,ids/
--regex-html=/class="([A-Za-z0-9_-]+)"/\1/c,class,classes/
--langdef=markdown
--langmap=markdown:.md
--regex-markdown=/^(#+[ \t]+.*)/\1/h,heading,headings/
--langmap=vim:+(vimrc)
--langdef=json
--langmap=json:.json
--regex-json=/^[ \t]*"(.*)":/\1/k,key,keys/
--langdef=yaml
--langmap=yaml:.yml.yaml
--regex-yaml=/^[ \t]*(.*):/\1/k,key,keys/
--langdef=dockerfile
--langmap=dockerfile:+(Dockerfile)
--regex-dockerfile=/^(FROM|MAINTAINER|RUN|CMD|LABEL|EXPOSE|ENV|ADD|COPY|ENTRYPOINT|VOLUME|USER|WORKDIR|ARG|ONBUILD|STOPSIGNAL|HEALTHCHECK|SHELL)/\1/d,dockerfile,dockerfiles/
--exclude=*.min.*
--exclude=*.spec.*
--exclude=*.test.*
--exclude=*.stories.*
--exclude=*.tar.*
--exclude=.*bundle.*
--exclude=.Master
--exclude=.bak
--exclude=.cache
--exclude=.class
--exclude=.csproj
--exclude=.csproj.user
--exclude=.dll
--exclude=.map
--exclude=.pdb
--exclude=.pyc
--exclude=.sln
--exclude=.swp
--exclude=.tmp
--exclude=bower_components
--exclude=coverage
--exclude=cscope.*
--exclude=dist
--exclude=min
--exclude=node_modules
--exclude=tags
--exclude=test
--exclude=tests
--exclude=vendor
--sort=no
--options=/path/to/ctags-patterns-for-javascript/ctagsrc
@jeromedalbert
Copy link

FYI the latest versions of universal-ctags come with markdown and scss configurations out of the box (and even yaml if compiled with libyaml support).

I've had problems with it though, so I have reverted back to an old version and your configuration comes in handy, especially the yaml one. Thanks!

@romainl
Copy link
Author

romainl commented Sep 28, 2020

@jeromedalbert thanks for the heads up.

@sc68cal
Copy link

sc68cal commented Apr 28, 2021

thanks for the YAML definition, now I can jump back to variable definitions for my Ansible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment