Neovim LSP, Treesitter, and Plugins

Language-aware development workflows in Neovim with built-in LSP, Treesitter, and plugin managers.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Built-in LSP workflows

Use Neovim’s built-in LSP features for semantic code navigation.

Go to definition

Jump to the definition of the symbol under cursor.

luaANYneovimlspnavigation
lua
vim.keymap.set("n", "gd", vim.lsp.buf.definition)

A core LSP navigation mapping.

Find references

List all references to a symbol.

luaANYneovimlspreferences
lua
vim.keymap.set("n", "gr", vim.lsp.buf.references)

Helpful for refactors and impact analysis.

Show hover docs

Display hover information from the language server.

luaANYneovimlspdocs
lua
vim.keymap.set("n", "K", vim.lsp.buf.hover)

Commonly used for signatures, docs, and type details.

Rename a symbol

Perform a semantic rename through LSP.

luaANYneovimlsprefactor
lua
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename)

Safer and broader than plain text replacement.

Treesitter

Enable structural parsing for better highlighting and editing.

Configure nvim-treesitter

Install parsers and enable syntax-aware modules.

luaANYneovimtreesittersyntax
lua
require("nvim-treesitter.configs").setup({
  ensure_installed = { "lua", "vim", "javascript", "typescript" },
  highlight = { enable = true },
  indent = { enable = true },
})

Treesitter improves syntax-aware highlighting and related editor features.

Use Treesitter textobjects

Select functions and classes structurally.

luaANYneovimtreesittertextobjects
lua
-- usually configured via nvim-treesitter-textobjects

Treesitter textobjects can make editing much more semantic.

Plugins and health checks

Install and organize plugins cleanly in modern Neovim.

Bootstrap lazy.nvim

Clone lazy.nvim automatically if missing.

luaANYneovimpluginslazy-nvim
lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.rtp:prepend(lazypath)

A common modern bootstrap pattern for plugin management.

Declare plugins with lazy.nvim

Register plugins and dependencies in Lua.

luaANYneovimpluginslazy-nvim
lua
require("lazy").setup({
  { "nvim-treesitter/nvim-treesitter" },
  { "neovim/nvim-lspconfig" },
  { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
})

This keeps plugin definitions in Lua and supports lazy loading.

Run :checkhealth

Inspect provider and plugin setup issues.

vimANYneovimtroubleshootingplugins
vim
:checkhealth

One of the best first steps when debugging Neovim environments.

Recommended next

No recommendations yet.