Vim no color - disable colors in text editor

vim
centos
vi-text-editor

#1

Whenever I open a shell script in vim, it shows colors and syntax highlighting. How dp I turn off all colors in vim text editor running on CentOS Linux system?


#2

That is easy task open vim:

vim file.sh

Type (press Esc + :)

syntax off

How to disable colors i…e turn off all colors in vim?

Edit a file named .vimrc in your home directory with the following command:

vim $HOME/.vimrc

Append the following

syntax off
set nohlsearch
set t_Co=0

Save and close the file. You won’t see any color when you open the script in vim:
Screenshot%20from%202018-08-14%2017-57-14

Conclusion

You can enable or disable colors by simply typing the following command in vim or in ~/.vimr (vim config file):

Turn it on

syntax on

Turn it off

syntax off

See