Neovim Setup
Initial setup flow
- List/update plugins in
lua/setup/packages.lua. - List/update language specs in
lua/modules/language-specs.lua. - Run
nvim --headless +Setup +qa. - Run
nvim --headless +FetchLspConfigs +qa.
If prettierd is stuck, run pkill prettierd and re-run install commands.
Where to put what
lua/setup/packages.lua: plugin package list managed by Paq.lua/modules/language-specs.lua: language spec source of truth.lsp/*.lua: native Neovim LSP config files (fetched byFetchLspConfigs).
Setup commands
-
:Setup- bootstraps Paq if needed
- installs plugins
- installs treesitter parsers + Mason tools (LSP/linters/formatters)
-
:InstallPackages(included in:Setup)- bootstraps Paq if needed
- installs plugins
-
:InstallLanguages(included in:Setup)- installs language tooling from language specs (treesitter + Mason tools)
-
:FetchLspConfigs(manually executed after modifying language-specs)- fetches default
nvim-lspconfigserver config files - writes them into
~/.config/nvim/lsp - skips files that already exist
- fetches default
-
:Sync- runs Paq sync for plugin updates/cleanup
Language specs: how they work
Each item in lua/modules/language-specs.lua can define:
ft: one filetype or a list of filetypests: treesitter parser(s)lsp: Mason package name(s) for language serverslint: Mason package name(s) for lintersformat: Mason package name(s) for formatters
One spec file drives all three layers together:
- install layer
- treesitter parsers are installed via
nvim-treesitter - LSP/lint/format tools are installed via Mason
- treesitter parsers are installed via
- runtime layer
- native Neovim
vim.lsp.enable(...)starts the resolved LSP configs nvim-lintis configured by filetypeconform.nvimis configured by filetype
- native Neovim
- config layer
FetchLspConfigsdownloads matchinglsp/*.luaserver configs for Neovim 0.11+
Important: for lsp, use Mason package names from:
https://github.com/mason-org/mason-registry/tree/main/packages
Add a new language
- Add/update a spec in
lua/modules/language-specs.lua. - Run
nvim --headless +InstallLanguages +qa. - Run
nvim --headless +FetchLspConfigs +qa. - Open Neovim and run
:checkhealth vim.lspif needed.
Description
Languages
Lua
100%