Note for everything
在~/.ctags里加上这几行定义下scss文件的规则:
~/.ctags
--langdef=scss--langmap=scss:.scss--regex-scss=/^[ \t]*([^\t {}][^{}]{1,100})(\t| )*\{/| \1/d,definition/--regex-scss=/^[@]mixin ([^ ()]+).*/\1/m,mixin/--regex-scss=/^[@]function ([^ ()]+).*/\1/f,function/}--regex-scss=/^\$([A-Za-z0-9._-]+)\s?:.*/\1/v,variable/}
在~/.vimrc里加上这几行(前提是VIM有安装Tagbar插件哦)
~/.vimrc
let g:tagbar_type_scss = { \ 'ctagsbin' : 'ctags', \ 'ctagstype' : 'scss', \ 'kinds' : [ \ 'd:definition', \ 'f:functions', \ 'm:mixins', \ 'v:variables', \ ],\ }
写正则真是越来越好玩了。