开发者

Inefficiency in Vim

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 (/, [, e开发者_运维技巧tc.) 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.


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.


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)


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).

I'm sitting in front of german keyboards all day long and know this problem very well. Some keyboard layouts are simply not very suited for programming / using vim. I think its safe to assume that most programming languages and keyboard shortcuts were designed with the us-layout in mind.

My advice: reset your keyboard layout to us-english and practive touch-typing on that layout (typing without looking at the keys). It won't matter that the keyboard labels are wrong and you'll be much more comfortable using vim hotkeys.

The only problem that still remains for me is to produce language specific characters (german umlauts such as ä,ö,ü) wich i assume will also be a problem for hungarian. For that I use a combination of vim-digraphs, linux window manager digraph-key and windows layout-switching hotkeys.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜