Original post
I've got a colorscheme configured in my .vimrc but sometimes I'd like to turn it off completely which means that I would like Vim to use the default background and foreground colors of my terminal.
My problem is that I don't know how to easily do it. When I use :syntax off
Vim turns off most of its coloring but it doesn't remove the cursorline color. It doesn't change the background color to the terminal's default one.
Is there a command like :nocolorscheme
or vim -u NONE
but just for the colors?
I am aware of the fact that I can create a custom .vimrc file and load it with the -u
option. I am looking for an easier solution though.
Major update
Because you've suggested me a number of different commands and approaches I decided to show you some photos of the screen after calling those commands.
Terminal envirnoment
I use st(1) terminal from suckless.org with a custom config.h so that I've got defaultfg = 10
(bright green) and defaultbg = 0
(black). I'm running the GNU/Linux version that PocketC.H.I.P. ships with (uname -a
results in Linux chip 4.3.0-ntc #1 SMP Wed May 11 21:57:30 UTC 2016 arm7l GNU/Linux).
Screenshots
No colorscheme (this is what I want)
This is what I want to achieve without having to start Vim with
vim -u NONE
.Normal colors
I get these colors when:
- I normally start my Vim (this is my standard colorscheme).
I call
:set t_Co=0
.
It is worth noting that it doesn't change anything when I use my custom monokai colorscheme. It does change the appearance in the default colorscheme as you can see in 5.The funny thing is that the output of
:verbose set t_Co?
called subsequently ist_Co=256
which indicates that literaly nothing has changed.I start Vim with
TERM=xterm vim
.
Default colors
I get these colors when:
- I call
:colorscheme default
.
- I call
Vim removed most of colors but doesn't fall back into terminal's defaults
I get it after:
- Calling
:syntax off
.
- Calling
Almost no colorscheme
I get this after running these 4 commands one after another:
" The effect is more visible on the default colorscheme " than on my molokai colorscheme. :set t_Co=0 :colorscheme default :hi clear
When I run
:hi LineNr
afterwards I get:LineNr XXX term=underline ctermfg=6 guifg=Brown
Strings and types underlined in a C source file
After applying
:set term=vt100
.Broken redrawing in Vim
Vim broke after calling :set term=builtin_dumb (video)After applying
:set term=builtin_dumb
my Vim forgets how to redraw lines as I move around using j and k.Examine the defaults of my temrminal
This is what I get after running
echo -e " \033[0;4mfoo\033[0;0mbar"
in my terminal.
vim -u NONE
it inherits the terminal's defaults. Thanks for pointing that out.:set t_Co=0
, immediately followed by:verbose set t_Co?
What is t_Co set to? (I'm wondering if somehow it's not getting set correctly: my only guesses are that possibly you've got an autocommand that resets it, or there is a bug that is causing it not to be set.):set t_Co=0
doesn't work when the colorscheme is set to monokai.