vim - text editor


Favourite config

edit config

vi ~/.vimrc
syntax on
colorscheme desert
highlight Comment ctermfg=Cyan guifg=Cyan

Changing the scheme

Inside of editor

:colorscheme [tab]

Once happy, add to the config

Indent text in vim

Using VISUAL mode

before you want to ensure you prefer TABs or SPACEs (and you not prefer TABs).

set expandtab

Define depth of indention.

:set shiftwidth=2

Enable VISUAL mode V, select text, press >

without VISUAL mode

Enable numbering

:set number

Command below will indent lines 9--16 by width configured above.

9,16>

(I use it to correct 2 spaces into 4 spaces.)

undo is your friend, press u