(neovim) switch to own configuration
This commit is contained in:
parent
957ec52ca8
commit
977453fa05
51 changed files with 1145 additions and 358 deletions
25
config/common/nvim/lua/core/mason-path.lua
Normal file
25
config/common/nvim/lua/core/mason-path.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
local mason_bin = vim.fn.stdpath("data") .. "/mason/bin"
|
||||
local current_path = vim.env.PATH or ""
|
||||
|
||||
-- Remove any existing Mason bin entries to prevent duplicates
|
||||
local path_entries = vim.split(current_path, ":")
|
||||
local clean_path_entries = {}
|
||||
local seen = {}
|
||||
|
||||
for _, entry in ipairs(path_entries) do
|
||||
-- Skip Mason bin entries and duplicates
|
||||
if entry ~= mason_bin and entry ~= "" and not seen[entry] then
|
||||
seen[entry] = true
|
||||
table.insert(clean_path_entries, entry)
|
||||
end
|
||||
end
|
||||
|
||||
-- Add Mason bin directory at the beginning
|
||||
local new_path = mason_bin .. ":" .. table.concat(clean_path_entries, ":")
|
||||
vim.env.PATH = new_path
|
||||
|
||||
-- Verify Mason bin directory exists
|
||||
if vim.fn.isdirectory(mason_bin) == 0 then
|
||||
-- Mason not installed yet, create placeholder
|
||||
vim.fn.mkdir(mason_bin, "p")
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue