From 9f511bcb594b7e2461c97cb8182603928c773c2f Mon Sep 17 00:00:00 2001 From: Rafael Date: Sun, 4 Jul 2021 22:14:01 -0300 Subject: start formatting rules --- ftplugin/go.lua | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'ftplugin/go.lua') diff --git a/ftplugin/go.lua b/ftplugin/go.lua index b2d6a82a..0bee465f 100644 --- a/ftplugin/go.lua +++ b/ftplugin/go.lua @@ -1,22 +1,22 @@ -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"), - init_options = {usePlaceholders = true, completeUnimported = true}, - on_attach = require'lsp'.common_on_attach +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"), + 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'} - } - }) + 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 -- cgit v1.2.3