Skip to content

Instantly share code, notes, and snippets.

@the0neWhoKnocks
Last active December 17, 2022 00:18
Show Gist options
  • Save the0neWhoKnocks/ece1903a179aeb16619768ba44570abe to your computer and use it in GitHub Desktop.
Save the0neWhoKnocks/ece1903a179aeb16619768ba44570abe to your computer and use it in GitHub Desktop.
vim commands and settings

Vim


Commands

Normal Mode (commands prefixed with : may require ESC beforehand)

Command Description
:? Search for text. n for next result, SHIFT+n for previous result.
:m <Number> Move the current line after line <NUMBER>.
:q Quit/exit editor. :q! to exit if there are unsaved changes.
:x Save changes and close.
dd Delete current line.

Insert Mode

Command Description
CTRL+D Undent
CTRL+T Indent

.vimrc

" file type detection
filetype on

" syntax highlighting
syntax on

" lint numbers
set number

" highlight row
set cursorline

" indent spacing
set shiftwidth=2
set tabstop=2

" case insensitive search
set ignorecase
" but allow for specifically cased search
set smartcase
" highlight found words
set showmatch

" show mode
set showmode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment