views:

146

answers:

3

I consider myself somewhat familiar with Vim,

  • hate the arrow keys (let alone the mouse),
  • regularly look up tips and plugins to get the most out of this tool,
  • use it daily to manage my cloud servers, etc.

However, I always find myself doing the same mistakes probably inherited from the GUI-world:

  • too often switching to visual mode to see what piece of code I'm about to manipulate,
  • undoing changes to retrieve lost statements because I forget to utilize registers (and pasting code on temporary lines just to grab it after other edits),
  • relying on Ctrl-C & Ctrl-V when working with operating system's clipboard,
  • keep pressing j button to browse through lengthy files to find certain functions.

Probably my Hungarian keyboard layout prevents me from being faster as most of the special characters (/, [, etc.) are only available as a key combination (with Shift or Alt Gr).

Given this specific situation, what pieces of advice could you give me? Have you faced similar bad habits when you were a Vim-novice? I'd like to see my productivity skyrocket (who wouldn't?). Thanks in advance.

+8  A: 

I've found a simple, effective strategy. Choose one action, one task or one set of keys that you think is unnecessarily slow. Figure out a better way of doing this using the vim manual or googling or a plugin etc. Force yourself to use this every time. Rinse, and repeat. The path to efficiency is one-by-one elimination of the slow parts.

I'd also recommend just reading the vim manual from time to time - even if you don't remember everything, knowing something's out there is very helpful.

Peter
+1, you have to measure before you can optimise. We can suggest tips but we're likely solving problems that you aren't having.
C4H5As
Yes, these simpler pieces of advice probably apply 95% of such problems.
pestaa
+3  A: 

This probably applies well beyond vim, but

something that worked for me was finding a specific feature that I knew would be more efficient and concentrate on using that for a week or two.

Just one feature at a time, and possibly using it excessively.

After a couple of weeks it becomes automatic and you can move on to the next thing.

I learn programming tricks the same way. eg. I'll have a month of using lambda expressions for everything, then a month of mapping and filtering. (not on production code though)

Colin Coghill
Having read your response, it could be the case that I want-it-all in an instant. Practice makes perfect, nobody became a productivity god in minutes. Thanks Colin.
pestaa
A: 

just keep using it. The more you use it, the better you become at it. VIM isn't too bad. The main thing is you just have to remember that it isn't always in edit mode.

Matt S.
I started to hate non-modular editors since I tried vim. It's in my blood flow, man! :)
pestaa