Skip to content

Instantly share code, notes, and snippets.

@anthonyclarka2
Created October 4, 2019 18:54
Show Gist options
  • Save anthonyclarka2/ce925a305d3f66402c4a28c08422697b to your computer and use it in GitHub Desktop.
Save anthonyclarka2/ce925a305d3f66402c4a28c08422697b to your computer and use it in GitHub Desktop.
snippet of vimrc to set tabs to 2 spaces
" Copy and paste below line into remote vim sessions that aren't configured:
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
" Add the following to your ~/.vimrc to make it permanent:
set tabstop=2 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.
set shiftwidth=2 " Indents will have a width of 4
set softtabstop=0 " Sets the number of columns for a TAB
set expandtab " Expand TABs to spaces
" Use :retab to convert existing tab to spaces
" Cargo-Culted from https://stackoverflow.com/questions/1878974/redefine-tab-as-4-spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment