Tags: vim

Vim Commands Ranked


Essentials

hjkl,ai,yYyy,dDdd,cCcc,wb,x,uCtrl-r,oO,:w:wq:q

These are the basics of Vim that are essential to use it.

S Tier

.,/?,n.,==,gdgr,22gg:22,AI,ci(

  • == auto indents, an improved >>
  • I personally prefer :22 over 22gg because you can make adjustments.
  • gd and gr “goto definition” and “gotoreference”, these are only great if the LSP powers them up to be cross-file.
  • Text object editing is one of the best Vim features, ex ci" to rewrite contents of a string.

A Tier

*#,qa@a@@,vVCtrl-v,mA'A,g;g,,ggG,zzztzb

  • * can be a nice shortcut to quickly search, but it is a little too situational for S-tier.
  • Macros qa, @a, or @@ can save a lot of time, but the uses are infrequent.
  • Marks with capital letters mA allow you to travel cross-file. Much better than regular lower case marks.

B Tier

r,>>,'',K,{}

  • '' jumps back to the previous jump location.
  • K can be useful if the LSP powers it up to show documentation instead of default man page use.
  • { jumps the cursor pretty far, useful to scroll around the file.

C Tier

fFtT,~g~gugU,J,ma'a,%

  • f searching saves one keypress over / searching, that benefit might not be worth the extra commands.
  • J adds a space between lines which I never want when coding.
  • % jumps to the matching bracket, most of the time you will have to move to get on the bracket.

D Tier

R,HML,WB

  • R replace mode would only be useful if changing something to something else with the same length.

F Tier

Nothing in F Tier

There is nothing in F-tier, maybe I would put Q, but everything in Vim is generally helpful.

Final Thoughts:

This is all just my opinion, let me know if you agree or disagree. This tier-list could be used to prioritize learning high value commands.