diff --git a/AGENTS.md b/AGENTS.md index 65306fc..a3c3942 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,6 +94,7 @@ This repository is being migrated to a modern, minimal Neovim setup driven by Lu ## Process - Before large changes, update the task plan via the CLI `update_plan` tool. - Keep the live checklist in `MIGRATION_PLAN.md:1` up to date and in sync with changes. +-- After any config or plugin change, immediately update `MIGRATION_PLAN.md` (check off items, add notes, or adjust next steps). - At the start of each phase, confirm scope and priorities for that phase. - Keep PR-sized patches; avoid broad unrelated edits. - Document non-obvious choices in commit messages or short comments near the code that needs it. diff --git a/MIGRATION_PLAN.md b/MIGRATION_PLAN.md index 39475ab..45c6f40 100644 --- a/MIGRATION_PLAN.md +++ b/MIGRATION_PLAN.md @@ -6,18 +6,19 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date. - [x] Create AGENTS.md with rules ## Phase 1 — Clean & Archive Legacy Config -- [ ] Confirm scope and priorities for this phase -- [ ] Inventory existing Vimscript, plugin files, and directories -- [ ] Create `legacy/` archive folder within this config -- [ ] Move legacy init files and plugin directories into `legacy/` (do not delete) -- [ ] Optionally add `legacy/README.md` noting what was archived -- [ ] Keep `undodir`, `spell`, `view`, `UltiSnips`, `templates` as-is for now (review later) +- [x] Confirm scope and priorities for this phase +- [x] Inventory existing Vimscript, plugin files, and directories +- [x] Create `legacy/` archive folder within this config +- [x] Move legacy init files and plugin directories into `legacy/` (do not delete) +- [x] Optionally add `legacy/README.md` noting what was archived +- [x] Keep `undodir`, `spell`, `view`, `UltiSnips`, `templates` as-is for now (review later) ## Phase 2 — Bootstrap -- [ ] Confirm scope and priorities for this phase -- [ ] Scaffold Lua config skeleton (`init.lua`, `lua/settings.lua`, `lua/keymaps.lua`, `lua/autocmds.lua`, `lua/utils.lua`, `lua/plugins/`) -- [ ] Bootstrap `lazy.nvim` plugin manager -- [ ] Disable unused providers (ruby, perl, node) +- [x] Confirm scope and priorities for this phase +- [x] Scaffold Lua config skeleton (`init.lua`, `lua/settings.lua`, `lua/keymaps.lua`, `lua/autocmds.lua`, `lua/utils.lua`, `lua/plugins/`) +- [x] Bootstrap `lazy.nvim` plugin manager +- [x] Disable unused providers (ruby, perl, node) + - [x] Ensure lazy boots without specs (add empty `lua/plugins/init.lua`) ## Phase 3 — Core Editing & LSP - [ ] Confirm scope and priorities for this phase diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..4bf981c --- /dev/null +++ b/init.lua @@ -0,0 +1,26 @@ +-- Leader keys early +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- Load basic settings, keymaps, autocmds (kept minimal for now) +require('settings') +require('keymaps') +require('autocmds') + +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + 'git', 'clone', '--filter=blob:none', '--single-branch', + 'https://github.com/folke/lazy.nvim.git', lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Setup plugin system (plugins will be added incrementally) +require('lazy').setup({ + spec = { + { import = 'plugins' }, + }, +}) + diff --git a/lua/autocmds.lua b/lua/autocmds.lua new file mode 100644 index 0000000..ba60fe8 --- /dev/null +++ b/lua/autocmds.lua @@ -0,0 +1,7 @@ +-- Non-plugin autocommands (minimal placeholder for bootstrap) +local aug = vim.api.nvim_create_augroup('UserDefaults', { clear = true }) + +-- Add specific autocmds in later phases + +return {} + diff --git a/lua/keymaps.lua b/lua/keymaps.lua new file mode 100644 index 0000000..e61a45b --- /dev/null +++ b/lua/keymaps.lua @@ -0,0 +1,8 @@ +-- Non-plugin keymaps (kept intentionally minimal for bootstrap) +local map = vim.keymap.set +local opts = { noremap = true, silent = true } + +-- Add non-plugin keymaps during Phase 3 when porting settings + +return {} + diff --git a/lua/plugins/.gitkeep b/lua/plugins/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..3acae53 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,4 @@ +-- Placeholder to let lazy.nvim import the `plugins` module before specs exist. +-- Individual plugin specs will be added as separate files in this directory. +return {} + diff --git a/lua/settings.lua b/lua/settings.lua new file mode 100644 index 0000000..49f1c71 --- /dev/null +++ b/lua/settings.lua @@ -0,0 +1,9 @@ +-- Minimal settings for bootstrap phase + +-- Disable unused language providers early; enable later only if a plugin requires them +vim.g.loaded_ruby_provider = 0 +vim.g.loaded_perl_provider = 0 +vim.g.loaded_node_provider = 0 + +-- Additional non-plugin options will be migrated in Phase 3 + diff --git a/lua/utils.lua b/lua/utils.lua new file mode 100644 index 0000000..419cde8 --- /dev/null +++ b/lua/utils.lua @@ -0,0 +1,10 @@ +local M = {} + +function M.safe_require(name) + local ok, mod = pcall(require, name) + if ok then return mod end + return nil +end + +return M +