vim-polyglot/ftplugin/plantuml.vim
Adam Stankiewicz e685e4b431
Update
2017-02-02 21:16:29 +01:00

43 lines
1.3 KiB
VimL

if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
" Vim plugin file
" Language: PlantUML
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
" Version: 0.1
if exists("b:loaded_plantuml_plugin")
finish
endif
let b:loaded_plantuml_plugin = 1
let s:cpo_save = &cpo
set cpo&vim
if !exists("g:plantuml_executable_script")
let g:plantuml_executable_script="plantuml"
endif
if exists("loaded_matchit")
let b:match_ignorecase = 0
let b:match_words =
\ '\(\<ref\>\|\<box\>\|\<opt\>\|\<alt\>\|\<group\>\|\<loop\>\|\<note\>\|\<legend\>\):\<else\>:\<end\>' .
\ ',\<if\>:\<elseif\>:\<else\>:\<endif\>' .
\ ',\<rnote\>:\<endrnote\>' .
\ ',\<hnote\>:\<endhnote\>' .
\ ',\<title\>:\<endtitle\>' .
\ ',\<\while\>:\<endwhile\>'
endif
let &l:makeprg=g:plantuml_executable_script . " " . fnameescape(expand("%"))
setlocal comments=s1:/',mb:',ex:'/,:' commentstring=/'%s'/ formatoptions-=t formatoptions+=croql
let b:endwise_addition = '\=index(["note","legend"], submatch(0))!=-1 ? "end " . submatch(0) : "end"'
let b:endwise_words = 'loop,group,alt,note,legend'
let b:endwise_pattern = '^\s*\zs\<\(loop\|group\|alt\|note\ze[^:]*$\|legend\)\>.*$'
let b:endwise_syngroups = 'plantumlKeyword'
let &cpo = s:cpo_save
unlet s:cpo_save
endif