How to change coc.nvim floating window colors? - text-editor

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

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

In their github Discussion, there is a conversation that can solve all problems with Coc FloatingWindow:
here is the link:
enter link description here

Related

vim colorschemes not displaying properly

I'm running vim in the default Mac terminal and I'm trying to change the color scheme to one of the included color schemes, but none of them seem to be displaying properly.
For example, if I type :colorscheme blue, the colors change but there is a white border around the background.
Additionally, if I type :colorscheme desert, which is the color scheme I want to use, the syntax highlighting changes, but the background color does not.
Note that the desert color scheme is ostensibly supposed to look like this:
Why are these color schemes not displaying properly, and is there a way to fix them? Thanks!
vim's set background={light|dark} is not designed to change your background color, it is designed to work with your existing background color and give you colors that show up on that background.
Some colorschemes have multiple options to try and reproduce what the designers wanted in a variety of settings. For example, the colorscheme I am using has a base section with all the color settings followed by a 256 color specific section:
....
hi LineNr guifg=#465457 guibg=#232526
if &t_Co > 255
hi Normal ctermfg=252 " ctermbg=232
hi CursorLine ctermbg=234 cterm=none
...
which sets all the colors based on having a 256 color terminal, so that way people with 256 color terminals can still get close to what the colorscheme author intended, since a 256 color terminal cannot draw RRGGBB colors.
Likewise, colorschemes can respect background and change the colors they are using to be visible on that background color (so dark terminals don't have comments as dark blue, for example).
Lastly, vim only attempts to draw the background where it can draw characters, i.e., only the printable area of the screen. If your terminal width is, for instance, between 64 and 65 COLUMNS wide, then vim can only draw 64 characters, and there will be some space around the edges where vim doesn't try to draw, leaving the terminal's default background.
On Mac's Terminal.app, the easiest way to change your background color is to go to Preferences -> Profiles and either choose a default theme or edit the Background "Colors & Effects" section to be what you want.

How to change low contrast highlight in default vim color scheme

I am using vim with the default color scheme on dark background, but in many cases, the white font is highlighted with light pink color, making it hard to read. How do I fix this (change highlight color) in the default color scheme?
Here is an example of the problem:
You can override the colors displayed with the :highlight command, which can be called from your vimrc. The documentation is really quite good for this, and can be read here: http://vimdoc.sourceforge.net/htmldoc/syntax.html#:highlight.

vim cursorline not working properly

I have the following in my .vimrc:
hi CursorLine ctermfg=00 ctermbg=00 cterm=bold
I should be unable to read the line the cursor is on, but I am able, because the text appears in grey. If I remove cterm=bold, I get true black, so it seems to be black or bold, but not both. Is "bold" a variable for a color in the theme (solarized light)? Or is my terminal theme overriding the fg color somehow? I get the exact same results in various terminal apps (on Xubuntu).
By typing :help attr-list you will get a whole list of possible values for cterm argument:
bold underline undercurl
inverse italic standout
term={attr-list} attr-list highlight-term E418
attr-list is a comma separated list (without spaces) of the
following items (in any order):
bold
underline
undercurl not always available
reverse
inverse same as reverse
italic
standout
NONE no attributes used (used to reset it)
These terms are not colors but they are considered as typographical emphasis. They add more font and shape to the text.
First, highlighting of the cursorline is disabled by default so there's no reason whatsoever to hack your colorscheme if you don't want it: just don't enable it. For the record, that feature is enabled with :set cursorline and disabled with :set nocursorline.
See :help 'cusorline'.
Second, the "bold" keyword is passed more or less directly to your terminal emulator which is ultimately in charge of deciding what to do with it. It may display "bold" text with a bolded font or use a brighter or color or… whatever. Use "bold" only if you know how your terminal emulator will react to it.
Third, Solarized is an over-engineered and very poorly written colorscheme that's a lot harder to hack than necessary. It's really a bad platform for experiments and customization.

How to change the folded part color on Vim

I fold some of the functions on my C code. When I fold them, the color becomes gray. Is there any way to change the color of folded part to another color?
You can use the :highlight setting. For instance, to set the background to red, add this to your .vimrc:
highlight Folded ctermbg=red
You can view a list of supported colour names by running :source $VIMRUNTIME/syntax/colortest.vim. ctermbg updates the console background; ctermfg updates the console foreground; and guibg & guifg update gvim's background and foreground colours. If you're changing gvim's settings, you can use whatever hex code you like (you don't have to restrict yourself to supported colours).
Type :verbose hi it will describe you all the highlighting groups and where they are defined. There is probably one describing the Fold but I don't know the group name by heart.

How to base vim colors off of iTerm colors?

I recently updated my iTerm color scheme and when I make a selection in visual mode (using vim) the color is awful. iTerm has some color options for Selection and Selection text what I would like to use as guibg and guifg respectivly. I tried this in my vim config but couldn't get it to work.
hi Visual guifg=SelectionText guibg=Selection
Is this possible to do?
As far as I know, the colors used for text, background, selection and friends are not exported by iTerm so what you want is out of reach.
Instead, use the same color you used in the settings window, converted to its nearest neighbor in the xterm palette.
Also, you are supposed to use ctermbg and ctermfg as guibg and guifg are, obviously, for GUI Vim and thus wrong and useless in your situation.
Example:
hi Visual ctermfg=16 ctermbg=67

Resources