Things I learned about Vi(m)

Here’s my personal documentation on Vi(m) in case I forget how I did it. Hope it helps someone.

Running Debian Jessie and I want:
– to make Vim the systemwide default editor;
– to have syntax highlighting;
– a nice colour scheme.

For the colour scheme and syntax highlighting we need to install some additional packages:


Set up syntax highlighting in ~/.vimrc for individual users or /etc/vim/vimrc systemwide (users’ config overrides system):

syntax on
if has("autocmd")
  filetype plugin indent on

Define amount of spaces in a tab:

set ts=2

…where 2 is the number of spaces.

Set line numbering:

set number

Set colour scheme:

" colorscheme blue
" colorscheme darkblue
" colorscheme default
colorscheme delek
" colorscheme desert
" colorscheme elflord
" colorscheme evening
" colorscheme industry
" colorscheme koehler
" colorscheme morning
" colorscheme murphy
" colorscheme pablo
" colorscheme peachpuff
" colorscheme ron
" colorscheme shine
" colorscheme slate
" colorscheme torte
" colorscheme zellner

Set Vim as the default editor in /etc/bash.bashrc or override in ~/.bashrc:

export EDITOR=vim

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top