Complete config migration cleanup

Retire legacy files and migration fixtures, move runtime state out of the repository, and migrate Tree-sitter and textobjects to their Neovim 0.12-compatible main branches.
This commit is contained in:
Ray Elliott 2026-10-28 19:26:42 +00:00
commit f8f478a985
99 changed files with 288 additions and 5473 deletions

View file

@ -1,5 +1,5 @@
-- Abbreviations (common typo corrections)
-- Phase 10.2: Insert-mode abbreviations for frequent typos
-- Insert-mode abbreviations for frequent typos
vim.cmd.iabbrev('adn', 'and')
vim.cmd.iabbrev('waht', 'what')

View file

@ -1,7 +1,7 @@
-- Non-plugin autocommands (minimal placeholder for bootstrap)
local aug = vim.api.nvim_create_augroup("UserDefaults", { clear = true })
-- Phase 10.3: Templates (auto-populate new files from templates)
-- Templates (auto-populate new files from templates)
local template_aug = vim.api.nvim_create_augroup("Templates", { clear = true })
vim.api.nvim_create_autocmd("BufNewFile", {
@ -14,7 +14,7 @@ vim.api.nvim_create_autocmd("BufNewFile", {
end,
})
-- Phase 9.4: Per-filetype indentation settings to match formatters
-- Per-filetype indentation settings to match formatters
-- PHP: WordPress coding standards (tabs, displayed as 2 spaces)
vim.api.nvim_create_autocmd("FileType", {
@ -77,7 +77,7 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- Phase 11.8: Colorize diagnostic severity in quickfix/location list
-- Colorize diagnostic severity in quickfix/location list
vim.api.nvim_create_autocmd("FileType", {
group = aug,
pattern = "qf", -- Applies to both quickfix and location list

View file

@ -1,4 +1,4 @@
-- Phase 6.5: nvim-autopairs for auto-closing brackets, quotes, etc.
-- nvim-autopairs for auto-closing brackets, quotes, etc.
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',

View file

@ -1,4 +1,4 @@
-- Phase 6.3: Comment.nvim for commenting
-- Comment.nvim for commenting
return {
'numToStr/Comment.nvim',
event = 'VeryLazy',

View file

@ -1,4 +1,4 @@
-- Phase 6.6: indent-blankline for visual indent guides
-- indent-blankline for visual indent guides
return {
'lukas-reineke/indent-blankline.nvim',
main = 'ibl',

View file

@ -1,4 +1,4 @@
-- Phase 6.4: nvim-surround for surrounding text with quotes, brackets, tags, etc.
-- nvim-surround for surrounding text with quotes, brackets, tags, etc.
return {
'kylechui/nvim-surround',
version = '*', -- Use stable releases

View file

@ -1,151 +1,176 @@
-- Treesitter: Syntax highlighting, incremental selection, textobjects, autotag
return {
{
"nvim-treesitter/nvim-treesitter",
branch = "master", -- The rewritten main branch uses a different configuration API
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
{ "nvim-treesitter/nvim-treesitter-textobjects", branch = "master" },
"windwp/nvim-ts-autotag",
},
config = function()
require("nvim-treesitter.configs").setup({
-- Install parsers for primary languages
ensure_installed = {
"lua",
"vim",
"vimdoc",
"php",
"html",
"javascript",
"typescript",
"tsx",
"css",
"scss",
"json",
"markdown",
"markdown_inline",
"bash",
"python",
"regex",
},
-- Auto-install missing parsers
auto_install = true,
-- Syntax highlighting
highlight = {
enable = true,
-- Disable for very large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
additional_vim_regex_highlighting = false,
},
-- Incremental selection
incremental_selection = {
enable = true,
keymaps = {
init_selection = "+",
node_incremental = "+",
scope_incremental = "g+",
node_decremental = "-",
},
},
-- Indentation: Enable for languages with good indent queries
-- PHP requires this because GetPhpIndent() depends on Vim syntax (disabled by Treesitter)
indent = {
enable = true,
-- Disable for languages with poor/incomplete indent queries if needed
disable = {},
},
-- Textobjects
textobjects = {
select = {
enable = true,
lookahead = true, -- Jump forward to next textobject
keymaps = {
-- Functions
["af"] = "@function.outer",
["if"] = "@function.inner",
-- Classes
["ac"] = "@class.outer",
["ic"] = "@class.inner",
-- Parameters/arguments
["aa"] = "@parameter.outer",
["ia"] = "@parameter.inner",
-- Conditionals
["ai"] = "@conditional.outer",
["ii"] = "@conditional.inner",
-- Loops
["al"] = "@loop.outer",
["il"] = "@loop.inner",
-- Comments
["a/"] = "@comment.outer",
},
},
move = {
enable = true,
set_jumps = true, -- Add to jumplist
goto_next_start = {
["]f"] = "@function.outer",
["]c"] = "@class.outer",
["]a"] = "@parameter.inner",
},
goto_next_end = {
["]F"] = "@function.outer",
["]C"] = "@class.outer",
["]A"] = "@parameter.inner",
},
goto_previous_start = {
["[f"] = "@function.outer",
["[c"] = "@class.outer",
["[a"] = "@parameter.inner",
},
goto_previous_end = {
["[F"] = "@function.outer",
["[C"] = "@class.outer",
["[A"] = "@parameter.inner",
},
},
swap = {
enable = true,
swap_next = {
["<leader>a"] = "@parameter.inner",
},
swap_previous = {
["<leader>A"] = "@parameter.inner",
},
},
},
})
-- Setup autotag
require("nvim-ts-autotag").setup({
opts = {
enable_close = false,
enable_rename = false,
enable_close_on_slash = false,
},
-- Enable only in filetypes that can contain HTML-style tags.
per_filetype = {
["html"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["php"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["javascript"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["javascriptreact"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["typescript"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["typescriptreact"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
["vue"] = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
},
})
end,
},
local parsers = {
"lua",
"vim",
"vimdoc",
"php",
"html",
"javascript",
"typescript",
"tsx",
"css",
"scss",
"json",
"markdown",
"markdown_inline",
"bash",
"python",
"regex",
}
local filetypes = {
"lua",
"vim",
"help",
"php",
"html",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"css",
"scss",
"json",
"jsonc",
"markdown",
"sh",
"bash",
"python",
}
local function map(modes, lhs, rhs, desc)
vim.keymap.set(modes, lhs, rhs, { desc = desc, silent = true })
end
return {
{
"nvim-treesitter/nvim-treesitter",
branch = "main",
lazy = false,
build = ":TSUpdate",
config = function()
local treesitter = require("nvim-treesitter")
-- Keep the configured parser set present without blocking startup.
treesitter.install(parsers)
local group = vim.api.nvim_create_augroup("treesitter_features", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
group = group,
pattern = filetypes,
desc = "Enable native Tree-sitter highlighting and supported indentation",
callback = function(args)
local path = vim.api.nvim_buf_get_name(args.buf)
local ok, stat = pcall(vim.uv.fs_stat, path)
if ok and stat and stat.size > 100 * 1024 then
return
end
local lang = vim.treesitter.language.get_lang(vim.bo[args.buf].filetype)
if not lang or not pcall(vim.treesitter.start, args.buf, lang) then
return
end
local has_indent, query = pcall(vim.treesitter.query.get, lang, "indents")
if has_indent and query then
vim.bo[args.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end
end,
})
map({ "n", "x" }, "+", function()
vim.treesitter.select("parent", vim.v.count1)
end, "Tree-sitter: Select parent node")
map("x", "-", function()
vim.treesitter.select("child", vim.v.count1)
end, "Tree-sitter: Select child node")
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
branch = "main",
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function()
require("nvim-treesitter-textobjects").setup({
select = { lookahead = true },
move = { set_jumps = true },
})
local select = require("nvim-treesitter-textobjects.select")
local move = require("nvim-treesitter-textobjects.move")
local swap = require("nvim-treesitter-textobjects.swap")
local function select_object(capture, query_group)
return function()
select.select_textobject(capture, query_group or "textobjects")
end
end
for lhs, capture in pairs({
af = "@function.outer",
["if"] = "@function.inner",
ac = "@class.outer",
ic = "@class.inner",
aa = "@parameter.outer",
ia = "@parameter.inner",
ai = "@conditional.outer",
ii = "@conditional.inner",
al = "@loop.outer",
il = "@loop.inner",
["a/"] = "@comment.outer",
}) do
map({ "x", "o" }, lhs, select_object(capture), "Tree-sitter: Select " .. capture)
end
map({ "n", "x" }, "g+", select_object("@local.scope", "locals"), "Tree-sitter: Select enclosing scope")
local movements = {
{ "]f", "goto_next_start", "@function.outer" },
{ "]F", "goto_next_end", "@function.outer" },
{ "[f", "goto_previous_start", "@function.outer" },
{ "[F", "goto_previous_end", "@function.outer" },
{ "]c", "goto_next_start", "@class.outer" },
{ "]C", "goto_next_end", "@class.outer" },
{ "[c", "goto_previous_start", "@class.outer" },
{ "[C", "goto_previous_end", "@class.outer" },
{ "]a", "goto_next_start", "@parameter.inner" },
{ "]A", "goto_next_end", "@parameter.inner" },
{ "[a", "goto_previous_start", "@parameter.inner" },
{ "[A", "goto_previous_end", "@parameter.inner" },
}
for _, movement in ipairs(movements) do
local lhs, method, capture = unpack(movement)
map({ "n", "x", "o" }, lhs, function()
move[method](capture, "textobjects")
end, "Tree-sitter: " .. method:gsub("_", " ") .. " " .. capture)
end
map("n", "<leader>a", function()
swap.swap_next("@parameter.inner")
end, "Tree-sitter: Swap with next parameter")
map("n", "<leader>A", function()
swap.swap_previous("@parameter.inner")
end, "Tree-sitter: Swap with previous parameter")
end,
},
{
"windwp/nvim-ts-autotag",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = {
opts = {
enable_close = false,
enable_rename = false,
enable_close_on_slash = false,
},
per_filetype = {
html = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
php = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
javascript = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
javascriptreact = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
typescript = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
typescriptreact = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
vue = { enable_close = true, enable_rename = true, enable_close_on_slash = true },
},
},
},
}

View file

@ -1,4 +1,4 @@
-- Phase 6.7: nvim-ufo for better folding with Treesitter and LSP support
-- nvim-ufo for better folding with Treesitter and LSP support
return {
'kevinhwang91/nvim-ufo',
dependencies = {

View file

@ -1,4 +1,4 @@
-- Minimal settings for bootstrap and Phase 3.2
-- Core editor settings
-- Disable unused language providers early; enable later only if a plugin requires them
vim.g.loaded_ruby_provider = 0
@ -64,7 +64,6 @@ utils.tabline_shorten_length = 4
vim.opt.tabline = '%!v:lua.require("utils").custom_tabline()'
vim.opt.showtabline = 1 -- Show tabline only when there are 2+ tabs
-- Phase 3.2: non-plugin settings (legacy values where specified)
-- Native completion popup style
vim.opt.pumblend = 0 -- No transparency
@ -104,12 +103,12 @@ vim.opt.relativenumber = true
-- Scrolloff settings
vim.opt.scrolloff = 4
-- Phase 6.2: UX settings
-- Editor UX
vim.opt.signcolumn = "yes" -- Always show sign column (for LSP diagnostics, git signs, etc.)
vim.opt.cursorline = true -- Highlight current line
vim.opt.colorcolumn = "80,120" -- Visual guides at 80 and 120 characters
-- Phase 9.4: Default indentation (per-filetype overrides in after/ftplugin/)
-- Default indentation (per-filetype overrides in after/ftplugin/)
vim.opt.tabstop = 4 -- Display tabs as 4 spaces
vim.opt.shiftwidth = 4 -- Indent by 4
vim.opt.softtabstop = 4 -- Backspace removes 4 spaces
@ -119,7 +118,9 @@ vim.opt.smartindent = true -- Smart autoindenting (C-like programs, PHP, etc.)
-- Persistent undo
vim.opt.undofile = true -- Enable persistent undo
vim.opt.undodir = vim.fn.stdpath("config") .. "/undodir" -- Store undo files in config directory
local undo_dir = vim.fn.stdpath("state") .. "/undo"
vim.fn.mkdir(undo_dir, "p")
vim.opt.undodir = undo_dir
-- LSP diagnostics configuration
vim.diagnostic.config({