Skip to content

Commit 239c228

Browse files
committed
feat(configuration): add g:sonokai_inlay_hints_background
1 parent d638deb commit 239c228

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
77
### Added
88

99
- Optimize `github/copilot.vim`.
10+
- Add `g:sonokai_inlay_hints_background`.
1011

1112
## [0.3.3] - 2023-01-14
1213

autoload/sonokai.vim

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function! sonokai#get_configuration() "{{{
2020
\ 'show_eob': get(g:, 'sonokai_show_eob', 1),
2121
\ 'float_style': get(g:, 'sonokai_float_style', 'bright'),
2222
\ 'current_word': get(g:, 'sonokai_current_word', get(g:, 'sonokai_transparent_background', 0) == 0 ? 'grey background' : 'bold'),
23+
\ 'inlay_hints_background': get(g:, 'sonokai_inlay_hints_background', 'none'),
2324
\ 'lightline_disable_bold': get(g:, 'sonokai_lightline_disable_bold', 0),
2425
\ 'diagnostic_text_highlight': get(g:, 'sonokai_diagnostic_text_highlight', 0),
2526
\ 'diagnostic_line_highlight': get(g:, 'sonokai_diagnostic_line_highlight', 0),

colors/sonokai.vim

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
let s:configuration = sonokai#get_configuration()
1111
let s:palette = sonokai#get_palette(s:configuration.style, s:configuration.colors_override)
1212
let s:path = expand('<sfile>:p') " the path of this script
13-
let s:last_modified = 'Wed May 15 02:11:59 PM UTC 2024'
13+
let s:last_modified = 'Sat May 18 06:17:18 UTC 2024'
1414
let g:sonokai_loaded_file_types = []
1515

1616
if !(exists('g:colors_name') && g:colors_name ==# 'sonokai' && s:configuration.better_performance)
@@ -208,6 +208,7 @@ if has('nvim')
208208
highlight! link LspReferenceText CurrentWord
209209
highlight! link LspReferenceRead CurrentWord
210210
highlight! link LspReferenceWrite CurrentWord
211+
highlight! link LspInlayHint InlayHints
211212
highlight! link LspCodeLens VirtualTextInfo
212213
highlight! link LspCodeLensSeparator VirtualTextHint
213214
highlight! link LspSignatureActiveParameter Search
@@ -346,6 +347,11 @@ elseif s:configuration.current_word ==# 'grey background'
346347
else
347348
call sonokai#highlight('CurrentWord', s:palette.none, s:palette.none, s:configuration.current_word)
348349
endif
350+
if s:configuration.inlay_hints_background ==# 'none'
351+
highlight! link InlayHints LineNr
352+
else
353+
call sonokai#highlight('InlayHints', s:palette.grey, s:palette.bg_dim)
354+
endif
349355
" Define a color for each LSP item kind to create highlights for nvim-cmp, aerial.nvim, nvim-navic and coc.nvim
350356
let g:sonokai_lsp_kind_color = [
351357
\ ["Array", "Yellow"],
@@ -671,7 +677,7 @@ highlight! link CocPumMenu Pmenu
671677
highlight! link CocMenuSel PmenuSel
672678
highlight! link CocDisabled Grey
673679
highlight! link CocSnippetVisual DiffAdd
674-
highlight! link CocInlayHint LineNr
680+
highlight! link CocInlayHint InlayHints
675681
highlight! link CocNotificationProgress Green
676682
highlight! link CocNotificationButton PmenuSel
677683
highlight! link CocSemClass TSType
@@ -732,8 +738,8 @@ highlight! link LspWarningHighlight WarningText
732738
highlight! link LspInformationHighlight InfoText
733739
highlight! link LspHintHighlight HintText
734740
highlight! link lspReference CurrentWord
735-
highlight! link lspInlayHintsType LineNr
736-
highlight! link lspInlayHintsParameter LineNr
741+
highlight! link lspInlayHintsType InlayHints
742+
highlight! link lspInlayHintsParameter InlayHints
737743
highlight! link LspSemanticType TSType
738744
highlight! link LspSemanticClass TSType
739745
highlight! link LspSemanticEnum TSType
@@ -762,7 +768,7 @@ highlight! link YcmErrorLine ErrorLine
762768
highlight! link YcmWarningLine WarningLine
763769
highlight! link YcmErrorSection ErrorText
764770
highlight! link YcmWarningSection WarningText
765-
highlight! link YcmInlayHint LineNr
771+
highlight! link YcmInlayHint InlayHints
766772
highlight! link YcmErrorText VirtualTextError
767773
highlight! link YcmWarningText VirtualTextWarning
768774
if !has('nvim') && has('textprop') && !exists('g:YCM_HIGHLIGHT_GROUP')

doc/sonokai.txt

+19
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,25 @@ Currently, the following plugins are supported:
434434
- https://github.com/itchyny/vim-cursorword
435435
- https://github.com/prabirshrestha/vim-lsp
436436

437+
------------------------------------------------------------------------------
438+
*g:sonokai_inlay_hints_background*
439+
g:sonokai_inlay_hints_background~
440+
441+
Inlay hints are special markers that are displayed inline with the code to
442+
provide you with additional information. You can use this option to customize
443+
the background color of inlay hints.
444+
445+
Type: |String|
446+
Available values: `'none'`, `'dimmed'`
447+
Default value: `'none'`
448+
449+
Currently, the following LSP clients are supported:
450+
451+
- neovim's built-in language server client
452+
- https://github.com/neoclide/coc.nvim
453+
- https://github.com/prabirshrestha/vim-lsp
454+
- https://github.com/ycm-core/YouCompleteMe
455+
437456
------------------------------------------------------------------------------
438457
*g:sonokai_disable_terminal_colors*
439458
g:sonokai_disable_terminal_colors~

0 commit comments

Comments
 (0)