feat(home-manager): rework neovim configuration

Use new neovim option introduced in 0.11
This commit is contained in:
Yorick Barbanneau 2025-04-17 23:56:44 +02:00
parent 5ac9a372b9
commit 69493a7d84
Signed by: ephase
GPG key ID: 4447A19BBEDB8DBA
13 changed files with 208 additions and 194 deletions

View file

@ -0,0 +1,17 @@
return {
cmd = { 'bash-language-server', 'start' },
settings = {
bashIde = {
-- Glob pattern for finding and parsing shell script files in the workspace.
-- Used by the background analysis features across files.
-- Prevent recursive scanning which will cause issues when opening a file
-- directly in the home directory (e.g. ~/foo.sh).
--
-- Default upstream pattern is "**/*@(.sh|.inc|.bash|.command)".
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
},
},
filetypes = { 'bash', 'sh' },
root_markers = { '.git' },
}

View file

@ -0,0 +1,30 @@
return {
cmd = { 'helm_ls', 'serve' },
filetypes = { 'helm' },
root_markers = { 'Chart.yaml' },
capabilities = {
workspace = {
didChangeWatchedFiles = {
dynamicRegistration = true,
},
},
},
settings = {
['helm-ls'] = {
yamlls = {
enabled = true,
enabledforfilesglob = "*.{yaml,yml}",
diagnosticslimit = 50,
showdiagnosticsdirectly = false,
path = "yaml-language-server",
config = {
schemas = {
kubernetes = "template/**",
},
completion = true,
hover = true,
}
}
}
}
}

View file

@ -0,0 +1,32 @@
return {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = {
'.luarc.json',
'.luarc.jsonc',
'.luacheckrc',
'.stylua.toml',
'stylua.toml',
'selene.toml',
'selene.yml',
'.git',
},
settings = {
Lua = {
diagnostics = {
globals = {'vim'} -- Add any globals you want to ignore as undefined
},
workspace = {
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true
}
},
telemetry = {
enable = false -- Disable telemetry
}
}
},
flags = {
debounce_text_changes = 150,
}
}

View file

@ -0,0 +1,5 @@
return {
cmd = { 'marksman' },
filetypes = { 'markdown', 'markdown.mdx' },
root_markers = { '.marksman.toml', '.git' },
}

View file

@ -0,0 +1,15 @@
---@brief
---
-- https://github.com/oxalica/nil
--
-- A new language server for Nix Expression Language.
--
-- If you are using Nix with Flakes support, run `nix profile install github:oxalica/nil` to install.
-- Check the repository README for more information.
--
-- _See an example config at https://github.com/oxalica/nil/blob/main/dev/nvim-lsp.nix._
return {
cmd = { 'nil' },
filetypes = { 'nix' },
root_markers = { 'flake.nix', '.git' },
}

View file

@ -0,0 +1,21 @@
return {
cmd = { 'pylsp' },
filetypes = { 'python' },
root_markers = {
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
},
settings = {
pylsp = {
plugins = {
pylint = {
enabled = true
}
}
}
}
}

View file

@ -0,0 +1,5 @@
return {
cmd = { 'terraform-ls', 'serve' },
filetypes = { 'terraform', 'terraform-vars' },
root_markers = { '.terraform', '.git' },
}

View file

@ -0,0 +1,5 @@
return {
cmd = { 'tflint', '--langserver' },
filetypes = { 'terraform' },
root_markers = { '.terraform', '.git', '.tflint.hcl' },
}

View file

@ -0,0 +1,33 @@
-- most used yaml schemas
local gitlab_ci = "https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"
local taskfile = "https://taskfile.dev/schema.json"
local lefthook = "https://raw.githubusercontent.com/evilmartians/lefthook/refs/heads/master/schema.json"
local github_workflow = "https://json.schemastore.org/github-workflow.json"
return {
cmd = { 'yaml-language-server', '--stdio' },
filetypes = { 'yaml', 'yaml.docker-compose', 'yaml.gitlab' },
root_markers = { '.git' },
settings = {
yaml = {
schemas = {
[gitlab_ci] = {
"ci/*.{yaml,yml}",
".gitlab/**/*.{yaml,yml}",
".gitlab-ci.{yaml,yml}",
},
[taskfile] = {
"Taskfile*.{yaml,yml}",
"taskfile*.{yaml,yml}",
"taskfiles/**/*.{yaml,yml}",
},
[lefthook] = {
"lefthook.{yaml,yml}",
},
[github_workflow] = {
".github/workflow/**/*.{yaml,yml}",
}
},
},
},
}