Replace hostname detection with gitignored lua/local.lua per-machine overrides

- init.lua: swap hostname if/elseif block for pcall(require, 'local')
- .gitignore: add lua/local.lua
- lua/local.lua.example: documented template (font, colorscheme, paths, opt-in extras)
- UNIFIED.md: update Machine Detection section and roadmap
This commit is contained in:
Geoff Cheshire 2026-05-10 15:56:54 -04:00
parent 9ab7b3b2d3
commit 9489fbefa9
4 changed files with 51 additions and 15 deletions

4
.gitignore vendored
View File

@ -12,3 +12,7 @@ spell/
# nvim-pack-lock.json # nvim-pack-lock.json
.DS_Store .DS_Store
# Per-machine local overrides — each machine maintains its own copy, never committed.
# See lua/local.lua.example for available options.
lua/local.lua

View File

@ -33,11 +33,21 @@ require 'whipsmart.plugins.debug'
Available extras: `autopairs`, `debug` (DAP/Go), `gitsigns` (extended keymaps), Available extras: `autopairs`, `debug` (DAP/Go), `gitsigns` (extended keymaps),
`indent_line`, `lint`, `neo-tree`. `indent_line`, `lint`, `neo-tree`.
## 💻 Machine Detection ## 💻 Per-Machine Local Config
We use `vim.uv.os_gethostname()` in `init.lua` to toggle settings. Each machine maintains a `lua/local.lua` that is **gitignored** and never committed.
Current machines: `init.lua` loads it at startup via `pcall(require, 'local')` — silently skipped if absent.
- **vera**: (Primary Linux workstation) - High-res font, full LSP suite.
- **tau**: Linux workstation. Use it for anything machine-specific: font size, colorscheme overrides, GUI settings,
local interpreter paths, or enabling whipsmart opt-in extras only on that machine.
See `lua/local.lua.example` for a documented template.
**Setup on a new machine:**
```sh
git clone git@github.com:4rc0s/whipsmart.nvim.git ~/.config/nvim
cp ~/.config/nvim/lua/local.lua.example ~/.config/nvim/lua/local.lua
# Edit lua/local.lua for this machine, then launch nvim
```
## 🗺️ The Grand Unified Roadmap ## 🗺️ The Grand Unified Roadmap
- [x] Rename project to **whipsmart.nvim**. - [x] Rename project to **whipsmart.nvim**.
@ -48,8 +58,10 @@ Current machines:
- [x] Explicit plugin load order in `init.lua`. - [x] Explicit plugin load order in `init.lua`.
- [x] Decouple Mason package names from lspconfig server names. - [x] Decouple Mason package names from lspconfig server names.
- [x] Document LSP server setup and opt-in extras workflow. - [x] Document LSP server setup and opt-in extras workflow.
- [ ] Merge legacy plugins from other machine forks. - [x] Replace hostname detection with gitignored lua/local.lua per-machine overrides.
- [ ] Add machine-specific UI toggles for terminal vs. GUI Neovim. - [x] Port hecate config: LSP servers, formatters, treesitter parsers, custom plugins.
- [ ] Migrate vera and tau to whipsmart (create their lua/local.lua files).
- [ ] Add machine-specific UI toggles for terminal vs. GUI Neovim (via local.lua).
- [ ] Centralize snippet collections. - [ ] Centralize snippet collections.
## 🛠️ Git Maintenance ## 🛠️ Git Maintenance

View File

@ -48,14 +48,9 @@ do
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- [[ Machine Specific Setup ]] -- [[ Machine Specific Setup ]]
local hostname = vim.uv.os_gethostname() -- lua/local.lua is gitignored — each machine maintains its own copy.
if hostname == 'vera' then -- See lua/local.lua.example for available options.
-- Vera specific settings pcall(require, 'local')
elseif hostname == 'tau' then
-- tau specific settings
elseif hostname == 'hecate' then
-- hecate specific settings
end
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = true vim.g.have_nerd_font = true

25
lua/local.lua.example Normal file
View File

@ -0,0 +1,25 @@
-- lua/local.lua — machine-specific overrides
--
-- Copy this file to lua/local.lua on each machine. It is gitignored and
-- never committed, so each machine can have its own version.
--
-- This file is loaded at startup via pcall(require, 'local') in init.lua.
-- It runs after global options are set, so anything here overrides the defaults.
-- Example: GUI font (for Neovide, etc.)
-- vim.o.guifont = 'JetBrainsMono Nerd Font:h13'
-- Example: disable Nerd Font if the terminal doesn't support it
-- vim.g.have_nerd_font = false
-- Example: machine-specific colorscheme
-- vim.cmd.colorscheme 'catppuccin'
-- Example: larger scroll offset on a big monitor
-- vim.o.scrolloff = 15
-- Example: use a local Python interpreter
-- vim.g.python3_host_prog = '/usr/local/bin/python3'
-- Example: enable a whipsmart opt-in extra only on this machine
-- require 'whipsmart.plugins.debug'