Add sourcegraph nvim plugin for cody AI

This commit is contained in:
Erica Marigold 2025-02-05 11:27:34 +00:00
parent 83b0399253
commit 0f483b469f
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw
2 changed files with 22 additions and 12 deletions

View file

@ -20,6 +20,7 @@
"oil.nvim": { "branch": "master", "commit": "add50252b5e9147c0a09d36480d418c7e2737472" },
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
"rustaceanvim": { "branch": "master", "commit": "f03035fa03ccb36cd26d0792c946fbacba1d1a39" },
"sg.nvim": { "branch": "master", "commit": "775f22b75a9826eabf69b0094dd1d51d619fe552" },
"snacks.nvim": { "branch": "main", "commit": "e6e9123debbe7317112a0889b15468bb6aedf992" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },

View file

@ -10,6 +10,17 @@ local blinkAcceptKeybind = {
'fallback'
}
local function on_attach(_, buf)
local function map(keys, fn, desc)
vim.keymap.set("n", keys, fn, { buffer = buf, desc = "LSP: " .. desc })
end
map("<leader>cr", vim.lsp.buf.rename, "Rename")
map("<leader>ca", vim.lsp.buf.code_action, "Code Action")
map("gd", require("telescope.builtin").lsp_definitions, "Goto Definition")
map("gr", require("telescope.builtin").lsp_references, "Goto References")
end
return {
{
"williamboman/mason.nvim",
@ -33,17 +44,6 @@ return {
local lspconfig = require("lspconfig")
local function on_attach(_, buf)
local function map(keys, fn, desc)
vim.keymap.set("n", keys, fn, { buffer = buf, desc = "LSP: " .. desc })
end
map("<leader>cr", vim.lsp.buf.rename, "Rename")
map("<leader>ca", vim.lsp.buf.code_action, "Code Action")
map("gd", require("telescope.builtin").lsp_definitions, "Goto Definition")
map("gr", require("telescope.builtin").lsp_references, "Goto References")
end
for server, config in pairs(opts.servers) do
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
config.on_attach = on_attach
@ -116,5 +116,14 @@ return {
dependencies = {
"nvim-lua/plenary.nvim",
},
}
},
{
"sourcegraph/sg.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
config = function()
require("sg").setup {
on_attach = on_attach
}
end
},
}