I'm trying to use vim via the terminal on Cloud9, and whilst functionally it works perfectly, I can't get themes to work properly.

I've tried Molokai and Badwolf (putting colorscheme molokai or colorscheme badwolf in ~/.vimrc), but neither look like the screenshots provided. I've also tried changing the theme in Preferences → Themes, but the terminal background appears to be being set to either white (flat theme) or dark blue (classic theme) instead of actual black.

I'm aware of the way terminal colours work (the application says 'red' and the terminal interprets that however it's been configured, whether that's #FF0000 or #CC2323), but I can't find an obvious way to change this palette of colours in Cloud9.


After some searching and use of the built-in editor (Ace) in vim mode, I've found that you can change the terminal text, background and selection colours in the preferences under Preferences → Settings → Editors → Terminal.


This is caused because Cloud9 leverages screen as a terminal. Screen sets the $TERM environment variable to screen, which Vim does not recognize.

This is solved by adding set t_Co=256 to your .vimrc file, which tells Vim that the terminal is capable of displaying 256 colors. This is the case, since the current release of Cloud9 is based on Ubuntu 14.04 LTS, where screen is capable of displaying 256 colors.

This addition produces the following:

256 Color Support

Running export TERM=xterm-256color or export TERM=xterm before invoking Vim will have similar results:

TERM set to xterm

Alternatively, you can add the following to your .vimrc to set TERM appropriately when Vim is invoked:

if match($TERM, "screen")!=-1
  set term=xterm

Your Answer

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