Neovim LSP Shortcuts
0.10Language Server Protocol keybindings for Neovim
Official docs →Neovim has had built-in LSP support since version 0.5, and it's one of the things that turned it from "that terminal editor" into a legitimate IDE competitor. The Language Server Protocol lets Neovim talk to language servers — the same ones that power VS Code's intellisense — giving you go-to-definition, autocompletion, diagnostics, rename refactoring, and more, all without leaving your terminal.
One important caveat: LSP keybindings depend on your configuration. Neovim doesn't ship with LSP keymaps out of the box — they're set up by your config, typically through vim.lsp.buf mappings or a plugin like nvim-lspconfig. The bindings on this page reflect the most common conventions you'll see across popular configs (LazyVim, kickstart.nvim, NvChad, etc.), but yours might be different. When in doubt, run :map to see what's actually bound, or check your lspconfig setup.
For the general overview, see the main Neovim cheatsheet.
Go-To Navigation
The bread and butter of LSP — jump to where things are defined, declared, or used. These are the bindings that make navigating a codebase feel effortless.
gd followed by Ctrl-o is probably the navigation pattern you'll use a hundred times a day. Jump to a definition to understand what something does, then Ctrl-o to bounce right back to where you were. It works across files, and Neovim remembers your full jump history, so you can chain multiple Ctrl-o presses to retrace your steps through a long investigation.
Hover & Signature Help
Quick information without leaving your current position. Hover docs show you what a symbol is, and signature help reminds you what arguments a function takes while you're typing.
K is mapped to hover docs by default in most LSP configs, but it's also Neovim's built-in "keyword lookup" key. If you're in a file without an LSP attached (say, a plain text file), K will fall back to looking up the word under the cursor in man pages or keywordprg. This means K is always useful — it just gets smarter when an LSP is running.
Rename & Code Actions
These are the refactoring commands — the ones that modify your code intelligently across the project.
<leader>rn (rename) is one of the most satisfying LSP features. It doesn't just find-and-replace a string — it understands scope. Renaming a local variable won't touch a global with the same name. Renaming a method updates every call site, import, and re-export across your entire project. It's the kind of refactoring you used to need an IDE for.
Diagnostics
Diagnostics are the errors, warnings, and hints that the language server surfaces. These bindings let you navigate through them and inspect the details.
Formatting
Auto-format your code according to the language server's rules, or a dedicated formatter if configured.
Workspace Symbols & Call Hierarchy
These go beyond single-file navigation. Workspace symbols search across your entire project, and the call hierarchy shows you who calls what.
LSP Server Management
Sometimes you need to check on or restart the language server itself.
When your LSP feels off — completions stop working, diagnostics disappear, or go-to-definition suddenly fails — try :LspRestart before you start debugging your config. Language servers are long-running processes and they occasionally get into a bad state. A quick restart usually fixes it. If it doesn't, :LspLog will show you what the server is actually saying.
Pair LSP navigation with Telescope for a much better experience. Many configs map gr to Telescope lsp_references instead of the built-in quickfix list, giving you a fuzzy-searchable, previewed list of references. Similarly, <leader>ds often maps to Telescope lsp_document_symbols. If you're setting up your own config, these Telescope integrations are worth the five minutes of configuration.