Git Product home page Git Product logo

nvim-dr-lsp's Introduction

nvim-dr-lsp ๐Ÿ‘จโ€โš•๏ธ๐Ÿ‘ฉโ€โš•๏ธ

badge

Definitions and References utility for the LSP.

Lightweight plugin that highlights definitions and references of the word under the cursor and displays their count in the statusline.

Showcase

Statusline 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

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

API: lspCountTable

Returns the lspCount information as Lua table for custom formatting.

{
	file = {
		definitions = 1,
		references = 4,
	},
	workspace = {
		definitions = 2,
		references = 10,
	},
}

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

There is no .setup call for this plugin. Just add the components to your statusline.

Highlights of definition and references

  • Definitions are under-dashed, references are under-dotted.
  • These are set up automatically for you as soon as the buffer is attached to an LSP client.
  • To disable the highlights feature, set vim.g.dr_lsp_no_highlight = true before loading the plugin.

Customizing the components

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

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

Similar Plugins

Credits

The basic idea for the progress component came 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 at ko-fi.com

nvim-dr-lsp's People

Contributors

chrisgrieser avatar ofirgall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ofirgall

nvim-dr-lsp's Issues

[Bug]: vim.lsp.util.get_progress_messages is deprecated in nvim >= 0.10

Bug Description

On nightly the deprecation notice vim.lsp.util.get_progress_messages is deprecated, use vim.lsp.status instead. :help deprecated This feature will be removed in Nvim version 0.11.0 is shown

Relevant Screenshot

No response

To Reproduce

No response

neovim version

NVIM v0.10.0-dev-546+g3bf887f6e

Make sure you have done the following

  • I have updated to the latest version of the plugin.

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.