DEV Community

samsepi0l
samsepi0l

Posted on

[Opinion] Real reason why i use Vim editor

[Opinion] Real reason why i use Vim editor

This is purely my opinion. And I want you to think a little, as it makes sense.

But I think, that people who say "why it's hard to switch between mouse and keyboard to edit some code/text? why learning Vim and whole keyboard commands "

It's not about saving a few milliseconds or saving the hassle of reaching the mouse, the real hassle from action from reaching the mouse is losing focus.

Because when you are coding, writing and doing something on the keyboard, you type, think, etc. And the last thing you think about is where your mouse cursor is because it's irrelevant. if you lose the mouse cursor, just move the mouse a little, and you will find it.

But when you're coding, and thinking, you're in the zone, and you need first to find that little pointer, by moving a mouse just a little, to be able to notice it where it is.

Why, because you need to use that same little pointer that is shaky and reliably click with that pointer to the place where in the text you need it to be (to move the cursor in text editor to some other place, or just to delete some paragraph).

Mostly, I can't get 100% accuracy all the time to match that little pointer where I want it in the editor, and mostly if I click with the pointer, it's 1-5 chars far from where I want it, so I additionally need to move with arrow keys to that location.

So in contrast when I do Vim commands, it will get the job done 100% all the time. The only prerequisite is to know to use Vim. Which is the hardest part. But most rewarding.

It's about not moving your hand from the keyboard if it's not needed.

Vim is not a reason to ditch IDE or modern tools, but, something that can make workflow simpler. Like, why run IDE, if you can set up Vim to have functions that IDE have?

But I use IDE of course because they are more efficient than Vim at managing resources for things and functions they provide, but I can't work in IDE (write) without Vim mode (extension), because i just can't be bothered to reach the mouse I need focus. I have no problem reaching the mouse to use the debugger, but I do have a problem reaching the mouse every moment i do some (minor) edits in code which are often specific to some parts of text.

would you want this power?


do you know what this does in vim normal mode when your cursor is somewhere on text?

ciw
Enter fullscreen mode Exit fullscreen mode

it removes that word, and you can input word in it's place

like (my cursor is ):

hello world hello world

and if i move it to:

hello wo**rld hello world

(like, i don't know how i got cursor there, but i know just, that i want to change this word into something else)

i am in Normal mode and type ciw

and this happens:

hello | hello world

so in insert mode cursor is like | , so I can type something (hello):

hello hello | hello world

type Esc to get back to Normal mode

hello hello** hello world

And wow ! Isn't that amaizing !

Top comments (0)