Перевёл dotfiles на stow
This commit is contained in:
parent
27416cef99
commit
97af93b2a8
169 changed files with 1256 additions and 100 deletions
31
config/nvim/lua/lsp.lua
Normal file
31
config/nvim/lua/lsp.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
-- инициализация LSP для различных ЯП
|
||||
local lspconfig = require("lspconfig")
|
||||
local util = require("lspconfig/util")
|
||||
|
||||
local function config(_config)
|
||||
return vim.tbl_deep_extend("force", {
|
||||
-- capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()),
|
||||
}, _config or {})
|
||||
end
|
||||
-- иницализация gopls LSP для Go
|
||||
-- https://github.com/golang/tools/blob/master/gopls/doc/vim.md#neovim-install
|
||||
lspconfig.gopls.setup(config({
|
||||
cmd = { "gopls", "serve" },
|
||||
filetypes = { "go", "go.mod" },
|
||||
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true,
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
lspconfig.templ.setup(config({
|
||||
cmd = { "templ", "lsp" },
|
||||
filetypes = { "templ" },
|
||||
root_markers = { "go.work", "go.mod", ".git" },
|
||||
}))
|
Loading…
Add table
Add a link
Reference in a new issue