24 lines
751 B
Lua
24 lines
751 B
Lua
vim.diagnostic.config {
|
|
update_in_insert = false,
|
|
severity_sort = true,
|
|
float = { border = 'rounded', source = 'if_many' },
|
|
underline = { severity = { min = vim.diagnostic.severity.WARN } },
|
|
virtual_text = true,
|
|
virtual_lines = false,
|
|
jump = { float = true },
|
|
}
|
|
|
|
local function open_line_diagnostics()
|
|
vim.diagnostic.open_float {
|
|
scope = 'line',
|
|
focusable = true,
|
|
border = 'rounded',
|
|
source = 'always',
|
|
max_width = math.floor(vim.o.columns * 0.8),
|
|
max_height = math.floor(vim.o.lines * 0.5),
|
|
}
|
|
end
|
|
|
|
vim.api.nvim_create_user_command('Diag', open_line_diagnostics, { desc = 'Show diagnostics for the current line' })
|
|
vim.keymap.set('n', '<leader>d', open_line_diagnostics, { desc = 'Show line [D]iagnostics' })
|