clean up legacy files
This commit is contained in:
parent
638ff2812f
commit
bc35923fe2
|
|
@ -0,0 +1,99 @@
|
|||
# AGENTS: Neovim Config Migration
|
||||
|
||||
Scope: applies to the entire `~/.config/nvim` directory tree.
|
||||
|
||||
This repository is being migrated to a modern, minimal Neovim setup driven by Lua and lazy.nvim. Follow these rules when making changes.
|
||||
|
||||
## Goals
|
||||
- Modern Lua-first config; avoid Vimscript unless explicitly requested.
|
||||
- Keep it minimal, fast, and maintainable.
|
||||
- Base plugin management on `lazy.nvim` with modular plugin specs.
|
||||
- Support tab-per-context workflow with Neo-tree per tab, Telescope navigation, LSP, Treesitter, Copilot, and sane UX defaults.
|
||||
|
||||
## Do Not Reintroduce
|
||||
- Custom Vimscript tabline/statusline, foldtext, UI hacks.
|
||||
- Legacy autocommands toggling cursorline/column per window.
|
||||
- CoC or CoC-specific config.
|
||||
- netrw settings (Neo-tree will be used).
|
||||
- Providers for ruby/perl/node (disable unless required by a plugin).
|
||||
- Auto-reload vimrc-on-write templates.
|
||||
- `cursorcolumn` and old folding logic not related to UFO.
|
||||
|
||||
## Repository Structure (target)
|
||||
```
|
||||
~/.config/nvim/
|
||||
├── init.lua -- entrypoint; bootstraps lazy.nvim and loads Lua modules
|
||||
└── lua/
|
||||
├── settings.lua -- non-plugin options
|
||||
├── keymaps.lua -- non-plugin keymaps
|
||||
├── autocmds.lua -- non-plugin autocommands
|
||||
├── utils.lua -- helpers (only if needed)
|
||||
└── plugins/ -- one file per plugin or domain
|
||||
├── neo-tree.lua
|
||||
├── telescope.lua
|
||||
├── treesitter.lua
|
||||
├── cmp.lua
|
||||
├── lsp.lua
|
||||
├── copilot.lua
|
||||
├── ufo.lua
|
||||
├── gitsigns.lua
|
||||
├── markdown.lua
|
||||
└── none-ls.lua
|
||||
```
|
||||
|
||||
## Coding Conventions
|
||||
- Use Lua APIs: `vim.opt`, `vim.api.nvim_create_autocmd`, `vim.keymap.set`.
|
||||
- No inline Vimscript or `vim.cmd` blocks unless strictly necessary.
|
||||
- Keep plugin configuration self-contained in its plugin spec file.
|
||||
- Prefer small, readable modules and minimal configuration over heavy customization.
|
||||
- Keymaps: use `vim.keymap.set` with `{ silent = true, noremap = true }` defaults unless otherwise required.
|
||||
- Autocommands: group via `vim.api.nvim_create_augroup` and create specific, narrowly scoped autocmds.
|
||||
- Avoid global state; return tables from modules and plugin specs.
|
||||
|
||||
## Plugin Management (lazy.nvim)
|
||||
- Each plugin lives in `lua/plugins/<name>.lua` and returns a spec table.
|
||||
- Use `opts = {}` for default options and `config = function(_, opts) ... end` for setup.
|
||||
- Only include plugins listed in the migration guide unless explicitly approved.
|
||||
|
||||
## Required Plugin Categories
|
||||
- Core: `nvim-lspconfig`, `nvim-cmp`, `cmp-nvim-lsp`, `cmp-buffer`, `cmp-path`, `LuaSnip`.
|
||||
- Navigation: `neo-tree.nvim`, `telescope.nvim` (+ optional `telescope-fzf-native.nvim`).
|
||||
- Treesitter: `nvim-treesitter`, `nvim-treesitter-textobjects`, `nvim-ts-autotag`.
|
||||
- UX/Editing: `Comment.nvim`, `surround.nvim`, `nvim-autopairs`, `indent-blankline.nvim`, `leap.nvim` or `flash.nvim`, `nvim-ufo`, `undotree` (optional).
|
||||
- Git: `gitsigns.nvim`.
|
||||
- Markdown: `render-markdown.nvim`.
|
||||
- Copilot: `copilot.lua`, `copilot-cmp`.
|
||||
- Formatting: `none-ls.nvim`.
|
||||
|
||||
## Workflow Requirements to Preserve
|
||||
- Tab-per-context: each tab has its own Neo-tree root.
|
||||
- Provide keymaps for: Neo-tree floating, Neo-tree sidebar toggle, and file preview. Previews should not pollute buffer list.
|
||||
- Keep splits inside tabs.
|
||||
- Use Telescope and LSP for navigation.
|
||||
- Heavy HTML/PHP/JS/Markdown usage (WordPress plugin dev) — prioritize these languages in LSP/Treesitter.
|
||||
|
||||
## Behaviours to Keep (modernized)
|
||||
- Abbreviations: `adn→and`, `waht→what`, `tehn→then`, `functin→function`, `positin→position`.
|
||||
- Templates: auto-populate `.sh` from template.
|
||||
- Whitespace highlighting (use modern alternatives, e.g., `listchars`, plugins if needed).
|
||||
- Persistent folds (prefer `nvim-ufo`).
|
||||
- Spell & text: `spelllang=en_gb`, custom `listchars`, `showbreak`.
|
||||
|
||||
## Migration Notes
|
||||
- Do not edit legacy Vimscript files except to extract settings to Lua. Keep them intact until migration completes.
|
||||
- Introduce `init.lua` and bootstrap `lazy.nvim` before adding plugins.
|
||||
- Disable unnecessary providers early: `vim.g.loaded_ruby_provider = 0`, etc.
|
||||
- Keep startup fast; avoid unnecessary autoloading or heavy defaults.
|
||||
- When cleaning, archive existing files into a `legacy/` folder within this config instead of deleting. Maintain a brief index if helpful.
|
||||
|
||||
## Validation
|
||||
- Ensure Neovim starts without errors and with minimal startup time.
|
||||
- Verify tab workflow, Neo-tree behaviour, Telescope, LSP basics, and completion.
|
||||
- Keep plugin count tight; remove anything unused.
|
||||
|
||||
## 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.
|
||||
- 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.
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
# Neovim Migration Checklist
|
||||
|
||||
Source of truth for the step-by-step rebuild. Keep this concise and up to date. See details in `neovim-migration-guide.md`.
|
||||
|
||||
## Phase 0 — Ground Rules
|
||||
- [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)
|
||||
|
||||
## 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)
|
||||
|
||||
## Phase 3 — Core Editing & LSP
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Port non-plugin settings to Lua (options, listchars, showbreak, spelllang=en_gb)
|
||||
- [ ] Add core completion stack: `nvim-cmp`, `cmp-nvim-lsp`, `cmp-buffer`, `cmp-path`, `LuaSnip`
|
||||
- [ ] Add `nvim-lspconfig` with minimal defaults (no over-configuration)
|
||||
|
||||
## Phase 4 — Navigation
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Add `neo-tree.nvim` with per-tab roots, sidebar toggle, floating view, and preview keymap (no buffer pollution)
|
||||
- [ ] Add `telescope.nvim` (+ optional `telescope-fzf-native.nvim`) and basic pickers
|
||||
|
||||
## Phase 5 — Treesitter
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Add `nvim-treesitter` with incremental selection, highlighting
|
||||
- [ ] Add `nvim-treesitter-textobjects`
|
||||
- [ ] Add `nvim-ts-autotag`
|
||||
|
||||
## Phase 6 — UX / Editing
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Add `numToStr/Comment.nvim`
|
||||
- [ ] Add `kylechui/nvim-surround`
|
||||
- [ ] Add `windwp/nvim-autopairs`
|
||||
- [ ] Add `lukas-reineke/indent-blankline.nvim`
|
||||
- [ ] Add `ggandor/leap.nvim` or `folke/flash.nvim`
|
||||
- [ ] Add `kevinhwang91/nvim-ufo` for folding
|
||||
- [ ] (Optional) Add `mbbill/undotree`
|
||||
|
||||
## Phase 7 — Git, Markdown, Copilot, Formatting
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Add `lewis6991/gitsigns.nvim`
|
||||
- [ ] Add `render-markdown.nvim`
|
||||
- [ ] Add `zbirenbaum/copilot.lua` + `copilot-cmp`
|
||||
- [ ] Add `nvimtools/none-ls.nvim` with minimal formatters/linters
|
||||
|
||||
## Phase 8 — Migrate Kept Behaviours
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Abbreviations: `adn→and`, `waht→what`, `tehn→then`, `functin→function`, `positin→position`
|
||||
- [ ] Templates: auto-populate new `.sh` from template
|
||||
- [ ] Whitespace highlighting (modern approach)
|
||||
- [ ] Persistent folds (via UFO)
|
||||
|
||||
## Phase 9 — Cleanup & Validation
|
||||
- [ ] Confirm scope and priorities for this phase
|
||||
- [ ] Retire legacy Vimscript files (keep for reference until verified)
|
||||
- [ ] Validate startup performance (no errors, fast launch)
|
||||
- [ ] Validate tab-per-context workflow with Neo-tree
|
||||
- [ ] Validate Telescope navigation + LSP jumps
|
||||
- [ ] Validate HTML/PHP/JS/Markdown tooling
|
||||
|
||||
---
|
||||
|
||||
Notes:
|
||||
- Keep plugin specs minimal; configure in their own `lua/plugins/*.lua` files.
|
||||
- Avoid adding plugins not listed in the guide unless explicitly requested.
|
||||
- Prefer simple defaults; only add settings that clearly improve workflow.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue