Просмотр исходного кода

feat: make lsp highlight color configurable (#1659)

Abouzar Parvan 3 лет назад
Родитель
Сommit
1e0d0181d5
3 измененных файлов с 4 добавлено и 3 удалено
  1. 0 3
      lua/lsp/init.lua
  2. 3 0
      lua/onedarker/LSP.lua
  3. 1 0
      lua/onedarker/palette.lua

+ 0 - 3
lua/lsp/init.lua

@@ -9,9 +9,6 @@ local function lsp_highlight_document(client)
   if client.resolved_capabilities.document_highlight then
     vim.api.nvim_exec(
       [[
-      hi LspReferenceRead cterm=bold ctermbg=red guibg=#353d46
-      hi LspReferenceText cterm=bold ctermbg=red guibg=#353d46
-      hi LspReferenceWrite cterm=bold ctermbg=red guibg=#353d46
       augroup lsp_document_highlight
         autocmd! * <buffer>
         autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()

+ 3 - 0
lua/onedarker/LSP.lua

@@ -35,6 +35,9 @@ local LSP = {
   DiagnosticUnderlineWarn = { style = "underline" },
   DiagnosticUnderlineInfo = { style = "underline" },
   DiagnosticUnderlineHint = { style = "underline" },
+  LspReferenceRead = { bg = C.fg_gutter, style = "bold" },
+  LspReferenceText = { bg = C.fg_gutter, style = "bold" },
+  LspReferenceWrite = { bg = C.fg_gutter, style = "bold" },
   QuickScopePrimary = { fg = C.purple_test, style = "underline" },
   QuickScopeSecondary = { fg = C.cyan_test, style = "underline" },
   TelescopeSelection = { fg = C.hint_blue },

+ 1 - 0
lua/onedarker/palette.lua

@@ -6,6 +6,7 @@ local colors = {
   dark = "#282c34",
   accent = "#BBBBBB",
   dark_gray = "#2a2f3e",
+  fg_gutter = "#353d46",
   context = "#4b5263",
   popup_back = "#282c34",
   search_orange = "#613214",