1

I have browsed AstroNvim config extensively and even ran a grep seach for my LSP server's name but could not find mention of it. Yet I need to change the setup of this server :(. How can I do it?

The server is PyLsp, it is well installed and I want to config the linter rules.

I am on Ubuntu.

Here an example from neovim/nvim-lspconfig

require'lspconfig'.pylsp.setup{
  settings = {
    pylsp = {
      plugins = {
        pycodestyle = {
          ignore = {'W391'},
          maxLineLength = 100
        }
      }
    }
  }
}```
4
  • you are barely providing any information here. What LSP Server are you using? Have you installed it? What exaclty are you trying to change? Commented Jul 14, 2023 at 12:20
  • I improved it but I think it was understandable Commented Jul 15, 2023 at 12:53
  • Thanks @samuel, could you tell is for which language it is? Could you tell us which configuration settings you want to change and what is the expected effect such that we can test the solution? Commented Jul 16, 2023 at 19:13
  • 1
    OK I've just done it Commented Jul 18, 2023 at 11:42

2 Answers 2

1

I was able to come right by editing ~/.config/nvim/lua/user/lsp/config/pylsp.lua

return {
  settings = {
    pylsp = {
      plugins = {
        pycodestyle = {
          ignore = {'W391'},
          maxLineLength = 100
        }
      }
    }
  }
}

Much like the nvim-lspconfig example configuration you listed, but instead of require-ing it, returning the object directly.

1

There are some documentation in AstroNvim about advanced configuration of LSP servers.

e.g: If you want to disable formatting on save you could add a ~/.config/nvim/lua/user/init.vim with the following content:

return {
  lsp = {
    formatting = {
      format_on_save = false, -- enable or disable automatic formatting on save
    },
  },
}

Remark: you'll have to create the ~/.config/lua/user folder and the ~/.config/lua/user/init.vim file that are not present by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.