publish.vim : Publish hyperlinked, highlighted source code using Vim, 2html.vim and rsync
| script karma
Downloaded by 3187
Comments, bugs, improvements
script versions (upload new version)
|This plug-in uses the 2html.vim script included with Vim's runtime files to publish a collection of syntax highlighted files as HTML documents and then replaces identifiers such as function and variable names in the HTML output with hyper links (based on available tags as generated by Exuberant Ctags). The result is a directory (tree) of syntax highlighted, interlinked HTML documents. I've published the plug-in's source code as a demonstration at http://peterodding.com/code/vim/profile/plugin/publish.vim. For more information about the plug-in please refer to its homepage or the project page on GitHub:
If you have questions, bug reports, suggestions, etc. the author can be contacted at email@example.com. If you like this plug-in please vote for it below!
|Unzip the most recent ZIP archive file (see below) inside your Vim profile directory (usually this is "~/.vim" on UNIX and "%USERPROFILE%\vimfiles" on Windows), restart Vim and execute the command ":helptags ~/.vim/doc" (use ":helptags ~\vimfiles\doc" instead on Windows).
As an example we'll publish the plug-in using itself. First create a tags file that contains entries for the files you want to publish using a shell command such as:
ctags -Rf ~/.publish_tags ~/.vim/
If this doesn't work because "ctags" isn't installed you can download it from the Exuberant Ctags homepage http://ctags.sourceforge.net/ or if you're running Debian/Ubuntu you can install it by executing the following shell command:
sudo apt-get install exuberant-ctags
The plug-in needs an up-to-date tags file so that it can create hyper links between the published files. Now start Vim and write a script that registers the tags file you just created and calls the function Publish() as follows:
let sources = '/home/peter/.vim'
let target = 'sftp://peterodding.com/code/vim/profile'
call Publish(sources, target, [
Change the "sources" and "target" variables to reflect your situation, save the script as "~/publish_test.vim" and execute it in Vim by typing ":source ~/publish_test.vim" (without the quotes) and pressing Enter↵. If everything goes well Vim will be busy for a moment and after that you will find a bunch of syntax highlighted, interlinked HTML documents in the target directory!
Click on the package to download.
ip used for rating: 188.8.131.52