nvim disable pyright

While using ruff-lsp for Python diagnostics, I find it redundant to have pyright still active for all Python scripts. So I decide to disable it.

This is how I managed to solve it.

nvim-lspconfig

Firstly, we need to explicitly overwrite the config, telling nimv-lspconfig not to provide default for us.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
return {
    "neovim/nvim-lspconfig",
    opts = {
        servers = {
            -- disable pyright
            pyright = {
            mason = false,
            autostart = false,
            },
        },
    },
}

uninstall pyright

Secondly, we need to uninstall the pyright module if it’s installed, by running following command

1
npm uninstall -g pyright

Now, the pyright is totally gone.

william 支付宝支付宝
william 微信微信
0%