chrisgrieser/nvim-dr-lsp

github github
pluginlspstatusline
stars 15
issues 0
subscribers 2
forks 0
CREATED

2023-06-02

UPDATED

9 days ago


nvim-dr-lsp

Lightweight status line component showing the number of LSP Definitions and References of the token under the cursor. A second component shows loading progress.

Showcase

Components

lspCount

Definitions and references inside current buffer

LSP: 2D 6R

Definitions or references outside current buffer

LSP: 1(2)D 4(10)R
  • 1 definition in the current buffer
  • 2 definitions in the workspace
  • 4 references in the current buffer
  • 10 definitions in the workspace

lspProgress

  • Ignores null-ls
  • Shows LSP activity spinner, similar to fidget.nvim, but less obtrusive.

Installation

-- lazy.nvim
{ "chrisgrieser/nvim-dr-lsp" },

-- packer
use { "chrisgrieser/nvim-dr-lsp" }
-- adding the components to lualine.nvim
{
    sections = {
        lualine_c = {
            { require("dr-lsp").lspCount },
            { require("dr-lsp").lspProgress },
        },
    }
}

Formatting the components

There are no builtin options to format the components, since formatting can already be done with most statusline plugins. With l Lualine, for example, you can use the fmt component option:

lualine_c = {
    { 
        require("dr-lsp").lspCount, 
        -- remove the letters from the component
        fmt = function(str) return str:gsub("[RD]", "") end,
    },
},

Similar Plugins

Credits

Basic idea for the progress component from folke.

About Me
In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch.

Profiles

Buy Me a Coffee