ToolStack
KO

Vim Shortcuts & Commands

Essential Vim shortcuts for navigation, editing, search, and split windows

Your data never leaves the browser — all processing is done locally 0 server requests

01

Mode Switching, Saving & Quitting

Press Esc in insert mode to return to normal mode. Commands starting with : are entered in normal mode.

  • i

    Enter insert mode before the cursor (a inserts after)

  • o

    Open a new line below and enter insert mode (O opens above)

  • :w

    Save the file (:w filename to save as a different name)

  • :q

    Quit (fails if there are unsaved changes)

  • :wq

    Save and quit (same as ZZ)

  • :q!

    Force quit without saving

  • :e 파일명

    Open a different file

02

Cursor Movement

  • h j k l

    Move left, down, up, right

  • w / b

    Jump to next word start / previous word start (e goes to word end)

  • 0 / ^ / $

    Go to line start / first non-blank character / line end

  • gg / G

    Jump to the beginning / end of the file

  • :42

    Go to line 42 (42G works the same)

  • Ctrl+f / Ctrl+b

    Scroll one page down / up

  • { / }

    Move by paragraph

  • %

    Jump to the matching bracket

03

Editing — Delete, Copy & Paste

  • x

    Delete the character under the cursor

  • dd

    Delete the current line (3dd deletes 3 lines)

  • dw / d$

    Delete a word / delete to end of line

  • yy

    Yank (copy) the current line (3yy copies 3 lines)

  • p / P

    Paste below / above the cursor

  • u

    Undo (Ctrl+r to redo)

  • r글자

    Replace the character under the cursor with another

  • ciw

    Delete the word under the cursor and enter insert mode (cw, cc also useful)

  • >> / <<

    Indent / un-indent the current line

  • .

    Repeat the last change

  • J

    Join the line below to the current line

04

Search & Replace

  • /검색어

    Search forward (?pattern searches backward)

  • n / N

    Jump to next / previous search match

  • *

    Search for the word under the cursor

  • :%s/old/new/g

    Replace all occurrences of old with new in the entire file

  • :%s/old/new/gc

    Replace interactively with confirmation for each match (y/n)

  • :10,20s/old/new/g

    Replace only within lines 10 to 20

  • :noh

    Clear search highlighting

05

Visual Mode (Selection)

  • v

    Start character-wise selection

  • V

    Start line-wise selection

  • Ctrl+v

    Start block (column) selection for editing multiple lines at once

  • ggVG

    Select the entire file

  • y / d

    Yank (copy) / delete the selection

  • gu / gU

    Convert selection to lowercase / uppercase

06

Split Windows, Tabs & Misc

  • :sp / :vsp

    Split the window horizontally / vertically

  • Ctrl+w h j k l

    Navigate between split windows

  • :tabnew

    Open a new tab (gt / gT to switch tabs)

  • :set nu

    Show line numbers (:set nonu to hide)

  • :set paste

    Disable auto-indent to prevent paste corruption

  • qa … q 후 @a

    Record a macro into register a and replay it (5@a plays 5 times)

  • :!ls -al

    Run a shell command without leaving Vim

Vim Shortcuts: Think in Verbs and Objects

Vim commands combine verbs (d = delete, c = change, y = yank/copy) and text objects (w = word, $ = end of line, iw = inner word). Knowing a few verb-object combinations like dd, ciw, and y$ dramatically reduces what you need to memorize.

For quick server-side edits, five commands cover most cases: i (insert mode), Esc (return to Normal), :wq (save and quit), /search (search forward), and u (undo).

To go further, learn the . (repeat last change), :%s/old/new/g (global substitution), and macros for repetitive tasks. These three unlock a significant speed boost.

FAQ

How do I exit Vim?
Press Esc to ensure you are in Normal mode, then type :wq and press Enter to save and quit, or :q! to quit without saving. This is the most famous question in programming — now you know the answer.
Pasting text causes messy indentation. How do I fix it?
Auto-indent gets applied on top of pasted content. Before pasting, type :set paste to disable auto-indent, paste your text, then type :set nopaste to restore normal mode.
How do I repeat an action across multiple lines?
Use Ctrl+v for visual block selection to edit multiple lines at once. Alternatively, record a macro with qa (start recording to register a), perform your actions, then press q (stop), and replay with @a or 10@a (repeat 10 times).

Related Tools