Documentation support in Vim

Vim is a cool editor for Linux. I will now show you how to create a html documentation of your source code using vim.

The following tip has been suggested in  ILUGC mailing list.

1. Open the source code file using vim. I am using a tcl script file named sample.tcl

$ vim sample.tcl

2. In command mode type the following

:TOhtml

A new buffer will be opened with the html source

Just save and quit

:wq

3. You will find a new html file with the same name of the source code file in the directory where you the latter (in this case it is sample.html)

This is the documented code.

Have a look at it!

To add salt to the delicacy try out the following procedure before you try out the above tip…

Before performing the above conversion, running the following commands in command mode would produce an html file with a black background and lines numbered.

:sy on

:se nu

:se background=dark

Here is how it looks!!

 

 

 

Advertisements

12 comments on “Documentation support in Vim

  1. @Scott
    Thanks for your comment.
    I have corrected the mistake.
    Now you can see a vim screenshot 🙂
    If you like this post click on the “like” option below the post 🙂

  2. Pingback: World Wide News Flash

  3. Nice post ! Thank you for, writing on this blog page mate! I’ll email you some time. I did not know that. apologise, but it is necessary for me little bit more information.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s