Wednesday, February 14, 2007

Vim: Simple Autocompletion

Just in case I'm not the only one who didn't know this, using Vim, type the following into a file named temp.py:
def really_difficult_name(a, b):
return a + b
Now, type "really" and hit ^n. It'll autocomplete the function name.

I saw a talk by Bram Moolenaar, the author of Vim, at Google last night. I really like that guy. He reminded me that sometimes it's better to be practical than idealistic. Having his voice inside my head is soothing, especially since the little Stallman voice in my head is often so damn demanding ;)

2 comments:

Chris Clark said...

If you like that, check out the ^x completion. ^n is short hand for ^x^n, you can complete information contained in tags too.

Cornelius said...

^n will search completion globally.

^x^n will be faster. :)

another useful key is ^x^o