# Ubuntu – Permanently convert tabs to spaces in vi / vim

vim

If I wanted to have traditional indentation in vi / vim, I would enter these commands:

:set tabstop=4
:set shiftwidth=4
:set expandtab


It is tedious to type those commands every time I open a file. How do I permanently store those settings?

Create a file in your home directory called .vimrc, and put your commands in there:
set tabstop=4