https://github.com/chrisgrieser/nvim-dr-lsp

Status line component showing the number of LSP definition and reference of the token under the cursor.

https://github.com/chrisgrieser/nvim-dr-lsp

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: researchgate.net
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.7%) to scientific vocabulary

Keywords

lsp neovim-plugin nvim-plugin statusline
Last synced: 5 months ago · JSON representation

Repository

Status line component showing the number of LSP definition and reference of the token under the cursor.

Basic Info
  • Host: GitHub
  • Owner: chrisgrieser
  • License: mit
  • Language: Lua
  • Default Branch: main
  • Homepage:
  • Size: 76.2 KB
Statistics
  • Stars: 32
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
lsp neovim-plugin nvim-plugin statusline
Created over 2 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License

README.md

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

Installation

The plugin requires at least nvim 0.10.

```lua -- lazy.nvim { "chrisgrieser/nvim-dr-lsp", event = "LspAttach", opts = {}, },

-- packer use { "chrisgrieser/nvim-dr-lsp", config = function() require("dr-lsp").setup({}) end, } ```

Configuration

lua -- default config require("dr-lsp").setup { highlightCursorWordReferences = { enable = true, }, }

Highlight references for the word under the cursor

  • Definitions are under-dashed, references are under-dotted.
  • The time for the highlights to show up depends on the updatetime option. It's recommended to set it to something like 300 ms.

[!NOTE] In a previous version of this plugin, the highlights were enabled automatically. Now, the highlights are only enabled when the .setup() call is made.

Statusline: definition and reference count

Definitions and references inside current buffer:

text LSP: 2D 6R

Definitions or references outside current buffer

text 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

lua -- adding the component to lualine.nvim { sections = { lualine_c = { { require("dr-lsp").lspCount }, }, } }

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:

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

Alternatively, require("dr-lsp").lspCountTable() returns the lspCount information as lua table for custom formatting:

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

Similar Plugins

Credits

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.

Buy Me a Coffee at ko-fi.com

Owner

  • Name: Chris Grieser
  • Login: chrisgrieser
  • Kind: user
  • Location: Berlin, Germany
  • Company: Technical University of Berlin

Researcher in sociology & software developer

GitHub Events

Total
  • Issues event: 4
  • Watch event: 6
  • Delete event: 3
  • Issue comment event: 2
  • Push event: 23
  • Pull request event: 8
  • Fork event: 1
  • Create event: 6
Last Year
  • Issues event: 4
  • Watch event: 6
  • Delete event: 3
  • Issue comment event: 2
  • Push event: 23
  • Pull request event: 8
  • Fork event: 1
  • Create event: 6

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 1
  • Total pull requests: 1
  • Average time to close issues: 14 minutes
  • Average time to close pull requests: 4 minutes
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 5.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 4 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Oneechan69 (1)
  • cxwx (1)
Pull Request Authors
  • dependabot[bot] (4)
  • ofirgall (1)
Top Labels
Issue Labels
bug (1) enhancement (1)
Pull Request Labels
dependencies (4) github_actions (4)