GithubHelp home page GithubHelp logo

urso / diagflow.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dgagn/diagflow.nvim

0.0 1.0 0.0 493 KB

LSP diagnostics in virtual text at the top right of your screen

Lua 99.07% Vim Script 0.93%

diagflow.nvim's Introduction

diagflow.nvim

diagflow.nvim is a Neovim plugin that provides a neat and distraction-free way to display LSP diagnostics. It shows diagnostics in virtual text at the top-right corner of your screen, only when the cursor is positioned over the problematic code or across an entire line, according to your preference. This provides a clean and focused coding environment. This approach to diagnostics management is inspired by the Helix editor.

Example

  1. Opening a file with multiple diagnostics but no issues under the cursor:

nothing

  1. An error under the cursor:

error

  1. A hint under the cursor:

hint

Installation

To install diagflow.nvim, use your preferred Neovim package manager. If you're using packer.nvim, add the following line to your plugin list:

-- Packer
use {'dgagn/diagflow.nvim'}

If you're using lazy.nvim, add the following line to your plugin list:

-- Lazy
{
    'dgagn/diagflow.nvim',
    opts = {}
}

Configuration

Note if you are using the opts with lazy.nvim, you don't need to run the setup, it does it for you.

The scope option determines the context of diagnostics display: 'cursor' (default) shows diagnostics only under the cursor, while 'line' shows diagnostics for the entire line where the cursor is positioned.

require('diagflow').setup({
    enable = true,
    max_width = 60,  -- The maximum width of the diagnostic messages
    severity_colors = {  -- The highlight groups to use for each diagnostic severity level
        error = "DiagnosticFloatingError",
        warning = "DiagnosticFloatingWarn",
        info = "DiagnosticFloatingInfo",
        hint = "DiagnosticFloatingHint",
    },
    gap_size = 1,
    scope = 'cursor', -- 'cursor', 'line'
    padding_top = 0
})

Or simply use the default configuration:

require('diagflow').setup()

FAQ

  1. How do I change the colors of the virtual text?

You can set up custom colors by changing the highlight group in the configuration. For instance, in the default configuration, :hi Hint determines the color of the hints. You can change the hint color to blue with :hi Hint guifg=blue.

diagflow.nvim's People

Contributors

dgagn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.