From 963df050ea3f65005c8ee047a4ab5d76493bf5a8 Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 26 Apr 2025 12:30:48 +0200 Subject: feat: add more capabilities to `automatic_enable` --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 72f01bd..a2d3e1e 100644 --- a/README.md +++ b/README.md @@ -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, } ``` -- cgit v1.2.3-70-g09d2