From 82c98b224a967beac5bb990675c7f64815cfe4e4 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 26 Mar 2024 08:35:21 +0100 Subject: [PATCH 1/2] move git-related plugins to custom/fugitive --- lua/custom/plugins/fugitive.lua | 10 ++++++++++ lua/keymaps.lua | 3 --- lua/lazy-plugins.lua | 4 ---- 3 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 lua/custom/plugins/fugitive.lua diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua new file mode 100644 index 0000000..6d12068 --- /dev/null +++ b/lua/custom/plugins/fugitive.lua @@ -0,0 +1,10 @@ +-- Switch in fugitive.vim status window with the current one +vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) + +return { + -- Git related plugins + 'tpope/vim-fugitive', + dependencies = { + 'tpope/vim-rhubarb', + }, +} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 7886a02..7f27ff2 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -40,9 +40,6 @@ vim.keymap.set('v', 'pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' }) -- Populate CMD to prepare for change directory vim.keymap.set('n', 'cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' }) --- Switch in fugitive.vim status window with the current one -vim.keymap.set('n', 'gs', 'Gedit :', { desc = '[G]it [S]tatus' }) - -- Delete current buffer without closing window vim.keymap.set('n', 'bd', 'bpspbnbd', { desc = '[B]uffer [D]elete' }) -- Switch to between buffers diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index bf6ba7f..d4849b0 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -19,10 +19,6 @@ require('lazy').setup({ -- Practice games 'ThePrimeagen/vim-be-good', - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', - -- Processing-Java 'sophacles/vim-processing', From 6e22ad5fc5faff65a593b269f976e0b31272acaa Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Tue, 26 Mar 2024 08:36:01 +0100 Subject: [PATCH 2/2] additional git keymaps --- lua/custom/plugins/fugitive.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua index 6d12068..5562ab2 100644 --- a/lua/custom/plugins/fugitive.lua +++ b/lua/custom/plugins/fugitive.lua @@ -1,5 +1,11 @@ -- 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' }) return { -- Git related plugins