Saturday 26 March 2011

Vim Indentation-based Text Objects

I've created a small Vim plugin for treating indented blocks of code as text objects.

http://www.vim.org/scripts/script.php?script_id=3037

From the documentation:

Vim text objects provide a convenient way to select and operate on various types of objects. These objects include regions surrounded by various types of brackets and various parts of language (ie sentences, paragraphs, etc).

This plugin defines a new text object, based on indentation levels. This is very useful in languages such as Python, in which the syntax defines scope in terms of indentation. Using the objects defined in this plugin, an entire if structure can be quickly selected, for example.

No comments:

Post a Comment