D
efinitions and R
eferences utility for the LSP.
Lightweight plugin that highlights definitions and references of the word under the cursor and displays their count in the statusline.
lspCountTable
lspCount
Definitions and references inside current buffer
LSP: 2D 6R
Definitions or references outside current buffer
LSP: 1(2)D 4(10)R
lspProgress
null-ls
and none-ls
.lspCountTable
Returns the lspCount
information as Lua table for custom formatting.
{
file = {
definitions = 1,
references = 4,
},
workspace = {
definitions = 2,
references = 10,
},
}
-- 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.
vim.g.dr_lsp_no_highlight = true
before loading the plugin.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,
},
},
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