I just learned about the truly awesome object-select capabilities of vim. With the cursor within some "text object", a set of simple verbs can select or operate on the whole object. For example, with the cursor anywhere inside the quotes below (e.g. over the 'o'):
print "Hello, world"
^
The command vi"
will select the whole phrase inside the quotes. The same capability works with a number of "text objects" that vim defines, including words, sentences, paragraphs, and characters enclosed by quotes, parentheses, and braces.
But now I want this notion of a "text object" to be aware of the language I'm writing. For example, consider the following python:
re.sub("[^A-Z ]", " ", string)
I'd like to be able to place the cursor somewhere over that, and to select the whole thing. The function call is a well-defined syntactic construct, but it isn't a "word", "sentence", "paragraph", or enclosed in quotes or braces.
Are there any plugins or vimrc hacks out there that define these sorts of language-dependent "text objects"?