Friday, July 16, 2004

Turn off colors in Linux vi editor

to turn off colors in vi type

:syntax off


to turn them back on (they will automatically turn on the next time you enter vi)
:syntax enable


to get help on colors in vi

:help usr_06.txt




if you get into vi and type :version

there should be a directory with a "system vimrc" file in it

something like /usr/share/vim/vim61/macros/vimrc

if you edit it as root, then find the lines that say something like if &t_Co >2 etc
and syntax on and set hlsearch

it is an if statement.

just put a double quotes " at the beginning of each line of that if statement
to the end if

and save :w and quit :q

now vi should be in good old black & white.


you could have also made a personal .vimrc file with some such crap in it but that would be hard.


by the way, now the default is b&w you can enable the colors temporarily with :syntax enable

tada.

-gh