Neovim + rainbow

3.1k views Asked by At

Asking a question here worked before about this type of issue, so I will try again.

I'm trying to use the rainbow plugin (https://github.com/luochen1990/rainbow) while learning clojure.

I do have TERM=xterm-256color set in my shell (zsh, if it matters).

I've also tried running nvim as COLORTERM=xterm-256color TERM=xterm-256color nvim

Here are my results:

vim:

Vim results

nvim:

Neovim results

If anyone has any advice or settings to try, I'd be extremely obliged. Thanks very much!

1

There are 1 answers

4
FDinoff On BEST ANSWER

Seems your not the only one to notice https://github.com/luochen1990/rainbow/issues/31

It looks like something doesn't work properly to activate the plugin in neovim. Adding the following to your nvimrc

let g:rainbow_active = 1
autocmd VimEnter * RainbowToggle

makes the plugin work for me.

The autocmd just forces the plugin to start. If the plugin gets updated this might make it stop working since it could toggle it off.


Second answer

After more digging it appears you only need to put the following into your nvimrc.

syntax on
let g:rainbow_active = 1

The auto command gets fired on syntax on assuming g:rainbow_active is in your nvimrc.