Neovim が動作するすべての場所で実行される Neovim 用のポータブルパッケージマネージャー。
LSPサーバー、DAPサーバー、リンター、フォーマッタを簡単にインストールして管理します。
:help mason.nvim
:h mason-introduction
mason.nvimは、LSPサーバー、DAPサーバーなどの外部エディターツールを簡単に管理できるNeovimプラグインです。 リンター、およびフォーマッタを単一のインターフェイスで。Neovim が動作するすべての場所 (Linux、macOS、Windows など) で実行されます。 必要な外部要件はごくわずかです。
パッケージはデフォルトでNeovimにインストールされます。実行可能ファイルは単一のディレクトリにリンクされており、セットアップ中にNeovimのPATHに追加され、Neovimビルトイン(シェル、ターミナル、 など)だけでなく、他の3rdパーティのプラグイン。
:h stdpath
bin/
mason.nvim
使用可能なすべてのパッケージの一覧については、「PACKAGES.md」を参照してください。
:h mason-how-to-use-packages
多くのパッケージはNeovimビルトインを介して箱から出して完全に使用できますが、他の3rdを使用することをお勧めします これらをさらに統合するためのパーティープラグイン。次のプラグインをお勧めします。
mason-lspconfig.nvim
nvim-dap
null-ls.nvim または nvim-lint
formatter.nvim
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
:h mason-requirements
mason.nvim複数の異なるユーティリティ (たとえば、, 、およびはすべて完全な代替です) を試行して、最小要件を緩和します。 推奨される最小要件は次のとおりです。
wget
curl
Invoke-WebRequest
>= 0.7.0
git(1)
curl(1)
wget(1)
unzip(1)
tar(1)
gzip(1)
これは、 や などの外部パッケージマネージャーに定期的にシェルアウトすることに注意してください。に応じて あなたの個人的な使用、これらのいくつかもインストールする必要があります。完全なリストについては、「」を参照してください。
mason.nvim
cargo
npm
:checkhealth mason
use { "williamboman/mason.nvim" }
Plug 'williamboman/mason.nvim'
:h mason-quickstart
require("mason").setup()
mason.nvimセットアップ中にできるだけ負荷がかからないように最適化されています。プラグインを遅延読み込みするか、どういうわけか延期する セットアップは推奨されません。
使用可能な設定については、「構成」セクションを参照してください。
3rdパーティの拡張機能のリストについては、Wikiを参照してください。
mason-lspconfig.nvim
- での使用に推奨lspconfig
:h mason-commands
:Mason- グラフィカルなステータスウィンドウを開きます
:MasonInstall <package> ...- 提供されたパッケージをインストール/再インストールします
:MasonUninstall <package> ...- 提供されたパッケージをアンインストールします
:MasonUninstallAll- すべてのパッケージをアンインストールします
:MasonLog- ログファイルを新しいタブウィンドウで開きます
mason.nvim
:h mason-settings
オプションで、関数を呼び出すときの特定の動作を構成できます。使用可能なすべての設定のリストについては、デフォルト設定を参照してください。
mason.nvim
.setup()
例:
require("mason").setup({
ui = {
icons = {
package_installed = "✓",
package_pending = "➜",
package_uninstalled = "✗"
}
}
})
local DEFAULT_SETTINGS = {
-- The directory in which to install packages.
install_root_dir = path.concat { vim.fn.stdpath "data", "mason" },
-- Where Mason should put its bin location in your PATH. Can be one of:
-- - "prepend" (default, Mason's bin location is put first in PATH)
-- - "append" (Mason's bin location is put at the end of PATH)
-- - "skip" (doesn't modify PATH)
---@type '"prepend"' | '"append"' | '"skip"'
PATH = "prepend",
pip = {
-- Whether to upgrade pip to the latest version in the virtual environment before installing packages.
upgrade_pip = false,
-- 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,
-- 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",
},
-- The provider implementations to use for resolving package metadata (latest version, available versions, etc.).
-- Accepts multiple entries, where later entries will be used as fallback should prior providers fail.
-- Builtin providers are:
-- - mason.providers.registry-api (default) - uses the https://api.mason-registry.dev API
-- - mason.providers.client - uses only client-side tooling to resolve metadata
providers = {
"mason.providers.registry-api",
},
ui = {
-- Whether to automatically check for new versions when opening the :Mason window.
check_outdated_packages_on_open = true,
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
border = "none",
icons = {
-- The list icon to use for installed packages.
package_installed = "◍",
-- The list icon to use for packages that are installing, or queued for installation.
package_pending = "◍",
-- The list icon to use for packages that are not installed.
package_uninstalled = "◍",
},
keymaps = {
-- Keymap to expand a package
toggle_package_expand = "<CR>",
-- Keymap to install the package under the current cursor position
install_package = "i",
-- Keymap to reinstall/update the package under the current cursor position
update_package = "u",
-- Keymap to check for new version for the package under the current cursor position
check_package_version = "c",
-- Keymap to update all installed packages
update_all_packages = "U",
-- Keymap to check which installed packages are outdated
check_outdated_packages = "C",
-- Keymap to uninstall a package
uninstall_package = "X",
-- Keymap to cancel a package installation
cancel_installation = "<C-c>",
-- Keymap to apply language filter
apply_language_filter = "<C-f>",
},
},
}
:ヘルプmason.nvim!