Skip to content

A Neovim plugin that display prettier diagnostic messages. Display one line diagnostic messages where the cursor is, with icons and colors.

License

Notifications You must be signed in to change notification settings

eado/tiny-inline-diagnostic.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ“¦ tiny-inline-diagnostic.nvim

A Neovim plugin that display prettier diagnostic messages. Display one line diagnostic messages where the cursor is, with icons and colors.

πŸ–ΌοΈ Images

tinyinlinediagnostic_2

Overflow handling enabled

tinyinlinediagnostic_wrap

Break line enabled

image

πŸ› οΈ Setup

  • You need to set vim.diagnostic.config({ virtual_text = false }), to not have all diagnostics in the buffer displayed.

πŸ“₯ Installation

With Lazy.nvim:

{
    "rachartier/tiny-inline-diagnostic.nvim",
    event = "VeryLazy",
    config = function()
        require('tiny-inline-diagnostic').setup()
    end
}

βš™οΈ Options

-- 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,
            }
        }
})

πŸ’‘ Highlights

  • TinyInlineDiagnosticVirtualTextError
  • TinyInlineDiagnosticVirtualTextWarn
  • TinyInlineDiagnosticVirtualTextInfo
  • TinyInlineDiagnosticVirtualTextHint
  • TinyInlineDiagnosticVirtualTextArrow

Inv is used for left and right signs.

  • TinyInlineInvDiagnosticVirtualTextError
  • TinyInlineInvDiagnosticVirtualTextWarn
  • TinyInlineInvDiagnosticVirtualTextInfo
  • TinyInlineInvDiagnosticVirtualTextHint

πŸ“š API

  • 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.

❓ FAQ:

  • 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.
  • Q: All diagnostics are still displayed
    • You need to set vim.diagnostic.config({ virtual_text = false }) to remove all the others diagnostics.

About

A Neovim plugin that display prettier diagnostic messages. Display one line diagnostic messages where the cursor is, with icons and colors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%