commit f3e17dad3fe6d5c5dc5fd2c94953d977d32c589e parent 0e4cb2282f69b80b577a754dc2ac6e4ae11578da Author: Alex Balgavy <a.balgavy@gmail.com> Date: Sun, 22 Sep 2019 13:41:52 -0400 vim: support for plantuml Former-commit-id: a723b4b1a856151afeb56dad9bab5abc8692d98f Diffstat:
A | vim/after/ftplugin/plantuml.vim | | | 14 | ++++++++++++++ |
A | vim/compiler/plantuml.vim | | | 9 | +++++++++ |
A | vim/ftdetect/plantuml.vim | | | 1 | + |
3 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/vim/after/ftplugin/plantuml.vim b/vim/after/ftplugin/plantuml.vim @@ -0,0 +1,14 @@ +compiler plantuml +augroup plantuml_buffer + autocmd! * <buffer> +augroup END +nnoremap <buffer> <leader><CR> :silent !open "%<.png"<CR>:redraw!<CR> +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= '| nmapc <buffer>' + let b:undo_ftplugin .= '| setlocal makeprg<' + let b:undo_ftplugin .= '| exe "au! plantuml_buffer * <buffer>"' +else + let b:undo_ftplugin = 'nmapc <buffer>' + let b:undo_ftplugin .= '| setlocal makeprg<' + let b:undo_ftplugin .= '| exe "au! plantuml_buffer * <buffer>"' +endif diff --git a/vim/compiler/plantuml.vim b/vim/compiler/plantuml.vim @@ -0,0 +1,9 @@ +if exists("current_compiler") + finish +endif +let current_compiler = "plantuml" +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif +CompilerSet makeprg=plantuml\ % + diff --git a/vim/ftdetect/plantuml.vim b/vim/ftdetect/plantuml.vim @@ -0,0 +1 @@ +autocmd BufRead,BufNewFile *.puml set filetype=plantuml