vim tab settings
Created on July 3, 2026
vim
Set expandtab to use spaces, noexpandtab to use tabs, plus 3 more relevant settings.
:set expandtab
:set tabstop=4
:set shiftwidth=4
:set softtabstop=4
- expandtab – Insert spaces instead of literal tab (\t) characters.
- tabstop=4 – Display existing tab characters as 4 columns wide.
- shiftwidth=4 – Indent/unindent by 4 spaces when using >>, <<, ==, or autoindent.
- softtabstop=4 – Make the Tab and Backspace keys behave as if a tab is 4 spaces.