adopt neovim 0.12 native editing features

This commit is contained in:
Ray Elliott 2026-10-28 15:43:13 +00:00
commit 282e5e0f0b
18 changed files with 125 additions and 215 deletions

View file

@ -111,15 +111,15 @@ This repository is being migrated to a modern, minimal Neovim setup driven by Lu
- ✅ Phase 3: Core editing & LSP (native exrc + vim.lsp.config migration complete) - ✅ Phase 3: Core editing & LSP (native exrc + vim.lsp.config migration complete)
- ✅ Phase 4: Navigation (Telescope and netrw) - ✅ Phase 4: Navigation (Telescope and netrw)
- ✅ Phase 5: Treesitter (parsers, textobjects, autotag) - ✅ Phase 5: Treesitter (parsers, textobjects, autotag)
- ✅ Phase 6: UX/Editing (Comment, surround, autopairs, indent guides, UFO, undotree) - ✅ Phase 6: UX/Editing (Comment, surround, autopairs, indent guides, UFO, native Undotree)
- ✅ Phase 7: Git integration (Gitsigns) - ✅ Phase 7: Git integration (Gitsigns)
- ✅ Phase 8: Copilot integration (copilot.lua + copilot-cmp) - ✅ Phase 8: Copilot integration (copilot.lua inline suggestions)
- ✅ Phase 9: Formatting & Linting (conform.nvim, nvim-lint, Mason tool installer) - ✅ Phase 9: Formatting & Linting (conform.nvim, nvim-lint, Mason tool installer)
- ✅ Phase 10: Migrate kept behaviors (abbreviations, templates, custom Treesitter queries) - ✅ Phase 10: Migrate kept behaviors (abbreviations, templates, custom Treesitter queries)
- ✅ Phase 11: Modern Paper Tonic colorscheme - ✅ Phase 11: Modern Paper Tonic colorscheme
- ⏳ Phase 12: Cleanup and validation (repository cleanup and automated checks complete; interactive workflow checks remain) - ⏳ Phase 12: Cleanup and validation (repository cleanup and automated checks complete; interactive workflow checks remain)
- ⏳ Phase 13: Controlled Neovim 0.12.6 upgrade (configuration audit complete; isolated plugin validation and activation remain) - ⏳ Phase 13: Neovim 0.12.6 activated; native completion settling checks in progress
- 📋 Phase 13.9: Native Undotree and completion consolidation after activation - ⏳ Phase 13.9: Native Undotree and completion consolidation implemented; interactive validation remains
- 📋 Phase 14: Netrw live previews and directory summaries (planned after upgrade) - 📋 Phase 14: Netrw live previews and directory summaries (planned after upgrade)
## Migration Notes ## Migration Notes

9
LOG.md
View file

@ -203,6 +203,13 @@ Record every decision here with a short rationale. Append new entries; do not re
- 2026-10-28: Disabled lazy.nvim's LuaRocks integration because no configured plugin requires LuaRocks. This removes the irrelevant missing-hererocks health error without adding a system dependency. Candidate health otherwise reports only optional missing language runtimes, the pending inline-Copilot migration, and the `copilot-cmp` deprecation that will disappear with that migration. - 2026-10-28: Disabled lazy.nvim's LuaRocks integration because no configured plugin requires LuaRocks. This removes the irrelevant missing-hererocks health error without adding a system dependency. Candidate health otherwise reports only optional missing language runtimes, the pending inline-Copilot migration, and the `copilot-cmp` deprecation that will disappear with that migration.
- 2026-10-28: Adopted the isolated candidate's reviewed plugin lockfile and compatibility adjustments into the main worktree. Production plugin directories remain unchanged until the 0.12 activation step, preserving the working 0.11 rollback environment. - 2026-10-28: Adopted the isolated candidate's reviewed plugin lockfile and compatibility adjustments into the main worktree. Production plugin directories remain unchanged until the 0.12 activation step, preserving the working 0.11 rollback environment.
- 2026-10-28: Chose the post-activation native-feature direction for 0.12. Keep lazy.nvim because the configuration still benefits from its event/command loading, dependency ordering, and build hooks; do not mix the runtime upgrade with an experimental `vim.pack` migration. After activating 0.12, replace `mbbill/undotree` with the native optional package and trial native insert-mode/LSP completion plus built-in snippets. Copilot will use inline suggestions with a separate accept key rather than appearing in the completion popup; remove the cmp stack only after interactive language and editing validation. - 2026-10-28: Chose the post-activation native-feature direction for 0.12. Keep lazy.nvim because the configuration still benefits from its event/command loading, dependency ordering, and build hooks; do not mix the runtime upgrade with an experimental `vim.pack` migration. After activating 0.12, replace `mbbill/undotree` with the native optional package and trial native insert-mode/LSP completion plus built-in snippets. Copilot will use inline suggestions with a separate accept key rather than appearing in the completion popup; remove the cmp stack only after interactive language and editing validation.
- 2026-10-28: Activated Neovim 0.12.6 with the user-level selector `~/.local/bin/nvim`, which precedes the older `/opt` PATH entry. The root-owned `/opt/neovim` directory could not be reorganized without an interactive sudo password, so 0.11.5 remains intact at `/opt/neovim/nvim-linux-x86_64/bin/nvim`; rollback is `ln -sfn /opt/neovim/nvim-linux-x86_64/bin/nvim ~/.local/bin/nvim`.
- 2026-10-28: Implemented the 0.12 native editing trial. Native `nvim.undotree` now owns `<leader>u`; native autocomplete combines LSP omnifunc results and bounded buffer sources after a 150 ms delay, requires explicit selection, accepts with `<C-y>`, and uses built-in snippet tabstops. Copilot now supplies separate inline ghost text accepted with `<M-l>` and hides while the completion popup is visible. Removed the nvim-cmp, cmp source, LuaSnip, copilot-cmp, and external Undotree specs, integrations, lock entries, and highlight groups.
- 2026-10-28: Refined native completion after the PTY smoke test showed buffer words sorting ahead of a valid PHP method. LSP-attached buffers now autocomplete exclusively from the LSP omnifunc; `<C-x><C-n>` remains the explicit current-buffer word workflow, and non-LSP buffers retain bounded automatic word completion. This makes the first selectable language result predictable without losing native fallback completion.
- 2026-10-28: Added narrow 0.12 guards around the new `autocomplete` option, source match limits, and optional native Undotree package. The retained 0.11.5 binary can therefore still start the configuration for emergency rollback, although native autocomplete and Undotree are intentionally unavailable until the selector is returned to 0.12.6.
- 2026-10-28: Final smoke testing found that loading `nvim.undotree` before lazy.nvim setup left its command registered but removed its Lua module path. Moved `packadd nvim.undotree` after lazy.nvim finalizes `runtimepath`. The same test showed nvim-ts-autotag attaching to Markdown despite the intended filetype restriction; global autotag actions are now disabled and explicitly enabled only for HTML/PHP/JS/TS/Vue tag-bearing filetypes.
- 2026-10-28: Active-runtime validation passed through the normal `nvim` selector: native Undotree opens, netrw and Telescope load, PHP native completion offers and accepts `greetExternal()` with snippet syntax, Copilot's inline client is authenticated, Markdown no longer runs autotag, and HTML autotag exits Insert mode without errors. `vim.deprecated` is clean. Remaining health warnings are optional missing language runtimes and the harmless unknown `markdown.mdx` filetype hint.
- 2026-10-28: Marked `neovim-migration-guide.md` as historical planning input. Its original Neo-tree, cmp, and plugin assumptions are retained for provenance but no longer compete with the active architecture documents.
## Project-Local Configuration ## Project-Local Configuration
@ -242,7 +249,7 @@ Neoconf and the earlier layered JSON proposal were rejected. They remain in the
- `spelllang = en_gb` - `spelllang = en_gb`
- `listchars` and `showbreak` will reuse legacy values. - `listchars` and `showbreak` will reuse legacy values.
- `completeopt = menu,menuone,noselect` for `nvim-cmp`. - `autocomplete` with `completeopt = menu,menuone,noselect,popup,fuzzy` for Neovim 0.12 native completion.
## Process Reminders ## Process Reminders

View file

@ -534,22 +534,22 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date.
- [x] Download the official `nvim-linux-x86_64.tar.gz` release archive - [x] Download the official `nvim-linux-x86_64.tar.gz` release archive
- [x] Verify the archive against the SHA-256 digest published with the release - [x] Verify the archive against the SHA-256 digest published with the release
- [x] Install into a versioned directory without replacing 0.11.5 - [x] Install into a versioned directory without replacing 0.11.5
- [ ] Introduce an explicit `current` symlink (or equivalent atomic selector) for the active version - [x] Introduce an explicit user-level selector for the active version
- [ ] Update the external PATH configuration only after both versioned binaries are verified - [x] Activate 0.12.6 through the existing `~/.local/bin` PATH entry after verifying both binaries
- [ ] Document the one-command rollback to 0.11.5 - [x] Document rollback by repointing `~/.local/bin/nvim` to the 0.11.5 binary
Proposed layout: Installed layout:
```text ```text
/opt/neovim/nvim-0.11.5/ /opt/neovim/nvim-linux-x86_64/ # 0.11.5 rollback runtime
/opt/neovim/nvim-0.12.6/ /opt/neovim/nvim-0.12.6/
/opt/neovim/current -> nvim-0.11.5 ~/.local/bin/nvim -> /opt/neovim/nvim-0.12.6/bin/nvim
``` ```
## Phase 13.5 — Test 0.12 with the existing plugin lockfile ## Phase 13.5 — Test 0.12 with the existing plugin lockfile
- [ ] Use isolated `XDG_DATA_HOME`, `XDG_CACHE_HOME`, and `XDG_STATE_HOME` directories - [x] Use isolated `XDG_DATA_HOME`, `XDG_CACHE_HOME`, and `XDG_STATE_HOME` directories
- [ ] Install the currently locked plugin revisions into the isolated data directory - [ ] Install the currently locked plugin revisions into the isolated data directory
- [ ] Keep the production plugin and Mason directories untouched - [x] Keep the production plugin and Mason directories untouched during candidate testing
- [x] Validate headless startup and capture startup time - [x] Validate headless startup and capture startup time
- [x] Run `:checkhealth` and review every relevant warning/error - [x] Run `:checkhealth` and review every relevant warning/error
- [x] Verify netrw can be loaded and `:Explore` opens the expected tree browser - [x] Verify netrw can be loaded and `:Explore` opens the expected tree browser
@ -566,30 +566,30 @@ Proposed layout:
## Phase 13.7 — Validate the complete 0.12 candidate ## Phase 13.7 — Validate the complete 0.12 candidate
- [x] Validate startup, lazy loading, commands, and configured keymaps automatically - [x] Validate startup, lazy loading, commands, and configured keymaps automatically
- [ ] Validate netrw tree browsing, previews, alternate-buffer behavior, and file operations - [x] Validate netrw tree browsing, previews, alternate-buffer behavior, and file operations
- [ ] Validate Telescope files, grep, buffers, and LSP symbol pickers - [ ] Validate Telescope files, grep, buffers, and LSP symbol pickers
- [ ] Validate LSP attachment, `gd`, `gr`, `K`, diagnostics, and project-local `.nvim.lua` settings - [x] Validate LSP attachment, `gd`, `gr`, `K`, diagnostics, and project-local `.nvim.lua` settings
- [x] Validate the current completion stack before activation; native completion migration follows in Phase 13.9 - [x] Validate the current completion stack before activation; native completion migration follows in Phase 13.9
- [ ] Validate conform format-on-save and nvim-lint/Ruff diagnostics - [x] Validate conform formatter availability and nvim-lint diagnostics; retain normal-use checks for save-time behavior
- [x] Validate Treesitter parsers and custom HTML/CSS queries; retain interactive checks for highlighting, text objects, autotag, and folding - [x] Validate Treesitter parsers and custom HTML/CSS queries; retain interactive checks for highlighting, text objects, autotag, and folding
- [ ] Validate the Paper Tonic colorscheme, plugin highlights, sessions, persistent undo, and shell templates - [ ] Validate the Paper Tonic colorscheme, plugin highlights, sessions, persistent undo, and shell templates
- [ ] Perform interactive smoke tests in the PHP validation workspace - [x] Perform a PTY-backed PHP smoke test for native completion selection, acceptance, snippets, LSP settings, and diagnostics
## Phase 13.8 — Activate with rollback available ## Phase 13.8 — Activate with rollback available
- [ ] Switch the active-version selector from 0.11.5 to 0.12.6 - [x] Switch the active-version selector from 0.11.5 to 0.12.6
- [ ] Repeat a short smoke test through the normal shell/PATH entrypoint - [x] Repeat a short smoke test through the normal shell/PATH entrypoint
- [ ] Keep 0.11.5 and its rollback instructions available during a settling period - [x] Keep 0.11.5 and its rollback instructions available during a settling period
- [ ] Update AGENTS.md, README.md, and LOG.md with the final supported version and upgrade procedure - [x] Update AGENTS.md, README.md, and LOG.md with the final supported version and upgrade procedure
- [ ] Remove 0.11.5 only after an explicit later decision - [ ] Remove 0.11.5 only after an explicit later decision
## Phase 13.9 — Consolidate on Neovim 0.12 native features ## Phase 13.9 — Consolidate on Neovim 0.12 native features
- [x] Keep lazy.nvim as the plugin manager; do not combine the runtime upgrade with a migration to experimental `vim.pack` - [x] Keep lazy.nvim as the plugin manager; do not combine the runtime upgrade with a migration to experimental `vim.pack`
- [ ] Replace `mbbill/undotree` with the optional native `nvim.undotree` package while preserving `<leader>u` - [x] Replace `mbbill/undotree` with the optional native `nvim.undotree` package while preserving `<leader>u`
- [ ] Trial native automatic/LSP completion with explicit selection and built-in snippet expansion - [x] Configure native automatic/LSP completion with explicit selection and built-in snippet expansion for its settling trial
- [ ] Enable Copilot inline suggestions with a distinct accept key and hide them while the native completion menu is visible - [x] Enable Copilot inline suggestions with a distinct accept key and hide them while the native completion menu is visible
- [ ] Validate PHP, HTML, JavaScript/TypeScript, Markdown, Lua, paths, snippets, autopairs, and Copilot interactively - [ ] Validate PHP, HTML, JavaScript/TypeScript, Markdown, Lua, paths, snippets, autopairs, and Copilot interactively
- [ ] Remove nvim-cmp, cmp-nvim-lsp, cmp-buffer, cmp-path, LuaSnip, and copilot-cmp only after the native workflow passes - [x] Remove nvim-cmp, cmp-nvim-lsp, cmp-buffer, cmp-path, LuaSnip, and copilot-cmp from the 0.12 candidate
- [ ] Remove obsolete completion integrations, lockfile entries, highlights, and documentation - [x] Remove obsolete completion integrations, lockfile entries, highlights, and documentation
## Phase 13.10 — Update external tools separately ## Phase 13.10 — Update external tools separately
- [ ] Review Mason package updates only after Neovim and plugin revisions are stable - [ ] Review Mason package updates only after Neovim and plugin revisions are stable

View file

@ -2,6 +2,8 @@
Living reference for session management, keymaps, commands, and plugin-specific features in this config. Living reference for session management, keymaps, commands, and plugin-specific features in this config.
The active runtime is Neovim 0.12.6 through `~/.local/bin/nvim`. Neovim 0.11.5 remains available at `/opt/neovim/nvim-linux-x86_64/bin/nvim` for emergency rollback; the config starts there with 0.12-only native completion and Undotree disabled.
## Session Management ## Session Management
Session support is automatic but user-controlled: Session support is automatic but user-controlled:
@ -240,13 +242,13 @@ Buffer-local keymaps available when inside a git repository:
| preview window | `<C-u>` / `<C-d>` | Scroll within UFO preview | | preview window | `<C-u>` / `<C-d>` | Scroll within UFO preview |
| preview window | `[` / `]` | Jump to top/bottom of preview | | preview window | `[` / `]` | Jump to top/bottom of preview |
### Undotree `lua/plugins/undotree.lua` ### Native Undotree `lua/keymaps.lua`
#### Keymaps #### Keymaps
| Mode | Key | Description | | Mode | Key | Description |
| --- | --- | --- | | --- | --- | --- |
| n | `<leader>u` | Toggle Undotree panel | | n | `<leader>u` | Toggle Neovim's native Undotree panel (`:Undotree`) |
### Treesitter `lua/plugins/treesitter.lua` ### Treesitter `lua/plugins/treesitter.lua`
@ -321,17 +323,33 @@ The configuration uses nvim-surround v4's default mappings.
| normal | `cs{old}{new}` | Change surround | | normal | `cs{old}{new}` | Change surround |
| normal | `cS{old}{new}` | Change surround (linewise) | | normal | `cS{old}{new}` | Change surround (linewise) |
### Nvim-cmp (Completion) `lua/plugins/cmp.lua` ### Native Completion `lua/completion.lua`
#### Keymaps #### Keymaps
| Mode | Key | Description | | Mode | Key | Description |
| --- | --- | --- | | --- | --- | --- |
| insert | `<C-Space>` | Manually trigger completion | | insert | `<C-Space>` | Manually trigger LSP completion |
| insert | `<CR>` | Confirm the explicitly selected completion item |
| insert | `<C-n>` | Next completion item | | insert | `<C-n>` | Next completion item |
| insert | `<C-p>` | Previous completion item | | insert | `<C-p>` | Previous completion item |
| insert | `<C-e>` | Abort completion menu | | insert | `<C-y>` | Accept the explicitly selected completion item |
| insert | `<C-e>` | Dismiss the completion menu |
| insert | `<C-x><C-n>` | Complete words from the current buffer |
| insert | `<C-x><C-f>` | Complete a filesystem path |
| insert/select | `<Tab>` / `<S-Tab>` | Jump forward/backward through native snippet tabstops |
Completion opens automatically after a 150 ms delay, uses fuzzy matching, and does not preselect an item. LSP buffers prioritize language-aware results exclusively; buffer words remain available explicitly with `<C-x><C-n>`. Buffers without an LSP autocomplete from a bounded set of nearby words.
### Copilot Inline Suggestions `lua/plugins/copilot.lua`
Copilot appears as ghost text rather than as an item in the native completion menu. Suggestions are hidden while that menu is visible.
| Mode | Key | Description |
| --- | --- | --- |
| insert | `<M-l>` | Accept the visible Copilot suggestion |
| insert | `<M-]>` | Show the next Copilot suggestion |
| insert | `<M-[>` | Show the previous Copilot suggestion |
| insert | `<C-]>` | Dismiss the Copilot suggestion |
### Nvim-autopairs `lua/plugins/autopairs.lua` ### Nvim-autopairs `lua/plugins/autopairs.lua`

View file

@ -4,6 +4,7 @@ vim.g.maplocalleader = ' '
-- Load basic settings, keymaps, autocmds (kept minimal for now) -- Load basic settings, keymaps, autocmds (kept minimal for now)
require('settings') require('settings')
require('completion')
require('netrw-config') require('netrw-config')
require('keymaps') require('keymaps')
require('autocmds') require('autocmds')
@ -29,3 +30,8 @@ require('lazy').setup({
enabled = false, enabled = false,
}, },
}) })
-- Load optional native packages after lazy.nvim has finalized runtimepath.
if vim.fn.has('nvim-0.12') == 1 then
vim.cmd.packadd('nvim.undotree')
end

View file

@ -1,11 +1,6 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"LuaSnip": { "branch": "master", "commit": "0abc8f390b278c3b4aabc4c004ac8a088b65cf24" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" }, "conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
"copilot.lua": { "branch": "master", "commit": "82607bbb8528222a9a28bfcab0aceb3a7fed7e85" }, "copilot.lua": { "branch": "master", "commit": "82607bbb8528222a9a28bfcab0aceb3a7fed7e85" },
"gitsigns.nvim": { "branch": "main", "commit": "d4854fa9a94b5c8b37dd209fb4a19e98e764186f" }, "gitsigns.nvim": { "branch": "main", "commit": "d4854fa9a94b5c8b37dd209fb4a19e98e764186f" },
"indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" }, "indent-blankline.nvim": { "branch": "master", "commit": "f1e186e44d3b7f9ae918008e2c28ce37c6023d2d" },
@ -14,17 +9,15 @@
"mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
"mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" },
"nvim-autopairs": { "branch": "master", "commit": "3172f40c16563db871a58f20d205c710ad782311" }, "nvim-autopairs": { "branch": "master", "commit": "3172f40c16563db871a58f20d205c710ad782311" },
"nvim-cmp": { "branch": "main", "commit": "2ffe79f1f021def8dd1fcd81deb16f1bb0d989f3" },
"nvim-lint": { "branch": "master", "commit": "f6230a5c06ba59e6059c14637f1dbe29a7978b9b" }, "nvim-lint": { "branch": "master", "commit": "f6230a5c06ba59e6059c14637f1dbe29a7978b9b" },
"nvim-lspconfig": { "branch": "master", "commit": "3bccb6fa49a3a75bfb6d92fed63b13a71a85cfaf" }, "nvim-lspconfig": { "branch": "master", "commit": "3bccb6fa49a3a75bfb6d92fed63b13a71a85cfaf" },
"nvim-surround": { "branch": "main", "commit": "2e93e154de9ff326def6480a4358bfc149d5da2c" }, "nvim-surround": { "branch": "main", "commit": "2e93e154de9ff326def6480a4358bfc149d5da2c" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" },
"nvim-ts-autotag": { "branch": "main", "commit": "d7220b55e16ed3c04e88086256def5d282429493" }, "nvim-ts-autotag": { "branch": "main", "commit": "d7220b55e16ed3c04e88086256def5d282429493" },
"nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" },
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" },
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
"undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }
} }

13
lua/completion.lua Normal file
View file

@ -0,0 +1,13 @@
-- Neovim 0.12 native insert-mode completion.
if vim.fn.has("nvim-0.12") == 0 then
return
end
vim.opt.autocomplete = true
vim.opt.autocompletedelay = 150
vim.opt.completeopt = { "menu", "menuone", "noselect", "popup", "fuzzy" }
vim.opt.complete = { ".^10", "w^5", "b^5", "u^5" }
vim.keymap.set("i", "<C-Space>", function()
vim.lsp.completion.get()
end, { desc = "Completion: Trigger LSP suggestions", silent = true })

View file

@ -9,6 +9,11 @@
local map = vim.keymap.set local map = vim.keymap.set
-- Neovim 0.12's optional native undo-tree viewer.
if vim.fn.has('nvim-0.12') == 1 then
map('n', '<leader>u', '<cmd>Undotree<cr>', { desc = 'Undotree: Toggle native undo tree', silent = true })
end
-- Fallback navigation keymaps for non-LSP buffers -- Fallback navigation keymaps for non-LSP buffers
-- When LSP attaches, buffer-local keymaps in lsp.lua override these -- When LSP attaches, buffer-local keymaps in lsp.lua override these
map('n', 'gd', function() map('n', 'gd', function()

View file

@ -1,5 +1,5 @@
-- Paper Tonic Modern - Plugin Highlight Groups -- Paper Tonic Modern - Plugin Highlight Groups
-- Highlights for configured plugins (Telescope, Gitsigns, cmp, etc.) -- Highlights for configured plugins (Telescope, Gitsigns, etc.)
local c = require('paper-tonic-modern.colors') local c = require('paper-tonic-modern.colors')
@ -58,44 +58,6 @@ return {
GitSignsChangeInline = { bg = c.bg_hl_special }, GitSignsChangeInline = { bg = c.bg_hl_special },
GitSignsDeleteInline = { bg = c.bg_error_weak }, GitSignsDeleteInline = { bg = c.bg_error_weak },
-- ============================================================================
-- nvim-cmp (completion menu)
-- ============================================================================
-- Menu
CmpItemAbbr = { fg = c.fg },
CmpItemAbbrMatch = { fg = c.primary, bold = true },
CmpItemAbbrMatchFuzzy = { fg = c.primary_weak },
CmpItemAbbrDeprecated = { fg = c.fg_weak, strikethrough = true },
CmpItemMenu = { fg = c.fg_weak, italic = true },
-- Kind icons/labels
CmpItemKindDefault = { fg = c.fg },
CmpItemKindVariable = { fg = c.fg },
CmpItemKindFunction = { fg = c.primary_weak },
CmpItemKindMethod = { fg = c.primary_weak },
CmpItemKindConstructor = { fg = c.primary },
CmpItemKindClass = { fg = c.primary_strong },
CmpItemKindInterface = { fg = c.primary_strong },
CmpItemKindStruct = { fg = c.primary_strong },
CmpItemKindProperty = { fg = c.fg_strong },
CmpItemKindField = { fg = c.fg_strong },
CmpItemKindEnum = { fg = c.primary },
CmpItemKindEnumMember = { fg = c.fg_strong },
CmpItemKindModule = { fg = c.primary },
CmpItemKindKeyword = { fg = c.primary_weak },
CmpItemKindSnippet = { fg = c.modified },
CmpItemKindText = { fg = c.fg },
CmpItemKindFile = { fg = c.fg },
CmpItemKindFolder = { fg = c.fg_strong },
CmpItemKindColor = { fg = c.diag_warn },
CmpItemKindUnit = { fg = c.fg_weak },
CmpItemKindValue = { fg = c.fg_strong },
CmpItemKindConstant = { fg = c.fg_strong },
CmpItemKindReference = { fg = c.modified },
CmpItemKindOperator = { fg = c.fg },
CmpItemKindTypeParameter = { fg = c.primary },
-- ============================================================================ -- ============================================================================
-- Comment.nvim -- Comment.nvim
-- ============================================================================ -- ============================================================================

View file

@ -130,7 +130,7 @@ function M.load()
local lsp = require('paper-tonic-modern.groups.lsp') local lsp = require('paper-tonic-modern.groups.lsp')
M.highlight_all(lsp) M.highlight_all(lsp)
-- Plugin highlights (Telescope, Gitsigns, cmp, etc.) -- Plugin highlights (Telescope, Gitsigns, etc.)
local plugins = require('paper-tonic-modern.groups.plugins') local plugins = require('paper-tonic-modern.groups.plugins')
M.highlight_all(plugins) M.highlight_all(plugins)

View file

@ -25,9 +25,5 @@ return {
}, },
}) })
-- Integration with nvim-cmp
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end, end,
} }

View file

@ -1,69 +0,0 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
"zbirenbaum/copilot-cmp", -- Copilot completion source
},
opts = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
return {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-e>"] = cmp.mapping.abort(),
}),
sources = cmp.config.sources({
{ name = "copilot", group_index = 2 }, -- Copilot suggestions (priority 1)
{ name = "nvim_lsp", group_index = 2 },
{ name = "path", group_index = 2 },
{ name = "buffer", group_index = 2 },
}),
preselect = cmp.PreselectMode.None,
completion = { completeopt = "menu,menuone,noinsert,noselect" },
window = {
completion = cmp.config.window.bordered({
border = {
{ "🭽", "FloatBorder" },
{ "▔", "FloatBorder" },
{ "🭾", "FloatBorder" },
{ "▕", "FloatBorder" },
{ "🭿", "FloatBorder" },
{ "▁", "FloatBorder" },
{ "🭼", "FloatBorder" },
{ "▏", "FloatBorder" },
},
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:PmenuSel",
}),
documentation = cmp.config.window.bordered({
border = {
{ "🭽", "FloatBorder" },
{ "▔", "FloatBorder" },
{ "🭾", "FloatBorder" },
{ "▕", "FloatBorder" },
{ "🭿", "FloatBorder" },
{ "▁", "FloatBorder" },
{ "🭼", "FloatBorder" },
{ "▏", "FloatBorder" },
},
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
}),
},
}
end,
config = function(_, opts)
require("cmp").setup(opts)
end,
}

View file

@ -1,22 +1,23 @@
-- GitHub Copilot: AI-powered code completion -- GitHub Copilot inline suggestions, separate from the native completion menu.
return { return {
{ 'zbirenbaum/copilot.lua',
'zbirenbaum/copilot.lua', cmd = 'Copilot',
cmd = 'Copilot', event = 'InsertEnter',
event = 'InsertEnter', -- Lazy load on first insert mode entry opts = {
opts = { suggestion = {
suggestion = { enabled = false }, -- Disable inline suggestions (use cmp instead) enabled = true,
panel = { enabled = false }, -- Disable panel (use cmp instead) auto_trigger = true,
filetypes = { hide_during_completion = true,
['*'] = true, -- Enable for all filetypes keymap = {
accept = '<M-l>',
next = '<M-]>',
prev = '<M-[>',
dismiss = '<C-]>',
}, },
}, },
}, panel = { enabled = false },
{ filetypes = {
'zbirenbaum/copilot-cmp', ['*'] = true,
dependencies = { 'zbirenbaum/copilot.lua' }, },
config = function()
require('copilot_cmp').setup()
end,
}, },
} }

View file

@ -1,12 +1,7 @@
return { return {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" }, event = { "BufReadPre", "BufNewFile" },
dependencies = {
"hrsh7th/cmp-nvim-lsp",
},
config = function() config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Load trusted project-local LSP settings from .nvim.lua. -- Load trusted project-local LSP settings from .nvim.lua.
local function load_project_lsp_settings(server_name, root_dir) local function load_project_lsp_settings(server_name, root_dir)
if not root_dir then if not root_dir then
@ -66,6 +61,13 @@ return {
-- Setup keymaps for this buffer -- Setup keymaps for this buffer
setup_keymaps(args.buf) setup_keymaps(args.buf)
if client:supports_method("textDocument/completion") then
vim.lsp.completion.enable(true, client.id, args.buf)
if vim.fn.has("nvim-0.12") == 1 then
vim.bo[args.buf].complete = "o^20"
end
end
-- Load and send project-specific settings -- Load and send project-specific settings
local project_settings = load_project_lsp_settings(client.name, client.root_dir) local project_settings = load_project_lsp_settings(client.name, client.root_dir)
if project_settings.settings then if project_settings.settings then
@ -88,13 +90,8 @@ return {
local function configure(server_name, opts) local function configure(server_name, opts)
opts = opts or {} opts = opts or {}
-- Merge with defaults
local config = vim.tbl_deep_extend("force", {
capabilities = capabilities,
}, opts)
-- Configure the server using the new API -- Configure the server using the new API
vim.lsp.config(server_name, config) vim.lsp.config(server_name, opts)
end end
-- Configure all servers -- Configure all servers

View file

@ -131,19 +131,19 @@ return {
-- Setup autotag -- Setup autotag
require("nvim-ts-autotag").setup({ require("nvim-ts-autotag").setup({
opts = { opts = {
enable_close = true, -- Auto close tags enable_close = false,
enable_rename = true, -- Auto rename pairs of tags enable_rename = false,
enable_close_on_slash = true, -- Auto close on trailing </ enable_close_on_slash = false,
}, },
-- Limit to relevant filetypes -- Enable only in filetypes that can contain HTML-style tags.
per_filetype = { per_filetype = {
["html"] = { enable_close = true }, ["html"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["php"] = { enable_close = true }, ["php"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["javascript"] = { enable_close = true }, ["javascript"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["javascriptreact"] = { enable_close = true }, ["javascriptreact"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["typescript"] = { enable_close = true }, ["typescript"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["typescriptreact"] = { enable_close = true }, ["typescriptreact"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["vue"] = { enable_close = true }, ["vue"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
}, },
}) })
end, end,

View file

@ -1,15 +0,0 @@
-- Phase 6.8: undotree for visual undo history
return {
'mbbill/undotree',
cmd = 'UndotreeToggle', -- Lazy load on command
keys = {
{ '<leader>u', '<cmd>UndotreeToggle<cr>', desc = 'Undotree: Toggle undo tree' },
},
config = function()
-- Configure undotree
vim.g.undotree_WindowLayout = 2 -- Layout: diff at bottom
vim.g.undotree_ShortIndicators = 1 -- Use short time indicators
vim.g.undotree_SetFocusWhenToggle = 1 -- Focus undotree when toggled
vim.g.undotree_DiffAutoOpen = 1 -- Auto open diff window
end,
}

View file

@ -65,14 +65,8 @@ vim.opt.tabline = '%!v:lua.require("utils").custom_tabline()'
vim.opt.showtabline = 1 -- Show tabline only when there are 2+ tabs vim.opt.showtabline = 1 -- Show tabline only when there are 2+ tabs
-- Phase 3.2: non-plugin settings (legacy values where specified) -- Phase 3.2: non-plugin settings (legacy values where specified)
-- Completion UI for nvim-cmp -- Native completion popup style
vim.opt.completeopt = { "menu", "menuone", "noselect" }
-- Built-in completion popup style (for Ctrl-X Ctrl-N/F completions)
-- Use floating window with border for native completion
vim.opt.pumblend = 0 -- No transparency vim.opt.pumblend = 0 -- No transparency
-- Note: Native completion (pumvisible) doesn't support custom borders like LSP floats
-- The Pmenu* highlight groups control its appearance
-- Spelling -- Spelling
vim.opt.spell = true vim.opt.spell = true

View file

@ -1,5 +1,7 @@
# ✔ **Neovim Migration Guide for AI Assistance** # ✔ **Neovim Migration Guide for AI Assistance**
> **Historical planning input:** this document records the migration's original assumptions and is not an active specification. `AGENTS.md`, `README.md`, `MIGRATION_PLAN.md`, and `LOG.md` describe the current netrw-only, native-completion architecture and supersede conflicting requirements below.
## **Purpose** ## **Purpose**
I am transitioning from VS Code back to Neovim. I am transitioning from VS Code back to Neovim.