Added base folke setup

This commit is contained in:
2022-10-09 22:40:29 +02:00
parent 1afab44385
commit efc511cbcf
32 changed files with 2292 additions and 60 deletions

View File

@@ -0,0 +1,26 @@
local M = {}
M.signs = { Error = "", Warn = "", Hint = "", Info = "" }
function M.setup()
-- Automatically update diagnostics
vim.diagnostic.config({
underline = true,
update_in_insert = false,
virtual_text = { spacing = 4, prefix = "" },
severity_sort = true,
})
vim.lsp.handlers["workspace/diagnostic/refresh"] = function(_, _, ctx)
local ns = vim.lsp.diagnostic.get_namespace(ctx.client_id)
pcall(vim.diagnostic.reset, ns)
return true
end
for type, icon in pairs(M.signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
end
return M