[vim] migration to 0.11 and native lsp client

This commit is contained in:
Dmitrii Chumak
2025-07-24 18:04:28 +03:00
parent e2bdd71b08
commit 880bbd18e0
7 changed files with 164 additions and 132 deletions

25
nvim/lsp/basedpyright.lua Normal file
View File

@@ -0,0 +1,25 @@
return {
cmd = { 'basedpyright-langserver', '--stdio' },
filetypes = { 'python' },
root_markers = {
'pyrightconfig.json',
'ya.make',
'pyproject.toml',
'setup.py',
'setup.cfg',
'requirements.txt',
'Pipfile',
'.git',
},
settings = {
python = {
analysis = {
autoSearchPaths = false,
useLibraryCodeForTypes = true,
diagnosticMode = 'openFilesOnly',
include = {
}
},
},
},
}

25
nvim/lsp/bashls.lua Normal file
View File

@@ -0,0 +1,25 @@
return {
cmd = { 'bash-language-server', 'start' },
filetypes = { 'bash', 'sh', 'zsh' },
root_markers = { '.git', vim.uv.cwd() },
settings = {
bashIde = {
globPattern = vim.env.GLOB_PATTERN or '*@(.sh|.inc|.bash|.command)',
-- Modern formatting options (requires shfmt)
tabSize = 2,
insertSpaces = true,
-- Enable comprehensive features like Ruby LSP
enableSourceErrorDiagnostics = true,
enableCodeLens = true,
includeAllWorkspaceSymbols = true,
-- Background analysis for better performance
backgroundAnalysisMaxFiles = 500,
-- ShellCheck integration for linting
shellcheckPath = 'shellcheck',
shellcheckArguments = {
'--shell=bash',
'--format=json',
},
},
},
}

20
nvim/lsp/gopls.lua Normal file
View File

@@ -0,0 +1,20 @@
return {
cmd = { "/home/dmchumak/.ya/tools/v3/gopls-linux/gopls" },
filetypes = { "go", "gotempl", "gowork", "gomod" },
root_markers = { "ya.make", "YAOWNERS", ".arcadia.root", ".cloudia.root", "go.work", "go.mod", ".git" },
-- settings = {
-- gopls = {
-- completeUnimported = true,
-- usePlaceholders = true,
-- analyses = {
-- unusedparams = true,
-- },
-- ["ui.inlayhint.hints"] = {
-- compositeLiteralFields = true,
-- constantValues = true,
-- parameterNames = true,
-- rangeVariableTypes = true,
-- },
-- },
-- },
}

33
nvim/lsp/lua_ls.lua Normal file
View File

@@ -0,0 +1,33 @@
return {
cmd = { "lua-language-server" },
root_markers = { ".luarc.json", ".git", "init.lua" },
filetypes = { "lua" },
settings = {
Lua = {
format = {
enable = true,
defaultConfig = {
indent_style = "space",
indent_size = "2",
}
},
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
}
}
}