Hacker News new | ask | show | jobs
by bakul 3399 days ago
I don't know about being more productive but I use commands like 3cwfoo<esc> to replace the next three words with foo. Or 2cf,foo<esc> to replace everything including the second comma on the current line. Or some : command. I no longer even consciously think about such things as how vi works is something I know in my fingers. Originally I learned such things only after repeating some command multiple times, thinking there has to be a better way, and then learning the more powerful commands. The core set of vi commands is quite regular and once you learn something it can be applied in other situations.

If I am working with another expert vi user it is very easy to give him precise instructions - I can just say things like replace the second foo with bar on every line starting with a space and he'd know to type the correct : incantation.

The key is to pay attention to your inner voice saying "there has to be a better way" and doing something about it! Bottom line: learn to know how to use your everyday tools well.