mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 19:12:13 +02:00
added better sign in the sign columns for lsp diagnostics
This commit is contained in:
@@ -6,7 +6,6 @@ return {
|
|||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
local whichKey = require("which-key")
|
local whichKey = require("which-key")
|
||||||
local conform = require("conform")
|
|
||||||
|
|
||||||
-- Use LspAttach autocommand to only map the following keys
|
-- Use LspAttach autocommand to only map the following keys
|
||||||
-- after the language server attaches to the current buffer
|
-- after the language server attaches to the current buffer
|
||||||
@@ -110,8 +109,6 @@ return {
|
|||||||
vim.lsp.buf.format({
|
vim.lsp.buf.format({
|
||||||
async = true,
|
async = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
conform.format({ buffnr = ev.buff })
|
|
||||||
end,
|
end,
|
||||||
"Format file",
|
"Format file",
|
||||||
buffer = ev.buf,
|
buffer = ev.buf,
|
||||||
@@ -121,6 +118,13 @@ return {
|
|||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||||
|
|
||||||
|
for type, icon in pairs(signs) do
|
||||||
|
local hl = "DiagnosticSign" .. type
|
||||||
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
config = function()
|
config = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
@@ -154,14 +158,14 @@ return {
|
|||||||
|
|
||||||
lspconfig.tsserver.setup({
|
lspconfig.tsserver.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.volar.setup({
|
lspconfig.volar.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"vue"
|
"vue",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -190,43 +194,43 @@ return {
|
|||||||
lspconfig.prismals.setup({
|
lspconfig.prismals.setup({
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"prisma"
|
"prisma",
|
||||||
},
|
},
|
||||||
capabilities = capabilities
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.yamlls.setup({
|
lspconfig.yamlls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"yaml"
|
"yaml",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.marksman.setup({
|
lspconfig.marksman.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"markdown"
|
"markdown",
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.eslint.setup({
|
lspconfig.eslint.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.dockerls.setup({
|
lspconfig.dockerls.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.rust_analyzer.setup({
|
lspconfig.rust_analyzer.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
|
|
||||||
lspconfig.intelephense.setup({
|
lspconfig.intelephense.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach
|
on_attach = on_attach,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user