This page looks best with JavaScript enabled

VI theme configuration

 ·  🎃 kr0m

Properly visualizing a file can help us debugging scripts, code or configuration files, in this article, I will explain how to configure VI with this objective.

First, we check the available themes:

ls -la /usr/local/share/vim/vim90/colors/

total 247
drwxr-xr-x   4 root  wheel     30 Jul  7 22:24 .
drwxr-xr-x  19 root  wheel     37 Jul  7 22:24 ..
-rw-r--r--   1 root  wheel   4694 Jul  2 09:48 README.txt
-rw-r--r--   1 root  wheel  25030 Jul  2 09:48 blue.vim
-rw-r--r--   1 root  wheel  20973 Jul  2 09:48 darkblue.vim
-rw-r--r--   1 root  wheel    548 Jul  2 09:48 default.vim
-rw-r--r--   1 root  wheel  19562 Jul  2 09:48 delek.vim
-rw-r--r--   1 root  wheel  18911 Jul  2 09:48 desert.vim
-rw-r--r--   1 root  wheel  21039 Jul  2 09:48 elflord.vim
-rw-r--r--   1 root  wheel  23341 Jul  2 09:48 evening.vim
-rw-r--r--   1 root  wheel  22574 Jul  2 09:48 habamax.vim
-rw-r--r--   1 root  wheel  19242 Jul  2 09:48 industry.vim
-rw-r--r--   1 root  wheel  19963 Jul  2 09:48 koehler.vim
drwxr-xr-x   2 root  wheel      4 Jul  7 22:24 lists
-rw-r--r--   1 root  wheel  49870 Jul  2 09:48 lunaperche.vim
-rw-r--r--   1 root  wheel  18993 Jul  2 09:48 morning.vim
-rw-r--r--   1 root  wheel  18564 Jul  2 09:48 murphy.vim
-rw-r--r--   1 root  wheel  20429 Jul  2 09:48 pablo.vim
-rw-r--r--   1 root  wheel  19628 Jul  2 09:48 peachpuff.vim
-rw-r--r--   1 root  wheel  38980 Jul  2 09:48 quiet.vim
-rw-r--r--   1 root  wheel  46456 Jul  2 09:48 retrobox.vim
-rw-r--r--   1 root  wheel  21057 Jul  2 09:48 ron.vim
-rw-r--r--   1 root  wheel  19721 Jul  2 09:48 shine.vim
-rw-r--r--   1 root  wheel  21037 Jul  2 09:48 slate.vim
-rw-r--r--   1 root  wheel  21318 Jul  2 09:48 sorbet.vim
drwxr-xr-x   2 root  wheel      3 Jul  7 22:24 tools
-rw-r--r--   1 root  wheel  20093 Jul  2 09:48 torte.vim
-rw-r--r--   1 root  wheel  40572 Jul  2 09:48 wildcharm.vim
-rw-r--r--   1 root  wheel  23986 Jul  2 09:48 zaibatsu.vim
-rw-r--r--   1 root  wheel  19519 Jul  2 09:48 zellner.vim

We must instruct to load the theme. I am showing the entire configuration as it is valid in FreeBSD and can be very useful:

vi .vimrc

set nocompatible
set mouse=
set backspace=indent,eol,start
set termguicolors
set t_Co=256
syntax on
colorscheme torte

We can see how the scripts look like:

BASH/PHP PYTHON/ASM
If you liked the article, you can treat me to a RedBull here