[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" }, "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" }, "bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "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" }, "dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" },
"flutter-tools.nvim": { "branch": "main", "commit": "990a1349c29f7d474a0cd51355aba773ccc9deea" }, "flutter-tools.nvim": { "branch": "main", "commit": "990a1349c29f7d474a0cd51355aba773ccc9deea" },
"gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" }, "gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" },

View file

@ -1,5 +1,5 @@
vim.api.nvim_set_keymap("n", "<leader>;", "<cmd>bprev<cr>", { desc="prev buffer", noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<leader>;", "<cmd>bprev<cr>", { desc = "prev buffer", noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>'", "<cmd>bnext<cr>", { desc="next buffer", noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "<leader>'", "<cmd>bnext<cr>", { desc = "next buffer", noremap = true, silent = true })
vim.api.nvim_set_keymap("x", "<C-p>", '"_dP', { noremap = true, silent = true }) vim.api.nvim_set_keymap("x", "<C-p>", '"_dP', { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>/", "gcc", { noremap = false, silent = true }) vim.api.nvim_set_keymap("n", "<leader>/", "gcc", { noremap = false, silent = true })
vim.api.nvim_set_keymap( vim.api.nvim_set_keymap(
@ -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" }) vim.keymap.set("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
-- lazy -- 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 -- new file
vim.keymap.set("n", "<leader>n", "<cmd>enew<cr>", { desc = "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 -- lsp
vim.keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition" }) 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>vsplit | lua vim.lsp.buf.definition()<cr>",
vim.keymap.set("n", "gS", "<cmd>belowright | lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition in horizontal split" }) { 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", "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", "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" }) 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 -- trouble
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>", { desc = "Trouble toggle" }) 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>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>",
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>", { desc = "Trouble document diagnostics" }) { 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>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>xl", "<cmd>TroubleToggle loclist<cr>", { desc = "Trouble loclist" })
vim.keymap.set("n", "<leader>gR", "<cmd>TroubleToggle lsp_references<cr>", { desc = "Trouble lsp references" }) 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 -- harpoon
vim.keymap.set("n", "<leader>hh", "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", { desc = "Harpoon Menu" }) 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>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>k", "<cmd>lua require('harpoon.ui').nav_next()<cr>",
vim.keymap.set("n", "<leader>j", "<cmd>lua require('harpoon.ui').nav_prev()<cr>", { desc = "Navigate to previous harpoon file" }) { 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 -- ditto
vim.keymap.set("n", "<leader>dd", "<cmd>ToggleDitto<cr>", { desc = "Ditto toggle" }) vim.keymap.set("n", "<leader>dd", "<cmd>ToggleDitto<cr>", { desc = "Ditto toggle" })

View file

@ -1,52 +1,15 @@
return { return {
{ {
"zbirenbaum/copilot.lua", 'Exafunction/codeium.vim',
cmd = "Copilot", event = 'BufEnter',
event = "InsertEnter", config = function()
config = function() -- Change '<C-g>' here to any keycode you like.
require("copilot").setup({ vim.keymap.set('i', '<C-a>', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true })
panel = { vim.keymap.set('i', '<C-e>', function() return vim.fn['codeium#CycleCompletions'](1) end,
enabled = true, { expr = true, silent = true })
auto_refresh = false, vim.keymap.set('i', '<C-q>', function() return vim.fn['codeium#CycleCompletions'](-1) end,
keymap = { { expr = true, silent = true })
jump_prev = "[[", vim.keymap.set('i', '<C-d>', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true })
jump_next = "]]", end
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,
},
} }

View file

@ -53,9 +53,9 @@ return {
lualine_x = { lualine_x = {
{ {
function() return "" .. require("dap").status() end, function() return "" .. require("dap").status() end,
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end, cond = function() return package.loaded["dap"] and require("dap").status() ~= "" end,
}, },
{ require("lazy.status").updates, cond = require("lazy.status").has_updates}, { require("lazy.status").updates, cond = require("lazy.status").has_updates },
{ {
"diff", "diff",
symbols = { symbols = {
@ -66,7 +66,7 @@ return {
}, },
}, },
lualine_y = { lualine_y = {
{ "progress", separator = " ", padding = { left = 1, right = 0 } }, { "progress", separator = " ", padding = { left = 1, right = 0 } },
{ "location", padding = { left = 0, right = 1 } }, { "location", padding = { left = 0, right = 1 } },
}, },
lualine_z = { lualine_z = {
@ -81,7 +81,7 @@ return {
}, },
{ {
"lukas-reineke/indent-blankline.nvim", "lukas-reineke/indent-blankline.nvim",
lazy=false, lazy = false,
}, },
{ {
"echasnovski/mini.indentscope", "echasnovski/mini.indentscope",
@ -116,7 +116,7 @@ return {
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
event = "VeryLazy", event = "VeryLazy",
keys = { keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" }, { "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" }, { "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
}, },
opts = { opts = {
@ -129,7 +129,7 @@ return {
always_show_bufferline = false, always_show_bufferline = false,
diagnostics_indicator = function(_, _, diag) diagnostics_indicator = function(_, _, diag)
local ret = (diag.error and "" .. diag.error or "") local ret = (diag.error and "" .. diag.error or "")
.. (diag.warning and "" .. diag.warning or "") .. (diag.warning and "" .. diag.warning or "")
return vim.trim(ret) return vim.trim(ret)
end, end,
offsets = { offsets = {
@ -188,7 +188,7 @@ return {
dependencies = { dependencies = {
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
"rcarriga/nvim-notify", "rcarriga/nvim-notify",
} }
}, },
-- icons -- icons
{ "nvim-tree/nvim-web-devicons", lazy = true }, { "nvim-tree/nvim-web-devicons", lazy = true },