mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
fix(neovim-lsp): Default LSP configured with default LSP client & color
completions - Default configs for: markdownlint, marksman, prettier, shellcheck, shellharden, shfmt, trivy - Configure `mason` to `append` PATH - Configure completions for `nvim-highlight-colors`
This commit is contained in:
@@ -3,7 +3,11 @@ return {
|
||||
"neovim/nvim-lspconfig",
|
||||
cond = require("config.util").is_not_vscode(),
|
||||
dependencies = {
|
||||
{ "williamboman/mason.nvim", config = true }, -- TIP: Must be loaded before dependants
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
config = true,
|
||||
opts = { PATH = "append" },
|
||||
},
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
"saghen/blink.cmp",
|
||||
@@ -156,11 +160,49 @@ return {
|
||||
-- Highlight colors
|
||||
{
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
setup = {
|
||||
enable_tailwind = true,
|
||||
},
|
||||
setup = { enable_tailwind = true },
|
||||
config = function()
|
||||
require("nvim-highlight-colors").setup()
|
||||
require("nvim-highlight-colors").setup({
|
||||
render = "virtual",
|
||||
virtual_symbol_position = "eow",
|
||||
virtual_symbol_prefix = " ",
|
||||
virtual_symbol_suffix = "",
|
||||
completion = {
|
||||
menu = {
|
||||
draw = {
|
||||
components = {
|
||||
-- customize the drawing of kind icons
|
||||
kind_icon = {
|
||||
text = function(ctx)
|
||||
-- default kind icon
|
||||
local icon = ctx.kind_icon
|
||||
-- if LSP source, check for color derived from documentation
|
||||
if ctx.item.source_name == "LSP" then
|
||||
local color_item = require("nvim-highlight-colors").format(ctx.item.documentation, { kind = ctx.kind })
|
||||
if color_item and color_item.abbr ~= "" then
|
||||
icon = color_item.abbr
|
||||
end
|
||||
end
|
||||
return icon .. ctx.icon_gap
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
-- default highlight group
|
||||
local highlight = "BlinkCmpKind" .. ctx.kind
|
||||
-- if LSP source, check for color derived from documentation
|
||||
if ctx.item.source_name == "LSP" then
|
||||
local color_item = require("nvim-highlight-colors").format(ctx.item.documentation, { kind = ctx.kind })
|
||||
if color_item and color_item.abbr_hl_group then
|
||||
highlight = color_item.abbr_hl_group
|
||||
end
|
||||
end
|
||||
return highlight
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user