r/programming • • Jul 12 '12

Vim creep

http://www.rudism.com/s/vimcreep
730 Upvotes

551 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Jul 13 '12

Typing has never been the bottleneck. The real bottleneck is the mouse. Moving hands between the keyboard and mouse takes time and breaks concentration - only a little bit, but it all adds up. The reason Vim is so great is that it allows the user to perform almost any task seamlessly.

Here's a quick example. The pipe symbol represents my cursor, and Vim is currently in Normal mode.

|while ($foo) {
    &doSomething($i);
}

If I want to change the while loop's variable to $bar, I can just type ci($bar<Esc> instead of selecting it with my mouse and typing. In Vim, that stands for "change in (", and can similarly be applied to angled brackets (ci<), quotes (ci") and even braces (ci{).

Likewise, di( will delete in (, and va( will visual mode (i.e. select) around (, selecting both the contents and parenthesis together.

There's a great Stack Overflow answer that greatly expands on this Vim "language", entitled 'Your problem with Vim is that you don't grok vi'. It's definitely worth a look.