一键导入
add-lsp
Add a new LSP server configuration following this repo's patterns. Use when adding support for a new language server.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new LSP server configuration following this repo's patterns. Use when adding support for a new language server.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | add-lsp |
| description | Add a new LSP server configuration following this repo's patterns. Use when adding support for a new language server. |
Follow these steps to add a new LSP server to this Neovim config.
Create lua/lsp/<server_name>.lua that returns a vim.lsp.Config table:
local util = require("util")
--- @class vim.lsp.Config : vim.lsp.ClientConfig
return {
cmd = { util.homebrew_binary("<formula>", "<binary>") }, -- or util.prefix(), util.go_path(), etc.
filetypes = { "<filetype>" },
settings = {
-- server-specific settings
},
}
Key conventions:
util.homebrew_binary(), util.prefix(), util.bun_prefix(), util.go_path(), or util.pnpm_prefix() — never use bare command names.lspconfig.setup().--- @class vim.lsp.Config : vim.lsp.ClientConfig annotation.on_attach only if the server needs buffer-specific overrides.If the server exists in lspconfig, add it to the servers table:
["<server_name>"] = require("lsp.<server_name>"),
If the server is NOT in lspconfig, register it first with register_lsp() before the servers table:
register_lsp(
"<server_name>",
{
cmd = { "<binary>" },
filetypes = { "<filetype>" },
root_markers = { ".git" },
single_file_support = true,
capabilities = default_capabilities_config(),
}
)
If the filetype isn't already detected by Neovim, add an entry in filetype.lua via vim.filetype.add().
For filetype-specific buffer settings, create after/ftplugin/<filetype>.lua.