feat: update nvim config

This commit is contained in:
2026-03-31 16:26:32 +08:00
parent 3bc05c5abb
commit 4ec54aeff7
16 changed files with 205 additions and 469 deletions
+16
View File
@@ -2,6 +2,22 @@ if vim.loader then
vim.loader.enable()
end
-- 让 Mason / 健康检查能找到本仓库常用的本地 CLI(fd、lazygit、tree-sitter 等)
local _local_bin = vim.fn.expand("~/.local/bin")
if vim.fn.isdirectory(_local_bin) == 1 then
vim.env.PATH = _local_bin .. ":" .. vim.env.PATH
end
-- 全局 npm 包(如 mermaid-cli 的 `mmdc`)通常在 $(npm prefix -g)/bin
do
local ok, out = pcall(vim.fn.system, { "npm", "prefix", "-g" })
if ok and out and out ~= "" then
local npm_bin = vim.fn.trim(out) .. "/bin"
if vim.fn.isdirectory(npm_bin) == 1 then
vim.env.PATH = npm_bin .. ":" .. vim.env.PATH
end
end
end
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1