From e360869a6dc08899f05a7bb55364d37ced7346b7 Mon Sep 17 00:00:00 2001
From: Paul Schulze
Date: Thu, 28 Mar 2024 15:47:55 +0100
Subject: [PATCH] mason-tool-installer
---
init.lua | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
plugins.lua | 1 +
2 files changed, 53 insertions(+)
diff --git a/init.lua b/init.lua
index df5c317..4526087 100644
--- a/init.lua
+++ b/init.lua
@@ -132,6 +132,58 @@ let g:rooter_patterns = ['.git']
let g:rooter_change_directory_for_non_project_files = 'current'
]]
+
+require('mason-tool-installer').setup {
+
+ -- a list of all tools you want to ensure are installed upon start
+ ensure_installed = {
+ 'bash-language-server',
+ 'clangd',
+ 'codelldb',
+ 'cpptools',
+ 'debugpy',
+ 'emmet-ls',
+ 'html-lsp',
+ 'jq',
+ 'json-lsp',
+ 'lua-language-server',
+ 'luau-lsp',
+ 'node-debug2-adapter',
+ 'pyright',
+ 'rust-analyzer',
+ 'shellcheck',
+ 'shellharden',
+ 'shfmt',
+ 'vim-language-server',
+ },
+
+ -- if set to true this will check each tool for updates. If updates
+ -- are available the tool will be updated. This setting does not
+ -- affect :MasonToolsUpdate or :MasonToolsInstall.
+ -- Default: false
+ auto_update = false,
+
+ -- automatically install / update on startup. If set to false nothing
+ -- will happen on startup. You can use :MasonToolsInstall or
+ -- :MasonToolsUpdate to install tools and check for updates.
+ -- Default: true
+ run_on_start = true,
+
+ -- set a delay (in ms) before the installation starts. This is only
+ -- effective if run_on_start is set to true.
+ -- e.g.: 5000 = 5 second delay, 10000 = 10 second delay, etc...
+ -- Default: 0
+ start_delay = 3000, -- 3 second delay
+
+ -- Only attempt to install if 'debounce_hours' number of hours has
+ -- elapsed since the last time Neovim was started. This stores a
+ -- timestamp in a file named stdpath('data')/mason-tool-installer-debounce.
+ -- This is only relevant when you are using 'run_on_start'. It has no
+ -- effect when running manually via ':MasonToolsInstall' etc....
+ -- Default: nil
+ debounce_hours = 5, -- at least 5 hours between attempts to install/update
+}
+
-- vim.opt.shada = "/100,'10,\"100,:20,%"
-- vim.opt.shadafile = "/home/pfs/.config/nvpunk/lua/user/nviminfo"
-- autocmd BufWinLeave * if expand("%") != "" | silent! mkview | endif
diff --git a/plugins.lua b/plugins.lua
index 2371c47..8b95cf9 100644
--- a/plugins.lua
+++ b/plugins.lua
@@ -2,4 +2,5 @@ return {
{ 'tpope/vim-fugitive' },
{ 'ibhagwan/fzf-lua' },
{ 'airblade/vim-rooter' },
+ { 'WhoIsSethDaniel/mason-tool-installer.nvim' },
}