A Neovim plugin that display prettier diagnostic messages. Display one line diagnostic messages where the cursor is, with icons and colors.
- You need to set
vim.diagnostic.config({ virtual_text = false })
, to not have all diagnostics in the buffer displayed.
With Lazy.nvim:
{
"rachartier/tiny-inline-diagnostic.nvim",
event = "VeryLazy",
config = function()
require('tiny-inline-diagnostic').setup()
end
}
-- Default configuration
require('tiny-inline-diagnostic').setup({
signs = {
left = "ξΆ",
right = "ξ΄",
diag = "β",
arrow = " ο
· ",
up_arrow = " ο
Ά ",
vertical = " β",
vertical_end = " β"
},
hi = {
error = "DiagnosticError",
warn = "DiagnosticWarn",
info = "DiagnosticInfo",
hint = "DiagnosticHint",
arrow = "NonText",
background = "CursorLine", -- Can be a highlight or a hexadecimal color (#RRGGBB)
mixing_color = "None", -- Can be None or a hexadecimal color (#RRGGBB). Used to blend the background color with the diagnostic background color with another color.
},
blend = {
factor = 0.27,
},
options = {
-- The minimum length of the message, otherwise it will be on a new line.
softwrap = 15,
--- When overflow="wrap", when the message is too long, it is then displayed on multiple lines.
overflow = "wrap",
--- Enable it if you want to always have message with `after` characters length.
break_line = {
enabled = false,
after = 30,
}
}
})
- TinyInlineDiagnosticVirtualTextError
- TinyInlineDiagnosticVirtualTextWarn
- TinyInlineDiagnosticVirtualTextInfo
- TinyInlineDiagnosticVirtualTextHint
- TinyInlineDiagnosticVirtualTextArrow
Inv
is used for left and right signs.
- TinyInlineInvDiagnosticVirtualTextError
- TinyInlineInvDiagnosticVirtualTextWarn
- TinyInlineInvDiagnosticVirtualTextInfo
- TinyInlineInvDiagnosticVirtualTextHint
require("tiny-inline-diagnostic").change(background, factor)
: change the background color and the blend factor, useful if you want to change the colorscheme on the fly.require("tiny-inline-diagnostic").get_diagnostic_under_cursor(bufnr)
: get the diagnostic under the cursor, useful if you want to display the diagnostic in a statusline.
- Q: My colors are bad
- You can change the colors with the
hi
option. - If you have no background color, you should try to set
blend.mixing_color
to a color that will blend with the background color.
- You can change the colors with the
- Q: All diagnostics are still displayed
- You need to set
vim.diagnostic.config({ virtual_text = false })
to remove all the others diagnostics.
- You need to set