Skip to content

Commit

Permalink
feat: update golang plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
0xRichardH committed Jan 11, 2024
1 parent 6dbbb97 commit f27100d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 124 deletions.
28 changes: 14 additions & 14 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"LazyVim": { "branch": "main", "commit": "879e29504d43e9f178d967ecc34d482f902e5a91" },
"LuaSnip": { "branch": "master", "commit": "68153ebb03e65d8a437c6240553645c57f17cf99" },
"SchemaStore.nvim": { "branch": "main", "commit": "7ccffe69a8c24fcd8637788955e13d7fd8aa2f46" },
"LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" },
"SchemaStore.nvim": { "branch": "main", "commit": "fcb1522fefd0f9029b7dc71aa2664d2d0ead0fb3" },
"SmoothCursor.nvim": { "branch": "main", "commit": "cc8780622a7b7c328f774762fa2d97d9f83be828" },
"barbecue": { "branch": "main", "commit": "d38a2a023dfb1073dd0e8fee0c9be08855d3688f" },
"catppuccin": { "branch": "main", "commit": "5e36ca599f4aa41bdd87fbf2c5aae4397ac55074" },
Expand All @@ -10,12 +10,12 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"committia.vim": { "branch": "master", "commit": "a187b8633694027ab5ef8a834527d33093282f95" },
"conform.nvim": { "branch": "master", "commit": "a4e84d56d5959dae685c5e22db202cd86b5b322b" },
"copilot.lua": { "branch": "master", "commit": "858bbfa6fa81c88fb1f64107d7981f1658619e0a" },
"crates.nvim": { "branch": "main", "commit": "6d779c7b85139d89d92a4a0bcf0afbdcf0cd961a" },
"conform.nvim": { "branch": "master", "commit": "75e7c5c7eb5fbd53f8b12dc420b31ec70770b231" },
"copilot.lua": { "branch": "master", "commit": "b03617a6dc4bc88b65ab5deac1631da9a9c2dcaf" },
"crates.nvim": { "branch": "main", "commit": "330d8049f1d359dad28c93ea2664b4823643b7db" },
"dressing.nvim": { "branch": "master", "commit": "94b0d24483d56f3777ee0c8dc51675f21709318c" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"friendly-snippets": { "branch": "main", "commit": "53d3df271d031c405255e99410628c26a8f0d2b0" },
"friendly-snippets": { "branch": "main", "commit": "69a2c1675b66e002799f5eef803b87a12f593049" },
"gitsigns.nvim": { "branch": "main", "commit": "3e6e91b09f0468c32d3b96dcacf4b947f037ce25" },
"glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
"go.nvim": { "branch": "master", "commit": "24d2fa373d55d9900cd4b502a88214dc17e6fab6" },
Expand All @@ -33,23 +33,23 @@
"mini.pairs": { "branch": "main", "commit": "552062017ff207e1f35f7028bfb3f27c7421d22d" },
"mini.surround": { "branch": "main", "commit": "7bf8915ba15d7a4f3c2afe7868d3c15a858d73f1" },
"neoconf.nvim": { "branch": "main", "commit": "64437787dba70fce50dad7bfbb97d184c5bc340f" },
"neodev.nvim": { "branch": "main", "commit": "be8d4d4cab6c13c6a572269c9d6a63774baba9a0" },
"neodev.nvim": { "branch": "main", "commit": "34b93b809b781b8a1ad862142e40b11bae1dc0e9" },
"no-neck-pain.nvim": { "branch": "main", "commit": "b305821ca45897db6276e9ae5893747bb24040c7" },
"noice.nvim": { "branch": "main", "commit": "92433164e2f7118d4122c7674c3834d9511722ba" },
"nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" },
"nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" },
"nvim-code-action-menu": { "branch": "main", "commit": "8c7672a4b04d3cc4edd2c484d05b660a9cb34a1b" },
"nvim-lint": { "branch": "master", "commit": "d44185d3e57e00c164485a454174294b36ef7067" },
"nvim-lint": { "branch": "master", "commit": "8df53b5dde8ea80f0a039775777eae6648a10229" },
"nvim-lspconfig": { "branch": "master", "commit": "796394fd19fb878e8dbc4fd1e9c9c186ed07a5f4" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-notify": { "branch": "master", "commit": "1576123bff3bed67bc673a3076e591abfe5d8ca9" },
"nvim-spectre": { "branch": "master", "commit": "d8906855f1949ac97b1e77aaf8d3fe12ed158ddc" },
"nvim-treesitter": { "branch": "master", "commit": "5032f9952ad2a3a7f7792ac438c4f9e2bd53e0b9" },
"nvim-treesitter-context": { "branch": "master", "commit": "652ec514d6ba8bc4a3c2de76c855fe668e2c7196" },
"nvim-treesitter": { "branch": "master", "commit": "8cd2b230174efbf7b5d9f49fe2f90bda6b5eb16e" },
"nvim-treesitter-context": { "branch": "master", "commit": "400a99ad43ac78af1148061da3491cba2637ad29" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "85b9d0cbd4ff901abcda862b50dbb34e0901848b" },
"nvim-ts-autotag": { "branch": "main", "commit": "8515e48a277a2f4947d91004d9aa92c29fdc5e18" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1277b4a1f451b0f18c0790e1a7f12e1e5fdebfee" },
"nvim-ufo": { "branch": "main", "commit": "c6d88523f574024b788f1c3400c5d5b9bb1a0407" },
"nvim-ufo": { "branch": "main", "commit": "35089d4bf300943f1ab04c631d9b8a44ebbfc174" },
"nvim-web-devicons": { "branch": "master", "commit": "db0c864375c198cacc171ff373e76bfce2a85045" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" },
Expand All @@ -58,16 +58,16 @@
"sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" },
"symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" },
"tailiscope.nvim": { "branch": "main", "commit": "d756e166cc1fec4eb06549b218b275c21d652e1e" },
"telescope-all-recent.nvim": { "branch": "main", "commit": "766d79bedf8dd59c2d0a944a7cf3c98795ab5f07" },
"telescope-all-recent.nvim": { "branch": "main", "commit": "bfd8bb3b9c43bf0d09c2a77f3a5fcbecddbf9908" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
"telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" },
"telescope-zf-native.nvim": { "branch": "master", "commit": "beb34b6c48154ec117930180f257a5592606d48f" },
"telescope.nvim": { "branch": "master", "commit": "87e92ea31b2b61d45ad044cf7b2d9b66dad2a618" },
"telescope.nvim": { "branch": "master", "commit": "b3ff5f33201f474d58f5be96244869f189bbc091" },
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" },
"vim-tmux-navigator": { "branch": "master", "commit": "38b1d0402c4600543281dc85b3f51884205674b6" },
"vim-wakatime": { "branch": "master", "commit": "8c8856327815a077cbebeba8c7456312a3d2c39c" },
"vim-wakatime": { "branch": "master", "commit": "cae21a19c3db4d9aadd5d320de3da0c99dfd0f62" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
"yanky.nvim": { "branch": "main", "commit": "6bb9ffd3cad4c9876bda54e19d0659de28a4f84f" }
}
114 changes: 4 additions & 110 deletions config/nvim/lua/plugins/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,116 +6,10 @@ return {
"neovim/nvim-lspconfig",
"nvim-treesitter/nvim-treesitter",
},
opts = {
disable_defaults = false, -- true|false when true set false to all boolean settings and replace all table
-- settings with {}
go = "go", -- go command, can be go[default] or go1.18beta1
goimport = "gopls", -- goimport command, can be gopls[default] or goimport
fillstruct = "gopls", -- can be nil (use fillstruct, slower) and gopls
gofmt = "gofumpt", --gofmt cmd,
max_line_len = 128, -- max line length in golines format, Target maximum line length for golines
tag_transform = false, -- can be transform option("snakecase", "camelcase", etc) check gomodifytags for details and more options
tag_options = "json=omitempty", -- sets options sent to gomodifytags, i.e., json=omitempty
gotests_template = "", -- sets gotests -template parameter (check gotests for details)
gotests_template_dir = "", -- sets gotests -template_dir parameter (check gotests for details)
comment_placeholder = "", -- comment_placeholder your cool placeholder e.g. ﳑ    
icons = { breakpoint = "🧘", currentpos = "🏃" }, -- setup to `false` to disable icons setup
verbose = false, -- output loginf in messages
lsp_cfg = false, -- true: use non-default gopls setup specified in go/lsp.lua
-- false: do nothing
-- if lsp_cfg is a table, merge table with with non-default gopls setup in go/lsp.lua, e.g.
-- lsp_cfg = {settings={gopls={matcher='CaseInsensitive', ['local'] = 'your_local_module_path', gofumpt = true }}}
lsp_gofumpt = true, -- true: set default gofmt in gopls format to gofumpt
lsp_on_attach = nil, -- nil: use on_attach function defined in go/lsp.lua,
-- when lsp_cfg is true
-- if lsp_on_attach is a function: use this function as on_attach function for gopls
lsp_keymaps = true, -- set to false to disable gopls/lsp keymap
lsp_codelens = true, -- set to false to disable codelens, true by default, you can use a function
-- function(bufnr)
-- vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>F", "<cmd>lua vim.lsp.buf.formatting()<CR>", {noremap=true, silent=true})
-- end
-- to setup a table of codelens
lsp_diag_hdlr = true, -- hook lsp diag handler
lsp_diag_underline = true,
-- virtual text setup
lsp_diag_virtual_text = { space = 0, prefix = "" },
lsp_diag_signs = true,
lsp_diag_update_in_insert = false,
lsp_document_formatting = true,
-- set to true: use gopls to format
-- false if you want to use other formatter tool(e.g. efm, nulls)
lsp_inlay_hints = {
enable = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- Event which triggers a refersh of the inlay hints.
-- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
-- not that this may cause higher CPU usage.
-- This option is only respected when only_current_line and
-- autoSetHints both are true.
only_current_line_autocmd = "CursorHold",
-- whether to show variable name before type hints with the inlay hints or not
-- default: false
show_variable_name = true,
-- prefix for parameter hints
parameter_hints_prefix = "",
show_parameter_hints = true,
-- prefix for all the other hints (type, chaining)
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 6,
-- The color of the hints
highlight = "Comment",
},
gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile","/var/log/gopls.log" }
gopls_remote_auto = true, -- add -remote=auto to gopls
gocoverage_sign = "",
sign_priority = 5, -- change to a higher number to override other signs
dap_debug = true, -- set to false to disable dap
dap_debug_keymap = true, -- true: use keymap for debugger defined in go/dap.lua
-- false: do not use keymap in go/dap.lua. you must define your own.
-- windows: use visual studio keymap
dap_debug_gui = {}, -- bool|table put your dap-ui setup here set to false to disable
dap_debug_vt = { enabled_commands = true, all_frames = true }, -- bool|table put your dap-virtual-text setup here set to false to disable
dap_port = 38697, -- can be set to a number, if set to -1 go.nvim will pickup a random port
dap_timeout = 15, -- see dap option initialize_timeout_sec = 15,
dap_retries = 20, -- see dap option max_retries
build_tags = "tag1,tag2", -- set default build tags
textobjects = true, -- enable default text jobects through treesittter-text-objects
test_runner = "go", -- one of {`go`, `richgo`, `dlv`, `ginkgo`, `gotestsum`}
verbose_tests = true, -- set to add verbose flag to tests deprecated, see '-v' option
run_in_floaterm = false, -- set to true to run in float window. :GoTermClose closes the floatterm
-- float term recommend if you use richgo/ginkgo with terminal color

floaterm = {
-- position
posititon = "auto", -- one of {`top`, `bottom`, `left`, `right`, `center`, `auto`}
width = 0.45, -- width of float window if not auto
height = 0.98, -- height of float window if not auto
},
trouble = false, -- true: use trouble to open quickfix
test_efm = false, -- errorfomat for quickfix, default mix mode, set to true will be efm only
luasnip = true, -- enable included luasnip snippets. you can also disable while add lua/snips folder to luasnip load
-- Do not enable this if you already added the path, that will duplicate the entries
on_jobstart = function(cmd)
_ = cmd
end, -- callback for stdout
on_stdout = function(err, data)
_, _ = err, data
end, -- callback when job started
on_stderr = function(err, data)
_, _ = err, data
end, -- callback for stderr
on_exit = function(code, signal, output)
_, _, _ = code, signal, output
end, -- callback for jobexit, output : string
},
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
},
Expand Down

0 comments on commit f27100d

Please sign in to comment.