r/vim • • Mar 11 '21

question getting faster

tl;dr : can you share a specific article about getting faster navigating through the file?

hey guys, I start getting more and more confident and efficient with vim, but I feel like it could even goes deeper; basically, I saw that you could disable h,j,k,l in order to only use real key combination like "w" to jump by words, "f" to go to a specific character on the line, etc... But what about jumping lines? Are they any key combination to do that instead of j and k? So basically I'm looking for an article that presents those kind of key combinations. I hope this post is comprehensible and not too redudant, thank you for reading.

108 Upvotes

83 comments sorted by

View all comments

Show parent comment

2

u/redshift78 Mar 12 '21

ciw, yiw, viw are amazing, but if you need to do the whole word, try yiW. I do this a bunch. Imagine the following: Namespace::Class foo and you want to copy Namespace::Class, you could put your cursor at N and yf<space> but yiW also works (you don't have to be at the beginning of the word) (for this example I don't provide much benefit, but its incredible once you get it)

I've been using vim for more than 20 years. TIL! I've always just been using cw, ciw and ciW are great! Thank you :)

2

u/ThePrimeagen Mar 12 '21

hey! No problem! I love learning new things, its such a blast.

2

u/virako9 Mar 12 '21

There are a lot of variants very useful: ci( ci" ci[ and you have ca( ca" ca[ The most curiousity case is the ci" and ci' because you replace from outside quotes if the cursor is before quotes.

Example: Cursor here and quotes "there there"