Viewing a single comment thread. View all comments

QuillanFae t1_j5wre75 wrote

Okay, I will. I'll do it because I feel cool when I use vim, and making my IDE less accessible to the average person is something that appeals to a pretentious wanker like me. But what I'll be left with is the realisation that my vim skills are weak, that I pretty much just toggle insert mode and navigate with arrow keys for the most part, and I don't really know what habits I should be developing to turn vim into a productivity enhancement.

So everyone, favourite ways to incorporate vim into everyday code editing?

6

therealphatmike t1_j5wzmp8 wrote

Be ok with sucking for a month. Use vim tutor to learn and navigate the basics. But then commit to learning 1-2 new cool and helpful things a day. In just a few weeks you’ll be crushing it.

Also relative line numbers. They’re necessarily navigating a file quickly and effortlessly

6

QuillanFae t1_j5x76y2 wrote

Okay, I can handle that, thank you. Looks like I'm about to burn an afternoon figuring out which interactive vim tutorials don't suck. So many!

Relative line numbers (looks like hybrid is the option I'll be going with) is gonna be game changing.

3

SirThunderDump t1_j5x0uy0 wrote

I pick one thing that I suck at, or am slow at with VIM. I then learn the command, and practice the hell out of it until it's natural. Then rinse, wash, and repeat.

3

H9419 t1_j5y44ya wrote

That works really well for beginners to get started, but after you really understand and use Regex, the rest is just learned from discussions among colleagues and only remembering what seems useful.

There's a grammar to vim and it's easy once you are able to distinguish between the verb and adjective of the same character in vim

2

therealphatmike t1_j5z9r7r wrote

u/QuillanFae like this user pointed out, there’s a grammar to vim commands. Once you notice the pattern you can start to put things together from the different commands you know. Like :diw :ciw do slightly different actions the word the cursor is inside. And you change the object the action is taken on. Like need to rewrite a whole block? Go somewhere inside it and run :ci{ and it’ll remove everything inside the curly braces and put you in insert mode in between them, where :di{ would just remove the content between the braces but leave you in normal mode.

1