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!!