Imported from feryardiant/config-nvim (
AGENTS.md). Install upstream withnpx skills add feryardiant/config-nvim. Copyright stays with the author.
AGENTS.md
Personal Neovim config (LazyVim-style, hand-rolled). Cloned to ~/.config/nvim.
Commands
- Fresh install / after changing plugin specs:
nvim --headless '+Lazy! sync' +qa, then open a file once (tree-sitter + Mason), then:MasonToolsInstallSync. - Editing
lua/**only needs an nvim restart to take effect. No build step. lazy-lock.jsonis gitignored: plugin versions are never pinned in git. Expect upstream drift.- Requires Neovim ≥ 0.11 (uses
vim.lsp.config/vim.lsp.enableand the nvim-treesitter rewrite API).
Layout
lua/plugins/*.lua— lazy.nvim specs, auto-imported via{ import = 'plugins' }ininit.lua. One file per concern. No registration needed for a new file. A spec file may also register top-level autocmds at load time (seeplugins/lsp.lua), so it is not necessarily a purereturn {...}.lua/bootstrap.lua— sets leaders, then loadslua/custom/{autocmds,options,keymaps}.luaat startup.lua/custom/lsp-servers/*.lua— per-servervim.lsp.Configoverrides; index file (lua/custom/lsp-servers.lua) metatable auto-merges defaultfiletypesfromlspconfig.configs.<name>and sorts them.lua/utils/*— shared helpers:keymap.create/deleteregistry,php(installed extensions, composer home),fs,workspace.utilsis lazy-loaded; require it inside functions, never at module top level of plugins.queries/<parser>/<querytype>.scm— custom tree-sitter queries; the config dir is on the runtimepath.queries/dotenv/backs a customdotenvparser registered inplugins/treesitter.lua.
LSP conventions (important)
- Modern flow only: servers auto-enable from the
ensure_installedlist inplugins/lsp.luaviavim.lsp.enable. Do not reintroduce legacyopts.handlersfrom mason-lspconfig. - To add/configure a server: add its mason name to
ensure_installedinplugins/lsp.lua, then createlua/custom/lsp-servers/<name>.luareturning avim.lsp.Config(annotate---@type vim.lsp.Config). - Shared capabilities for blink.cmp are set via
vim.lsp.config('*', ...). - TS/JS uses
vtsls(replacedts_ls), Vue usesvue_ls(not volar).intelephenseis commented out in favor ofphpantom_lsp. Blade highlighting comes built-in fromtreesitter-blade— no custom blade query/filetype override.
Code style
- Lua: stylua via conform on save (
<leader>foformats)..stylua.toml: 2-space indent, single quotes;-- stylua: ignoreis used deliberately around hand-kept blocks. - LuaLS annotations (
---@type,---@module,---@param) on opts/configs throughout — keep them accurate;nvim.logcatches type diagnostics on save (see.luarc.json). .tool-versionspinslua 5.5.1(asdf). PHP tooling preferspint(mason orvendor/bin/pint).- Git: conventional commits scoped by area, e.g.
fix(lsp):,chore(debugging):.
Gotchas
- Neovim buffer option indentation is 4 (
custom/options.lua); stylua still formats Lua at 2. Don't "fix" the mismatch. - nvim-treesitter rewrite: install parsers with
nvim_treesitter.install { 'name', ... }, notensure_installed. .env.*maps to thedotenvfiletype and is value-cloaked bycloak.nvim(plugins/editor.lua) — edits to those patterns are intentional.