📜 Neovim/Vim Cheatsheet

⚡ Neovim/Vim Cheatsheet: The Lazy Developer’s Guide to Ultimate Efficiency

Why Should You Even Care About Vim/Neovim? 🤔

Let’s be honest. Learning a new tool feels like extra work, especially when your IDE already does everything. But hear me out—what if you could code, navigate, and edit like a machine without ever lifting your hands from the keyboard? No more dragging your mouse around, no more clunky UI menus—just pure, uninterrupted flow.

That’s where Vim and Neovim come in. These aren’t just text editors; they’re efficiency boosters that let you do more with less effort.

🥊 Vim vs. Neovim vs. Other Editors

FeatureVimNeovimVS Code / IntelliJ
Blazing Fast❌ (Gets sluggish with plugins)
Highly Customizable✅✅ (More modern)✅ (But GUI-based)
Works Everywhere❌ (Requires UI)
LSP & Modern Features❌ (Needs plugins)✅ (Built-in)
Mouse Required?❌ (Never!)❌ (Never!)✅ (Too much 😩)
Best for Keyboard Lovers?✅✅✅✅✅✅✅❌ (Mouse is your frenemy)

Long story short:

  • Vim is powerful but traditional—great for purists.

  • Neovim is Vim’s smarter, younger sibling, built for the modern age.

  • VS Code & IntelliJ are great, but bloated and mouse-dependent.

If you’re tired of your mouse slowing you down, this cheatsheet will help you unlock Vim/Neovim superpowers. 🦸‍♂️


🏁 Basic Navigation (a.k.a. "Moving Around Like a Pro")

🚨 Pro Tip: Vim doesn’t use arrow keys (well, you can use them, but real pros don’t). Instead, use HJKL to move.

CommandDescription
hMove left
lMove right
jMove down
kMove up
0Jump to beginning of line
^Jump to first non-blank character in line
$Jump to end of line
ggGo to the top of the file
GGo to the bottom of the file
5GJump to line 5 (replace 5 with any number)

🎯 Challenge:
Try navigating through a file without using arrow keys. Your fingers will thank you later.


📝 Editing & Inserting (a.k.a. "Actually Writing Stuff")

Vim has modes, and you start in Normal Mode. To type something, you need to enter Insert Mode first.

CommandWhat it does
iInsert before cursor
IInsert at beginning of line
aAppend after cursor
AAppend at end of line
oOpen a new line below cursor
OOpen a new line above cursor
r<char>Replace single character with <char>
uUndo last action
Ctrl + rRedo last action
.Repeat last action (super useful!)

🚀 Speed Tip:
Instead of pressing Esc every time, map jk or jj to escape mode in your vimrc or init.lua.


🔍 Searching & Replacing

Finding stuff in a file is easy with these commands:

CommandAction
/wordSearch for word (press n for next, N for previous)
?wordSearch backwards for word
:%s/old/new/gReplace all occurrences of old with new
:%s/old/new/gcReplace with confirmation

🔥 Pro Trick:
Use * to search for the word under your cursor automatically.


📌 Copy, Paste, and Delete

CommandAction
yyCopy current line
3yyCopy 3 lines
pPaste after cursor
PPaste before cursor
ddDelete current line
3ddDelete 3 lines
d$Delete from cursor to end of line
xDelete character under cursor

📌 Tip: Use "0p to paste from the last yank, so deletions don’t overwrite your clipboard.


📂 Working with Files

CommandAction
:wSave file
:qQuit
:q!Quit without saving
:wq or ZZSave and quit
:e filenameOpen a file
:saveas filenameSave as a new file

🖥 Splits & Windows (Multitasking Like a Pro)

CommandAction
:split or :spSplit horizontally
:vsplit or :vspSplit vertically
Ctrl + w + wSwitch between splits
Ctrl + w + h/j/k/lMove between splits
Ctrl + w + qClose current split

🔥 Tabs (Because You Love Having 100 Open at Once)

CommandAction
:tabnewOpen a new tab
:tabcloseClose current tab
:tabnGo to next tab
:tabpGo to previous tab

🚀 Git Integration (via Fugitive Plugin)

CommandAction
:Git statusShow Git status
:Git add %Add current file to Git
:Git commit -m "message"Commit changes
:Git pushPush changes
:Git pullPull latest changes
:GdiffsplitView Git diff

🎯 Final Thoughts

Congrats! 🎉 You now have enough Vim/Neovim knowledge to be dangerous.

But don’t stop here—Vim mastery is a journey. The more you practice, the faster and more efficient you’ll become.

💡 Your next step? Try using Vim/Neovim exclusively for one full day. It’ll feel weird at first, but by the end, you’ll be 10x more productive. 🚀

Happy coding! 🎉

0
Subscribe to my newsletter

Read articles from Himanshu Nikhare directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Himanshu Nikhare
Himanshu Nikhare

I am a Senior Software Engineer at BigBasket with over three years of experience in software development. Specializing in QA automation, CI/CD, and mobile automation, I am passionate about creating efficient workflows and sharing knowledge through blogs and articles. I actively contribute to the tech community through my work, open-source projects, and insightful content. Feel free to connect with me on GitHub or LinkedIn to explore my projects and contributions.