---
title: "Vim Editor Cheatsheet | FindUtils"
description: "Vim modes, movement, editing, copy and paste, search, replacement, and file commands."
url: https://findutils.com/cheatsheets/vim-editor/
---

# Vim Editor Cheatsheet

Vim modes, movement, editing, copy and paste, search, replacement, and file commands. 64 commands in 8 sections, filed under [Linux & Terminal](https://findutils.com/cheatsheets/linux/).

## Modes

- `i`: Enter Insert mode (before cursor)
- `a`: Enter Insert mode (after cursor)
- `I`: Insert at beginning of line
- `A`: Insert at end of line
- `o`: Open new line below and enter Insert mode
- `O`: Open new line above and enter Insert mode
- `v`: Enter Visual mode (character selection)
- `V`: Enter Visual Line mode (line selection)
- `Ctrl+v`: Enter Visual Block mode (column selection)
- `Esc`: Return to Normal mode

## Navigation

- `h j k l`: Move left, down, up, right
- `w / W`: Jump forward to next word / WORD
- `b / B`: Jump backward to previous word / WORD
- `e / E`: Jump to end of word / WORD
- `0`: Jump to beginning of line
- `^`: Jump to first non-blank character
- `$`: Jump to end of line
- `gg`: Go to first line of file
- `G`: Go to last line of file
- `<n>G`: Go to line number n
- `Ctrl+d / Ctrl+u`: Half-page down / up
- `Ctrl+f / Ctrl+b`: Full-page forward / backward
- `%`: Jump to matching bracket

## Editing

- `x`: Delete character under cursor
- `dd`: Delete (cut) entire line
- `dw`: Delete to end of word
- `d$`: Delete to end of line
- `D`: Delete to end of line (same as d$)
- `cc`: Change entire line (delete and enter Insert mode)
- `cw`: Change word
- `C`: Change to end of line
- `r<char>`: Replace single character
- `R`: Enter Replace mode (overwrite text)
- `J`: Join current line with next line
- `~`: Toggle case of character

## Copy & Paste

- `yy`: Yank (copy) entire line
- `yw`: Yank word
- `y$`: Yank to end of line
- `p`: Paste after cursor
- `P`: Paste before cursor
- `"+y`: Yank to system clipboard
- `"+p`: Paste from system clipboard

## Search & Replace

- `/<pattern>`: Search forward for pattern
- `?<pattern>`: Search backward for pattern
- `n`: Repeat search in same direction
- `N`: Repeat search in opposite direction
- `*`: Search for word under cursor (forward)
- `#`: Search for word under cursor (backward)
- `:%s/old/new/g`: Replace all in file
- `:%s/old/new/gc`: Replace all with confirmation
- `:s/old/new/g`: Replace all in current line

## Undo & Redo

- `u`: Undo last change
- `Ctrl+r`: Redo last undone change
- `.`: Repeat last command

## File Operations

- `:w`: Save file
- `:w <filename>`: Save as new file
- `:q`: Quit (fails if unsaved changes)
- `:q!`: Quit without saving
- `:wq`: Save and quit
- `:x`: Save and quit (only writes if changed)
- `ZZ`: Save and quit (Normal mode)
- `:e <file>`: Open a file
- `:bn / :bp`: Next / previous buffer

## Sources

- `https://vimhelp.org/quickref.txt.html`: Vim reference: modes, movement, editing, search, and file commands.

## Related

- Cheatsheet: [Linux Commands](https://findutils.com/cheatsheets/linux-commands/)
- Cheatsheet: [Bash Scripting](https://findutils.com/cheatsheets/bash-scripting/)
- Cheatsheet: [SSH Commands](https://findutils.com/cheatsheets/ssh-commands/)
- Guide: [Visual JSON Editor — Edit JSON with Drag & Drop, Tree View, and Diff](https://findutils.com/guides/visual-json-editor-guide/)
- Tool: [UML Diagram Editor](https://findutils.com/developers/uml-diagram-editor/)
- Tool: [Spreadsheet Editor](https://findutils.com/productivity/spreadsheet-editor/)
- Tool: [Photo Editor](https://findutils.com/design/photo-editor/)
