This commit is contained in:
Ray Elliott 2025-12-06 21:16:25 +00:00
parent a0049b8e06
commit ed3cabf8b0
6 changed files with 119 additions and 8 deletions

View File

@ -53,21 +53,21 @@ Source of truth for the step-by-step rebuild. Keep this concise and up to date.
- [x] Decision: No direnv fallback for local config
## Phase 3.2 — Non-plugin settings to Lua
- [ ] Port non-plugin settings to Lua (options, listchars, showbreak, spelllang=en_gb)
- [x] Port non-plugin settings to Lua (options, listchars, showbreak, spelllang=en_gb)
## Phase 3.3 — Core completion stack
- [ ] Add core completion stack: `nvim-cmp`, `cmp-nvim-lsp`, `cmp-buffer`, `cmp-path`, `LuaSnip`
- [x] Add core completion stack: `nvim-cmp`, `cmp-nvim-lsp`, `cmp-buffer`, `cmp-path`, `LuaSnip`
## Phase 3.4 — Projectlocal configuration (neoconf)
- [ ] Confirm scope and priorities for this subphase
- [x] Choose approach: use `folke/neoconf.nvim` (replaces custom loader)
- [ ] Add `folke/neoconf.nvim` plugin spec and minimal setup
- [ ] Document `.neoconf.json` usage and example in README
- [x] Add `folke/neoconf.nvim` plugin spec and minimal setup
- [x] Document `.neoconf.json` usage and example in README
- [ ] Verify neoconf merges settings into lspconfig
- [ ] Wire `intelephense.environment.includePaths` via `.neoconf.json`
- [x] Wire `intelephense.environment.includePaths` via `.neoconf.json`
## Phase 3.5 — LSP minimal defaults
- [ ] Add `nvim-lspconfig` with minimal defaults (no over-configuration)
- [x] Add `nvim-lspconfig` with minimal defaults (no over-configuration)
## Phase 4 — Navigation

10
lazy-lock.json Normal file
View File

@ -0,0 +1,10 @@
{
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
"neoconf.nvim": { "branch": "main", "commit": "fbf01840998b9f0e6b05a5c3811a882fcbcaf563" },
"nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" },
"nvim-lspconfig": { "branch": "master", "commit": "9c923997123ff9071198ea3b594d4c1931fab169" }
}

39
lua/plugins/cmp.lua Normal file
View File

@ -0,0 +1,39 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"L3MON4D3/LuaSnip",
},
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 = "nvim_lsp" },
{ name = "path" },
{ name = "buffer" },
}),
completion = { completeopt = "menu,menuone,noselect" },
}
end,
config = function(_, opts)
require("cmp").setup(opts)
end,
}

36
lua/plugins/lsp.lua Normal file
View File

@ -0,0 +1,36 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"folke/neoconf.nvim",
"hrsh7th/cmp-nvim-lsp",
},
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local servers = {
lua_ls = {
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
},
},
},
ts_ls = {},
html = {},
cssls = {},
jsonls = {},
bashls = {},
marksman = {},
intelephense = {},
}
for name, opts in pairs(servers) do
local ok, mod = pcall(require, "lspconfig." .. name)
if ok and mod and type(mod.setup) == "function" then
opts = vim.tbl_deep_extend("force", { capabilities = capabilities }, opts or {})
mod.setup(opts)
end
end
end,
}

10
lua/plugins/neoconf.lua Normal file
View File

@ -0,0 +1,10 @@
return {
"folke/neoconf.nvim",
lazy = false, -- load early so it can influence lspconfig later
priority = 1000,
opts = {},
config = function(_, opts)
require("neoconf").setup(opts)
end,
}

View File

@ -1,9 +1,25 @@
-- Minimal settings for bootstrap phase
-- Minimal settings for bootstrap and Phase 3.2
-- 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
-- Phase 3.2: non-plugin settings (legacy values where specified)
-- Completion UI for nvim-cmp
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
-- Spelling
vim.opt.spelllang = { 'en_gb' }
-- Visuals
vim.opt.showbreak = ''
vim.opt.listchars = {
eol = '¬',
tab = '',
trail = '~',
extends = '>',
precedes = '<',
space = '·',
}