mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-04 01:55:08 +02:00
refactor autocommands
This commit is contained in:
parent
d8cf871a38
commit
9e7ad60747
14 changed files with 283 additions and 298 deletions
|
@ -1,7 +1,22 @@
|
|||
require'lspconfig'.gopls.setup{
|
||||
require'lspconfig'.gopls.setup {
|
||||
cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
|
||||
settings = {gopls = {analyses = {unusedparams = true}, staticcheck = true}},
|
||||
root_dir = require'lspconfig'.util.root_pattern(".git","go.mod"),
|
||||
root_dir = require'lspconfig'.util.root_pattern(".git", "go.mod"),
|
||||
init_options = {usePlaceholders = true, completeUnimported = true},
|
||||
on_attach = require'lsp'.common_on_attach
|
||||
}
|
||||
|
||||
if O.lang.go.autoformat then
|
||||
require('lv-utils').define_augroups({
|
||||
_go_format = {
|
||||
'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'
|
||||
},
|
||||
_go = {
|
||||
-- Go generally requires Tabs instead of spaces.
|
||||
{'FileType', 'go', 'setlocal tabstop=4'},
|
||||
{'FileType', 'go', 'setlocal shiftwidth=4'},
|
||||
{'FileType', 'go', 'setlocal softtabstop=4'},
|
||||
{'FileType', 'go', 'setlocal noexpandtab'}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue