breaking: Remove setup script and use chezmoi

This commit is contained in:
js0ny 2025-09-27 02:25:06 +01:00
parent 02bbb24cac
commit 0051a163c3
190 changed files with 118 additions and 3456 deletions

View file

@ -0,0 +1,15 @@
-- Bash
--[[ Installation
brew install bash-language-server
npm i -g bash-language-server
dnf install -y nodejs-bash-language-server # Fedora Linux
--]]
return {
cmd = { "bash-language-server", "start" },
filetypes = { "bash", "sh" },
settings = {
bashIde = {
globPattern = vim.env.GLOB_PATTERN or "*@(.sh|.inc|.bash|.command)",
},
},
}

View file

@ -0,0 +1,16 @@
-- Beancount
--[[ Installation:
Dependency:
uv tool install beancount
LSP:
cargo install beancount-language-server
brew install beancount-language-server
--]]
return {
cmd = { "beancount-language-server" },
filetypes = { "beancount" },
settings = {
},
}

View file

@ -0,0 +1,30 @@
-- C/C++
-- Clangd requires compile_commands.json to work and the easiest way to generate it is to use CMake.
-- How to use clangd C/C++ LSP in any project: https://gist.github.com/Strus/042a92a00070a943053006bf46912ae9
return {
cmd = {
"clangd",
"--clang-tidy",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--function-arg-placeholders",
"--fallback-style=none",
},
filetypes = { "c", "cpp" },
root_markers = {
".clangd",
".clang-format",
"compile_commands.json",
"compile_flags.txt",
".git",
},
capabilities = {
textDocument = {
completion = {
editsNearCursor = true,
},
},
offsetEncoding = { "utf-8", "utf-16" },
},
}

View file

@ -0,0 +1,19 @@
-- Golang
--[[ Installation
go install golang.org/x/tools/gopls@latest
brew install gopls
--]]
return {
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_markers = { "go.work", "go.mod", ".git" },
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
-- semanticTokens = true, -- go's semantic token highlight is not accurate so far
},
},
}

View file

@ -0,0 +1,12 @@
-- Java
--[[ Installation
go install golang.org/x/tools/gopls@latest
brew install gopls
--]]
return {
cmd = { "jdtls" },
filetypes = { "java" },
root_markers = { ".git", "build.gradle", "build.gradle.kts", "build.xml", "pom.xml"},
settings = {
},
}

View file

@ -0,0 +1,18 @@
-- JSON
--[[
npm i vscode-json-languageserver
--]]
return {
cmd = { "vscode-json-language-server", "--stdio" },
filetypes = { "json", "jsonc" },
root_markers = { ".git" },
init_options = {
provideFormatter = true,
},
settings = {
-- See setting options
-- https://github.com/microsoft/vscode/tree/main/extensions/json-language-features/server#settings
json = {
},
},
}

View file

@ -0,0 +1,37 @@
-- Lua
--[[ Installation
scoop install lua-language-server
brew install lua-language-server
sudo port install lua-language-server
--]]
--[[ Build: Ninja & C++17 Required
git clone https://github.com/LuaLS/lua-language-server --depth 1
cd lua-language-server
./make.sh
--]]
--[[ Note: For building from source, wrapper script is required
Accompanied with a wrapper script
#!/bin/bash
exec "$HOME/.local/build/lua-language-server/bin/lua-language-server" "$@"
--]]
return {
cmd = { "lua-language-server" },
root_markers = {
".luarc.json",
".luarc.jsonc",
".luacheckrc",
".stylua.toml",
"stylua.toml",
"selene.toml",
"selene.yml",
},
filetypes = { "lua" },
settings = {
Lua = {
hint = {
enable = true,
setType = true,
},
},
},
}

View file

@ -0,0 +1,15 @@
-- Markdown PKM
--[[ Installation:
cargo install --locked --git https://github.com/Feel-ix-343/markdown-oxide.git markdown-oxide
--]]
return {
cmd = { "markdown-oxide" },
root_markers = {
".obsidian",
},
filetypes = { "markdown" },
settings = {
Markdown = {
},
},
}

View file

@ -0,0 +1,27 @@
-- Python
--[[ Installation
uv tool install pyright
--]]
return {
cmd = { "pyright-langserver", "--stdio" },
filetypes = { "python" },
root_markers = {
".python_version",
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
"Pipfile",
"pyrightconfig.json",
".git",
},
settings = {
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "openFilesOnly",
},
},
},
}

View file

@ -0,0 +1,33 @@
-- Rust
--[[ Installation
rustup component add rust-src
--]]
return {
cmd = { "rust-analyzer" },
filetypes = { "rust" },
root_dir = function(bufnr, cb)
local root = vim.fs.root(bufnr, { "Cargo.toml" })
if root then
vim.system({ "cargo", "metadata", "--no-depts", "--format-version", "1" }, { cwd = root }, function(obj)
if obj.code ~= 0 then
cb(root)
else
local success, result = pcall(vim.json.decode, obj.stdout)
if success and result.workspace_root then
cb(result.workspace_root)
else
cb(root)
end
end
end)
else
cb(vim.fs.root(bufnr, { "rust-project.json", ".git" }))
end
end,
before_init = function(init_params, config)
-- See https://github.com/rust-lang/rust-analyzer/blob/eb5da56d839ae0a9e9f50774fa3eb78eb0964550/docs/dev/lsp-extensions.md?plain=1#L26
if config.settings and config.settings["rust-analyzer"] then
init_params.initializationOptions = config.settings["rust-analyzer"]
end
end,
}

View file

@ -0,0 +1,32 @@
-- TOML
--[[ Installation
cargo install taplo-cli --locked
brew install taplo
pnpm install -g @taplo/cli
--]]
return {
cmd = { "taplo", "lsp", "stdio" },
filetypes = { "toml" },
root_markers = { ".git" },
settings = {
-- See all the setting options
-- https://github.com/tamasfe/taplo/blob/master/editors/vscode/package.json
evenBetterToml = {
taplo = {
configFile = {
enabled = true,
},
},
schema = {
enabled = true,
catalogs = {
"https://www.schemastore.org/api/json/catalog.json",
},
cache = {
memoryExpiration = 60,
diskExpiration = 600,
},
},
},
},
}

View file

@ -0,0 +1,19 @@
return {
cmd = { "vim-language-server", "--stdio" },
filetypes = { "vim" },
root_markers = { ".git" },
init_options = {
isNeovim = true,
iskeyword = "@,48-57,_,192-255,-#",
vimruntime = "",
runtimepath = "",
diagnostic = { enable = true },
indexes = {
runtimepath = true,
gap = 100,
count = 3,
projectRootPatterns = { "runtime", "nvim", ".git", "autoload", "plugin" },
},
suggest = { fromVimruntime = true, fromRuntimepath = true },
},
}

View file

@ -0,0 +1,9 @@
return {
cmd = { "yaml-language-server", "--stdio" },
filetypes = { "yaml", "yaml.docker-compose", "yaml.gitlab" },
root_markers = { ".git" },
settings = {
yaml = {
},
},
}