From dee826520640317270f873fedf926b4e403fd111 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Sat, 5 Jul 2014 19:36:38 -0700 Subject: [PATCH] Support TagBar for snippets files Bundle an exuberant ctags definition for UltiSnips and tell TagBar how to find it. --- ctags/UltiSnips.cnf | 3 +++ ftplugin/snippets.vim | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 ctags/UltiSnips.cnf diff --git a/ctags/UltiSnips.cnf b/ctags/UltiSnips.cnf new file mode 100644 index 0000000..c30aa8b --- /dev/null +++ b/ctags/UltiSnips.cnf @@ -0,0 +1,3 @@ +--langdef=UltiSnips +--langmap=UltiSnips:.snippets +--regex-UltiSnips=/^snippet (.*)/\1/s,snippet/ diff --git a/ftplugin/snippets.vim b/ftplugin/snippets.vim index 69e1abf..3191444 100644 --- a/ftplugin/snippets.vim +++ b/ftplugin/snippets.vim @@ -15,3 +15,12 @@ if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = '^snippet\>:^endsnippet\>,^global\>:^endglobal\>,\${:}' endif + +" Add TagBar support +let g:tagbar_type_snippets = { + \ 'ctagstype': 'UltiSnips', + \ 'kinds': [ + \ 's:snippets', + \ ], + \ 'deffile': expand(':p:h:h') . '/ctags/UltiSnips.cnf', + \ }