feat: add bootstrap module and update docs
- Add lua/bootstrap.lua: redirects Neovim data/state paths when running
as root (e.g. via symlinked ~/.config/nvim) to prevent root sessions
from conflicting with the user-level install
- Update init.lua to require("bootstrap") before any other module
- Standardize license headers across all Lua files (capitalize author,
add SPDX-License-Identifier)
- Update README with full plugin stack section, bootstrap docs,
machine-local override docs, qalculate dependency, and blink.cmp
auto-rebuild note
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ Bootstaps │
|
||||
-- ╰─────────────────────────────────────────────────────────╯
|
||||
|
||||
---- Copyright (C) 2026 Rootiest
|
||||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
-- This file is sourced before anything else so it can be used to set up
|
||||
-- the runtime path and other fundamental settings.
|
||||
|
||||
-- ─────────────── Manage root user permissions for Neovim ───────────────
|
||||
|
||||
-- Redirect data directories if running as root to avoid permission issues
|
||||
if os.getenv("USER") == "root" or os.getenv("SUDO_USER") ~= nil then
|
||||
local root_data = "/root/.local/share/nvim-root"
|
||||
vim.opt.packpath:prepend(root_data .. "/site")
|
||||
vim.opt.runtimepath:prepend(root_data .. "/site")
|
||||
-- Prevent root from writing shada to your user home
|
||||
vim.opt.shadafile = "/root/.local/state/nvim-root.shada"
|
||||
end
|
||||
Reference in New Issue
Block a user