Compare commits

...

2 Commits

Author SHA1 Message Date
rootiest 859cfc3793 Merge pull request 'feat: add bootstrap module and update docs' (#2) from feat/add-bootstrap-and-update-docs into main
Reviewed-on: #2
2026-05-08 18:21:52 +00:00
rootiest d43128c2d0 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>
2026-05-08 14:19:11 -04:00
7 changed files with 83 additions and 63 deletions
+46 -4
View File
@@ -14,19 +14,56 @@ A modern, modular, and high-performance Neovim configuration built from scratch
- **AI-Powered**: Native integration with the **GitHub Copilot Language Server**. - **AI-Powered**: Native integration with the **GitHub Copilot Language Server**.
- **User-Centric QoL**: Hybrid line numbers, autosave-on-edit, and seamless system clipboard integration. - **User-Centric QoL**: Hybrid line numbers, autosave-on-edit, and seamless system clipboard integration.
- **Resilient & Portable**: Intelligent terminal title management (Kitty + Fallback), automatic project root detection, and machine-local override support. - **Resilient & Portable**: Intelligent terminal title management (Kitty + Fallback), automatic project root detection, and machine-local override support.
- **Lean & Readable**: ~800 lines of Lua code (excluding comments and blanks). - **Lean & Readable**: ~850 lines of Lua code (excluding comments and blanks).
## 📁 Architecture ## 📁 Architecture
The configuration is strictly modular: The configuration is strictly modular:
- `init.lua`: Entry point and global state initialization. - `init.lua`: Entry point, bootstrap, global state initialization, and machine-local overrides.
- `lua/bootstrap.lua`: Early runtime setup — redirects Neovim's data/state paths when running as root (e.g. via a symlinked `~/.config/nvim`), preventing root sessions from polluting or conflicting with the user-level install.
- `lua/lazyload.lua`: Logic for async and phased plugin loading. - `lua/lazyload.lua`: Logic for async and phased plugin loading.
- `lua/options.lua`: Global Vim settings, root management, and terminal title logic. - `lua/options.lua`: Global Vim settings, auto-reload, root management, and terminal title logic.
- `lua/plugins.lua`: Plugin declarations and detailed registry-based configurations. - `lua/plugins.lua`: Plugin declarations and detailed registry-based configurations.
- `lua/keymaps.lua`: Centralized user-facing keybindings. - `lua/keymaps.lua`: Centralized user-facing keybindings.
- `lua/const.lua`: Stores constant values (like dashboard headers) for the configuration. - `lua/const.lua`: Stores constant values (like dashboard headers) for the configuration.
## 🔌 Plugin Stack
### Core UI
- **Catppuccin**: Primary colorscheme (Mocha flavour).
- **Lualine**: Statusline with Git diff and line-by-line Gitsigns blame.
- **Noice**: Modern UI for cmdline (popup), messages, and LSP hover.
- **Snacks**: High-performance dashboard, explorer, and pickers.
- **Nvim-web-devicons**: Consistent icons across UI components.
### Editing & Navigation
- **Flash**: Enhanced motion and search.
- **Focusline**: Keeps the active line at a configurable screen position (30%) during scrolling motions.
- **Mini.ai**: Better text objects (including `g` for entire buffer).
- **Mini.surround**: Surround text objects (add/delete/change).
- **Mini.pairs**: Auto-close brackets and quotes.
- **Persistence**: Session management.
- **Which-key**: Interactive keybinding documentation.
- **Gitsigns**: In-buffer git indicators and line highlights.
- **Grug-far**: Project-wide search and replace.
- **Gx.nvim**: Smart URL/reference opener under cursor.
- **Comment-box**: Decorative comment boxes and lines.
- **Undotree**: Visual undo history browser.
- **Zen Mode**: Distraction-free editing.
- **Qalc**: Inline calculator via `qalculate`.
### LSP & Completion
- **Blink.cmp** + **blink.lib**: High-performance Rust-based completion. Auto-detects binary across install layouts; falls back gracefully if unavailable. Rebuilds automatically on `PackChanged`.
- **LSPConfig + Mason**: Managed LSP support for Lua, C/C++, Rust, Python, Fish, and Shell.
- **Copilot**: GitHub Copilot language server integration.
- **Conform**: Formatter with format-on-save and range formatting.
- **Inc-rename**: Incremental LSP rename with live preview.
- **Lazydev**: Neovim Lua type definitions for `lua_ls`.
### Terminal
- **Kitty Scrollback**: Browse Kitty terminal scrollback buffer inside Neovim.
## 🛠️ System Dependencies ## 🛠️ System Dependencies
To ensure all features (pickers, formatters, and LSPs) work correctly, the following packages are required: To ensure all features (pickers, formatters, and LSPs) work correctly, the following packages are required:
@@ -44,6 +81,7 @@ To ensure all features (pickers, formatters, and LSPs) work correctly, the follo
- `Node.js` & `npm` (Copilot and various LSPs) - `Node.js` & `npm` (Copilot and various LSPs)
- `Python3` & `pip` (Python LSPs) - `Python3` & `pip` (Python LSPs)
- `Cargo` (Rust toolchain, required for building `blink.cmp`) - `Cargo` (Rust toolchain, required for building `blink.cmp`)
- `qalculate` (optional, required for the Qalc calculator plugin)
### Installation Commands ### Installation Commands
@@ -68,10 +106,14 @@ nvim
### Post-Install ### Post-Install
1. **Build Blink**: If completion isn't working, run `cargo build --release` inside `~/.local/share/nvim/site/pack/core/opt/blink.cmp`. 1. **Build Blink**: Completion auto-rebuilds on `PackChanged`. If it still isn't working, run `cargo build --release` inside `~/.local/share/nvim/site/pack/core/opt/blink.cmp`.
2. **LSP Servers**: Run `:Mason` to monitor the installation of Language Servers. 2. **LSP Servers**: Run `:Mason` to monitor the installation of Language Servers.
3. **Copilot**: Run `:LspCopilotSignIn` to authenticate. 3. **Copilot**: Run `:LspCopilotSignIn` to authenticate.
### Machine-Local Overrides
Place machine-specific or secret configuration in `~/.config/.user-dots/nvim/local.lua` or `~/.config/.user-dots/nvim/secrets.lua`. These files are sourced automatically at startup if present, and are intentionally outside the repo to avoid accidental commits.
## ⌨️ Key Features & Mappings ## ⌨️ Key Features & Mappings
| Key | Description | | Key | Description |
+8 -17
View File
@@ -4,20 +4,11 @@
└────────────────────────────────────────────────────────────────┘ └────────────────────────────────────────────────────────────────┘
--]] --]]
-- Copyright (C) 2026 rootiest -- Copyright (C) 2026 Rootiest
-- -- SPDX-License-Identifier: AGPL-3.0-or-later
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by -- Trigger bootstrap (runtime path, etc.)
-- the Free Software Foundation, either version 3 of the License, or require("bootstrap")
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
-- Initialize global registry -- Initialize global registry
_G.Config = { _G.Config = {
@@ -27,9 +18,9 @@ _G.Config = {
-- Load core modules -- Load core modules
require("lazyload") -- Plugin lazy-loading module require("lazyload") -- Plugin lazy-loading module
require("options") -- Configuration options require("options") -- Configuration options
require("plugins") -- Plugin specifications and setup require("plugins") -- Plugin specifications and setup
require("keymaps") -- Key mappings require("keymaps") -- Key mappings
-- Source machine-local and secret overrides (silently ignored if absent) -- Source machine-local and secret overrides (silently ignored if absent)
local user_dots = vim.fn.expand("~/.config/.user-dots/nvim/") local user_dots = vim.fn.expand("~/.config/.user-dots/nvim/")
+20
View File
@@ -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
+3
View File
@@ -4,6 +4,9 @@
└────────────────────────────────────────────────────────────────┘ └────────────────────────────────────────────────────────────────┘
--]] --]]
-- Copyright (C) 2026 Rootiest
-- SPDX-License-Identifier: GPL-3.0-or-later
local M = {} local M = {}
--- Dashboard Header --- Dashboard Header
+2 -14
View File
@@ -4,20 +4,8 @@
└────────────────────────────────────────────────────────────────┘ └────────────────────────────────────────────────────────────────┘
--]] --]]
-- Copyright (C) 2026 rootiest ---- Copyright (C) 2026 Rootiest
-- -- SPDX-License-Identifier: GPL-3.0-or-later
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
-- System Clipboard Integration -- System Clipboard Integration
-- This makes 'y' and 'p' (and all other yank/paste operations) -- This makes 'y' and 'p' (and all other yank/paste operations)
+2 -14
View File
@@ -4,20 +4,8 @@
└────────────────────────────────────────────────────────────────┘ └────────────────────────────────────────────────────────────────┘
--]] --]]
-- Copyright (C) 2026 rootiest ---- Copyright (C) 2026 Rootiest
-- -- SPDX-License-Identifier: GPL-3.0-or-later
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
-- ╭─────────────────────────────────────────────────────────╮ -- ╭─────────────────────────────────────────────────────────╮
-- │ Basic Options │ -- │ Basic Options │
+2 -14
View File
@@ -4,20 +4,8 @@
└────────────────────────────────────────────────────────────────┘ └────────────────────────────────────────────────────────────────┘
--]] --]]
-- Copyright (C) 2026 rootiest ---- Copyright (C) 2026 Rootiest
-- -- SPDX-License-Identifier: GPL-3.0-or-later
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
-- Catppuccin.nvim -- Catppuccin.nvim
-- Eagerly load the colorscheme plugin. -- Eagerly load the colorscheme plugin.