feat(home-manager): rework neovim configuration
Use new neovim option introduced in 0.11
This commit is contained in:
parent
5ac9a372b9
commit
69493a7d84
13 changed files with 208 additions and 194 deletions
17
modules/home-manager/cli/neovim/files/lsp/bash.lua
Normal file
17
modules/home-manager/cli/neovim/files/lsp/bash.lua
Normal 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' },
|
||||
}
|
30
modules/home-manager/cli/neovim/files/lsp/helm.lua
Normal file
30
modules/home-manager/cli/neovim/files/lsp/helm.lua
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
32
modules/home-manager/cli/neovim/files/lsp/lua.lua
Normal file
32
modules/home-manager/cli/neovim/files/lsp/lua.lua
Normal 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,
|
||||
}
|
||||
}
|
5
modules/home-manager/cli/neovim/files/lsp/marksman.lua
Normal file
5
modules/home-manager/cli/neovim/files/lsp/marksman.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { 'marksman' },
|
||||
filetypes = { 'markdown', 'markdown.mdx' },
|
||||
root_markers = { '.marksman.toml', '.git' },
|
||||
}
|
15
modules/home-manager/cli/neovim/files/lsp/nills.lua
Normal file
15
modules/home-manager/cli/neovim/files/lsp/nills.lua
Normal 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' },
|
||||
}
|
21
modules/home-manager/cli/neovim/files/lsp/pylsp.lua
Normal file
21
modules/home-manager/cli/neovim/files/lsp/pylsp.lua
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { 'terraform-ls', 'serve' },
|
||||
filetypes = { 'terraform', 'terraform-vars' },
|
||||
root_markers = { '.terraform', '.git' },
|
||||
}
|
5
modules/home-manager/cli/neovim/files/lsp/tflint.lua
Normal file
5
modules/home-manager/cli/neovim/files/lsp/tflint.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
cmd = { 'tflint', '--langserver' },
|
||||
filetypes = { 'terraform' },
|
||||
root_markers = { '.terraform', '.git', '.tflint.hcl' },
|
||||
}
|
33
modules/home-manager/cli/neovim/files/lsp/yaml.lua
Normal file
33
modules/home-manager/cli/neovim/files/lsp/yaml.lua
Normal 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}",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue