Integrate VIM and Graphviz and use these methods for real-time preview.

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.