I understand that I can change my coc.nvim colours from inside neovim, but how do I do so permanently from the init.vim file (or otherwise), so that they're changed automatically every time I open the editor?
func! s:my_colors_setup() abort
highlight CocFloating ctermbg=color " For background color
highlight CocErrorFloat ctermfg=color " For text color
endfunc
augroup colorscheme_coc_setup | au!
au VimEnter * call s:my_colors_setup()
augroup END
On your init.vim file you can write the following:
func! s:my_colors_setup() abort
highlight CocFloating ctermbg=color " For background color
highlight CocErrorFloat ctermfg=color " For text color
endfunc
augroup colorscheme_coc_setup | au!
au VimEnter * call s:my_colors_setup()
augroup END
This works by calling the highlight command on a function that gets called when vim starts.
CocErrorFloat changes the text color for error popups, you could also change warnings, infos and hints with CocWarningFloat, CocInfoFloat and CocHintFloat respectively.
发布评论
评论(1)
我的解决方案来自您分享的stackoverflow帖子,这篇 vi stackexchange 帖子 并学习一些vimscript 艰难地学习 vimscript。
在
init.vim
文件中,您可以编写以下内容:这可以通过调用 突出显示 vim 启动时调用的函数上的命令。
CocErrorFloat
更改错误弹出窗口的文本颜色,您还可以使用CocWarningFloat
、CocInfoFloat
和CocHintFloat
更改警告、信息和提示代码> 分别。My solution comes from the stackoverflow post you shared, this vi stackexchange post and learning a bit of vimscript with learning vimscript the hard way.
On your
init.vim
file you can write the following:This works by calling the highlight command on a function that gets called when vim starts.
CocErrorFloat
changes the text color for error popups, you could also change warnings, infos and hints withCocWarningFloat
,CocInfoFloat
andCocHintFloat
respectively.