Basics of Vim/Neovim
Neowhat?
It was the end of May 2025. A friend and former colleague of mine sent me a link about a YouTuber called ThePrimeagen. In his videos, he featured some funny takes on tech news and had some sassy remarks, but what sparked my interest was his IDE. He used a terminal in which he was editing text, but it didn’t look like old-school Vi. It had rich support for languages, an uncluttered interface, and I never saw a mouse cursor. I was interested, so I viewed some more videos, and my Neovim journey began. I’ve a deep interest in how technology works, and I wanted a deeper understanding of how VSCode works and how it helps me with code editing. What better way than to check out the competition? This, plus a desire to become more able with editors like Vi, made it a clear choice to invest time to better understand this editor.
If you’re unfamiliar with Vim or Neovim, or if you’re interested in the topic, this blog post will provide a brief overview of my understanding of how to navigate text in Vim/Neovim. In later posts, I’ll dive deeper into more advanced topics and how to extend Neovim to make it a full-fledged IDE.
Neovim
Vim is the scary editor in your terminal where noobies die because they can’t get out. However, it isn’t as frightening as it looks. You do, however, need to understand why it works differently from other editors. Neovim is a fork of Vim, so it shares many similarities with Vim and offers added value beyond it. It provides speed, extensibility, and is a fun timesink.
Installing
I’m a macOS user, so I installed using brew install neovim
. After doing so, you have to type nvim
in your terminal, and you’re in the editor. It is a strange editor if you’re used to clicking on all the things, because where are the buttons? The central idea is that your buttons are on your keyboard, and you use shortcuts/keymaps to perform your actions.
An Integrated Developer Environment is a rich text editor first, so I did some baby steps in trying to edit, and I wasn’t really successful. I had to read a bit and view some Vim for Dummies videos, because all Neovim getting-started videos are about extending functionality, but not about how to edit text.
I could’ve saved myself a lot of time at this point by first reading the documentation, which is the first thing the editor shows you, d’oh! When it launches, you can type :help neovim
and read the help. Although you do need to know how to navigate text to do so.
Modes
Neovim uses modes to change between functionalities.
When using a text editor, we’re used to clicking on the position we want to edit, typing what we want, and then scrolling. Regular text editing is done in the Insert-mode, by default, the editor is launched in the Normal mode, in which you can navigate the text.
Every time I tried to use Vim via a terminal on a remote machine, I was intimidated and ended up installing the nano editor. But no more! If you press i
, the editor enters Insert mode, and you can type as you’re used to. This all worked fine, but when I needed to navigate to a different line, things got scary again. Luckily, Esc
brings our editor back to Normal-mode.
But now I was faced with the scariest part: how do you exit the darn editor? When not in Insert-mode, you can press :
, to enter Commandline mode. This Command-line mode allows us to :write
the text in our current editor and :quit
the editor, but this being a fast editor, you can also just type :w
and :q
or :wq
.
Quitting a help or any vim tab also works via :q
, so if you’ve a help open, this way you can exit that too. You can read more about modes by reading the help on modes with :help vim-modes
.
Navigating
So far so good, but this wasn’t more than a extremely simple “Hello World”-like example. The normal mode isn’t a shortcut to the command mode, it’s so much more! In the Normal mode you can navigate your cursor in the editor, manipulate text relative to your cursor and a lot more. But it all start with navigating your cursor across the editor. In all the videos they talked about the home row, this means the row your fingers hopefully land on when you touch a keyboard.
The most important fact you have to understand is, you have no mouse, and no arrow-keys they just don’t exist anymore from this point on.

On your home-row the most import keys are located in the portion of your right hand, the hjkl
section.
The barebones:
h
moves the cursor one character leftj
moves the cursor one line downk
moves the cursor one line upl
moves the cursor one character right
I watched this video by DevOps Toolbox. And I was ready to take on the world, at least I thought. It didn’t click with me until I tried a browser based game called Vim Adventures. After the video and the game I was able to navigate text using vim motions.
In the video and game it’s made clear that in Normal mode you can move your cursor not only per character, but you can move around words, sentences, paragraphs etc. A small note I made to remember these:
w
moves the cursor to the first character of the next wordb
moves the cursor to the first character of the previous worde
moves the cursor to the last character of the current worda
moves to the next character and enters Insert mode$
moves the cursor to the end of the line0
moves the cursor to the start of the line^
moves the cursor to the first non blank character of the linegg
moves towards the start of your fileG
moves towards the end of your fileH
moves to the top of your screenM
moves towards the middle of your screenL
moves towards the bottom of your screen{
moves towards the previous paragraph}
moves towards the next paragraph (blank line)Ctrl + D
moves your screen downCtrl + U
moves your screen upzz
moves your screen in a way your cursor is in the middle.
Those are my most-used shortcuts for navigation. This makes you a lot faster navigating around files, so there might be something about that Normal-mode after all. However, the editing still felt a bit clunky; I was always moving around, entering Insert mode with i , and then going back to Normal mode.
Operators
The clunkiness came from the fact that I was navigating, but not really combining knowledge. For instance if I wanted to delete a word, I’d move towards the end of the word, then move right with l
, enter Insert mode and backspace until the word is gone. There are better ways to do so. Enter operators, if I’d only would’ve read the manual at :help operator
sooner..
Operators are commands you provide a motion and then the editor performs the command on the text based on the motion you provided. This maybe sounds difficult, but bear with me. The most important operators are:
d
for deletec
for change, this deletes and sets the editor mode to Insert, so you can type the text immediatlyy
for yank, this yanks/copies the text to a buffer/clipboard
So, if you want to delete a word, you can type dw
, which deletes from your current cursor position to the start of the next word. If you want to delete from your current position to the end of the line, you can type d$
. You get the idea, you can combine operators with motions.
To delete a whole line, you can type dd
, which deletes the entire line you are on. The same applies to yy
, which yanks the entire line. Or cc
, which removes the whole line and sets you in Insert-mode.
Pasting is done with p
for paste after your cursor and P
for paste before your cursor. What caught me offguard a few time is that your buffer/clipboard is filled when yanking but also with deleting text. So deleting a word will default to overwriting your clipboard. This caught me offguard a bit, since I usually copy/yank my text, delete the thing I want gone and then paste, but this will paste the deleted text.
This may feel like a lot, but just start small with dw
, d$
, dd
,cw
,cc
,yw
, yy
and p
and you’ll be amazed how fast you can edit text.
Operators on Steroids
This enables us to edit text much faster by combining motions and operators. But wait, there’s more. You can also repeat an action a few times by providing a number before the operator. So if you want to delete 3 words, you can type d3w
, or if you want to delete 4 lines, you can type d4d
. This also works with change and yank, so c3w
, y3w
, c4d
, and y4d
work too. The same applies to dd
and yy
; so, 3dd
deletes 3 lines and 4yy
yanks 4 lines relative to your cursor.
There are also other tools, like delete until the character you provide, which is done with d
+ t
+ character
. So if you want to delete until the next comma you can type dt,
. This also works with change and yank, so ct,
and yt,
work too. If you want to include the comma, you can use f
instead of t
, so df,
, cf,
and yf,
.
With some googling, I found out you can delete something and not have it in your buffer/clipboard, by using the _
register, so _d3w
deletes 3 words without putting it in your clipboard.
Undo/Redo
Mistakes happen, luckily you can undo and redo your actions. Undo is done with u
and redo with Ctrl + r
.
Other useful commands
There are some other useful commands I use often:
.
repeats your last action, so if you deleted a word withdw
you can repeat that with.
x
deletes the character under your cursor, this is like backspace in Insert-modeX
deletes the character before your cursor, this is like delete in Insert-moder
+character
replaces the character under your cursor with the character you providedR
enters Replace-mode, this is like Insert-mode but it overwrites texto
opens a new line below your current line and enters Insert-modeO
opens a new line above your current line and enters Insert-modeK
adds a new line above your cursor in Normal-modeP
pastes on the line above your cursorJ
joins the current line with the next lineD
deletes from your cursor to the end of the line, this is liked$
C
changes from your cursor to the end of the line, this is likec$
A
moves your cursor to the end of the line and enters Insert-modeI
moves your cursor to the first non-blank character of the line and enters Insert-modeZZ
saves and exits the editor, this is like:wq
ZQ
exits the editor without saving, this is like:q!
There is also a trick in which you can do a motion towards text inside braces, parentheses or quotes. If on a line you have text in quotes, you can use ci"
to change the text inside the quotes. Or for instance if there are braces on a line you can delete the text inside by typing di[
.
Conclusion
I left out a significant amount of commands and motions, but this is a good start to get you going. In a subsequent post, I’d like to demonstrate how to utilize substitutions, visual mode, and extend Neovim to make it a full-fledged IDE. These tips work in both Vim and Neovim, so if you’re using Vim, you can use these too. There are several cheat sheets available online; just Google “vim cheat sheet” and you’ll find several. But the best way to git gud is by putting in the hours and getting it in the fingers, Happy Vimming!