Neovim이 실행되는 Neovim의 휴대용 패키지 관리자.
LSP 서버, DAP 서버, 라이터 및 형태를 쉽게 설치하고 관리합니다.
:help mason.nvim
최신 버전 : v1.10.0
:h mason-introduction
mason.nvim
은 단일 인터페이스를 통해 LSP 서버, DAP 서버, 라이터 및 형식 반포와 같은 외부 편집기 툴링을 쉽게 관리 할 수있는 Neovim 플러그인입니다. Neovim이 실행되는 곳 (Linux, MacOS, Windows 등)이 어디에서나 실행되며 작은 외부 요구 사항이 필요합니다.
패키지는 기본적으로 Neovim의 데이터 디렉토리 ( :h standard-path
)에 설치됩니다. 실행 파일은 단일 bin/
디렉토리에 연결되어 있으며, mason.nvim
설정 중에 Neovim의 경로에 추가하여 Neovim Buildins (Shell, Terminal 등) 및 기타 제 3 자 플러그인의 원활한 액세스를 허용합니다.
사용 가능한 모든 패키지 목록은 https://mason-registry.dev/registry/list를 참조하십시오.
:h mason-how-to-use-packages
Neovim Buildins를 통해 많은 패키지가 상자에서 완벽하게 사용할 수 있지만 다른 제 3 자 플러그인을 사용하여이를 더 통합하는 것이 좋습니다. 다음 플러그인이 권장됩니다.
lspconfig
& mason-lspconfig.nvim
nvim-dap
& nvim-dap-ui
null-ls.nvim
또는 nvim-lint
null-ls.nvim
또는 formatter.nvim
![]() | ![]() | ![]() |
![]() | ![]() | ![]() |
:h mason-requirements
mason.nvim
여러 가지 다른 유틸리티 (예 : wget
, curl
및 Invoke-WebRequest
모두 완벽한 대체물 임)를 시도하여 최소 요구 사항을 완화합니다. 최소 권장 요구 사항은 다음과 같습니다.
>= 0.7.0
git(1)
curl(1)
또는 wget(1)
unzip(1)
tar(1)
또는 gtar(1)
gzip(1)
mason.nvim
cargo
및 npm
과 같은 외부 패키지 관리자에게 정기적으로 껍질을 벗길 것입니다. 개인적 사용에 따라 일부도 설치해야합니다. 전체 목록은 :checkhealth mason
을 참조하십시오.
use {
" williamboman/mason.nvim "
}
{
" williamboman/mason.nvim "
}
Plug ' williamboman/mason.nvim '
:h mason-quickstart
require ( " mason " ). setup ()
mason.nvim
은 설정 중에 가능한 한 적게로드하도록 최적화되었습니다. 게으른로드 플러그인 또는 어떻게 든 설정을 연기하는 것은 권장되지 않습니다.
사용 가능한 설정에 대한 정보는 구성 섹션을 참조하십시오.
타사 확장 목록은 위키를 참조하십시오.
mason-lspconfig.nvim
lspconfig
와 함께 사용하는 데 권장됩니다
:h mason-commands
:Mason
그래픽 상태 창을 엽니 다:MasonUpdate
모든 관리되는 레지스트리를 업데이트합니다:MasonInstall <package> ...
제공된 패키지를 설치/재 설계합니다:MasonUninstall <package> ...
제공된 패키지를 제거합니다:MasonUninstallAll
모든 패키지를 제거합니다:MasonLog
mason.nvim
로그 파일을 새 탭 창에 엽니 다. Mason의 핵심 패키지 레지스트리는 Mason-Org/Mason-Registry에 있습니다. 패키지를 사용하기 전에 레지스트리를 다운로드해야합니다. 이것은 다른 Mason 명령 (예 :MasonInstall
)을 사용할 때 자동으로 수행되지만 :MasonUpdate
명령을 사용하여 수동으로 수행 할 수도 있습니다.
메이슨의 LUA API를 사용하여 패키지에 액세스하는 경우 :h mason-registry.refresh()
및/또는 :h mason-registry.update()
함수를 사용하여 패키지를 검색하기 전에 최신 패키지 정보를 보장하는 것이 좋습니다. .
:h mason-settings
.setup()
함수를 호출 할 때 mason.nvim
의 특정 동작을 선택적으로 구성 할 수 있습니다. 사용 가능한 모든 설정 목록은 기본 구성을 참조하십시오.
예:
require ( " mason " ). setup ({
ui = {
icons = {
package_installed = " ✓ " ,
package_pending = " ➜ " ,
package_uninstalled = " ✗ "
}
}
})
--- @class MasonSettings
local DEFAULT_SETTINGS = {
--- @since 1.0.0
-- The directory in which to install packages.
install_root_dir = path . concat { vim . fn . stdpath " data " , " mason " },
--- @since 1.0.0
-- 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 " ,
--- @since 1.0.0
-- 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 ,
--- @since 1.0.0
-- 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 ,
--- @since 1.0.0
-- [Advanced setting]
-- The registries to source packages from. Accepts multiple entries. Should a package with the same name exist in
-- multiple registries, the registry listed first will be used.
registries = {
" github:mason-org/mason-registry " ,
},
--- @since 1.0.0
-- The provider implementations to use for resolving supplementary package metadata (e.g., all available versions).
-- Accepts multiple entries, where later entries will be used as fallback should prior providers fail.
-- Builtin providers are:
-- - mason.providers.registry-api - uses the https://api.mason-registry.dev API
-- - mason.providers.client - uses only client-side tooling to resolve metadata
providers = {
" mason.providers.registry-api " ,
" mason.providers.client " ,
},
github = {
--- @since 1.0.0
-- 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 " ,
},
pip = {
--- @since 1.0.0
-- Whether to upgrade pip to the latest version in the virtual environment before installing packages.
upgrade_pip = false ,
--- @since 1.0.0
-- 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 = {},
},
ui = {
--- @since 1.0.0
-- Whether to automatically check for new versions when opening the :Mason window.
check_outdated_packages_on_open = true ,
--- @since 1.0.0
-- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
border = " none " ,
--- @since 1.0.0
-- Width of the window. Accepts:
-- - Integer greater than 1 for fixed width.
-- - Float in the range of 0-1 for a percentage of screen width.
width = 0.8 ,
--- @since 1.0.0
-- Height of the window. Accepts:
-- - Integer greater than 1 for fixed height.
-- - Float in the range of 0-1 for a percentage of screen height.
height = 0.9 ,
icons = {
--- @since 1.0.0
-- The list icon to use for installed packages.
package_installed = " ◍ " ,
--- @since 1.0.0
-- The list icon to use for packages that are installing, or queued for installation.
package_pending = " ◍ " ,
--- @since 1.0.0
-- The list icon to use for packages that are not installed.
package_uninstalled = " ◍ " ,
},
keymaps = {
--- @since 1.0.0
-- Keymap to expand a package
toggle_package_expand = " <CR> " ,
--- @since 1.0.0
-- Keymap to install the package under the current cursor position
install_package = " i " ,
--- @since 1.0.0
-- Keymap to reinstall/update the package under the current cursor position
update_package = " u " ,
--- @since 1.0.0
-- Keymap to check for new version for the package under the current cursor position
check_package_version = " c " ,
--- @since 1.0.0
-- Keymap to update all installed packages
update_all_packages = " U " ,
--- @since 1.0.0
-- Keymap to check which installed packages are outdated
check_outdated_packages = " C " ,
--- @since 1.0.0
-- Keymap to uninstall a package
uninstall_package = " X " ,
--- @since 1.0.0
-- Keymap to cancel a package installation
cancel_installation = " <C-c> " ,
--- @since 1.0.0
-- Keymap to apply language filter
apply_language_filter = " <C-f> " ,
--- @since 1.1.0
-- Keymap to toggle viewing package installation log
toggle_package_install_log = " <CR> " ,
--- @since 1.8.0
-- Keymap to toggle the help view
toggle_help = " g? " ,
},
},
}
:help mason.nvim
찾으십시오!