LazyVim/Keyshort/LSP/Navigation
- Keyshort LazyVim LazyVim/Keyshort LazyVim/Keyshort/LSP
- Go to Definition Card
- Shortcut:
gd - Description: Jumps to where the symbol under the cursor is defined. Provided by the attached LSP (e.g. Pyright/basedpyright for Python).
- Shortcut:
- Go to Declaration Card
- Shortcut:
gD - Description: Jumps to the symbol's declaration.
- Mnemonic
- Go to Declaration
- go to Declaration
- different from go to definition (lowercase
d) because declaration is the implementation, the current context, just like how many of the LazyVim keyshorts use shift to be the modifier for "current directory" rather than "repository." The declaration, that is, the implementation, is "local," while the definition or interface is "global."
- Shortcut:
- Go to Implementation Card
- Go to References Card
- Go to Type Definition Card
- Shortcut:
gy - Description: Jumps to the definition of the symbol's type rather than the symbol itself — on a variable, that means the class or interface it is an instance of. LazyVim's description spells the Mnemonic out as "Goto T[y]pe Definition".
- My Note
- Shortcut:
- Hover Documentation Card
- Step Between References in the Buffer Card
- Shortcut:
]]next,[[previous - Description: Cycles through the other occurrences of the symbol under the cursor, in place, without opening a picker. Backed by nvim/Plugin/snacks.nvim/Words over the LSP's document highlights, so it needs a server advertising nvim/LSP/documentHighlight.
- nvim/Plugin/snacks.nvim/Words Test Setup
- bash
cd /tmp && mkdir -p snacks-words-test && cd snacks-words-test cat > sample.py <<'EOF' def greet(name): return f"hello {name}" greet("world") greet("logseq") EOF nvim sample.py - Inside
nvim, put the cursor ongreetand confirm the other two occurrences highlight automatically, then press]]/[[to cycle between them. Run:LspInfofirst if nothing highlights — pyright or basedpyright must be attached fordocumentHighlightto work.
- Shortcut:
- Rename Symbol Card
- Inspect Attached Language Servers Card
- My Note
- These keymaps are LSP-dependent —
gdonly resolves when a language server is attached. Ifgddoes nothing:- 1. Check attached clients with
:LspInfo. - 2. Confirm the server is installed via
:Mason(e.g.pyrightorbasedpyright). - 3. Open Neovim from the project root (
nvim .) so the LSP starts — a single file outside a project may not attach one. - 4. Verify the symbol actually has a definition the LSP can resolve.
- 5. Deeper diagnosis:
:checkhealth vim.lsp.
- 1. Check attached clients with
- For an outline instead of a jump,
<leader>csopens document symbols in nvim/Plugin/trouble.nvim — see LazyVim/Keyshort/Code Action.<leader>ssbelongs to the Telescope and fzf-lua extras and is not mapped here. <C-o>returns from any of these jumps — see vim/Keyshort/Jump/Back and Forward.
- These keymaps are LSP-dependent —
- Go to Definition Card