tessl install tessl/npm-coc-nvim@0.0.0LSP based intellisense engine for neovim & vim8.
Complexity: Intermediate | Category: Reference | Keywords: highlights, colors, appearance, theme, syntax
Common Tasks: Customize colors | Match theme | Style diagnostics | Configure completion menu
Complete reference for all highlight groups used by coc.nvim. These groups control the appearance of diagnostics, completions, floating windows, and semantic highlighting.
" Link coc highlights to existing groups
highlight link CocErrorSign ErrorMsg
highlight link CocWarningSign WarningMsg
highlight link CocFloating PmenuReuses existing Vim highlight groups for consistency.
highlight CocErrorSign ctermfg=Red guifg=#e06c75
highlight CocWarningSign ctermfg=Yellow guifg=#e5c07b
highlight CocInfoSign ctermfg=Blue guifg=#61afef
highlight CocHintSign ctermfg=Cyan guifg=#56b6c2Sets custom colors for diagnostic signs.
highlight CocMenuSel ctermbg=237 guibg=#3e4452
highlight CocPumSearch ctermfg=214 guifg=#e5c07b cterm=bold gui=boldCustomizes completion popup appearance.
highlight CocErrorHighlight ctermbg=52 guibg=#5f0000
highlight CocWarningHighlight ctermbg=58 guibg=#5f5f00Uses background color instead of undercurl for diagnostics.
Coc.nvim uses over 100 highlight groups organized into these categories:
| Category | Count | Purpose |
|---|---|---|
| Text Style | 6 | Bold, italic, underline, strikethrough |
| Markdown | 3 | Documentation formatting |
| Diagnostics | 20 | Errors, warnings, hints (signs, text, highlights) |
| Document | 6 | Symbol highlighting, hover ranges |
| Float Windows | 5 | Floating window backgrounds and text |
| Notifications | 4 | Notification borders and buttons |
| List Interface | 6 | Fuzzy finder appearance |
| Tree View | 4 | Explorer tree styling |
| Completion | 7 | Popup menu items and search |
| Symbol Icons | 35+ | Completion item kinds |
| Semantic Tokens | 25+ | Language semantic highlighting |
| Other | 5 | CodeLens, snippets, inlay hints |
CocBoldBold text in documentation and UI elements.
Default: Bold text style Example:
highlight CocBold cterm=bold gui=bold
highlight CocBold cterm=bold gui=bold guifg=#ffffffCocItalicItalic text in documentation and UI elements.
Default: Italic text style Example:
highlight CocItalic cterm=italic gui=italic
highlight CocItalic cterm=italic gui=italic guifg=#928374CocUnderlineUnderlined text.
Default: Underline style Example:
highlight CocUnderline cterm=underline gui=underline
highlight CocUnderline cterm=underline gui=underline guisp=#61afefCocStrikeThroughStrikethrough text for deprecated items.
Default: Strikethrough style Example:
highlight CocStrikeThrough cterm=strikethrough gui=strikethrough
highlight CocStrikeThrough cterm=strikethrough gui=strikethrough guifg=#888888CocFadeOutFaded out text for inactive elements.
Default: Dimmed foreground color Example:
highlight CocFadeOut ctermfg=245 guifg=#928374
highlight CocFadeOut ctermfg=240 guifg=#5c6370CocDisabledDisabled UI items.
Default: Very dim foreground color Example:
highlight CocDisabled ctermfg=240 guifg=#585858
highlight CocDisabled ctermfg=238 guifg=#3e4452CocMarkdownCodeInline code in markdown documentation.
Default: Distinct code color Example:
highlight CocMarkdownCode ctermfg=109 guifg=#83a598
highlight CocMarkdownCode ctermfg=114 guifg=#98c379CocMarkdownHeaderMarkdown headers in documentation.
Default: Bold header color Example:
highlight CocMarkdownHeader ctermfg=214 guifg=#fabd2f cterm=bold gui=bold
highlight CocMarkdownHeader ctermfg=204 guifg=#e06c75 cterm=bold gui=boldCocMarkdownLinkMarkdown links.
Default: Underlined link color Example:
highlight CocMarkdownLink ctermfg=109 guifg=#83a598 cterm=underline gui=underline
highlight CocMarkdownLink ctermfg=39 guifg=#61afef cterm=underline gui=underlineCocErrorSignError signs in sign column.
Default: Red color Example:
highlight CocErrorSign ctermfg=Red guifg=#ff0000
highlight CocErrorSign ctermfg=204 guifg=#e06c75
highlight CocErrorSign ctermfg=196 guifg=#ff5555CocWarningSignWarning signs in sign column.
Default: Yellow/orange color Example:
highlight CocWarningSign ctermfg=Yellow guifg=#ffcc00
highlight CocWarningSign ctermfg=214 guifg=#e5c07b
highlight CocWarningSign ctermfg=220 guifg=#ffcc66CocInfoSignInformation signs in sign column.
Default: Blue color Example:
highlight CocInfoSign ctermfg=Blue guifg=#0088ff
highlight CocInfoSign ctermfg=39 guifg=#61afef
highlight CocInfoSign ctermfg=75 guifg=#56b6c2CocHintSignHint signs in sign column.
Default: Cyan/green color Example:
highlight CocHintSign ctermfg=Cyan guifg=#00ffaa
highlight CocHintSign ctermfg=114 guifg=#98c379
highlight CocHintSign ctermfg=87 guifg=#56b6c2CocErrorVirtualTextError virtual text at end of line.
Default: Red dimmed color Example:
highlight CocErrorVirtualText ctermfg=Red guifg=#ff0000
highlight CocErrorVirtualText ctermfg=203 guifg=#be5046CocWarningVirtualTextWarning virtual text.
Default: Yellow dimmed color Example:
highlight CocWarningVirtualText ctermfg=Yellow guifg=#ffcc00
highlight CocWarningVirtualText ctermfg=173 guifg=#d19a66CocInfoVirtualTextInfo virtual text.
Default: Blue dimmed color Example:
highlight CocInfoVirtualText ctermfg=Blue guifg=#0088ff
highlight CocInfoVirtualText ctermfg=38 guifg=#528bffCocHintVirtualTextHint virtual text.
Default: Cyan dimmed color Example:
highlight CocHintVirtualText ctermfg=Cyan guifg=#00ffaa
highlight CocHintVirtualText ctermfg=86 guifg=#4db5bdCocErrorHighlightError code range highlighting.
Default: Red undercurl or background Example:
" Undercurl style
highlight CocErrorHighlight cterm=undercurl gui=undercurl guisp=#ff0000
" Background style
highlight CocErrorHighlight ctermbg=52 guibg=#5f0000
" Subtle undercurl
highlight CocErrorHighlight cterm=undercurl gui=undercurl guisp=#e06c75CocWarningHighlightWarning code range highlighting.
Default: Yellow undercurl or background Example:
" Undercurl style
highlight CocWarningHighlight cterm=undercurl gui=undercurl guisp=#ffcc00
" Background style
highlight CocWarningHighlight ctermbg=58 guibg=#5f5f00
" Subtle undercurl
highlight CocWarningHighlight cterm=undercurl gui=undercurl guisp=#e5c07bCocInfoHighlightInfo code range highlighting.
Default: Blue undercurl or background Example:
" Undercurl style
highlight CocInfoHighlight cterm=undercurl gui=undercurl guisp=#0088ff
" Background style
highlight CocInfoHighlight ctermbg=17 guibg=#00005f
" Subtle undercurl
highlight CocInfoHighlight cterm=undercurl gui=undercurl guisp=#61afefCocHintHighlightHint code range highlighting.
Default: Cyan undercurl or background Example:
" Undercurl style
highlight CocHintHighlight cterm=undercurl gui=undercurl guisp=#00ffaa
" Background style
highlight CocHintHighlight ctermbg=23 guibg=#005f5f
" Subtle undercurl
highlight CocHintHighlight cterm=undercurl gui=undercurl guisp=#56b6c2CocDeprecatedHighlightDeprecated code highlighting.
Default: Strikethrough Example:
highlight CocDeprecatedHighlight cterm=strikethrough gui=strikethrough
highlight CocDeprecatedHighlight cterm=strikethrough gui=strikethrough guisp=#888888
highlight CocDeprecatedHighlight ctermfg=240 guifg=#585858 cterm=strikethrough gui=strikethroughCocUnusedHighlightUnused code highlighting.
Default: Dimmed color Example:
highlight CocUnusedHighlight ctermfg=240 guifg=#585858
highlight CocUnusedHighlight ctermfg=243 guifg=#5c6370CocErrorLineFull line highlight for errors.
Default: Error background color Example:
highlight CocErrorLine ctermbg=52 guibg=#3f0000
highlight CocErrorLine ctermbg=52 guibg=#2d0f0fCocWarningLineFull line highlight for warnings.
Default: Warning background color Example:
highlight CocWarningLine ctermbg=58 guibg=#3f3f00
highlight CocWarningLine ctermbg=58 guibg=#2d2a0fCocInfoLineFull line highlight for info.
Default: Info background color Example:
highlight CocInfoLine ctermbg=17 guibg=#00003f
highlight CocInfoLine ctermbg=17 guibg=#0f1a2dCocHintLineFull line highlight for hints.
Default: Hint background color Example:
highlight CocHintLine ctermbg=23 guibg=#003f3f
highlight CocHintLine ctermbg=23 guibg=#0f2d2aCocHighlightTextDefault symbol highlight (read/write).
Default: Subtle background highlight Example:
highlight CocHighlightText ctermbg=237 guibg=#3a3a3a
highlight CocHighlightText ctermbg=238 guibg=#3e4452CocHighlightReadSymbol read occurrence highlight.
Default: Green-tinted background Example:
highlight CocHighlightRead ctermbg=22 guibg=#2a4a2a
highlight CocHighlightRead ctermbg=22 guibg=#2d3a2dCocHighlightWriteSymbol write occurrence highlight.
Default: Red-tinted background Example:
highlight CocHighlightWrite ctermbg=52 guibg=#4a2a2a
highlight CocHighlightWrite ctermbg=52 guibg=#3a2d2dCocHoverRangeHovered symbol range.
Default: Subtle background highlight Example:
highlight CocHoverRange ctermbg=237 guibg=#3a3a3a
highlight CocHoverRange ctermbg=238 guibg=#3e4452CocCursorRangeCursor range for multi-cursor.
Default: Distinct background highlight Example:
highlight CocCursorRange ctermbg=237 guibg=#3a3a3a
highlight CocCursorRange ctermbg=239 guibg=#4b5263CocLinkedEditingLinked editing ranges (e.g., HTML tags).
Default: Background highlight Example:
highlight CocLinkedEditing ctermbg=237 guibg=#3a3a3a
highlight CocLinkedEditing ctermbg=238 guibg=#3e4452CocSelectedRangeSelected ranges.
Default: Background highlight Example:
highlight CocSelectedRange ctermbg=237 guibg=#3a3a3a
highlight CocSelectedRange ctermbg=238 guibg=#3e4452CocFloatingDefault floating window background.
Default: Popup menu background Example:
highlight CocFloating ctermbg=235 guibg=#1e1e1e
highlight CocFloating ctermbg=236 guibg=#282c34
highlight link CocFloating PmenuCocErrorFloatError text in floating windows.
Default: Error foreground color Example:
highlight CocErrorFloat ctermfg=Red guifg=#ff0000
highlight CocErrorFloat ctermfg=204 guifg=#e06c75CocWarningFloatWarning text in floating windows.
Default: Warning foreground color Example:
highlight CocWarningFloat ctermfg=Yellow guifg=#ffcc00
highlight CocWarningFloat ctermfg=214 guifg=#e5c07bCocInfoFloatInfo text in floating windows.
Default: Info foreground color Example:
highlight CocInfoFloat ctermfg=Blue guifg=#0088ff
highlight CocInfoFloat ctermfg=39 guifg=#61afefCocHintFloatHint text in floating windows.
Default: Hint foreground color Example:
highlight CocHintFloat ctermfg=Cyan guifg=#00ffaa
highlight CocHintFloat ctermfg=114 guifg=#98c379CocNotificationProgressProgress notification line.
Default: Accent color Example:
highlight CocNotificationProgress ctermfg=109 guifg=#83a598
highlight CocNotificationProgress ctermfg=39 guifg=#61afefCocNotificationButtonAction buttons in notifications.
Default: Button background Example:
highlight CocNotificationButton ctermbg=237 guibg=#3a3a3a
highlight CocNotificationButton ctermbg=238 guibg=#3e4452CocNotificationErrorError notification border.
Default: Error color Example:
highlight CocNotificationError ctermfg=Red guifg=#ff0000
highlight CocNotificationError ctermfg=204 guifg=#e06c75CocNotificationWarningWarning notification border.
Default: Warning color Example:
highlight CocNotificationWarning ctermfg=Yellow guifg=#ffcc00
highlight CocNotificationWarning ctermfg=214 guifg=#e5c07bCocNotificationInfoInfo notification border.
Default: Info color Example:
highlight CocNotificationInfo ctermfg=Blue guifg=#0088ff
highlight CocNotificationInfo ctermfg=39 guifg=#61afefCocListLineCurrent selected line in list.
Default: Selection background Example:
highlight CocListLine ctermbg=237 guibg=#3a3a3a
highlight CocListLine ctermbg=238 guibg=#3e4452CocListSearchMatched search characters in list.
Default: Highlighted search text Example:
highlight CocListSearch ctermfg=214 guifg=#fabd2f cterm=bold gui=bold
highlight CocListSearch ctermfg=214 guifg=#e5c07b cterm=bold gui=boldCocListModeMode indicator text in list.
Default: Mode color Example:
highlight CocListMode ctermfg=109 guifg=#83a598
highlight CocListMode ctermfg=39 guifg=#61afefCocListPathFile path text in list.
Default: Subdued color Example:
highlight CocListPath ctermfg=245 guifg=#928374
highlight CocListPath ctermfg=243 guifg=#5c6370CocSelectedTextSign for selected text.
Default: Accent color Example:
highlight CocSelectedText ctermfg=214 guifg=#fabd2f
highlight CocSelectedText ctermfg=204 guifg=#e06c75CocSelectedLineSelected line background.
Default: Selection background Example:
highlight CocSelectedLine ctermbg=237 guibg=#3a3a3a
highlight CocSelectedLine ctermbg=238 guibg=#3e4452CocSearchGeneral search result highlight.
Default: Search highlight Example:
highlight CocSearch ctermfg=214 guifg=#fabd2f ctermbg=237 guibg=#3a3a3a
highlight CocSearch ctermfg=214 guifg=#e5c07b ctermbg=238 guibg=#3e4452CocTreeTitleTree view title.
Default: Bold title color Example:
highlight CocTreeTitle ctermfg=214 guifg=#fabd2f cterm=bold gui=bold
highlight CocTreeTitle ctermfg=204 guifg=#e06c75 cterm=bold gui=boldCocTreeDescriptionTree item descriptions.
Default: Subdued color Example:
highlight CocTreeDescription ctermfg=245 guifg=#928374
highlight CocTreeDescription ctermfg=243 guifg=#5c6370CocTreeOpenCloseTree expand/collapse icons.
Default: Accent color Example:
highlight CocTreeOpenClose ctermfg=109 guifg=#83a598
highlight CocTreeOpenClose ctermfg=39 guifg=#61afefCocTreeSelectedSelected tree item.
Default: Selection background Example:
highlight CocTreeSelected ctermbg=237 guibg=#3a3a3a
highlight CocTreeSelected ctermbg=238 guibg=#3e4452CocPumSearchMatched input characters in completion menu.
Default: Highlighted match color Example:
highlight CocPumSearch ctermfg=214 guifg=#fabd2f cterm=bold gui=bold
highlight CocPumSearch ctermfg=214 guifg=#e5c07b cterm=bold gui=boldCocPumMenuCompletion menu background.
Default: Popup menu background Example:
highlight CocPumMenu ctermbg=235 guibg=#262626
highlight CocPumMenu ctermbg=236 guibg=#282c34
highlight link CocPumMenu PmenuCocPumShortcutSource shortcut in completion.
Default: Subdued color Example:
highlight CocPumShortcut ctermfg=245 guifg=#928374
highlight CocPumShortcut ctermfg=243 guifg=#5c6370CocPumDeprecatedDeprecated completion items.
Default: Strikethrough Example:
highlight CocPumDeprecated cterm=strikethrough gui=strikethrough
highlight CocPumDeprecated ctermfg=240 guifg=#585858 cterm=strikethrough gui=strikethroughCocPumVirtualTextVirtual text in completion menu.
Default: Subdued color Example:
highlight CocPumVirtualText ctermfg=245 guifg=#928374
highlight CocPumVirtualText ctermfg=243 guifg=#5c6370CocMenuSelSelected completion item.
Default: Selection background Example:
highlight CocMenuSel ctermbg=237 guibg=#3a3a3a
highlight CocMenuSel ctermbg=238 guibg=#3e4452
highlight link CocMenuSel PmenuSelAll completion item kinds can be customized. The pattern is CocSymbol{Kind}:
CocSymbolDefaultDefault symbol kind color.
Default: Normal foreground Example:
highlight CocSymbolDefault ctermfg=250 guifg=#abb2bf| Highlight Group | Description |
|---|---|
CocSymbolText | Plain text items |
CocSymbolMethod | Methods and functions |
CocSymbolFunction | Functions |
CocSymbolConstructor | Constructors |
CocSymbolField | Fields and properties |
CocSymbolVariable | Variables |
CocSymbolClass | Classes |
CocSymbolInterface | Interfaces |
CocSymbolModule | Modules and namespaces |
CocSymbolProperty | Properties |
CocSymbolEnum | Enumerations |
CocSymbolKeyword | Keywords |
CocSymbolSnippet | Snippets |
CocSymbolColor | Color values |
CocSymbolFile | Files |
CocSymbolReference | References |
CocSymbolFolder | Folders |
CocSymbolEnumMember | Enum members |
CocSymbolConstant | Constants |
CocSymbolStruct | Structures |
CocSymbolEvent | Events |
CocSymbolOperator | Operators |
CocSymbolTypeParameter | Type parameters |
Example Configuration:
" Functions and methods in blue
highlight CocSymbolFunction ctermfg=109 guifg=#61afef
highlight CocSymbolMethod ctermfg=109 guifg=#61afef
" Classes and types in yellow
highlight CocSymbolClass ctermfg=214 guifg=#e5c07b
highlight CocSymbolInterface ctermfg=214 guifg=#e5c07b
highlight CocSymbolStruct ctermfg=214 guifg=#e5c07b
" Variables in green
highlight CocSymbolVariable ctermfg=142 guifg=#98c379
highlight CocSymbolProperty ctermfg=142 guifg=#98c379
highlight CocSymbolField ctermfg=142 guifg=#98c379
" Keywords in purple
highlight CocSymbolKeyword ctermfg=170 guifg=#c678dd
highlight CocSymbolOperator ctermfg=170 guifg=#c678ddLanguage servers provide semantic tokens for enhanced syntax highlighting. Pattern: CocSem{TokenType}:
| Highlight Group | Description |
|---|---|
CocSemNamespace | Namespaces |
CocSemType | Types |
CocSemClass | Classes |
CocSemEnum | Enums |
CocSemInterface | Interfaces |
CocSemStruct | Structs |
CocSemTypeParameter | Type parameters |
CocSemParameter | Parameters |
CocSemVariable | Variables |
CocSemProperty | Properties |
CocSemEnumMember | Enum members |
CocSemEvent | Events |
CocSemFunction | Functions |
CocSemMethod | Methods |
CocSemMacro | Macros |
CocSemKeyword | Keywords |
CocSemModifier | Modifiers |
CocSemComment | Comments |
CocSemString | Strings |
CocSemNumber | Numbers |
CocSemBoolean | Booleans |
CocSemRegexp | Regular expressions |
CocSemOperator | Operators |
CocSemDecorator | Decorators |
CocSemDeprecated | Deprecated items |
Example Configuration:
" TypeScript-style semantic colors
highlight CocSemClass ctermfg=214 guifg=#4ec9b0
highlight CocSemInterface ctermfg=214 guifg=#4ec9b0
highlight CocSemType ctermfg=214 guifg=#4ec9b0
highlight CocSemFunction ctermfg=109 guifg=#dcdcaa
highlight CocSemMethod ctermfg=109 guifg=#dcdcaa
highlight CocSemVariable ctermfg=142 guifg=#9cdcfe
highlight CocSemProperty ctermfg=142 guifg=#9cdcfe
highlight CocSemParameter ctermfg=142 guifg=#9cdcfe
highlight CocSemKeyword ctermfg=170 guifg=#c586c0
highlight CocSemModifier ctermfg=170 guifg=#c586c0
highlight CocSemString ctermfg=173 guifg=#ce9178
highlight CocSemNumber ctermfg=180 guifg=#b5cea8
highlight CocSemBoolean ctermfg=180 guifg=#569cd6
highlight CocSemDeprecated cterm=strikethrough gui=strikethrough guifg=#808080CocCodeLensCodeLens virtual text (reference counts, implementations, etc).
Default: Subdued color Example:
highlight CocCodeLens ctermfg=245 guifg=#999999
highlight CocCodeLens ctermfg=243 guifg=#5c6370CocSnippetVisualSnippet visual selection.
Default: Visual selection background Example:
highlight CocSnippetVisual ctermbg=237 guibg=#3a3a3a
highlight CocSnippetVisual ctermbg=238 guibg=#3e4452CocInlayHintInlay hint virtual text (parameter names, type hints).
Default: Subdued color Example:
highlight CocInlayHint ctermfg=245 guifg=#999999
highlight CocInlayHint ctermfg=243 guifg=#5c6370 cterm=italic gui=italic" Diagnostics
highlight CocErrorSign ctermfg=167 guifg=#fb4934
highlight CocWarningSign ctermfg=214 guifg=#fabd2f
highlight CocInfoSign ctermfg=109 guifg=#83a598
highlight CocHintSign ctermfg=142 guifg=#b8bb26
highlight CocErrorHighlight cterm=undercurl gui=undercurl guisp=#fb4934
highlight CocWarningHighlight cterm=undercurl gui=undercurl guisp=#fabd2f
" Document highlights
highlight CocHighlightText ctermbg=237 guibg=#3c3836
highlight CocHighlightRead ctermbg=22 guibg=#2d3a2d
highlight CocHighlightWrite ctermbg=52 guibg=#3a2d2d
" Float windows
highlight CocFloating ctermbg=235 guibg=#282828
" List and completion
highlight CocListLine ctermbg=237 guibg=#3c3836
highlight CocListSearch ctermfg=214 guifg=#fabd2f cterm=bold gui=bold
highlight CocMenuSel ctermbg=237 guibg=#3c3836
highlight CocPumSearch ctermfg=214 guifg=#fabd2f cterm=bold gui=bold
" Symbols
highlight CocSymbolClass ctermfg=214 guifg=#fabd2f
highlight CocSymbolFunction ctermfg=109 guifg=#83a598
highlight CocSymbolVariable ctermfg=142 guifg=#b8bb26" Diagnostics
highlight CocErrorSign ctermfg=204 guifg=#e06c75
highlight CocWarningSign ctermfg=214 guifg=#e5c07b
highlight CocInfoSign ctermfg=39 guifg=#61afef
highlight CocHintSign ctermfg=114 guifg=#98c379
highlight CocErrorHighlight cterm=undercurl gui=undercurl guisp=#e06c75
highlight CocWarningHighlight cterm=undercurl gui=undercurl guisp=#e5c07b
" Document highlights
highlight CocHighlightText ctermbg=238 guibg=#3e4452
highlight CocHighlightRead ctermbg=22 guibg=#2d3a2d
highlight CocHighlightWrite ctermbg=52 guibg=#3a2d2d
" Float windows
highlight CocFloating ctermbg=236 guibg=#282c34
" List and completion
highlight CocListLine ctermbg=238 guibg=#3e4452
highlight CocListSearch ctermfg=214 guifg=#e5c07b cterm=bold gui=bold
highlight CocMenuSel ctermbg=238 guibg=#3e4452
highlight CocPumSearch ctermfg=214 guifg=#e5c07b cterm=bold gui=bold
" Symbols
highlight CocSymbolClass ctermfg=214 guifg=#e5c07b
highlight CocSymbolFunction ctermfg=39 guifg=#61afef
highlight CocSymbolVariable ctermfg=114 guifg=#98c379" Diagnostics
highlight CocErrorSign ctermfg=204 guifg=#ff5555
highlight CocWarningSign ctermfg=228 guifg=#ffb86c
highlight CocInfoSign ctermfg=117 guifg=#8be9fd
highlight CocHintSign ctermfg=84 guifg=#50fa7b
highlight CocErrorHighlight cterm=undercurl gui=undercurl guisp=#ff5555
highlight CocWarningHighlight cterm=undercurl gui=undercurl guisp=#ffb86c
" Document highlights
highlight CocHighlightText ctermbg=238 guibg=#44475a
highlight CocHighlightRead ctermbg=22 guibg=#2d3a2d
highlight CocHighlightWrite ctermbg=52 guibg=#3a2d2d
" Float windows
highlight CocFloating ctermbg=236 guibg=#282a36
" List and completion
highlight CocListLine ctermbg=238 guibg=#44475a
highlight CocListSearch ctermfg=228 guifg=#f1fa8c cterm=bold gui=bold
highlight CocMenuSel ctermbg=238 guibg=#44475a
highlight CocPumSearch ctermfg=228 guifg=#f1fa8c cterm=bold gui=bold
" Symbols
highlight CocSymbolClass ctermfg=117 guifg=#8be9fd
highlight CocSymbolFunction ctermfg=84 guifg=#50fa7b
highlight CocSymbolVariable ctermfg=228 guifg=#f1fa8c" Use existing Vim highlight groups
highlight link CocErrorSign ErrorMsg
highlight link CocWarningSign WarningMsg
highlight link CocInfoSign MoreMsg
highlight link CocHintSign Question
highlight link CocErrorHighlight SpellBad
highlight link CocWarningHighlight SpellCap
highlight link CocHighlightText Visual
highlight link CocFloating Pmenu
highlight link CocMenuSel PmenuSel
" Let colorscheme handle the restCheck terminal capabilities:
if has('termguicolors')
set termguicolors
" Use gui colors
else
" Use cterm colors only
endifProvide fallbacks for both terminal types:
" Always specify both cterm and gui
highlight CocErrorSign ctermfg=Red guifg=#ff0000Test highlights are visible:
function! TestHighlights()
for group in ['CocErrorSign', 'CocWarningSign', 'CocInfoSign']
let hl = execute('highlight ' . group)
echo group . ': ' . hl
endfor
endfunctionProblem: Diagnostic highlights don't show up.
Solutions:
Check if highlight group is defined:
:highlight CocErrorHighlightVerify terminal color support:
:set termguicolors?Set explicit colors:
highlight CocErrorHighlight cterm=undercurl gui=undercurl guisp=#ff0000Problem: Diagnostic undercurls appear as underlines.
Solutions:
Check terminal support:
Use background instead:
highlight CocErrorHighlight ctermbg=52 guibg=#5f0000Use underline as fallback:
highlight CocErrorHighlight cterm=underline gui=undercurl guisp=#ff0000Problem: Coc colors clash with colorscheme.
Solutions:
Link to existing groups:
highlight link CocErrorSign ErrorMsg
highlight link CocWarningSign WarningMsg
highlight link CocFloating PmenuSet highlights after colorscheme loads:
autocmd ColorScheme * call SetCocHighlights()
function! SetCocHighlights()
highlight CocErrorSign ctermfg=Red guifg=#ff0000
" ... more highlights
endfunctionUse colorscheme's palette:
" Get colors from colorscheme
let s:red = synIDattr(synIDtrans(hlID('Error')), 'fg', 'gui')
execute 'highlight CocErrorSign guifg=' . s:redProblem: Semantic tokens override syntax highlighting.
Solutions:
Disable semantic tokens:
{
"semanticTokens.enable": false
}Customize semantic token highlights:
" Link to existing syntax groups
highlight link CocSemClass Type
highlight link CocSemFunction Function
highlight link CocSemVariable IdentifierDisable for specific filetypes:
{
"semanticTokens.filetypes": ["!javascript"]
}Problem: Floating windows have poor contrast.
Solutions:
Match popup menu:
highlight link CocFloating PmenuSet explicit background:
highlight CocFloating ctermbg=235 guibg=#1e1e1eAdd border for contrast:
let g:coc_borderchars = ['─', '│', '─', '│', '┌', '┐', '┘', '└']