When programming or sorting out the knowledge has been suffering from the lack of a tool to help clarify the idea.
In the online bitter search for a long, finally found a small software--graphviz.
Toss a few, finally can make the use of.
The results of the toss are now recorded here to make a memo, of course, if you can throw bricks and jade that would be better.
Because I mainly use Windows below will be described in the Windows environment as an example.
First
- Download the required version here: http://www.graphviz.org/Download..php
- Install or unzip the downloaded MSI file or zip file and note the installation path.
- Place the Bin folder in the installation directory into path.
Sencond
- Download the view software that can be automatically refreshed here jpegview:https://sourceforge.net/projects/jpegview/
- Unzip and put it where you want it.
Third
- You should have VIM installed, if not, go here. Download Installation: http://www.vim.org/
- Now find your. vimrc file, where you will add the following:
1 autocmd bufwritepost *.dot:silent!dot-tpng-o%<.png%23 autocmd bufwinenter *.dot Nno <leader>g:!start "Jpegview path to Main program"%:p:r.png<cr>
The% in the first line represents the file name of the current edit, and%< indicates the file name with the extension removed, plus. png, which forms the file name of the output image. So the meaning of this sentence is to save the current. dot file at the same time generate the corresponding. png file for easy viewing.
The second line means that when the user presses <LEADER>G, the image file generated in the previous step is opened with Jpegview. Where%:p: R represents the absolute path to the picture file (I do not know why the. dot file opened in the Second tab is not working with%<.png. ),:p represents the path to the current file: R means the removal of the extension, and details can be viewed using filename-modifiers in VIM.
You can now edit the. dot file in VIM and view it in real time.
Just like this:
In addition VIM has a Wmgraphviz plug-in can provide some Graphviz-related features, including a graphvizinteractive command according to the official statement can also be real-time preview, but may not support the use of Windows. If you are interested can click this link: https://github.com/wannesm/wmgraphviz.vim
Integrate vim and Graphviz, and use this method to achieve real-time preview