---
title: "VIM Cheat Sheet"
description: "VIM is a highly configurable, powerful text editor available on most Linux distributions. Ideal for editing files via the command line, its modal design offers distinct modes for various tasks. This cheat sheet provides a quick reference for VIM’s essential commands and features."
author: "Mohammad Abu Mattar"
canonical: https://mkabumattar.com/blog/post/vim-cheat-sheet
---

# VIM Cheat Sheet

## What Is VIM?

VIM (Vi Improved) is a versatile text editor pre-installed on most Linux systems, known for its efficiency in command-line file editing. Its modal nature switching between modes like Normal, Insert, and Command makes it a favorite among developers and system administrators. This cheat sheet serves as a handy guide to mastering VIM’s core functionalities.

## VIM Modes

VIM operates in three primary modes, each designed for specific tasks, allowing users to navigate, edit, and manage files seamlessly.

### Normal Mode

Normal Mode is VIM’s default state for navigation and manipulation. Use it to move the cursor, delete text, or copy content, entering it with the <kbd class="btn-kdb">Esc</kbd> key.

### Insert Mode

Insert Mode enables text input and editing. Activate it with the <kbd class="btn-kdb">i</kbd> key to start typing at the cursor’s position.

### Command Mode

Command Mode lets you execute file-level operations like saving or quitting. Access it by pressing <kbd class="btn-kdb">:</kbd> from Normal Mode.

## VIM Commands

This section lists essential VIM commands, organized by function, to streamline your workflow.

### Global

Global commands affect the entire file or VIM environment, such as saving files or accessing help.

| Command                                    | Description                      |
| :----------------------------------------- | :------------------------------- |
| <kbd class="btn-kdb">:h[elp] keyword</kbd> | Open help for keyword.           |
| <kbd class="btn-kdb">:sav[eas] file</kbd>  | Save the file as file.           |
| <kbd class="btn-kdb">:clo[se]</kbd>        | Close the current file.          |
| <kbd class="btn-kdb">:ter[minal]</kbd>     | Open a terminal.                 |
| <kbd class="btn-kdb">K</kbd>               | Open help for word under cursor. |

### Cursor Movement

These commands control cursor navigation, helping you move efficiently within a file.

| Command                                                        | Description                                                                |
| :------------------------------------------------------------- | :------------------------------------------------------------------------- |
| <kbd class="btn-kdb">h</kbd>                                   | Move left.                                                                 |
| <kbd class="btn-kdb">j</kbd>                                   | Move down.                                                                 |
| <kbd class="btn-kdb">k</kbd>                                   | Move up.                                                                   |
| <kbd class="btn-kdb">l</kbd>                                   | Move right.                                                                |
| <kbd class="btn-kdb">gj</kbd>                                  | Move down a screen.                                                        |
| <kbd class="btn-kdb">gk</kbd>                                  | Move up a screen.                                                          |
| <kbd class="btn-kdb">H</kbd>                                   | Move to top of screen.                                                     |
| <kbd class="btn-kdb">M</kbd>                                   | Move to middle of screen.                                                  |
| <kbd class="btn-kdb">L</kbd>                                   | Move to bottom of screen.                                                  |
| <kbd class="btn-kdb">w</kbd>                                   | Move forward one word.                                                     |
| <kbd class="btn-kdb">W</kbd>                                   | Move forward one WORD.                                                     |
| <kbd class="btn-kdb">e</kbd>                                   | Move to end of word.                                                       |
| <kbd class="btn-kdb">E</kbd>                                   | Move to end of WORD.                                                       |
| <kbd class="btn-kdb">b</kbd>                                   | Move back one word.                                                        |
| <kbd class="btn-kdb">B</kbd>                                   | Move back one WORD.                                                        |
| <kbd class="btn-kdb">ge</kbd>                                  | Move to end of previous word.                                              |
| <kbd class="btn-kdb">gE</kbd>                                  | Move to end of previous WORD.                                              |
| <kbd class="btn-kdb">%</kbd>                                   | Move to matching character (default supported pairs: (), {}, []).          |
| <kbd class="btn-kdb">0</kbd>                                   | Move to the start of the line.                                             |
| <kbd class="btn-kdb">^</kbd>                                   | Move to the first non-blank character of the line.                         |
| <kbd class="btn-kdb">$</kbd>                                   | Move to the end of the line.                                               |
| <kbd class="btn-kdb">g\_</kbd>                                 | Move to the last non-blank character of the line.                          |
| <kbd class="btn-kdb">gg</kbd>                                  | Move to the first line of the file.                                        |
| <kbd class="btn-kdb">G</kbd>                                   | Move to the last line of the file.                                         |
| <kbd class="btn-kdb">5G</kbd>                                  | Move to line 5.                                                            |
| <kbd class="btn-kdb">gd</kbd>                                  | Move to the definition of the word under the cursor.                       |
| <kbd class="btn-kdb">gD</kbd>                                  | Move to the definition of the WORD under the cursor.                       |
| <kbd class="btn-kdb">fx</kbd>                                  | Move to the next occurrence of character x.                                |
| <kbd class="btn-kdb">Fx</kbd>                                  | Move to the previous occurrence of character x.                            |
| <kbd class="btn-kdb">tx</kbd>                                  | Move to the character before the next occurrence of character x.           |
| <kbd class="btn-kdb">Tx</kbd>                                  | Move to the character after the previous occurrence of character x.        |
| <kbd class="btn-kdb">;</kbd>                                   | Repeat the previous f, t, F, or T movement.                                |
| <kbd class="btn-kdb">,</kbd>                                   | Repeat the previous f, t, F, or T movement, but in the opposite direction. |
| <kbd class="btn-kdb">`}`</kbd>                                 | Move to the next paragraph (or function/block, when editing code).         |
| <kbd class="btn-kdb">`{`</kbd>                                 | Move to the previous paragraph (or function/block, when editing code).     |
| <kbd class="btn-kdb">zz</kbd>                                  | Center cursor on screen.                                                   |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">e</kbd> | Move screen down one line (without moving cursor).                         |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">y</kbd> | Move screen up one line (without moving cursor).                           |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">b</kbd> | Move back one full screen.                                                 |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">f</kbd> | Move forward one full screen.                                              |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">d</kbd> | Move forward half a screen.                                                |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">u</kbd> | Move back half a screen.                                                   |

### Insert Mode

Insert Mode commands facilitate text entry and minor adjustments while typing.

| Command                                                         | Description                                                  |
| :-------------------------------------------------------------- | :----------------------------------------------------------- |
| <kbd class="btn-kdb">i</kbd>                                    | Insert before the cursor.                                    |
| <kbd class="btn-kdb">I</kbd>                                    | Insert at the beginning of the line.                         |
| <kbd class="btn-kdb">a</kbd>                                    | Insert (append) after the cursor.                            |
| <kbd class="btn-kdb">A</kbd>                                    | Insert (append) at the end of the line.                      |
| <kbd class="btn-kdb">o</kbd>                                    | Append (open) a new line below the current line.             |
| <kbd class="btn-kdb">O</kbd>                                    | Append (open) a new line above the current line.             |
| <kbd class="btn-kdb">ea</kbd>                                   | Insert (append) at the end of the word.                      |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">h</kbd>  | Delete the character before the cursor.                      |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">w</kbd>  | Delete the word before the cursor.                           |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">j</kbd>  | Begin a new line.                                            |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">t</kbd>  | Shift the current line one tab to the right.                 |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">d</kbd>  | Shift the current line one tab to the left.                  |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">n</kbd>  | Insert the next completion of the word under the cursor.     |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">p</kbd>  | Insert the previous completion of the word under the cursor. |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">rx</kbd> | Insert the register x contents.                              |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">ox</kbd> | Temporarily enter Normal Mode to issue a single command.     |
| <kbd class="btn-kdb">ESC</kbd>                                  | Exit Insert Mode.                                            |

### Editing

Editing commands allow you to modify text, from single characters to entire lines.

| Command                                                        | Description                                                   |
| :------------------------------------------------------------- | :------------------------------------------------------------ |
| <kbd class="btn-kdb">r</kbd>                                   | Replace a single character.                                   |
| <kbd class="btn-kdb">R</kbd>                                   | Replace multiple characters.                                  |
| <kbd class="btn-kdb">J</kbd>                                   | Join line below to the current one with one space in between. |
| <kbd class="btn-kdb">gJ</kbd>                                  | Join line below to the current one without space in between.  |
| <kbd class="btn-kdb">gwip</kbd>                                | Reformat paragraph.                                           |
| <kbd class="btn-kdb">g~</kbd>                                  | Switch case of character under cursor.                        |
| <kbd class="btn-kdb">gu</kbd>                                  | Make character under cursor lowercase.                        |
| <kbd class="btn-kdb">gU</kbd>                                  | Make character under cursor uppercase.                        |
| <kbd class="btn-kdb">cc</kbd>                                  | Change (replace) an entire line.                              |
| <kbd class="btn-kdb">c$</kbd>                                  | Change (replace) to the end of the line.                      |
| <kbd class="btn-kdb">C</kbd>                                   | Change (replace) to the end of the line.                      |
| <kbd class="btn-kdb">ciw</kbd>                                 | Change (replace) the entire word.                             |
| <kbd class="btn-kdb">cw</kbd>                                  | Change (replace) to the end of the word.                      |
| <kbd class="btn-kdb">ce</kbd>                                  | Change (replace) to the end of the word.                      |
| <kbd class="btn-kdb">s</kbd>                                   | Delete character under cursor and substitute text.            |
| <kbd class="btn-kdb">S</kbd>                                   | Delete line and substitute text (same as cc).                 |
| <kbd class="btn-kdb">xp</kbd>                                  | Transpose two letters (delete and paste).                     |
| <kbd class="btn-kdb">u</kbd>                                   | Undo.                                                         |
| <kbd class="btn-kdb">U</kbd>                                   | Undo all changes on line.                                     |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">r</kbd> | Redo.                                                         |
| <kbd class="btn-kdb">.</kbd>                                   | Repeat last command.                                          |

### Marking Text (Visual Mode)

Visual Mode commands help you select text for further actions like copying or deleting.

| Command                                                        | Description                                                     |
| :------------------------------------------------------------- | :-------------------------------------------------------------- |
| <kbd class="btn-kdb">v</kbd>                                   | Start Visual Mode, mark lines, then do a command (like y-yank). |
| <kbd class="btn-kdb">V</kbd>                                   | Start linewise Visual Mode.                                     |
| <kbd class="btn-kdb">o</kbd>                                   | Move to other end of marked area.                               |
| <kbd class="btn-kdb">O</kbd>                                   | Move to other corner of block.                                  |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">v</kbd> | Start Visual Block Mode.                                        |
| <kbd class="btn-kdb">aw</kbd>                                  | Mark a word.                                                    |
| <kbd class="btn-kdb">ab</kbd>                                  | A block with ()                                                 |
| <kbd class="btn-kdb">aB</kbd>                                  | A block with {}                                                 |
| <kbd class="btn-kdb">at</kbd>                                  | A block with &lt;&gt;                                           |
| <kbd class="btn-kdb">ib</kbd>                                  | Inner block with ()                                             |
| <kbd class="btn-kdb">iB</kbd>                                  | Inner block with {}                                             |
| <kbd class="btn-kdb">it</kbd>                                  | Inner block with &lt;&gt;                                       |
| <kbd class="btn-kdb">Esc</kbd>                                 | Exit Visual Mode.                                               |

### Visual Commands

These commands operate on text selected in Visual Mode, such as shifting or copying.

| Command                         | Description                      |
| :------------------------------ | :------------------------------- |
| <kbd class="btn-kdb">&gt;</kbd> | Shift text right.                |
| <kbd class="btn-kdb">&lt;</kbd> | Shift text left.                 |
| <kbd class="btn-kdb">y</kbd>    | Yank (copy) marked text.         |
| <kbd class="btn-kdb">d</kbd>    | Delete marked text.              |
| <kbd class="btn-kdb">~</kbd>    | Switch case.                     |
| <kbd class="btn-kdb">u</kbd>    | Change marked text to lowercase. |
| <kbd class="btn-kdb">U</kbd>    | Change marked text to uppercase. |

### Registers

Registers store text for later use, enhancing copy-paste efficiency.

| Command                                 | Description                 |
| :-------------------------------------- | :-------------------------- |
| <kbd class="btn-kdb">:reg[isters]</kbd> | List all registers.         |
| <kbd class="btn-kdb">"xy</kbd>          | Yank text into register x.  |
| <kbd class="btn-kdb">"xp</kbd>          | Paste text from register x. |
| <kbd class="btn-kdb">"xP</kbd>          | Paste before cursor.        |
| <kbd class="btn-kdb">"+y</kbd>          | Yank into system clipboard. |

### Marks and Positions

Marks and positions let you bookmark and jump to specific locations in a file.

| Command                                                        | Description                      |
| :------------------------------------------------------------- | :------------------------------- |
| <kbd class="btn-kdb">:marks</kbd>                              | List all marks.                  |
| <kbd class="btn-kdb">ma</kbd>                                  | Set current position for mark a. |
| <kbd class="btn-kdb">a</kbd>                                   | Jump to mark a.                  |
| <kbd class="btn-kdb">y'a</kbd>                                 | Yank to mark a.                  |
| <kbd class="btn-kdb">0</kbd>                                   | Jump to start of line.           |
| <kbd class="btn-kdb">"</kbd>                                   | Jump to last edit position.      |
| <kbd class="btn-kdb">.</kbd>                                   | Jump to last edit position.      |
| <kbd class="btn-kdb"></kbd>                                    | Jump to last edit position.      |
| <kbd class="btn-kdb">:ju[mps]</kbd>                            | List all jump positions.         |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">o</kbd> | Jump to previous position.       |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">i</kbd> | Jump to next position.           |
| <kbd class="btn-kdb">:changes</kbd>                            | List all changes.                |
| <kbd class="btn-kdb">g,</kbd>                                  | Jump to previous change.         |
| <kbd class="btn-kdb">g;</kbd>                                  | Jump to next change.             |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">j</kbd> | Jump to next change.             |

### Macros

Macros record and replay sequences of commands to automate repetitive tasks.

| Command                       | Description              |
| :---------------------------- | :----------------------- |
| <kbd class="btn-kdb">qa</kbd> | Start recording macro a. |
| <kbd class="btn-kdb">q</kbd>  | Stop recording macro.    |
| <kbd class="btn-kdb">@a</kbd> | Execute macro a.         |
| <kbd class="btn-kdb">@@</kbd> | Execute last macro.      |

### Cut and Paste

Cut and paste commands handle copying, deleting, and moving text.

| Command                        | Description                                                                                     |
| :----------------------------- | :---------------------------------------------------------------------------------------------- |
| <kbd class="btn-kdb">yy</kbd>  | Yank (copy) a line.                                                                             |
| <kbd class="btn-kdb">2yy</kbd> | Yank (copy) 2 lines.                                                                            |
| <kbd class="btn-kdb">yw</kbd>  | Yank (copy) the characters of the word from the cursor position to the start of the next word.  |
| <kbd class="btn-kdb">y$</kbd>  | Yank (copy) to end of line.                                                                     |
| <kbd class="btn-kdb">yiw</kbd> | Yank (copy) inner word.                                                                         |
| <kbd class="btn-kdb">yaw</kbd> | Yank (copy) a word including the surrounding white space.                                       |
| <kbd class="btn-kdb">p</kbd>   | Put (paste) the clipboard after cursor.                                                         |
| <kbd class="btn-kdb">P</kbd>   | Put (paste) before cursor.                                                                      |
| <kbd class="btn-kdb">gp</kbd>  | Put (paste) after cursor.                                                                       |
| <kbd class="btn-kdb">gP</kbd>  | Put (paste) before cursor.                                                                      |
| <kbd class="btn-kdb">dd</kbd>  | Delete (cut) a line.                                                                            |
| <kbd class="btn-kdb">2dd</kbd> | Delete (cut) 2 lines.                                                                           |
| <kbd class="btn-kdb">dw</kbd>  | Delete (cut) the characters of the word from the cursor position to the start of the next word. |
| <kbd class="btn-kdb">D</kbd>   | Delete (cut) to the end of the line.                                                            |
| <kbd class="btn-kdb">d$</kbd>  | Delete (cut) to the end of the line.                                                            |
| <kbd class="btn-kdb">diw</kbd> | Delete (cut) inner word.                                                                        |
| <kbd class="btn-kdb">daw</kbd> | Delete (cut) a word including the surrounding white space.                                      |
| <kbd class="btn-kdb">x</kbd>   | Delete (cut) character.                                                                         |

### Indent Text

Indentation commands adjust text alignment, crucial for code formatting.

| Command                             | Description                 |
| :---------------------------------- | :-------------------------- |
| <kbd class="btn-kdb">&gt;&gt;</kbd> | Shift text right.           |
| <kbd class="btn-kdb">&lt;&lt;</kbd> | Shift text left.            |
| <kbd class="btn-kdb">&gt;%</kbd>    | Shift selected lines right. |
| <kbd class="btn-kdb">&lt;%</kbd>    | Shift selected lines left.  |
| <kbd class="btn-kdb">&gt;ib</kbd>   | Shift inner block right.    |
| <kbd class="btn-kdb">&lt;ib</kbd>   | Shift inner block left.     |
| <kbd class="btn-kdb">&gt;at</kbd>   | Shift block right.          |
| <kbd class="btn-kdb">&lt;at</kbd>   | Shift block left.           |
| <kbd class="btn-kdb">3==</kbd>      | Auto indent 3 lines.        |
| <kbd class="btn-kdb">=%</kbd>       | Auto indent selected lines. |
| <kbd class="btn-kdb">=iB</kbd>      | Auto indent inner block.    |
| <kbd class="btn-kdb">gg=G</kbd>     | Auto indent whole file.     |
| <kbd class="btn-kdb">]p</kbd>       | Paste and indent.           |

### Exiting

Exiting commands manage how you save and close files in VIM.

| Command                                   | Description                                |
| :---------------------------------------- | :----------------------------------------- |
| <kbd class="btn-kdb">:w</kbd>             | Write (save) the file, but don't exit.     |
| <kbd class="btn-kdb">:w !sudo tee %</kbd> | Write out the current file using sudo.     |
| <kbd class="btn-kdb">:wq</kbd>            | Write (save) and quit.                     |
| <kbd class="btn-kdb">:x</kbd>             | Write (save) and quit.                     |
| <kbd class="btn-kdb">ZZ</kbd>             | Write (save) and quit.                     |
| <kbd class="btn-kdb">:q</kbd>             | Quit (fails if there are unsaved changes). |
| <kbd class="btn-kdb">:q!</kbd>            | Quit and throw away unsaved changes.       |
| <kbd class="btn-kdb">ZQ</kbd>             | Quit and throw away unsaved changes.       |
| <kbd class="btn-kdb">:wqa</kbd>           | Write (save) and quit on all tabs.         |
| <kbd class="btn-kdb">:qa</kbd>            | Quit on all tabs.                          |

### Search and Replace

Search and replace commands help you find and modify text efficiently.

| Command                                   | Description                                                      |
| :---------------------------------------- | :--------------------------------------------------------------- |
| <kbd class="btn-kdb">/pattern</kbd>       | Search for pattern.                                              |
| <kbd class="btn-kdb">?pattern</kbd>       | Search backward for pattern.                                     |
| <kbd class="btn-kdb">\vpattern</kbd>      | Search for lines not containing pattern.                         |
| <kbd class="btn-kdb">n</kbd>              | Repeat search in same direction.                                 |
| <kbd class="btn-kdb">N</kbd>              | Repeat search in opposite direction.                             |
| <kbd class="btn-kdb">:%s/old/new/g</kbd>  | Replace all old with new throughout file.                        |
| <kbd class="btn-kdb">:%s/old/new/gc</kbd> | Replace all old with new throughout file with confirmations.     |
| <kbd class="btn-kdb">:s/old/new/g</kbd>   | Replace all old with new in the current line.                    |
| <kbd class="btn-kdb">:s/old/new/gc</kbd>  | Replace all old with new in the current line with confirmations. |
| <kbd class="btn-kdb">:noh[lsearch]</kbd>  | Remove highlighting of search matches.                           |

### Search in Multiple Files

These commands extend search capabilities across multiple files.

| Command                                                | Description                           |
| :----------------------------------------------------- | :------------------------------------ |
| <kbd class="btn-kdb">:vimgrep /pattern/ \{file\}</kbd> | Search for pattern in multiple files. |
| <kbd class="btn-kdb">:cn[ext]</kbd>                    | Jump to the next match.               |
| <kbd class="btn-kdb">:cp[revious]</kbd>                | Jump to the previous match.           |
| <kbd class="btn-kdb">:cope[n]</kbd>                    | Open a window containing the list.    |
| <kbd class="btn-kdb">:ccl[ose]</kbd>                   | Close the window.                     |

### Tabs

Tab commands manage multiple files in separate tabs for multitasking.

| Command                                                | Description                                                         |
| :----------------------------------------------------- | :------------------------------------------------------------------ |
| <kbd class="btn-kdb">:tabe</kbd>                       | Open a new tab.                                                     |
| <kbd class="btn-kdb">:tabnew \{page.words.file\}</kbd> | Open a new tab.                                                     |
| <kbd class="btn-kdb">gt</kbd>                          | Move to the next tab.                                               |
| <kbd class="btn-kdb">:tabn[ext]</kbd>                  | Move to the next tab.                                               |
| <kbd class="btn-kdb">gT</kbd>                          | Move to the previous tab.                                           |
| <kbd class="btn-kdb">:tabp[revious]</kbd>              | Move to the previous tab.                                           |
| <kbd class="btn-kdb">#gt</kbd>                         | Move to tab #.                                                      |
| <kbd class="btn-kdb">:tabm[ove] \{number\}</kbd>       | Move the current tab to the \{number\}th position (indexed from 0). |
| <kbd class="btn-kdb">:tabc[lose]</kbd>                 | Close the current tab.                                              |
| <kbd class="btn-kdb">:tabo[nly]</kbd>                  | Close all tabs except for the current one.                          |
| <kbd class="btn-kdb">:tabr[ewind]</kbd>                | Move to the first tab.                                              |
| <kbd class="btn-kdb">:tabfir[st]</kbd>                 | Move to the first tab.                                              |
| <kbd class="btn-kdb">:tabl[ast]</kbd>                  | Move to the last tab.                                               |
| <kbd class="btn-kdb">:tabs</kbd>                       | List all tabs.                                                      |
| <kbd class="btn-kdb">:tabdo</kbd>                      | Run a command for each open tab.                                    |
| <kbd class="btn-kdb">:tabdo \{cmd\}</kbd>              | Run \{cmd\} for each open tab.                                      |

### Working with Multiple Files

These commands handle multiple files using buffers and window splits.

| Command                                                         | Description                                              |
| :-------------------------------------------------------------- | :------------------------------------------------------- |
| <kbd class="btn-kdb">:e[dit] \{file\}</kbd>                     | Edit a file in a new buffer.                             |
| <kbd class="btn-kdb">:bn[ext]</kbd>                             | Go to the next buffer.                                   |
| <kbd class="btn-kdb">:bp[revious]</kbd>                         | Go to the previous buffer.                               |
| <kbd class="btn-kdb">:bd[elete]</kbd>                           | Delete a buffer.                                         |
| <kbd class="btn-kdb">:b[uffer]\{number\}</kbd>                  | Go to buffer \{number\}.                                 |
| <kbd class="btn-kdb">:b[uffer] file</kbd>                       | Go to buffer \{file\}.                                   |
| <kbd class="btn-kdb">:ls</kbd>                                  | List all open buffers.                                   |
| <kbd class="btn-kdb">:buffers</kbd>                             | List all open buffers.                                   |
| <kbd class="btn-kdb">:sp[lit] \{file\}</kbd>                    | Open a file in a new buffer and split window.            |
| <kbd class="btn-kdb">:vsp[lit] \{file\}</kbd>                   | Open a file in a new buffer and vertically split window. |
| <kbd class="btn-kdb">:vert[ical] ba[ll]</kbd>                   | Open a file in a new buffer and vertically split window. |
| <kbd class="btn-kdb">:tab ba[ll]</kbd>                          | Open a file in a new buffer and split window.            |
| <kbd class="btn-kdb">:tabe[dit] \{file\}</kbd>                  | Open a file in a new buffer and split window.            |
| <kbd class="btn-kdb">:tabnew \{file\}</kbd>                     | Open a file in a new buffer and split window.            |
| <kbd class="btn-kdb">:tab sball</kbd>                           | Open a file in a new buffer and split window.            |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">ws</kbd> | Split window.                                            |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">ww</kbd> | Move to the next window.                                 |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wq</kbd> | Close the current window.                                |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wv</kbd> | Split window vertically.                                 |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wh</kbd> | Move to the window on the left.                          |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wl</kbd> | Move to the window on the right.                         |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wj</kbd> | Move to the window below.                                |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wk</kbd> | Move to the window above.                                |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">w=</kbd> | Make all windows the same height.                        |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wH</kbd> | Move the current window to the far left.                 |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wL</kbd> | Move the current window to the far right.                |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wJ</kbd> | Move the current window to the bottom.                   |
| <kbd class="btn-kdb">Ctrl</kbd> + <kbd class="btn-kdb">wK</kbd> | Move the current window to the top.                      |

## Summary

This guide covers VIM’s essentials: navigating files, editing text, performing search-and-replace operations, and managing multiple files. With practice, these commands will boost your productivity in this powerful editor.

## References

- [VIM Official Website](https://www.vim.org/)
- [VIM Documentation](https://www.vim.org/docs.php)
- [VIM Adventures (Interactive Tutorial)](https://vim-adventures.com/)
- [OpenVIM (Interactive Tutorial)](https://www.openvim.com/)
- [VIM Cheat Sheet by vim.rtorr.com](https://vim.rtorr.com/)
- [A VIM Tutorial and Primer by Daniel Miessler](https://danielmiessler.com/p/vim/)
- [Learn Vim (the Smart Way) - Free Code Camp](https://www.freecodecamp.org/news/learn-vim-beginners-tutorial/)
- [Vim User Manual by Bram Moolenaar](http://vimdoc.sourceforge.net/htmldoc/usr_toc.html)
- [Practical Vim: Edit Text at the Speed of Thought (Book by Drew Neil)](https://pragprog.com/titles/dnvim2/practical-vim-second-edition/)
- [VIM Galore - A comprehensive guide to VIM](https://github.com/mhinz/vim-galore)
- [VIM Wiki](https://vim.fandom.com/wiki/Vim_Tips_Wiki)
- [Thoughtbot - Learn Vim](https://thoughtbot.com/upcase/vim)
- [Vimcasts - Free Vim Screencasts](http://vimcasts.org/)
- [Devhints VIM Cheat Sheet](https://devhints.io/vim)
- [Linux.com - An Introduction to the VIM Editor](https://www.linux.com/training-tutorials/vim-101-beginners-guide-vim/)
