我的neovim lsp错误消息没有红色

问题描述

我的neovim lsp错误消息没有红色:(

enter image description here

这是我的vimrc文件。我真的不知道是什么问题。我在此上花了3个多小时,就这样完成了。...

@NgModule({
  declarations: [
    AppComponent
  ],imports: [
    browserModule,HttpModule
  ],providers: [
    ThingProvider,{ provide: APP_INITIALIZER,useFactory: thingsProviderFactory,deps: [ThingProvider],multi: true }
  ],bootstrap: [AppComponent]
})
export class AppModule { }

解决方法

我在Windows 10上并使用新的Windows Terminal + NeoVim,我的配置与您的配置类似,但具有相同的颜色。我通过在设置colorscheme之前将其添加到“ init.vim”文件中来解决颜色问题:

set termguicolors

在不同的GitHub讨论中,建议使用以下选项作为解决方案,但是它们对我没有任何影响:

let g:gruvbox_contrast_dark = 'hard'

if exists('+termguicolors')
    let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
    let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif

let g:gruvbox_invert_selection='0'
set background=dark
,

为了将来参考,旧的答案可能会失败,现在有更多有组织的高亮组供您自定义它们的颜色,例如:

highlight LspDiagnosticsDefaultError guifg=#FF0000

有关更多详细信息,请阅读 :help lsp-highlight-diagnostics:help highlight

编辑:请注意,这需要遵循更通用的配色方案设置,例如 colorscheme whatever 可能会覆盖您的突出显示

,

我删除了"Plug 'leafgarland/typescript-vim'并删除了它:D

,

这是对我有用的一个

hi LspDiagnosticsVirtualTextError guifg=Red ctermfg=Red

guifg 用于 GUI 客户端,ctermfg 用于终端客户端

这应该适用于终端和 gui 客户端

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...