0

This is the setting I have in my nvim config file

  local servers = { 'tsserver', 'eslint', 'bashls' }

  for _, lsp in ipairs(servers) do
      lspconfig[lsp].setup {
          capabilities = capabilities,
          on_attach = on_attach,
          flags = lsp_flags,
          on_attach = function(client, bufnr)
            navbuddy.attach(client, bufnr)
            vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
            vim.keymap.set('n', 'gl', vim.diagnostic.open_float, opts)
          end
      }
  end

I love the go to definition etc capabilities offered, but the linter can be distracting:

enter image description here

(note: the code isn’t my own so don’t judge)

How can I silence the linter (ideally i would be able to turn it on/off from vim itself, but lacking that I’m ok enabling/disabling it from the nvim config file iteself)

abbood
  • 23,101
  • 16
  • 132
  • 246

1 Answers1

1

You can disable virtual text for LSP diagnostics in your configuration, see :help vim.diagnostic.config :

vim.diagnostic.config({ virtual_text = false })
lcheylus
  • 1,217
  • 8
  • 21