https://github.com/chrisgrieser/nvim-dr-lsp
Status line component showing the number of LSP definition and reference of the token under the cursor.
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
Repository
Status line component showing the number of LSP definition and reference of the token under the cursor.
Basic Info
Statistics
- Stars: 32
- Watchers: 2
- Forks: 2
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
nvim-dr-lsp 👨⚕️👩⚕️
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.
- Installation
- Configuration
- Highlight references for the word under the cursor
- Statusline: definition and reference count
- Similar Plugins
- Credits
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.
Owner
- Name: Chris Grieser
- Login: chrisgrieser
- Kind: user
- Location: Berlin, Germany
- Company: Technical University of Berlin
- Website: https://chris-grieser.de/
- Repositories: 189
- Profile: https://github.com/chrisgrieser
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)