The vi/vim configuration file is located @ $HOME/.exrc. of it does not exist, just create it.
$HOME/.exrc
:set number :set ts=2
Your vi now will have tab size = 2 and line number is shown.
More useful settings
- :set – all Display all Set options
- :set autoindent – Indent following lines to the indentation of previous line.
- :set ts=4 – set tab stop to 4 char
- :set ignorecase – Ignore case during pattern matching.
- :set list – Show special characters in the file.
- :set number – Display line numbers.
- :set shiftwidth=n – Width for shifting operators << and >>
- :set showmode – Display when in Insert, Append, or Replace mode.
- :set wrapmargin=n – Set right margin 80-n for autowrapping lines (inserting newlines). 0 turns it off.
Done =)
Reference: how to change the tab size in vi?
