vim/Neovim/Report/Find Usages and Copy Python Dotted Path - Deep Research
Report - nvim parity with PyCharm for symbol navigation and reference copying
Goal
ChatGPT/Deep Research/Query
- You are doing deep technical research on modern nvim (2025-2026 era) with built-in LSP support and ecosystem plugins.
- I want concrete, battle-tested ways to reproduce two PyCharm features for Python development:
- 1. Find usages of the symbol under cursor (class, function, method, variable, imported symbol), with fast navigation across a medium-to-large codebase.
- 2. Copy a dotted Python reference path for the symbol under cursor (for example:
package.subpackage.module.ClassNameorpackage.module.function_name) with minimal friction.
- Research questions:
- Which combinations of nvim plugins and LSP servers are most commonly used for high-quality "find references/usages" in Python?
- How do these options compare in correctness, speed, UX, and setup complexity?
- What exact keymap patterns do experienced users apply for "symbol under cursor -> usages list -> jump and backtrack" workflows?
- What options exist to copy the dotted Python path for the symbol under cursor?
- If no single plugin gives exact "copy reference" parity, what are practical implementations (Lua snippets, Treesitter-based approaches, LSP symbol APIs, Telescope pickers, etc.)?
- How do solutions differ when using Pyright vs basedpyright vs jedi-language-server?
- What are known failure modes (namespace packages, re-exported imports, dynamic attributes, monkeypatching, generated code, editable installs, src-layout repos, tests importing from app code)?
- What configuration details matter most for large repos and monorepos (root detection, virtualenv/venv activation, extra paths, stub packages, indexing limits, performance tuning)?
- Required output format:
- 1. Executive summary with a recommended default stack for most users.
- 2. Comparison table of viable stacks:
- nvim distribution/baseline config assumptions
- Plugin set
- LSP server
- "Find usages" quality
- "Copy dotted path" strategy
- Setup complexity
- Performance notes
- 3. Step-by-step implementation guide for the top recommendation:
- Minimal plugin list
- Example
init.luaor modular Lua config snippets - Keymaps for references/usages and navigation history
- Command or mapping to copy dotted path under cursor to clipboard
- 4. Alternative implementations (at least 2) with tradeoffs.
- 5. Verification checklist:
- 6. Troubleshooting section for common "no references found" or incorrect path issues.
- Source quality constraints:
- Prefer primary sources in this order:
- Official docs/repos for nvim, plugins, and language servers
- Maintainer issue threads/discussions
- High-signal community writeups with reproducible configs
- Avoid stale advice older than 2023 unless still explicitly valid.
- Cite exact links for every important claim.
- Prefer primary sources in this order:
- Practical constraints:
ChatGPT/Deep Research/Response
Executive summary
- A nvim setup can get close to PyCharm for "find usages", but indexing depth is bounded by the Python language server, not by UI plugins.[1] [12]
- Recommended default stack for terminal-first Python on macOS:
- nvim >= 0.11 built-in LSP +
nvim-lspconfigdefaults.[3] [24] basedpyrightas default server, with optional fallback topyright.[4] [13]fzf-luafor low-latency references list and jump flow.[5] [15]- Optional
trouble.nvimfor persistent reference/result panes.[6] python-copy-reference.vimorcopy-python-path.nvimfor dotted reference copy workflows.[7] [8]
- nvim >= 0.11 built-in LSP +
- Important caveat: pyright maintainer guidance and open issues indicate reference-finding is limited compared with Pylance indexing behavior.[1] [11] [12]
Viable stacks
Implementation notes
- Use workspace-aware analysis for cross-file references in medium/large repos where possible.[13] [38]
- Validate LSP root detection (
pyproject.toml,.git,pyrightconfig.json) to avoid false "no references" behavior.[27] [37] [39] - For dotted path copy, prefer dedicated plugins over raw LSP-only reconstruction.[7] [8] [29]
- In src-layout or monorepos, configure prefix stripping/root heuristics explicitly.[7] [35]
Sample keymaps
- lua
local fzf = require("fzf-lua") vim.keymap.set("n", "gr", function() fzf.lsp_references({ includeDeclaration = false }) end, { desc = "References (usages)" }) vim.keymap.set("n", "gd", function() fzf.lsp_definitions({ jump1 = true }) end) vim.keymap.set("n", "gY", "<cmd>PythonCopyReferenceDotted<cr>") vim.keymap.set("n", "<leader>yI", "<cmd>CopyPythonPath import<cr>")
Verification checklist
Troubleshooting highlights
Footnotes
[3] https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/doc/lspconfig.txt
[4] https://docs.basedpyright.com/v1.26.0/benefits-over-pyright/pylance-features/
[12] https://github.com/microsoft/pyright/issues/10086?utm_source=chatgpt.com
[13] https://docs.basedpyright.com/v1.31.0/configuration/language-server-settings/?utm_source=chatgpt.com
[14] https://github.com/ranelpadon/python-copy-reference.vim
[18] https://lazyvim.github.io/extras/lang/python?utm_source=chatgpt.com
[19] https://lazyvim.github.io/extras/lang/python?utm_source=chatgpt.com
[20] https://jedi.readthedocs.io/en/v0.16.0/docs/api.html?utm_source=chatgpt.com
[22] https://www.seanh.cc/2025/10/13/helix-lsp-virtualenv/?utm_source=chatgpt.com
[24] https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/doc/lspconfig.txt
[26] https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/lsp/basedpyright.lua
[27] https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/lsp/pyright.lua
[29] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/
[30] https://neo.vimhelp.org/motion.txt.html?utm_source=chatgpt.com
[31] https://vimhelp.org/quickref.txt.html?utm_source=chatgpt.com
[34] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/
[35] https://github.com/ranelpadon/python-copy-reference.vim
[37] https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/lsp/pyright.lua
[38] https://docs.basedpyright.com/v1.31.0/configuration/language-server-settings/?utm_source=chatgpt.com
[39] https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/lsp/pyright.lua
[41] https://github.com/microsoft/pyright/blob/main/docs/configuration.md?utm_source=chatgpt.com
[42] https://packaging.python.org/guides/packaging-namespace-packages/?utm_source=chatgpt.com
[43] https://github.com/microsoft/pyright/issues/3430?utm_source=chatgpt.com
[44] https://docs.basedpyright.com/v1.34.0/usage/import-statements/?utm_source=chatgpt.com
[45] https://www.seanh.cc/2025/10/13/helix-lsp-virtualenv/?utm_source=chatgpt.com