From 9489fbefa922045ff56a10043bf94c6a200b48c5 Mon Sep 17 00:00:00 2001 From: Geoff Cheshire Date: Sun, 10 May 2026 15:56:54 -0400 Subject: [PATCH] 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 --- .gitignore | 4 ++++ UNIFIED.md | 26 +++++++++++++++++++------- init.lua | 11 +++-------- lua/local.lua.example | 25 +++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 lua/local.lua.example diff --git a/.gitignore b/.gitignore index 3890fdb8..443b736c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ spell/ # nvim-pack-lock.json .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 diff --git a/UNIFIED.md b/UNIFIED.md index 877ebef2..a214b663 100644 --- a/UNIFIED.md +++ b/UNIFIED.md @@ -33,11 +33,21 @@ require 'whipsmart.plugins.debug' Available extras: `autopairs`, `debug` (DAP/Go), `gitsigns` (extended keymaps), `indent_line`, `lint`, `neo-tree`. -## πŸ’» Machine Detection -We use `vim.uv.os_gethostname()` in `init.lua` to toggle settings. -Current machines: -- **vera**: (Primary Linux workstation) - High-res font, full LSP suite. -- **tau**: Linux workstation. +## πŸ’» Per-Machine Local Config +Each machine maintains a `lua/local.lua` that is **gitignored** and never committed. +`init.lua` loads it at startup via `pcall(require, 'local')` β€” silently skipped if absent. + +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 - [x] Rename project to **whipsmart.nvim**. @@ -48,8 +58,10 @@ Current machines: - [x] Explicit plugin load order in `init.lua`. - [x] Decouple Mason package names from lspconfig server names. - [x] Document LSP server setup and opt-in extras workflow. -- [ ] Merge legacy plugins from other machine forks. -- [ ] Add machine-specific UI toggles for terminal vs. GUI Neovim. +- [x] Replace hostname detection with gitignored lua/local.lua per-machine overrides. +- [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. ## πŸ› οΈ Git Maintenance diff --git a/init.lua b/init.lua index 5445dc11..6cc720ac 100644 --- a/init.lua +++ b/init.lua @@ -48,14 +48,9 @@ do vim.g.maplocalleader = ' ' -- [[ Machine Specific Setup ]] - local hostname = vim.uv.os_gethostname() - if hostname == 'vera' then - -- Vera specific settings - elseif hostname == 'tau' then - -- tau specific settings - elseif hostname == 'hecate' then - -- hecate specific settings - end + -- lua/local.lua is gitignored β€” each machine maintains its own copy. + -- See lua/local.lua.example for available options. + pcall(require, 'local') -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true diff --git a/lua/local.lua.example b/lua/local.lua.example new file mode 100644 index 00000000..2f304b74 --- /dev/null +++ b/lua/local.lua.example @@ -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'