See vimcast 1 video
To set the options - use :set instruction. Example:
:set ts=4
:set shiftwidth=4
:set expandtab
:set autoindent
To view the current value of the option - type :set {option}?. Example:
:set ts?
To reset the value of the option to its default - type :set {option}&. Example:
:set ts&
To make indentations 4 spaces wide:
:set shiftwidth=4
To use spaces as indents, 4 spaces wide:
:set expandtab
:set softtabstop=4
softtabstop and sts are equivalent:
:set sts=4
To use tabs as indents, 4 spaces wide:
:set noexpandtab
:set tabstop=4
tabstop and ts are equivalent:
:set ts=4
:set autoindent
| Instruction | Description | Default |
|---|---|---|
| tabstop | width of tab character | 8 |
| expandtab | causes spaces to be use instead of tab character | off |
| softabstop | tune the whitespace | 0 |
| shiftwidth | determines whitespace amount when in normal mode | 8 |
To show invisible characters:
:set list
To hide invisible characters:
:set nolist
To toggle between showing and hiding invisible characters:
:set list!
| Symbol | Character |
|---|---|
| ^I | Tab |
| $ | New Line |
To set the tab character to **> ** and the new line character to ¬
set listchars=tab:>\ ,eol:¬
To set the spaces to _
set listchars=spaces
To see a list of character options
:help listchars
:set [no](option|shortcut):set (option|shortcut)=value:set (option|shortcut)(?|&): in the vimrc file