go lsp
parent
232eeb0368
commit
6d642c4df1
|
@ -127,5 +127,5 @@ export NVM_DIR="$HOME/.nvm"
|
|||
|
||||
export KUBECONFIG=$HOME/kubeconfig
|
||||
|
||||
export PATH="$PATH:$HOME:$HOME/bin:$HOME/.local/bin:/usr/local/go/bin:/usr/local/bin"
|
||||
export PATH="$PATH:$HOME:$HOME/bin:$HOME/.local/bin:/usr/local/go/bin:/usr/local/bin:$GOPATH/bin"
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require('go.format').goimports()
|
||||
end,
|
||||
group = format_sync_grp,
|
||||
})
|
||||
|
||||
require('go').setup()
|
||||
|
|
@ -58,3 +58,7 @@ lsp.on_attach(function(client, bufnr)
|
|||
end)
|
||||
|
||||
lsp.setup()
|
||||
|
||||
require("lspconfig").gopls.setup({
|
||||
-- your gopls setup
|
||||
})
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" },
|
||||
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
|
||||
"go.nvim": { "branch": "master", "commit": "294d65c93514f14fbbe8af0545ab8918d939acdb" },
|
||||
"guihua.lua": { "branch": "master", "commit": "5b45e29629eb1136c82870a5ebe55747ffebe79b" },
|
||||
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" },
|
||||
"lsp-zero.nvim": { "branch": "v3.x", "commit": "f12d50716e8e59ea9f5cf484eac6968c33a95917" },
|
||||
|
|
|
@ -71,5 +71,19 @@ return require('lazy').setup({
|
|||
{
|
||||
'zbirenbaum/copilot.lua',
|
||||
dependencies = 'zbirenbaum/copilot-cmp'
|
||||
},
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
end,
|
||||
event = {"CmdlineEnter"},
|
||||
ft = {"go", 'gomod'},
|
||||
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue