4 ms·
Basically all you need is nvim-lspconfig, which just attaches the language servers to your buffers (so you wouldn't even need that, but it saves a lot of boiler
by d12bb 4y ago
Basically all you need is nvim-lspconfig, which just attaches the language servers to your buffers (so you wouldn't even need that, but it saves a lot of boilerplate). From there you can use all you already know (this is from my Lua-based config, but you can do the same in Viml):
vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = buf })
vim.keymap.set("n", "<leader>qf", vim.diagnostic.setqflist, { buffer = buf, desc = "Quickfix diagnostics" }) -- open Quickfix with LSP issues, Loclist possible too
vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc") -- use LSP completion for omnifunc
vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc") -- Ctrl+] for go to definition using LSP instead of ctags
vim.api.nvim_buf_set_option(buf, "formatexpr", "v:lua.vim.lsp.formatexpr()") -- Code formatting (gq etc) using LSP
Everything else one always sees with Neovim and LSP are other plugins like nvim-cmp or Telescope.