diff options
author | LostNeophyte <[email protected]> | 2023-01-25 18:55:31 +0100 |
---|---|---|
committer | LostNeophyte <[email protected]> | 2023-01-25 18:55:31 +0100 |
commit | 75b653cc623a8cd6de397e42f21b838a065eb0e0 (patch) | |
tree | 7b43499c99423651d7e75662bb4628569834e28f /lua/lvim/core/mason.lua | |
parent | 4f02e54d923414eb6690d64c7e334f624a2a9342 (diff) |
refactor!: put all plugin options under `opts`
Diffstat (limited to 'lua/lvim/core/mason.lua')
-rw-r--r-- | lua/lvim/core/mason.lua | 80 |
1 files changed, 41 insertions, 39 deletions
diff --git a/lua/lvim/core/mason.lua b/lua/lvim/core/mason.lua index a6613897..ab58c5c8 100644 --- a/lua/lvim/core/mason.lua +++ b/lua/lvim/core/mason.lua @@ -4,50 +4,52 @@ local join_paths = require("lvim.utils").join_paths function M.config() local config = { - ui = { - border = "rounded", - keymaps = { - toggle_package_expand = "<CR>", - install_package = "i", - update_package = "u", - check_package_version = "c", - update_all_packages = "U", - check_outdated_packages = "C", - uninstall_package = "X", - cancel_installation = "<C-c>", - apply_language_filter = "<C-f>", + opts = { + ui = { + border = "rounded", + keymaps = { + toggle_package_expand = "<CR>", + install_package = "i", + update_package = "u", + check_package_version = "c", + update_all_packages = "U", + check_outdated_packages = "C", + uninstall_package = "X", + cancel_installation = "<C-c>", + apply_language_filter = "<C-f>", + }, }, - }, - -- NOTE: should be available in $PATH - install_root_dir = join_paths(vim.fn.stdpath "data", "mason"), + -- NOTE: should be available in $PATH + install_root_dir = join_paths(vim.fn.stdpath "data", "mason"), - -- NOTE: already handled in the bootstrap stage - PATH = "skip", + -- NOTE: already handled in the bootstrap stage + PATH = "skip", - pip = { - -- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior - -- and is not recommended. - -- - -- Example: { "--proxy", "https://proxyserver" } - install_args = {}, - }, + pip = { + -- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior + -- and is not recommended. + -- + -- Example: { "--proxy", "https://proxyserver" } + install_args = {}, + }, - -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when - -- debugging issues with package installations. - log_level = vim.log.levels.INFO, + -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when + -- debugging issues with package installations. + log_level = vim.log.levels.INFO, - -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further - -- packages that are requested to be installed will be put in a queue. - max_concurrent_installers = 4, + -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further + -- packages that are requested to be installed will be put in a queue. + max_concurrent_installers = 4, - github = { - -- The template URL to use when downloading assets from GitHub. - -- The placeholders are the following (in order): - -- 1. The repository (e.g. "rust-lang/rust-analyzer") - -- 2. The release version (e.g. "v0.3.0") - -- 3. The asset name (e.g. "rust-analyzer-v0.3.0-x86_64-unknown-linux-gnu.tar.gz") - download_url_template = "https://github.com/%s/releases/download/%s/%s", + github = { + -- The template URL to use when downloading assets from GitHub. + -- The placeholders are the following (in order): + -- 1. The repository (e.g. "rust-lang/rust-analyzer") + -- 2. The release version (e.g. "v0.3.0") + -- 3. The asset name (e.g. "rust-analyzer-v0.3.0-x86_64-unknown-linux-gnu.tar.gz") + download_url_template = "https://github.com/%s/releases/download/%s/%s", + }, }, } ---@cast config +LvimBuiltin @@ -84,9 +86,9 @@ function M.setup() return end - add_to_path(lvim.builtin.mason.PATH == "append") + add_to_path(lvim.builtin.mason.opts.PATH == "append") - mason.setup(lvim.builtin.mason) + mason.setup(lvim.builtin.mason.opts) end return M |