3

I am using the Google Cloud Shell and wanted to install a theme for Vim. Adding the following to my .vimrc (using vim-plug as a plugin manager):

Plug 'mhartington/oceanic-next'

syntax enable

if (has("termguicolors"))
 set termguicolors
endif

colorscheme OceanicNext

But after doing so, everything appears in black and white:

Before: enter image description here

After: enter image description here

Has someone an Idea why that happens and how to solve this?

  • Can you explain what you mean by « install a theme for vim » (specific steps?) and what « appears in black and white » means? – D. Ben Knoble Dec 9 '18 at 14:29
  • What is CloudShell? Is that a terminal? Did you play around with setting the t_Co option value or the 'terminal' option value? – Christian Brabandt Dec 10 '18 at 7:07
  • It also would be interesting to know the value of $TERM in the shell. – statox Dec 10 '18 at 10:20
  • @ChristianBrabandt It is the cloud shell available on Google Cloud Platform, I think. – Blaszard Dec 10 '18 at 15:12
  • so is this a terminal? You need to configure it correctly. I guess, Vim cannot detect its features and therefore disables all sophisticated terminal features. As I said, play around with t_Co and the 'terminal' option value (try to use a builtin terminal) – Christian Brabandt Dec 10 '18 at 15:21
2

Christian Brabandt mentioned the right answer in his comment. It was the t_Co option I needed to set. And remove the termguicolors option.

My .vimrc looks now like this:

" Loading Plugin
call plug#begin('~/.vim/plugged')
Plug ('mhartington/oceanic-next')
call plug#end()

" Theme
syntax enable
set t_Co=256
colorscheme OceanicNext

The confusion came cause I followed the installation instructions on GitHub which say, that I should use set termguicolors with vim 8. And I have vim 8 installed but needed to use the instructions for vim 7.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy