From aac0e96aee64454f30032ee9ceb39ce0066b566d Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Thu, 16 Oct 2025 17:29:12 +0200 Subject: Update some go shortcut --- init.lua | 23 +++++++++++++---------- lua/gabrielgio/ai.lua | 5 +++++ lua/gabrielgio/dap.lua | 5 +---- lua/gabrielgio/go.lua | 5 ++--- lua/gabrielgio/init.lua | 1 + lua/gabrielgio/lazy.lua | 6 ++++-- lua/gabrielgio/lsp.lua | 1 + lua/gabrielgio/so.lua | 4 ++-- 8 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 lua/gabrielgio/ai.lua diff --git a/init.lua b/init.lua index cd12bf6..cb0e376 100644 --- a/init.lua +++ b/init.lua @@ -25,7 +25,6 @@ local pkgs = { "mfussenegger/nvim-dap", -- add dap support "nvim-neotest/nvim-nio", -- async support library "rcarriga/nvim-dap-ui", -- dap ui - "leoluz/nvim-dap-go", -- dap go "nvim-lua/plenary.nvim", -- base lib "nvim-telescope/telescope.nvim", -- telescope "nvim-telescope/telescope-file-browser.nvim", -- telescope file browser @@ -36,8 +35,9 @@ local pkgs = { "mhartington/formatter.nvim", -- provider formatter "mfussenegger/nvim-lint", -- general linter "nvim-treesitter/nvim-treesitter-context", -- show context of where it is at the code + "theHamsta/nvim-dap-virtual-text", -- support lib from tree sitter "mbbill/undotree", -- keep track of undos - "simrat39/symbols-outline.nvim", -- symbols tree (lsp aware) + "hedyhli/outline.nvim", -- symbols tree (lsp aware) "akinsho/toggleterm.nvim", -- terminal "RRethy/vim-illuminate", -- hightlight use of the same word (lsp aware) "sainnhe/edge", -- light theme @@ -46,6 +46,7 @@ local pkgs = { "williamboman/mason-lspconfig.nvim", -- glue mason and lspconfig "neovim/nvim-lspconfig", -- lsp support "vimwiki/vimwiki", -- wiki + "ray-x/go.nvim", -- go things } -- stylua: ignore end @@ -57,14 +58,16 @@ add({ end, }, }) -add({ - source = "fatih/vim-go", - hooks = { - post_checkout = function() - vim.cmd("GoUpdateBinaries") - end, - }, -}) + +-- work related ai plugins +if vim.fn.executable("copilot") == 1 then + table.insert(pkgs, "github/copilot.vim") -- copilot +end + +if vim.fn.executable("claude") == 1 then + table.insert(pkgs, "coder/claudecode.nvim") -- claude +end + for _, value in ipairs(pkgs) do add({ source = value }) end diff --git a/lua/gabrielgio/ai.lua b/lua/gabrielgio/ai.lua new file mode 100644 index 0000000..08a49a6 --- /dev/null +++ b/lua/gabrielgio/ai.lua @@ -0,0 +1,5 @@ +local ok, claudecode = pcall(require, "claudecode") + +if ok then + claudecode.setup() +end diff --git a/lua/gabrielgio/dap.lua b/lua/gabrielgio/dap.lua index 4d55ca6..e4a2923 100644 --- a/lua/gabrielgio/dap.lua +++ b/lua/gabrielgio/dap.lua @@ -1,9 +1,6 @@ -local dap = require("dap") local key = require("gabrielgio.key") +local dap = require("dap") local dapui = require("dapui") -local dapgo = require("dap-go") - -dapgo.setup() key.nnoremap("", ":lua require'dap'.continue()") key.nnoremap("", ":lua require'dap'.step_over()") diff --git a/lua/gabrielgio/go.lua b/lua/gabrielgio/go.lua index e0b27b7..e95c641 100644 --- a/lua/gabrielgio/go.lua +++ b/lua/gabrielgio/go.lua @@ -1,11 +1,10 @@ local key = require("gabrielgio.key") +require("go").setup() + vim.g["go_def_mode"] = "gopls" vim.g["go_info_mode"] = "gopls" -key.nnoremap("r", ":GoReferrers") -key.nnoremap("a", ":GoAlternate") key.nnoremap("s", ":GoRename") -key.nnoremap("i", ":GoImplements") key.nnoremap("o", ":GoIfErr") key.nnoremap("gs", ":GoDebugStart .") key.nnoremap("gc", ":GoDebugContinue") diff --git a/lua/gabrielgio/init.lua b/lua/gabrielgio/init.lua index 2c146cf..fcdce8c 100644 --- a/lua/gabrielgio/init.lua +++ b/lua/gabrielgio/init.lua @@ -23,3 +23,4 @@ later(require_func("gabrielgio.trouble")) later(require_func("gabrielgio.dap")) later(require_func("gabrielgio.term")) later(require_func("gabrielgio.neovide")) +later(require_func("gabrielgio.ai")) diff --git a/lua/gabrielgio/lazy.lua b/lua/gabrielgio/lazy.lua index 1354b76..e8b76cc 100644 --- a/lua/gabrielgio/lazy.lua +++ b/lua/gabrielgio/lazy.lua @@ -3,17 +3,19 @@ require("gitblame").setup() require("neogit").setup() require("mason").setup() +require("nvim-dap-virtual-text").setup() +require("treesitter-context").setup() require("mason-lspconfig").setup({ ensure_installed = { "cssls", "emmet_ls", - "gopls", + -- "gopls", "html", "lua_ls", "pylsp", "rust_analyzer", "tsserver", "zls", - -- "clangd" not working on alpine + -- "clangd" not working on alpine }, }) diff --git a/lua/gabrielgio/lsp.lua b/lua/gabrielgio/lsp.lua index 36a3c25..3c169c4 100644 --- a/lua/gabrielgio/lsp.lua +++ b/lua/gabrielgio/lsp.lua @@ -10,6 +10,7 @@ local function on_attach(client, bufnr) set_key("n", "gd", vim.lsp.buf.definition, bufopts) set_key("n", "K", vim.lsp.buf.hover, bufopts) set_key("n", "gi", vim.lsp.buf.implementation, bufopts) + set_key("n", "gr", vim.lsp.buf.references, bufopts) set_key("n", "", vim.lsp.buf.signature_help, bufopts) set_key("n", "rn", vim.lsp.buf.declaration, bufopts) set_key("n", "ca", vim.lsp.buf.code_action, bufopts) diff --git a/lua/gabrielgio/so.lua b/lua/gabrielgio/so.lua index df04319..d699646 100644 --- a/lua/gabrielgio/so.lua +++ b/lua/gabrielgio/so.lua @@ -1,6 +1,6 @@ local key = require("gabrielgio.key") -local symbols = require("symbols-outline") +local symbols = require("outline") -key.nnoremap("to", ":SymbolsOutline") +key.nnoremap("to", ":Outline") symbols.setup() -- cgit v1.2.3