8 Shortcuts To Get Started With Vim

I am a developer from Kolkata, Interested in all thing's tech!
Search for a command to run...

I am a developer from Kolkata, Interested in all thing's tech!
No comments yet. Be the first to comment.
Imagine you're lost in a giant maze. Trying to find your way out with just a list of directions won't work, right? You need a map that shows how everything connects, where the twists and turns are, and maybe even some hidden shortcuts. That's where g...

Here is the story, So I was building my portfolio website and I wanted to create some blogs post cards to show case my recent articles. But while I built the cards and fetched the articles, I found out that the brief about the articles were of differ...

Vim has too many shortcuts and it can be confusing π΅βπ« for newcomers. So, I comprised a list of 8 shortcuts from the perspective of a person coming from normal text editors β¨οΈ.
For the people who are asking why not just go through Vim Tutor? Vim tutor is easy but It has too many shortcuts to wrap our mind around. Normally We don't use all of them all the time so learning all at the same time is not productive as we will eventually forgetπ΅ them!
To develop the πͺπ§ muscle memory, first we have to work with these limited shortcuts.
So, let's get started!! π₯³

Vim has three text modes:
Escape to exit current text mode or to enter Normal modei to enter Insert Modev to enter Visual ModeLook at the status bar at the bottom to know which mode you currently in.
In Vim, we use h, j, k, l to navigate between lines.
h for moving right l for moving left j for moving down k for moving up First enter Insert mode using i. That's it! Now Text is editable normally.
Use Escape to exit Insert mode.
shift+6 or ^ to get to the start of the line or the first non-blank charactershift+4 or $ to get the end of the lineshift+a to append to the end of the line and switch to insert mode shift + g or G - to go to last line of the filegg - to go to the first line of the fileu to undo changesctrl + r to redo changes/ followed by the text you are searching forn - to go to next occurrenceshift+n - to go to previous occurrence :%s/text1/text2/g - replace text1 with word you want to change and text2 is the replacement wordc to the end like :%s/text1/text2/gc to confirm every replacementy for replacing the current entryn to not replace the current entry and skips to next entrya to change all entriesq to quit l replace only the first entry and quitshift+zz or :wq! - save and exit the file:q! - exit file without savingTada!! You are done.

Liked my article? Give a thumps up!! Have some feedbacks? Comment them below!!