From 69c8790f6e60f3743f92ebd7801b3852bba1c4f0 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Thu, 1 Aug 2024 11:08:00 +0200 Subject: [PATCH] configure keymaps during plugin config --- lua/custom/plugins/codeium.lua | 7 ++++--- lua/custom/plugins/fugitive.lua | 23 ++++++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lua/custom/plugins/codeium.lua b/lua/custom/plugins/codeium.lua index 2ffc237..e8d1d58 100644 --- a/lua/custom/plugins/codeium.lua +++ b/lua/custom/plugins/codeium.lua @@ -1,8 +1,9 @@ --- Set keymap to open chat in browser -vim.keymap.set('n', 'cc', ':execute codeium#Chat()', { 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', 'cc', ':execute codeium#Chat()', { desc = '[C]odeium [C]hat' }) + end, } diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua index 665d462..c6f71a0 100644 --- a/lua/custom/plugins/fugitive.lua +++ b/lua/custom/plugins/fugitive.lua @@ -1,14 +1,3 @@ --- Switch in fugitive.vim status window with the current one -vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) --- Fetch all changes -vim.keymap.set('n', 'gF', 'Git fetch', { desc = '[G]it [F]etch' }) --- Push changes -vim.keymap.set('n', 'gP', 'Git push', { desc = '[G]it [P]ush' }) --- Pull changes -vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) --- Open history graph -vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { 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', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) + -- Fetch all changes + vim.keymap.set('n', 'gF', 'Git fetch', { desc = '[G]it [F]etch' }) + -- Push changes + vim.keymap.set('n', 'gP', 'Git push', { desc = '[G]it [P]ush' }) + -- Pull changes + vim.keymap.set('n', 'gp', 'Git pull', { desc = '[G]it [P]ull' }) + -- Open history graph + vim.keymap.set('n', 'gl', 'Flogsplitwincmd kq', { desc = '[G]it [L]og' }) + end, }