configure keymaps during plugin config

This commit is contained in:
Baipyrus 2024-08-01 11:08:00 +02:00
parent 15d4cfcdf7
commit 69c8790f6e
2 changed files with 16 additions and 14 deletions

View File

@ -1,8 +1,9 @@
-- Set keymap to open chat in browser
vim.keymap.set('n', '<leader>cc', ':execute codeium#Chat()<Enter>', { desc = '[C]odeium [C]hat' })
return {
-- Free Github Copilot alternative
'Exafunction/codeium.vim',
event = 'BufEnter',
config = function()
-- Set keymap to open chat in browser
vim.keymap.set('n', '<leader>cc', ':execute codeium#Chat()<Enter>', { desc = '[C]odeium [C]hat' })
end,
}

View File

@ -1,14 +1,3 @@
-- Switch in fugitive.vim status window with the current one
vim.keymap.set('n', '<leader>gs', '<cmd>Gedit :<cr>', { desc = '[G]it [S]tatus' })
-- Fetch all changes
vim.keymap.set('n', '<leader>gF', '<cmd>Git fetch<cr>', { desc = '[G]it [F]etch' })
-- Push changes
vim.keymap.set('n', '<leader>gP', '<cmd>Git push<cr>', { desc = '[G]it [P]ush' })
-- Pull changes
vim.keymap.set('n', '<leader>gp', '<cmd>Git pull<cr>', { desc = '[G]it [P]ull' })
-- Open history graph
vim.keymap.set('n', '<leader>gl', '<cmd>Flogsplit<cr><cmd>wincmd k<cr><cmd>q<cr>', { desc = '[G]it [L]og' })
return {
-- Git related plugins
'tpope/vim-fugitive',
@ -20,4 +9,16 @@ return {
},
'idanarye/vim-merginal',
},
config = function()
-- Switch in fugitive.vim status window with the current one
vim.keymap.set('n', '<leader>gs', '<cmd>Gedit :<cr>', { desc = '[G]it [S]tatus' })
-- Fetch all changes
vim.keymap.set('n', '<leader>gF', '<cmd>Git fetch<cr>', { desc = '[G]it [F]etch' })
-- Push changes
vim.keymap.set('n', '<leader>gP', '<cmd>Git push<cr>', { desc = '[G]it [P]ush' })
-- Pull changes
vim.keymap.set('n', '<leader>gp', '<cmd>Git pull<cr>', { desc = '[G]it [P]ull' })
-- Open history graph
vim.keymap.set('n', '<leader>gl', '<cmd>Flogsplit<cr><cmd>wincmd k<cr><cmd>q<cr>', { desc = '[G]it [L]og' })
end,
}