Extensions for the Vim text editor

One of the most important tools for any programmer is their text editor — you can’t reach the zone when your development environment is working against you. After weighing my options for a while I decided to try Vim for at least a few months and then decide whether investing more time would be worth it. Five years later I’m still using Vim so i guess that worked out rather well :-).

It took me a long time to grok Vim’s scripting language but since then I’ve been able to script everything I do in Vim which is really great. Most of the stuff I write is held together with duct tape ;-) but I’ve also developed several useful plug-ins which you can find below.

# easytags.vim

This plug-in runs Exuberant Ctags in the background to keep a global tags file (~/.vimtags by default) up-to-date without user intervention. It also uses this tags file to perform dynamic syntax highlighting of user-defined functions and other identifiers.

# luainspect.vim

Using the LuaInspect tool this plug-in performs (automatic) semantic highlighting of variables in Lua source code.

# publish.vim

Vim’s runtime includes the script syntax/2html.vim which can be used to convert Vim’s syntax highlighting to HTML that, when viewed in a web browser, should look exactly the same. This plug-in enables you to run the 2html.vim script in batch-mode, to publish a whole tree of source code at once. It will also use tags files created by Exuberant Ctags to convert tags to hyper links, producing a tree of interlinked HTML documents. I’ve published the sources of all the plug-ins on this page as an example of the output produced.

# pyref.vim

This plug-in maps <F1> in Python files to search through the Python language reference and library reference documentation for the keyword or identifier at the current cursor position and open the first match in your web browser. When no GUI is available a command-line web browser like lynx or w3m will be used, otherwise the plug-in prefers a graphical web browser like Mozilla Firefox or Google Chrome. You can also use a local copy of the Python documentation (very handy when traveling without a reliable internet connection).

# reload.vim

When you edit and save a Vim script this plug-in automatically reloads the script. Supports standard plug-ins, auto-load scripts, file-type plug-ins, syntax highlighting scripts, file-type indentation plug-ins and color scheme scripts.

# session.vim

The session.vim plug-in improves upon Vim’s built-in :mksession command by enabling you to easily and (if you want) automatically persist and restore your Vim editing sessions. It works by generating a Vim script that restores your current settings and the arrangement of tab pages and/or split windows and the files they contain.

# shell.vim

This plug-in aims to improve the integration between Vim and its environment by providing functions to switch to full-screen (see the screenshots), open URLs in the user’s default web browser and execute external commands in the background without opening a command prompt window. The shell.dll library exists to perform these things on Windows, while on UNIX external commands are used.

Last updated on 8 August 2010 at 01:36.