From 21f2ee7d8a6204f550bf0739107cbead6156afdf Mon Sep 17 00:00:00 2001 From: Juan Miguel Rua Date: Mon, 15 Jul 2024 10:05:46 +0200 Subject: [PATCH] adding more git configs --- lua/custom/plugins/git.lua | 36 ++++++++++++++++++++++++++++++++ lua/custom/plugins/lazygit.lua | 21 ------------------- lua/custom/plugins/which-key.lua | 17 ++++++++------- 3 files changed, 45 insertions(+), 29 deletions(-) create mode 100644 lua/custom/plugins/git.lua delete mode 100644 lua/custom/plugins/lazygit.lua diff --git a/lua/custom/plugins/git.lua b/lua/custom/plugins/git.lua new file mode 100644 index 00000000..b647f545 --- /dev/null +++ b/lua/custom/plugins/git.lua @@ -0,0 +1,36 @@ +return { + { -- LazyGit + 'kdheepak/lazygit.nvim', + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { 'lg', 'LazyGit', desc = 'LazyGit' }, + }, + }, + { + 'akinsho/git-conflict.nvim', + version = '*', + config = true, + opts = { + default_mappings = false, -- disable buffer local mapping created by this plugin + default_commands = true, -- disable commands created by this plugin + disable_diagnostics = false, -- This will disable the diagnostics in a buffer whilst it is conflicted + list_opener = 'copen', -- command or function to open the conflicts list + highlights = { -- They must have background color, otherwise the default color will be used + incoming = 'DiffAdd', + current = 'DiffText', + }, + }, + }, +} diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua deleted file mode 100644 index 17e5ae5d..00000000 --- a/lua/custom/plugins/lazygit.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - { - 'kdheepak/lazygit.nvim', - cmd = { - 'LazyGit', - 'LazyGitConfig', - 'LazyGitCurrentFile', - 'LazyGitFilter', - 'LazyGitFilterCurrentFile', - }, - -- optional for floating window border decoration - dependencies = { - 'nvim-lua/plenary.nvim', - }, - -- setting the keybinding for LazyGit with 'keys' is recommended in - -- order to load the plugin when the command is run for the first time - keys = { - { 'lg', 'LazyGit', desc = 'LazyGit' }, - }, - }, -} diff --git a/lua/custom/plugins/which-key.lua b/lua/custom/plugins/which-key.lua index b046f29f..1ac2064e 100644 --- a/lua/custom/plugins/which-key.lua +++ b/lua/custom/plugins/which-key.lua @@ -22,17 +22,18 @@ return { -- Document existing key chains require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, + { '', group = 'Git [H]unk' }, + { '', group = '[W]orkspace' }, + { '', group = '[S]earch' }, + { '', group = '[C]ode' }, + { '', group = '[R]ename' }, + { '', group = '[T]oggle' }, + { '', group = '[D]ocument' }, + { '', desc = '', hidden = true, mode = { 'n', 'n', 'n', 'n', 'n', 'n', 'n' } }, } -- visual mode require('which-key').register({ - ['h'] = { 'Git [H]unk' }, + { '', desc = 'h', mode = 'v' }, }, { mode = 'v' }) end, },