How do I set buffer-local keymaps that only activate when an LSP server attaches to a buffer in Neovim?
vim.api.nvim_create_autocmd('LspAttach', ...)
Setting your LSP keymaps inside a LspAttach autocmd ensures they are only active in buffers where a language server is actually running.