Skip to main content

Vim Philosophy and Mental Model

Vim is not just a text editor with weird shortcuts. It is a language for editing text based on a composable grammar that, once internalized, makes editing dramatically faster than any point-and-click approach.

Core Idea

Vim operates like a language: verbs (operators) act on nouns (text objects/motions). d2w means "delete two words." Once you know the grammar, you can compose any action from its parts.

The Editing Language Grammar​

[count] [operator] [motion/text-object]
PartExamplesRole
Count (optional)2, 5, 10Repeat the action N times
Operator (verb)d delete, c change, y yankWhat to do
Motion / text objectw word, j line, ip paragraphWhere to act

Examples​

CommandBreakdownMeaning
dwd + wDelete to next word
3dd3 + ddDelete 3 lines
ci"c + i + "Change inside quotes
yapy + a + pYank around paragraph
>3j> + 3 + jIndent 3 lines down
gUiwgU + iwUppercase inner word

Why Modal Editing Exists​

In a modal editor, all the keyboard keys are available as commands in Normal mode (no need to hold Ctrl or Alt). This is the key insight:

CTRL+D = delete char (in non-modal editors)
d = delete (composed with motions) (in Vim normal mode)

In Vim: dw = delete word
d3j = delete 3 lines down
dap = delete a paragraph
D = delete to end of line

In nano: CTRL+K → cut whole line (only option)

The richness of what you can express with fewer keystrokes compounds with every combination.

The Four Most Important Principles​

1. Stay in Normal Mode as Much as Possible​

Normal mode is your home base. You enter Insert mode to type, then immediately return to Normal mode. The habit of being in Normal mode most of the time is what makes Vim fast.

Wrong habit: Press i, type everything, never press Esc
Right habit: Type → Esc → navigate → i → type → Esc → ...

2. Motions Are Reusable Across Operators​

Every motion (w, b, $, gg, G, }, etc.) works with every operator (d, c, y, ><). Learning one motion multiplies your editing vocabulary.

3. Dot Repeat (.) — Repeat the Last Change​

The . key in Normal mode repeats the last change you made. This is one of the most powerful features in Vim:

ciw "new-value" → Esc # Change inner word to "new-value"
w # Move to next occurrence
. # Repeat the change
w.w.w. # Repeat on each subsequent word

4. Count Multiplies Everything​

Prefix any command with a number to repeat it:

5j → Move down 5 lines
3dw → Delete 3 words
10>> → Indent 10 lines
2f, → Find the 2nd occurrence of ','

The Movement Mindset​

Forget about arrow keys and mouse clicks. Think about text units:

UnitKeys
Characterh l
Wordw b e
WORD (space-delimited)W B E
Linej k 0 $ ^
Sentence( )
Paragraph{ }
ScreenH M L
Filegg G
Matching bracket%

Think in Terms of Patterns, Not Keystrokes​

A common beginner mistake is memorizing individual keystrokes. Instead, learn the patterns:

PatternGrammarExample
Change somethingc&#123;motion&#125;cw change word, c$ change to end of line
Delete somethingd&#123;motion&#125;d} delete to end of paragraph
Copy somethingy&#123;motion&#125;yG yank to end of file
Select somethingv&#123;motion&#125;viB select inside braces

The Composability Rule​

Operators, motions, text objects, and counts combine into one grammar. That is why dw, ci", and 3dd all feel like variations of the same idea instead of unrelated shortcuts.

Common Analogies​

Vim conceptNatural language analogy
d (delete)"Delete"
w (word)"the word"
dw"Delete the word"
3dw"Delete three words"
ci""Change inside quotes"
yap"Yank (copy) a paragraph"

In LazyVim​

LazyVim Context

LazyVim inherits all Neovim modal editing and vim philosophy — no differences. However, LazyVim comes with the flash.nvim plugin bundled, which significantly enhances jump motions (like f and t) by showing visual labels to jump directly to any word on the screen.

AspectVanilla NeovimLazyVim
Core MotionsStandard Vim motionsStandard Vim motions
Extended MotionsNone by defaultIncludes flash.nvim (s to jump anywhere)
Surround OperationsNone by defaultIncludes mini.surround for changing quotes/brackets
CommentingBasic gc (in 0.10+)Enhanced commenting with mini.comment (or ts-context-commentstring)

What's Next​