Ⅰ. 插件描述
A Vim plugin for previewing sequence diagram in a browserⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'xavierchow/vim-sequence-diagram'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'xavierchow/vim-sequence-diagram'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'xavierchow/vim-sequence-diagram'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/xavierchow/vim-sequence-diagram
Ⅳ. 文档说明
Vim Sequence-diagram Preview
Intro
A Vim plugin for previewing sequence diagram in a browser. It's inspired by vim-markdown-preview
and JS Sequence Diagram.
JS Sequence Diagram is awesome!
And its online editing feature is cool as well.
However, there're 2 drawbacks:
- Online editing is opt to be lost, especially with an unexpected browser fresh or history-back.
- You have to copy&paste between the online web page and your text editor repeatedly for updating/preview.
This vim plugin helps you handle the issues above, write your sequence diagram description in vim, press a hotkey to preview it in browser!
Installation
- With Pathogen: Place
vim-sequnce-diagram/in.vim/bundle/. With Vundle:
- Add
Plugin 'xavierchow/vim-sequence-diagram'to your.vimrc. - Launch
vimand run:PluginInstall
- Add
Usage
File extension
This plugin only applies to files with .seq or .sequence file extension,
that means it has nearly no performance impact on other file types.
Note: Make sure you have renamed the file name with proper extension.
Keymap for preview
The default keymap is <leader>t, it brings up a browser window and shows the sequence diagram for you.
You can also define your keymap in vimrc.
nmap <unique> <leader>t <Plug>GenerateDiagram JS Sequence Diagram Theme
Currently there're mainly 2 themes with js-sequence-diagrams, hand drawn and simple.
You can add the following line into your vimrc for using hand drawn theme, set it to 0 or remove the line for simple theme.
let g:generate_diagram_theme_hand = 1Download as SVG or PNG
Use the buttons at the bottom to download the diagram as SVG or PNG.
License
MIT