Common Settings in Vim

From the Vim cheat sheet · Settings & Customization · verified Jul 2026

Common Settings

Useful Vim settings and options

text
:set number or :set nu - Show line numbers
:set nonumber or :set nonu - Hide line numbers
:set relativenumber or :set rnu - Relative line numbers
:set wrap - Enable line wrapping
:set nowrap - Disable line wrapping
:set ignorecase or :set ic - Case insensitive search
:set smartcase - Smart case search
:set hlsearch - Highlight search results
:set incsearch - Incremental search
:set expandtab - Use spaces instead of tabs
:set tabstop=4 - Set tab width
:set shiftwidth=4 - Set indent width
:set autoindent - Auto indent new lines
:set paste - Paste mode (preserves formatting)
:set nopaste - Exit paste mode
:syntax on - Enable syntax highlighting
:set background=dark - Dark background
:colorscheme name - Change color scheme
💡 Add settings to ~/.vimrc for persistence
⚡ :set paste before pasting formatted code
📌 number + relativenumber for hybrid line numbers
🟢 Start with :set number and :syntax on
settingsconfiguration
Back to the full Vim cheat sheet