Convert Source Code to HTML using vim
1. open your source code in vim
go to Applications >>> Accessories >>> Terminal
then type vim <codeFileName> then hit Enter
e.g vim factorial.py
2. convert your code to readable html
type :runtime! syntax/2html.vim then hit Enter
note: be sure you are in command mode, if your in insert mode just press Esc

3. save the generated html file
type :wq <filename.html> then hit Enter
note: be sure you are in command mode, if your in insert mode just press Esc
e.g. :wq factorial.html
You can now open the html page of your source code with your favorite web browser.
example output


Post new comment