[nvim] migrate from copilot to codeium

This commit is contained in:
Piotr Domański 2024-08-21 14:18:36 +02:00
parent 6beac901d8
commit bf693f4ae3
4 changed files with 36 additions and 67 deletions

View file

@ -3,7 +3,7 @@
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
"codeium.vim": { "branch": "main", "commit": "0b74f274b82c00eaad4b5b5cd8b2e76f872d19f1" },
"dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
"flutter-tools.nvim": { "branch": "main", "commit": "990a1349c29f7d474a0cd51355aba773ccc9deea" },
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },

View file

@ -47,7 +47,7 @@ vim.keymap.set("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev se
vim.keymap.set("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
-- lazy
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
vim.keymap.set("n", "<leader>p", "<cmd>Lazy<cr>", { desc = "Lazy" })
-- new file
vim.keymap.set("n", "<leader>n", "<cmd>enew<cr>", { desc = "New File" })
@ -72,8 +72,10 @@ vim.keymap.set("t", "<C-w>", "<cmd>close<cr>", { desc = "Hide Terminal" })
-- lsp
vim.keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition" })
vim.keymap.set("n", "gs", "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition in vertical split" })
vim.keymap.set("n", "gS", "<cmd>belowright | lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition in horizontal split" })
vim.keymap.set("n", "gs", "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>",
{ desc = "Goto Definition in vertical split" })
vim.keymap.set("n", "gS", "<cmd>belowright | lua vim.lsp.buf.definition()<cr>",
{ desc = "Goto Definition in horizontal split" })
vim.keymap.set("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", { desc = "Goto Declaration" })
vim.keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<cr>", { desc = "Goto Implementation" })
vim.keymap.set("n", "gr", "<cmd>lua vim.lsp.buf.references()<cr>", { desc = "Goto References" })
@ -87,8 +89,10 @@ vim.keymap.set("n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<CR>", { desc =
-- trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>", { desc = "Trouble toggle" })
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>", { desc = "Trouble workspace diagnostics" })
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>", { desc = "Trouble document diagnostics" })
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>",
{ desc = "Trouble workspace diagnostics" })
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>",
{ desc = "Trouble document diagnostics" })
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>", { desc = "Trouble quickfix" })
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>", { desc = "Trouble loclist" })
vim.keymap.set("n", "<leader>gR", "<cmd>TroubleToggle lsp_references<cr>", { desc = "Trouble lsp references" })
@ -102,8 +106,10 @@ vim.keymap.set('n', '<leader>uu', vim.cmd.UndotreeToggle, { desc = "Toggle undo
-- harpoon
vim.keymap.set("n", "<leader>hh", "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", { desc = "Harpoon Menu" })
vim.keymap.set("n", "<leader>ha", "<cmd>lua require('harpoon.mark').add_file()<cr>", { desc = "Harpoon Add File" })
vim.keymap.set("n", "<leader>k", "<cmd>lua require('harpoon.ui').nav_next()<cr>", { desc = "Navigate to next harpoon file" })
vim.keymap.set("n", "<leader>j", "<cmd>lua require('harpoon.ui').nav_prev()<cr>", { desc = "Navigate to previous harpoon file" })
vim.keymap.set("n", "<leader>k", "<cmd>lua require('harpoon.ui').nav_next()<cr>",
{ desc = "Navigate to next harpoon file" })
vim.keymap.set("n", "<leader>j", "<cmd>lua require('harpoon.ui').nav_prev()<cr>",
{ desc = "Navigate to previous harpoon file" })
-- ditto
vim.keymap.set("n", "<leader>dd", "<cmd>ToggleDitto<cr>", { desc = "Ditto toggle" })

View file

@ -1,52 +1,15 @@
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
'Exafunction/codeium.vim',
event = 'BufEnter',
config = function()
require("copilot").setup({
panel = {
enabled = true,
auto_refresh = false,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<C-a>",
refresh = "<C-r>",
open = "<C-w>",
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4,
},
},
suggestion = {
enabled = true,
auto_trigger = true,
debounce = 80,
keymap = {
accept = "<C-a>",
accept_word = false,
accept_line = false,
next = "<C-q>",
prev = "<C-e>",
dismiss = "<C-d>",
},
},
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
["."] = false,
},
copilot_node_command = "node", -- Node.js version must be > 16.x
server_opts_overrides = {},
})
end,
},
-- Change '<C-g>' here to any keycode you like.
vim.keymap.set('i', '<C-a>', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
vim.keymap.set('i', '<C-e>', function() return vim.fn['codeium#CycleCompletions'](1) end,
{ expr = true, silent = true })
vim.keymap.set('i', '<C-q>', function() return vim.fn['codeium#CycleCompletions'](-1) end,
{ expr = true, silent = true })
vim.keymap.set('i', '<C-d>', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true })
end
}
}