Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add Tagbar settings

  • Loading branch information...
commit 485bb9bf113b40a37b56fd48d1eb7286d9324177 1 parent 54309c3
@gfx gfx authored
Showing with 36 additions and 6 deletions.
  1. +7 −0 ctags/jsx.conf
  2. +0 −6 extras/ctags
  3. +29 −0 ftplugin/jsx.vim
View
7 ctags/jsx.conf
@@ -0,0 +1,7 @@
+--langdef=JSX
+--langmap=jsx:.jsx
+--regex-jsx=/^[ \t]*import[ \t]+([^;]+)/\1/r,import,imports/
+--regex-jsx=/^[ \t]*([a-z]+[ \t]+)*function[ \t]+([A-Za-z0-9_]+[ \t]*[^{;]*)/\2/f,function,functions/
+--regex-jsx=/^[ \t]*([a-z]+[ \t]+)*class[ \t]+([A-Za-z0-9_]+)[ \t]*([^)])/\2/c,class,classes/
+--regex-jsx=/^[ \t]*([a-z]+[ \t]+)*interface[ \t]+([A-Za-z0-9_]+)[ \t]*([^)])/\2/i,interface,interfaces/
+--regex-jsx=/^[ \t]*([a-z]+[ \t]+)*mixin[ \t]+([A-Za-z0-9_]+)[ \t]*([^)])/\2/m,mixin,mixins/
View
6 extras/ctags
@@ -1,6 +0,0 @@
---langdef=jsx
---langmap=js:.jsx
---regex-jsx=/function[ \t]+([A-Za-z0-9._$]+)[ \t]*([^)])/\1/,function/
---regex-jsx=/class[ \t]+([A-Za-z0-9._$]+)[ \t]*([^)])/\1/,class/
---regex-jsx=/interface[ \t]+([A-Za-z0-9._$]+)[ \t]*([^)])/\1/,interface/
---regex-jsx=/mixin[ \t]+([A-Za-z0-9._$]+)[ \t]*([^)])/\1/,mixin/
View
29 ftplugin/jsx.vim
@@ -3,4 +3,33 @@
" URL: http://github.com/jsx/jsx.vim
" License: MIT License
"
+
setlocal omnifunc=jsx#complete
+
+" Tagbar http://majutsushi.github.com/tagbar/
+let g:tagbar_type_jsx = {}
+let g:tagbar_type_jsx.ctagstype = "jsx"
+let g:tagbar_type_jsx.kinds = [
+ \ 'r:imports',
+ \ 'i:interfaces',
+ \ 'm:mixins',
+ \ 'c:classes',
+ \ 'f:functions'
+\ ]
+let g:tagbar_type_jsx.sro = '.'
+
+"let g:tagbar_type_jsx.kind2scope = {
+" \ 'i' : 'interface',
+" \ 'm' : 'mixin',
+" \ 'c' : 'class'
+"\ }
+"let g:tagbar_type_jsx.scope2kind = {
+" \ 'interface' : 'i',
+" \ 'mixin' : 'm',
+" \ 'class' : 'c'
+"\ }
+
+let g:tagbar_type_jsx.sort = 0
+let g:tagbar_type_jsx.deffile = expand('<sfile>:p:h:h') . '/ctags/jsx.conf'
+" End of Tagbar setting
+
Please sign in to comment.
Something went wrong with that request. Please try again.