Integrate VIM and Graphviz and use these methods for real-time preview.
There is no tool that can help clarify ideas while programming or organizing knowledge.
After a long time of searching on the internet, I finally found a friendly little software, Graphviz.
After a while, you can finally use it together.
Now we will record the tossing results here to make a memo. Of course, it would be better if we could give a reference.
I will use Windows as an example below.
First
Sencond
Third
1 autocmd BufWritePost *. dot: silent! Dot-Tpng-o % <. png % 2 3 autocmd BufWinEnter *. dot nno <leader> g :! Start "Paths view main program path" %: p: r.png <cr>
% In the first row indicates the file name of the current edited file, while % <indicates that the file name with the extension is removed, and. png is added to form the file name of the output image. Therefore, when saving the current. dot file, the corresponding. png file is generated to facilitate viewing.
The second line indicates that when you press <leader> g, use preview view to open the image file generated in the previous step. Here, %: p: r indicates the absolute path of the image file (I do not know why % <. png does not work for the. dot file opened in the second tab .), : P indicates the path of the current file, and: r indicates removing the extension. For details, use filename-modifiers in VIM.
Now you can edit the. dot file in VIM and view it in real time.
Like this:
In addition, VIM has a wmgraphviz plug-in that provides some Graphviz-related functions. One of the GraphvizInteractive commands can also be used for real-time preview according to official statements, but it may not be supported in Windows. If you are interested, click this link: https://github.com/wannesm/wmgraphviz.vim