open vimrc during a vim editing session

While editing a file, you want to do something, google it and need to make a change to your vimrc.

This can be done with the command

:e $MYVIMRC

You now need to load the new settings. Do this with

:so $MYVIMRC

or, if your vimrc is the current file

:so %

Advertisements

vim tabs to spaces

Add to vimrc file:
set expandtab
inserts spaces when tab key is pressed.

The number is set (to 4 by example) by
set tabwidth=4
and
set shiftwidth=4
sets the number of spaces to use for indentation.