简体   繁体   English

Neovim +彩虹

[英]Neovim + rainbow

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. 我正在尝试学习Clojure时尝试使用Rainbow插件( https://github.com/luochen1990/rainbow )。

I do have TERM=xterm-256color set in my shell (zsh, if it matters). 我的外壳中确实设置了TERM=xterm-256color (如果重要,请使用zsh)。

I've also tried running nvim as COLORTERM=xterm-256color TERM=xterm-256color nvim 我也尝试过将Nvim运行为COLORTERM=xterm-256color TERM=xterm-256color nvim

Here are my results: 这是我的结果:

vim: VIM:

Vim结果

nvim: nvim:

Neovim结果

If anyone has any advice or settings to try, I'd be extremely obliged. 如果有人有任何建议或设置可以尝试,我将非常有义务。 Thanks very much! 非常感谢!

Seems your not the only one to notice https://github.com/luochen1990/rainbow/issues/31 似乎您不是唯一一个注意到的人https://github.com/luochen1990/rainbow/issues/31

It looks like something doesn't work properly to activate the plugin in neovim. 在neovim中激活插件似乎无法正常工作。 Adding the following to your nvimrc 将以下内容添加到您的nvimrc中

let g:rainbow_active = 1
autocmd VimEnter * RainbowToggle

makes the plugin work for me. 使插件为我工作。

The autocmd just forces the plugin to start. autocmd只是强制插件启动。 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. 经过更多挖掘后,您似乎只需要将以下内容放入您的nvimrc中。

syntax on
let g:rainbow_active = 1

The auto command gets fired on syntax on assuming g:rainbow_active is in your nvimrc. 如果假设g:rainbow_active在您的nvimrc中,则会在syntax on触发auto命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM