add devops and development profile

This commit is contained in:
TapTap committed 2026-10-29 11:56:24 +01:00
1 parent a0d2bcdfb0
commit ab80f0d763
9 files changed
+128 -140

No files matched your search

+65 -86
View File
@@ -114,98 +114,23 @@ do
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
-- See `:help lsp-config` for information about keys and how to configure
local formatters_and_tools = {
'clang-format', -- Using the correct hyphen!
'isort',
'ktfmt',
'nixfmt',
'shfmt',
'stylua',
'black',
}
if vim.g.load_devops then vim.list_extend(formatters_and_tools, { 'nixfmt', 'terraform', 'yamlfmt' }) end
if vim.g.load_development then vim.list_extend(formatters_and_tools, { 'black', 'isort', 'clang-format', 'ktfmt' }) end
-- Servers that apply regardless of profile
---@type table<string, vim.lsp.Config>
local servers = {
-- json
jsonls = {},
-- terraform
terraformls = {},
-- c
clangd = {
cmd = {
'clangd',
'--background-index',
'--clang-tidy',
'--query-driver=/nix/store/*/bin/*gcc*',
},
},
neocmake = {},
-- nix
nil_ls = {},
-- python
-- pylsp = {
-- -- plugins = {
-- -- -- formatter options
-- -- black = { enabled = true },
-- -- autopep8 = { enabled = false },
-- -- yapf = { enabled = false },
-- -- -- linter options
-- -- pylint = { enabled = true, executable = 'pylint' },
-- -- pyflakes = { enabled = false },
-- -- pycodestyle = { enabled = false },
-- -- -- type checker
-- -- pylsp_mypy = { enabled = true },
-- -- -- auto-completion options
-- -- jedi_completion = { fuzzy = true },
-- -- -- import sorting
-- -- pyls_isort = { enabled = true },
-- -- },
-- },
pyright = {},
ruff = {},
isort = {},
-- kotlin
kotlin_lsp = {},
-- latex
texlab = {},
-- bash
-- bash / sh
bashls = {},
-- markdown
-- markdown / prose
markdown_oxide = {},
kakehashi = {
filetypes = { 'markdown' },
init_options = {
languageServers = {
['texlab'] = {
cmd = { 'texlab' },
languages = { 'latex' },
},
['lua_ls'] = {
cmd = { 'lua-language-server' },
languages = { 'lua' },
},
},
languages = {
_ = {
autoInstall = true,
},
markdown = {
bridge = {
texlab = { enabled = true },
lua_ls = { enabled = true },
},
},
},
},
},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
--
-- Some languages (like typescript) have entire language plugins that can be useful:
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
-- Special Lua Config, as recommended by neovim help docs
lua_ls = {
@@ -242,6 +167,62 @@ do
},
}
-- Infrastructure / DevOps profile
if vim.g.load_devops then
-- terraform
servers.terraformls = {}
-- nix
servers.nil_ls = {}
-- yaml
servers.yamlls = {
settings = {
yaml = {
schemaStore = { enable = true },
validate = true,
format = { enable = false }, -- formatting is handled by conform
},
},
}
end
-- General development profile
if vim.g.load_development then
servers.clangd = {
cmd = { 'clangd', '--background-index', '--clang-tidy' },
}
servers.neocmake = {}
servers.pyright = {}
servers.ruff = {}
servers.kotlin_lsp = {}
servers.texlab = {}
servers.kakehashi = {
filetypes = { 'markdown' },
init_options = {
languageServers = {
['texlab'] = {
cmd = { 'texlab' },
languages = { 'latex' },
},
['lua_ls'] = {
cmd = { 'lua-language-server' },
languages = { 'lua' },
},
},
languages = {
_ = {
autoInstall = true,
},
markdown = {
bridge = {
texlab = { enabled = true },
lua_ls = { enabled = true },
},
},
},
},
}
end
vim.pack.add {
gh 'neovim/nvim-lspconfig',
gh 'mason-org/mason.nvim',
@@ -262,7 +243,7 @@ do
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, formatters_and_tools)
safe_require('mason-tool-installer', { ensure_installed = ensure_installed, auto_update = true, run_on_start = true }, function(_)
safe_require('mason-tool-installer', { ensure_installed = ensure_installed, auto_update = false, run_on_start = true }, function(_)
-- for name in ensure_installed do
-- vim.lsp.enable(name)
-- end
@@ -272,6 +253,4 @@ do
vim.lsp.enable(name)
end
end)
vim.diagnostic.config { update_in_insert = true }
end