nvim/lua/init.lua

33 lines
1017 B
Lua
Raw Normal View History

2022-07-25 20:09:29 +00:00
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
2022-02-06 10:28:49 +00:00
2022-01-22 21:36:03 +00:00
vim.diagnostic.config({
2022-07-25 20:09:29 +00:00
virtual_text = false,
signs = true,
underline = false,
update_in_insert = false,
severity_sort = true,
float = {
source = "always" -- Or "if_many"
}
2022-01-22 21:36:03 +00:00
})
2022-07-25 20:09:29 +00:00
local signs = {Error = "", Warn = "", Hint = "", Info = ""}
2022-01-22 21:36:03 +00:00
for type, icon in pairs(signs) do
2022-07-25 20:09:29 +00:00
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
2022-01-22 21:36:03 +00:00
end
local border = {
2022-07-25 20:09:29 +00:00
{"", "FloatBorder"}, {"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"}
2022-01-22 21:36:03 +00:00
}
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
2022-07-25 20:09:29 +00:00
opts = opts or {}
opts.border = opts.border or border
return orig_util_open_floating_preview(contents, syntax, opts, ...)
2022-01-22 21:36:03 +00:00
end