Master Vim Navigation and Editing: Essential Keybindings Explained
This guide provides a comprehensive reference of Vim's core keybindings for cursor movement, text editing, and file operations, detailing each command's function so users can efficiently navigate, modify, and manage files within the editor.
Cursor Control
h: Move cursor left j: Move cursor down k: Move cursor up l (or spacebar): Move cursor right w: Move forward one word b: Move backward one word e: Move to the end of the next word (: Jump to the beginning of the current sentence ): Jump to the beginning of the next sentence {: Jump to the beginning of the current paragraph }: Jump to the beginning of the next paragraph [[: Jump to the beginning of the current section ]]: Jump to the beginning of the next section 0: Jump to the start of the current line $: Jump to the end of the current line ^: Jump to the first non‑blank character of the line + or RETURN: Move to the first character of the next line -: Move to the first character of the previous line n | n: Move to the character at column n on the current line H: Move to the top of the screen M: Move to the middle of the screen L: Move to the bottom of the screen nH: Move n lines down from the top of the screen nL: Move n lines up from the bottom of the screen Ctrl‑F: Scroll forward one screen Ctrl‑B: Scroll backward one screen Ctrl‑D: Scroll down half a screen Ctrl‑U: Scroll up half a screen z RETURN: Redraw with cursor at top of screen z .: Redraw with cursor at middle of screen z -: Redraw with cursor at bottom of screen Ctrl‑L / Ctrl‑R: Redraw screen without moving cursor /text: Search forward for text /: Repeat last forward search ?text: Search backward for text ?: Repeat last backward search n: Repeat last search forward N: Repeat last search backward /text/+n: Move n lines below the line containing text ?text?-n: Move n lines above the line containing text nG: Jump to line
n :n : Jump to line
n G: Jump to the last line of the file
Content Editing
A: Append text at end of line i: Insert text before cursor I: Insert text at beginning of line o: Open a new line below the current line O: Open a new line above the current line ESC: Exit insert/replace mode Ctrl‑T: Jump to next tab stop Backspace: Delete character before cursor Ctrl‑U: Delete from cursor to start of line cw: Change word (delete word and enter insert mode) cc: Change entire line (delete line and enter insert mode) C: Change from cursor to end of line dd: Delete current line ndd: Delete line
n D: Delete from cursor to end of line dw: Delete word under cursor d}: Delete to end of current paragraph d^: Delete to start of line c/pat: Delete up to first occurrence of pat dn: Delete up to next occurrence of n dfa: Delete up to and including first match of a dta: Delete up to but not including first match of a dL: Delete from cursor to last line on screen dG: Delete from cursor to end of file J: Join current line with the next line p: Paste after cursor from default register P: Paste before cursor from default register rx: Replace character x under cursor Rtext: Replace text starting at cursor with text u: Undo last change U: Restore the entire line to its original state x: Delete character under cursor X: Delete character before cursor nX: Delete n characters before cursor (cursor character stays) .: Repeat last change ~: Toggle case of character under cursor y: Yank (copy) current line into unnamed register yy: Yank current line "xyy: Yank current line into register
x ye: Yank to end of word
File Operations
:w: Write (save) file :w!: Write file, force overwrite warnings :w! file: Overwrite file without warnings :wq: Write file and quit :q: Quit without saving :q!: Force quit without saving :w file: Write current buffer to file ZZ or :x: Write if modified, then quit :n1,n2w file: Write lines n1 ‑ n2 to file :n1,n2w >>file: Append lines n1 ‑ n2 to file :e file2: Edit file2 in the current window :e!: Reload file from disk, discarding changes :e#: Switch to alternate file :n: Edit next file in argument list :n!: Edit next file, ignoring warnings :r file: Read file and insert after cursor :r! command: Execute command and insert its output after cursor
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Big Data and Microservices
Focused on big data architecture, AI applications, and cloud‑native microservice practices, we dissect the business logic and implementation paths behind cutting‑edge technologies. No obscure theory—only battle‑tested methodologies: from data platform construction to AI engineering deployment, and from distributed system design to enterprise digital transformation.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
