Key | Function |
---|---|
Esc | Gets out of the current mode into the “command mode”. All keys are bound of commands |
i | “Insert mode” for inserting text. Keys behave as expected |
v | Enter visual mode per character |
V | Enter visual mode per line |
: | “Last-line mode” where Vim expects you to enter a command such as to save the document. |
:/search_text | Search document for search_text going forward |
:?search_text | Search document for search_text going backward |
:q | Quits Vim but fails when file has been changed |
:w | Saves the file |
:w new_name | Save the file with the new_name filename |
:wq | Save the file and quit Vim |
:q! | Quit Vim without saving the changes to the file |
ZZ | Write file, if modified, and quit Vim |
## General
set number # Show line numbers
set linebreak # Break lines at word (requires Wrap lines)
set showbreak=+++ # Wrap-broken line prefix
set textwidth=100 # Line wrap (number of cols)
set showmatch # Highlight matching brace
set spell # Enable spell-checking
set visualbell # Use visual bell (no beeping)
set hlsearch # Highlight all search results
set smartcase # Enable smart-case search
set ignorecase # Always case-insensitive
set incsearch # Searches for strings incrementally
set autoindent # Auto-indent new lines
set shiftwidth=4 # Number of auto-indent spaces
set smartindent # Enable smart-indent
set smarttab # Enable smart-tabs
set softtabstop=4 # Number of spaces per Tab
## Advanced
set ruler # Show row and column ruler information
set undolevels=1000 # Number of undo levels
set backspace=indent,eol,start # Backspace behaviour
## Generated by VimConfig.com
dougblack
https://www.maketecheasier.com/vim-keyboard-shortcuts-cheatsheet/
https://gist.github.com/awidegreen/3854277
https://vim.rtorr.com/