What are the most-used vim commands/keypresses?

前端 未结 10 984
长发绾君心
长发绾君心 2020-12-22 14:22

I\'m a Ruby programming trying to switch from Textmate to MacVim, and I\'m having trouble wading through the gargantuan lists of things you can do in VIM and all of the keyp

10条回答
  •  萌比男神i
    2020-12-22 15:03

    @Greg Hewgill's cheatsheet is very good. I started my switch from TextMate a few months ago. Now I'm as productive as I was with TM and constantly amazed by Vim's power.

    Here is how I switched. Maybe it can be useful to you.

    Grosso modo, I don't think it's a good idea to do a radical switch. Vim is very different and it's best to go progressively.

    And to answer your subquestion, yes, I use all of iaIAoO everyday to enter insert mode. It certainly seems weird at first but you don't really think about it after a while.

    Some commands incredibly useful for any programming related tasks:

    • r and R to replace characters
    • and to increase and decrease numbers
    • cit to change the content of an HTML tag, and its variants (cat, dit, dat, ci(, etc.)
    • (mapped to ,,) for omnicompletion
    • visual block selection with
    • and so on…

    Once you are accustomed to the Vim way it becomes really hard to not hit o or x all the time when editing text in some other editor or textfield.

提交回复
热议问题