Ubuntu – Changing Vim editor settings


How do I change default settings of Vim editor such as setting auto indent, setting Tab space to 4 and changing text colors? Also how to set vim as the default code editor?

Best Answer

Edit ~/.vimrc and put these in it:

set autoindent
set tabstop=4
colorscheme default

Note: type :colorscheme and hit Tab in order to find available colorsschemes installed for your Vim .

To use vim as default editor, use this

export EDITOR=/path/to/vim or simply export EDITOR=vim

or you can save this in your rc file

Related Question