Ⅰ. 插件描述
Vim / Neovim plugin for preview PlantUMLⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'weirongxu/plantuml-previewer-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'weirongxu/plantuml-previewer-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'weirongxu/plantuml-previewer-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/weirongxu/plantuml-previewer.vim
Ⅳ. 文档说明
# Plantuml Previewer Vim
Vim/NeoVim plugin for preview PlantUML

Dependencies
- Java
Graphviz (https://www.graphviz.org/download/)
- brew install graphviz
- apt-get install graphviz
- open-browser.vim
- aklt/plantuml-syntax (vim syntax file for plantuml)
Usage
- Start editing plantuml file in Vim
- Run
:PlantumlOpento open previewer webpage in browser - Saving plantuml file in Vim, then previewer webpage will refresh
Commands
PlantumlOpen
Open previewer webpage in browser, and watch current buffer
PlantumlStart
Like PlantumlOpen, but won't open in browser
PlantumlStop
Stop watch buffer
PlantumlSave [filepath] [format]
Export uml diagram to file path
Available formats
png, svg, eps, pdf, vdx, xmi,
scxml, html, txt, utxt, latex
Example:
:e diagram.puml
:PlantumlSave
:PlantumlSave diagram.png
:PlantumlSave diagram.svgVariables
g:plantuml_previewer#plantuml_jar_path
Custom plantuml.jar file path
If plant uml was installed by homebrew, you can add the following code to your .vimrc to use the version installed by homebrew:
au FileType plantuml let g:plantuml_previewer#plantuml_jar_path = get(
\ matchlist(system('cat `which plantuml` | grep plantuml.jar'), '\v.*\s[''"]?(\S+plantuml\.jar).*'),
\ 1,
\ 0
\)g:plantuml_previewer#save_format
:PlantumlSave default format
Default: 'png'
g:plantuml_previewer#viewer_path
Custom plantuml viewer path
The plugin will copy viewer to here if the directory does not exist
And tmp.puml and tmp.svg will output to here