statox / blog-comments

Hosting comments for www.statox.fr
1 stars 0 forks source link

"Using Neovim's floating window to break bad habits" #23

Open statox opened 3 years ago

pyrho commented 3 years ago

🚀

bsjaramillo commented 3 years ago

Hi i readed yout post, how can i change the background color or set colorscheme for the window ?

statox commented 3 years ago

@bsjaramillo You can't set a colorscheme for a specific window. What you can do is to play with the highlighting as I showed in the article. You will need to find back this line and change the highlighting group used for Normal:

call nvim_win_set_option(win, 'winhl', 'Normal:ErrorFloat')

For example you could define your own highlighting group and use it like this:

highlight CustomFloatingWindow ctermbg=11 guibg=yellow ctermfg=10 guifg=green
call nvim_win_set_option(win, 'winhl', 'Normal:CustomFloatingWindow')

You get something quite ugly but then you just have to tweak the colors:

image

Some interesting resources: