diff options
| author | William Boman <william@redwill.se> | 2025-04-26 12:30:48 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-04-26 12:34:35 +0200 |
| commit | 963df050ea3f65005c8ee047a4ab5d76493bf5a8 (patch) | |
| tree | d42363b511a98e5121e1415136bb0a812c5eab0d /README.md | |
| parent | fix(command): only accept lspconfig names and filetypes in :LspInstall (diff) | |
| download | mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.tar mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.tar.gz mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.tar.bz2 mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.tar.lz mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.tar.xz mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.tar.zst mason-lspconfig-963df050ea3f65005c8ee047a4ab5d76493bf5a8.zip | |
feat: add more capabilities to `automatic_enable`
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 54 |
1 files changed, 53 insertions, 1 deletions
@@ -83,6 +83,42 @@ runtimepath`](https://neovim.io/doc/user/options.html#'runtimepath') before sett Refer to the [Configuration](#configuration) section for information about which settings are available. +# Automatically enable installed servers + +`mason-lspconfig.nvim` will automatically enable installed servers for you by default. + +To disable this feature: + +```lua +require("mason-lspconfig").setup { + automatic_enable = false +} +``` + +To exclude certain servers from being enabled: + +```lua +require("mason-lspconfig").setup { + automatic_enable = { + exclude = { + "rust_analyzer", + "ts_ls" + } + } +} +``` + +Alternatively, to only enable specific servers: + +```lua +require("mason-lspconfig").setup { + automatic_enable = { + "lua_ls", + "vimls" + } +} +``` + # Commands > `:h mason-lspconfig-commands` @@ -114,6 +150,22 @@ local DEFAULT_SETTINGS = { ensure_installed = {}, -- Whether installed servers should automatically be enabled via `:h vim.lsp.enable()`. - automatic_enable = true + -- + -- To exclude certain servers from being automatically enabled: + -- ```lua + -- automatic_enable = { + -- exclude = { "rust_analyzer", "ts_ls" } + -- } + -- ``` + -- + -- To only enable certain servers to be automatically enabled: + -- ```lua + -- automatic_enable = { + -- "lua_ls", + -- "vimls" + -- } + -- ``` + ---@type boolean | string[] | { exclude: string[] } + automatic_enable = true, } ``` |
