aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2025-04-26 12:30:48 +0200
committerWilliam Boman <william@redwill.se>2025-04-26 12:34:35 +0200
commit963df050ea3f65005c8ee047a4ab5d76493bf5a8 (patch)
treed42363b511a98e5121e1415136bb0a812c5eab0d /README.md
parentfix(command): only accept lspconfig names and filetypes in :LspInstall (diff)
downloadmason-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.md54
1 files changed, 53 insertions, 1 deletions
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,
}
```