Vim - Commands

Notation

NotationMeaning
Key 1 + Key 2Hold Key 1 and press Key 2
Key 1 , Key 2Press Key 1, then press Key 2

Modes are shown by their keybindings.

BindingMeaning
-Applies to all modes (Do not enter -)
EscNormal mode
Esc , :Command mode
Esc , iInsert mode
Esc , vVisual mode

Shortcuts

OperationModeCommand
Move to between tabs-Ctrl + Pg Up or Ctrl + Pg Dn
Copy a lineEscyy
Cut a lineEscdd
Paste at the cursorEscP
Paste after the cursorEscp
Go to file (the path is under the cursor)Escgf
Go to the previous cursor location (may be in a different file)EscCtrl + o
Go to the next cursor location (may be in a different file)EscCtrl + i
Replace a characterEscr
Open a file in a new tabEsc , :tabnew /path/to/file
Move to the end of a lineEsc , iCtrl + o , $
Select wordEsc, viw
Turn off highlighting for the last searched wordEsc , :noh
Replace the start the selected line(s) with # (Useful for commenting lines out in bash)Esc , vs/^/# /
Paste into the bufferEsc , :Ctrl + r , +
UndoEscu
RedoEscCtrl + r
Count wordsEsc , vg , Ctrl + g
Enclose line in parentheses/brackets (())Escbcw() , Esc , P
Record a macro (...) , binded to aEscqa, ... , Esc, q

Additional shortcuts

OperationModeCommandRequirement
List spelling options for a wordEscz=set spell=on in init.vim file
Show live preview of markdown fileEsc , :MarkdownPreviewInstall the plugin: ‘iamcco/markdown-preview.nvim’
Compile codeEsc , :QuickRunInstall the plugin: ‘thinca/vim-quickrun’

pacman - Remove orphaned packages

ClamAV - Speed up slow scans