Skip to content

Instantly share code, notes, and snippets.

@RobyCigar
Created September 10, 2021 13:42
Show Gist options
  • Save RobyCigar/13132c9c741a94da8e8f3c64cb02108a to your computer and use it in GitHub Desktop.
Save RobyCigar/13132c9c741a94da8e8f3c64cb02108a to your computer and use it in GitHub Desktop.

Posted on May 6, 2020 by admin Changing vim indentation and tab width to 2 spaces

You can add the configuration in the ~/.vimrc file

vim ~/.vimrc

Or add it through a separate plugin file

mkdir -p ~/.vim/plugin vim ~/.vim/plugin/indent.vim

And add the following lines to it

" Set tab width to 2 columns set tabstop=2 " Use 2 columns for indentation set shiftwidth=2 " Use spaces when pressing key set expandtab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment