VimPlugin: lsp: Difference between revisions

From wikinotes
Line 35: Line 35:
</blockquote><!-- Language Install -->
</blockquote><!-- Language Install -->


== Disable Inline Messages ==
== Disable Inline Linter Errors ==
<blockquote>
<blockquote>
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Revision as of 23:06, 6 February 2023

Neovim's builtin lsp client.

Documentation

:h lsp https://neovim.io/doc/user/lsp.html
avail lsp's https://microsoft.github.io/language-server-protocol/implementors/servers/

Configuration

Language Install

Vanilla

  • install an lsp using your OS (ex. pacman -S gopls
  • enable lsp (ex. lua require('lspconfig').gopls.setup{on_attach = custom_lsp_attach})

lspconfig

VimPlugin: nvim-lspconfig contains several pre-made LSP configurations.
You'll still need to install the LSP provider.

Mason

VimPlugin: mason can automate installing LSPs.
Use the :Mason command to see installed.

Disable Inline Linter Errors

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
    vim.lsp.diagnostic.on_publish_diagnostics, {
        virtual_text = false
    }
)