{"id":13409666,"url":"https://github.com/chrisgrieser/nvim-dr-lsp","last_synced_at":"2025-03-17T10:34:03.030Z","repository":{"id":171934276,"uuid":"648615317","full_name":"chrisgrieser/nvim-dr-lsp","owner":"chrisgrieser","description":"Status line component showing the number of LSP definition and reference of the token under the cursor.","archived":false,"fork":false,"pushed_at":"2024-08-17T12:22:39.000Z","size":68,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-14T07:32:22.736Z","etag":null,"topics":["lsp","nvim-plugin","statusline"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisgrieser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://www.paypal.me/ChrisGrieser","ko_fi":"pseudometa"}},"created_at":"2023-06-02T11:41:57.000Z","updated_at":"2024-08-17T12:22:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"f553d877-4a02-4da7-b35b-e64088f62994","html_url":"https://github.com/chrisgrieser/nvim-dr-lsp","commit_stats":null,"previous_names":["chrisgrieser/nvim-dr-lsp"],"tags_count":0,"template":false,"template_full_name":"chrisgrieser/nvim-pseudometa-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisgrieser%2Fnvim-dr-lsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisgrieser%2Fnvim-dr-lsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisgrieser%2Fnvim-dr-lsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisgrieser%2Fnvim-dr-lsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisgrieser","download_url":"https://codeload.github.com/chrisgrieser/nvim-dr-lsp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221675249,"owners_count":16861860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lsp","nvim-plugin","statusline"],"created_at":"2024-07-30T20:01:02.636Z","updated_at":"2025-03-17T10:34:03.021Z","avatar_url":"https://github.com/chrisgrieser.png","language":"Lua","funding_links":["https://www.paypal.me/ChrisGrieser","https://ko-fi.com/pseudometa","https://ko-fi.com/Y8Y86SQ91'"],"categories":["LSP","Lua"],"sub_categories":["(requires Neovim 0.5)"],"readme":"\u003c!-- LTeX: enabled=false --\u003e\n# nvim-dr-lsp 👨‍⚕️👩‍⚕️\n\u003c!-- LTeX: enabled=true --\u003e\n\u003ca href=\"https://dotfyle.com/plugins/chrisgrieser/nvim-dr-lsp\"\u003e\n\u003cimg alt=\"badge\" src=\"https://dotfyle.com/plugins/chrisgrieser/nvim-dr-lsp/shield\"/\u003e\u003c/a\u003e\n\n`D`efinitions and `R`eferences utility for the LSP.\n\nLightweight plugin that highlights definitions and references of the word under\nthe cursor and displays their count in the statusline.\n\n![Showcase](https://github.com/chrisgrieser/nvim-dr-lsp/assets/73286100/8c6600c8-b16d-434f-8bdb-47b4a9dab7cb)\n\n\u003c!-- toc --\u003e\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Highlight references for the word under the cursor](#highlight-references-for-the-word-under-the-cursor)\n- [Statusline: definition and reference count](#statusline-definition-and-reference-count)\n- [Similar Plugins](#similar-plugins)\n- [Credits](#credits)\n\n\u003c!-- tocstop --\u003e\n\n## Installation\nThe plugin requires at least nvim 0.10.\n\n```lua\n-- lazy.nvim\n{ \n\t\"chrisgrieser/nvim-dr-lsp\",\n\tevent = \"LspAttach\",\n\topts = {},\n},\n\n-- packer\nuse { \n\t\"chrisgrieser/nvim-dr-lsp\",\n\tconfig = function() require(\"dr-lsp\").setup({}) end,\n}\n```\n\n## Configuration\n\n```lua\n-- default config\nrequire(\"dr-lsp\").setup {\n\thighlightCursorWordReferences = {\n\t\tenable = true,\n\t},\n}\n```\n\n## Highlight references for the word under the cursor\n- Definitions are under-dashed, references are under-dotted.\n- The time for the highlights to show up depends on the [updatetime\n  option](https://neovim.io/doc/user/options.html#'updatetime'). It's\n  recommended to set it to something like 300\u0026nbsp;ms.\n\n\u003e [!NOTE]\n\u003e In a previous version of this plugin, the highlights were enabled\n\u003e automatically. Now, the highlights are only enabled when the `.setup()` call\n\u003e is made.\n\n## Statusline: definition and reference count\nDefinitions and references **inside** current buffer:\n\n```text\nLSP: 2D 6R\n```\n\nDefinitions or references **outside** current buffer\n\n```text\nLSP: 1(2)D 4(10)R\n```\n\n- 1 definition in the current buffer\n- 2 definitions in the workspace\n- 4 references in the current buffer\n- 10 definitions in the workspace\n\n```lua\n-- adding the component to lualine.nvim\n{\n\tsections = {\n\t\tlualine_c = {\n\t\t\t{ require(\"dr-lsp\").lspCount },\n\t\t},\n\t}\n}\n```\n\nThere are no built-in options to format the components, since formatting can\nalready be done with most statusline plugins. With `Lualine`, for example, you can\nuse the [`fmt` option](https://github.com/nvim-lualine/lualine.nvim#global-options):\n\n```lua\nlualine_c = {\n\t{ \n\t\trequire(\"dr-lsp\").lspCount, \n\t\t-- remove the letters from the component\n\t\tfmt = function(str) return str:gsub(\"[RD]\", \"\") end,\n\t},\n},\n```\n\nAlternatively, `require(\"dr-lsp\").lspCountTable()` returns the `lspCount`\ninformation as lua table for custom formatting:\n\n```lua\n{\n\tfile = {\n\t\tdefinitions = 1,\n\t\treferences = 4,\n\t},\n\tworkspace = {\n\t\tdefinitions = 2,\n\t\treferences = 10,\n\t},\n}\n```\n\n## Similar Plugins\n- [LSP-Lens](https://github.com/VidocqH/lsp-lens.nvim)\n- [action-hints.nvim](https://github.com/roobert/action-hints.nvim)\n- [symbol-usage.nvim](https://github.com/Wansmer/symbol-usage.nvim)\n\n## Credits\nIn my day job, I am a sociologist studying the social mechanisms underlying the\ndigital economy. For my PhD project, I investigate the governance of the app\neconomy and how software ecosystems manage the tension between innovation and\ncompatibility. If you are interested in this subject, feel free to get in touch.\n\n- [Website](https://chris-grieser.de/)\n- [Mastodon](https://pkm.social/@pseudometa)\n- [ResearchGate](https://www.researchgate.net/profile/Christopher-Grieser)\n- [LinkedIn](https://www.linkedin.com/in/christopher-grieser-ba693b17a/)\n\n\u003ca href='https://ko-fi.com/Y8Y86SQ91' target='_blank'\u003e \u003cimg height='36'\nstyle='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3'\nborder='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisgrieser%2Fnvim-dr-lsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisgrieser%2Fnvim-dr-lsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisgrieser%2Fnvim-dr-lsp/lists"}