This commit is contained in:
Ray Elliott 2022-07-25 21:09:29 +01:00
commit 3bf55a67c3
4 changed files with 21 additions and 61 deletions

View file

@ -1,44 +1,32 @@
vim.o.foldmethod='expr'
vim.o.foldexpr='nvim_treesitter#foldexpr()'
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = false,
update_in_insert = false,
severity_sort = true,
float = {
source = "always", -- Or "if_many"
},
virtual_text = false,
signs = true,
underline = false,
update_in_insert = false,
severity_sort = true,
float = {
source = "always" -- Or "if_many"
}
})
-- -- automatically show diagnostics for line
-- vim.cmd [[
-- augroup diagnostic_on_hover
-- autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})
-- augroup END
-- ]]
local signs = { Error = "● ", Warn = "● ", Hint = "● ", Info = "● " }
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 })
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
end
local border = {
{"┌", "FloatBorder"},
{"─", "FloatBorder"},
{"┐", "FloatBorder"},
{"│", "FloatBorder"},
{"┘", "FloatBorder"},
{"─", "FloatBorder"},
{"└", "FloatBorder"},
{"│", "FloatBorder"},
{"┌", "FloatBorder"}, {"─", "FloatBorder"}, {"┐", "FloatBorder"},
{"│", "FloatBorder"}, {"┘", "FloatBorder"}, {"─", "FloatBorder"},
{"└", "FloatBorder"}, {"│", "FloatBorder"}
}
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
opts = opts or {}
opts.border = opts.border or border
return orig_util_open_floating_preview(contents, syntax, opts, ...)
opts = opts or {}
opts.border = opts.border or border
return orig_util_open_floating_preview(contents, syntax, opts, ...)
end