This commit is contained in:
Christian Nieves
2024-05-08 15:49:55 +00:00
parent 822daa2ff0
commit 8a4fdc0e0b
5 changed files with 53 additions and 48 deletions

View File

@ -58,9 +58,22 @@ return {
},
{
"ray-x/go.nvim",
ft = "go",
-- cond = not use_google(),
dependencies = { "ray-x/guihua.lua" },
dependencies = { -- optional packages
"ray-x/guihua.lua",
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
config = function()
local capabilities =
require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities.offsetEncoding = { "utf-16" }
require("go").setup({
capabilities = capabilities,
})
end,
event = { "VeryLazy" },
ft = { "go", "gomod" },
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
},
{
"neovim/nvim-lspconfig",
@ -111,16 +124,6 @@ return {
vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]])
vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]])
-- Golang
-- if not use_google then
require("go").setup({
capabilities = capabilities,
-- root_dir = function(fname)
-- return string.match(fname, "(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$")
-- end,
-- lsp_cfg = {},
})
-- Run gofmt + goimports on save
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
vim.api.nvim_create_autocmd("BufWritePre", {
@ -130,7 +133,6 @@ return {
end,
group = format_sync_grp,
})
-- end
end,
},
}