Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
vim.g.mapleader = " "

local function ensure_system_parsers_on_rtp()
if #vim.api.nvim_get_runtime_file("parser/vimdoc.*", false) > 0 then
return
end

for _, dir in ipairs { "/usr/lib/nvim", "/usr/lib64/nvim" } do
if vim.uv.fs_stat(dir .. "/parser") then
vim.opt.rtp:append(dir)
return
end
end
end

-- Distro packages may ship parsers under /usr/lib*/nvim instead of runtime/.
ensure_system_parsers_on_rtp()

-- bootstrap lazy and all plugins
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"

Expand All @@ -25,6 +41,9 @@ require("lazy").setup({
{ import = "plugins" },
}, lazy_config)

-- lazy can rewrite rtp, so restore system parser path after setup too.
ensure_system_parsers_on_rtp()

-- load theme
dofile(vim.g.base46_cache .. "defaults")
dofile(vim.g.base46_cache .. "statusline")
Expand Down