2011-03-27 02:09:12 -04:00
|
|
|
" Set some sane defaults for snippet files
|
|
|
|
|
2014-08-05 21:03:36 -04:00
|
|
|
if exists('b:did_ftplugin')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2011-03-27 02:09:12 -04:00
|
|
|
" Fold by syntax, but open all folds by default
|
|
|
|
setlocal foldmethod=syntax
|
|
|
|
setlocal foldlevel=99
|
2012-08-20 13:24:17 -04:00
|
|
|
|
2013-01-26 11:29:37 -05:00
|
|
|
setlocal commentstring=#%s
|
|
|
|
|
2013-06-10 12:34:38 -04:00
|
|
|
setlocal noexpandtab
|
2014-07-01 00:17:52 -04:00
|
|
|
setlocal autoindent nosmartindent nocindent
|
2013-06-10 12:34:38 -04:00
|
|
|
|
2012-08-20 13:24:17 -04:00
|
|
|
" Define match words for use with matchit plugin
|
|
|
|
" http://www.vim.org/scripts/script.php?script_id=39
|
|
|
|
if exists("loaded_matchit") && !exists("b:match_words")
|
|
|
|
let b:match_ignorecase = 0
|
|
|
|
let b:match_words = '^snippet\>:^endsnippet\>,^global\>:^endglobal\>,\${:}'
|
2014-08-05 21:03:36 -04:00
|
|
|
let s:set_match_words = 1
|
2012-08-20 13:24:17 -04:00
|
|
|
endif
|
2014-07-05 22:36:38 -04:00
|
|
|
|
|
|
|
" Add TagBar support
|
|
|
|
let g:tagbar_type_snippets = {
|
|
|
|
\ 'ctagstype': 'UltiSnips',
|
|
|
|
\ 'kinds': [
|
|
|
|
\ 's:snippets',
|
|
|
|
\ ],
|
|
|
|
\ 'deffile': expand('<sfile>:p:h:h') . '/ctags/UltiSnips.cnf',
|
|
|
|
\ }
|
2014-08-05 21:03:36 -04:00
|
|
|
|
|
|
|
" don't unset g:tagbar_type_snippets, it serves no purpose
|
|
|
|
let b:undo_ftplugin = "
|
|
|
|
\ setlocal foldmethod< foldlevel< commentstring<
|
|
|
|
\|setlocal expandtab< autoindent< smartindent< cindent<
|
|
|
|
\|if get(s:, 'set_match_words')
|
|
|
|
\|unlet! b:match_ignorecase b:match_words s:set_match_words
|
|
|
|
\|endif
|
|
|
|
\"
|
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|