Vim is a fantastic text editor.

It provides a lot of interesting funvtionalities like syntax highlighting for many programming languages.

If you want to export your source code with the syntax highlighted, vim provides a way to export what you see in html format.

While you are editing your file simply issue the following command:

:runtime! syntax/2html.vim



The vim window will be splitted into two sub windows, in one of them there will be the source code in the other there will be the html.

Save the html using the command

:w filename.html

and exit from vim using the :q command on both the sub-windows.

in your current working directory you’ll find the html file named filename.html with the source code fully highlighted.