My First Steps with Vim: From Confusion to Magic

Andrii RAndrii R
4 min read

Today I dove deeper into Vim, the legendary text editor that everyone says is impossible to quit (literally and figuratively). At first it felt alien: different modes, strange keybindings, commands that look like hieroglyphs. But once a few pieces clicked, it started to feel like magic.

Here’s what I’ve learned so far.

Modes: The Core of Vim

Vim is built around three main modes:

  • Normal mode – where you run commands (navigation, cut, copy, paste, etc.). This is Vim’s default mode.

  • Insert mode – where you actually type text. You get here with i, a, o and a few other keys.

  • Visual mode – where you select text, similar to dragging with a mouse, and then apply commands to it.

The current mode is always visible at the bottom of the screen, so you never have to guess.

Operators + Motions

The “Vim way” of editing is to combine operators (actions) with motions (ranges).

Examples:

  • d$ → delete from the cursor to the end of the line

  • y0 → yank (copy) from the cursor to the beginning of the line

  • cw → change a word (delete it and drop straight into Insert mode)

This is what makes Vim feel powerful: almost every action follows the same pattern.

Cut, Copy, Paste

  • x → cut (delete) a character

  • dd → cut the current line

  • yy → copy the current line

  • p → paste after the cursor

  • P → paste before the cursor

A fun discovery: you can prefix these commands with a number, like 5yy to copy five lines.

Undo and Redo

Vim has its own Ctrl-Z and Ctrl-Shift-Z equivalents:

  • u → undo

  • Ctrl-r → redo

Even better, Vim supports undo branches, meaning you can explore multiple paths of edits instead of being locked to one linear undo history.

Search and Replace

Searching is straightforward:

  • /pattern → search forward

  • ?pattern → search backward

  • n / N → jump through results

Replacement uses the :s command:

  • :s/foo/bar/ → replace first match on the current line

  • :s/foo/bar/g → replace all matches on the line

  • :%s/foo/bar/g → replace all matches in the file

  • :%s/foo/bar/gc → confirm each replacement one by one (y = yes, n = no, a = all, q = quit)

Multi-File Power: vimgrep + cfdo

One of the coolest features I learned is that Vim can search across files, not just inside one.

  • :vimgrep /world/ *.txt → search for “world” across all .txt files and put matches into the quickfix list.

  • :copen → view all matches.

  • :cfdo %s/world/universe/gc | update → run a replacement across all those files, confirming each change, and save them automatically.

That’s when Vim stopped being “just an editor” and started looking like a real productivity engine:

Aha Moments

The biggest realizations for me so far:

  • Delete is cut → because the text goes into a register and you can paste it back.

  • Change = delete + insert → it’s a shortcut to replace text quickly.

  • Uppercase shortcuts exist: D = d$, C = c$, Y = yy.

  • Vim’s design feels weird at first, but everything is consistent once you see the patterns.

Final Thoughts

I started out fighting Vim. Why do I have to press i to type? Why does dw sometimes only delete part of a word? Why can’t I just Ctrl-C/V like in other editors?

But after some practice, I can see why people love it. Vim isn’t about making text editing “easy” — it’s about making it efficient. The more I learn, the more I feel like I’m driving a race car instead of pedaling a bike.

This is just the beginning of my Vim journey. Next, I want to dive deeper into registers, macros, and plugins — but for now, I’m just happy I can quit Vim without panic.

Takeaway for me as a learner

Vim rewards practice and patience, which is exactly the mindset I want to bring into cybersecurity and technical work. If I keep building these skills, I’ll not only be more productive in my own coding but also demonstrate to employers that I’m serious about mastering the tools of the trade.

0
Subscribe to my newsletter

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

Written by

Andrii R
Andrii R