Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change coc.nvim floating window colors?

I'm using coc.nvim plugin for C++ in my vim editor, here it's showing error but its colors hurt my eyes, I've been searching for solution but still don't know how to customize the colors

cocnvim floating window color

like image 645
Hoang Minh Avatar asked Oct 03 '20 03:10

Hoang Minh


People also ask

How to get color scheme autocommand in Vim?

If it is not Pmenu (maybe it is float window of neovim or popup of vim) then you'll have to dig out how coc passes colors to them. ColorScheme autocommand is triggered when colorscheme is changed. You change colorscheme before autocommand is defined.

How do I change the color of a group in COC?

if found something related to coc, try to change color of the group using :hi coc-group guibg=red or smth similar. ( coc-group is an example here). If it is not Pmenu (maybe it is float window of neovim or popup of vim) then you'll have to dig out how coc passes colors to them.

How do I get the currently attached UI in Neovim?

We begin by creating the buffer which will be shown in the floating window. Neovim provides the nvim_create_buf () function to create an unlisted buffer and return its reference. We then need to call nvim_list_uis () to get the currently attached UIs.

How to change the color of a suggestion box in Vim?

I assume that by suggestion box you mean regular vim Pmenu. if found something related to coc, try to change color of the group using :hi coc-group guibg=red or smth similar. ( coc-group is an example here). If it is not Pmenu (maybe it is float window of neovim or popup of vim) then you'll have to dig out how coc passes colors to them.


2 Answers

To choose another background color you can use

:highlight CocFloating ctermbg=color

And to change the foreground (text) color of the error message use

:highlight CocErrorFloat ctermfg=color

where color is either a color name or a color number (generally from 0 to 15).

To read more on color values

:h cterm-colors

GUI

If you want to use a GUI for vim, you should consider using guibg and guifg arguments in addition to ctermbg and ctermfg.

guifg and guibg value is either a color name or a hex-encoded RGB value (ex. #ff0000 for red).

GUI color values can be found here

:h gui-colors
like image 68
Slavik303 Avatar answered Oct 19 '22 17:10

Slavik303


In their github Discussion, there is a conversation that can solve all problems with Coc FloatingWindow:

here is the link: enter link description here

like image 1
alumen- Avatar answered Oct 19 '22 17:10

alumen-