From a42c3175c2961a139dcbefc4a2b1d19e346ff10c Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Thu, 6 Jun 2024 01:21:05 +0200 Subject: [PATCH] Add fugitive, remove git bindings from telescope, add git bindings for git signs (line blame and line preview) --- home/.config/nvim/lua/plugs/fugitive.lua | 18 +++++++++++++ home/.config/nvim/lua/plugs/telescope.lua | 33 ----------------------- 2 files changed, 18 insertions(+), 33 deletions(-) create mode 100644 home/.config/nvim/lua/plugs/fugitive.lua diff --git a/home/.config/nvim/lua/plugs/fugitive.lua b/home/.config/nvim/lua/plugs/fugitive.lua new file mode 100644 index 0000000..4544efc --- /dev/null +++ b/home/.config/nvim/lua/plugs/fugitive.lua @@ -0,0 +1,18 @@ +return { + "tpope/vim-fugitive", + config = function() + require("utils").add_keymaps({ + n = { + ["gp"] = { + cmd = ":Gitsigns preview_hunk_inline", + }, + ["gt"] = { + cmd = ":Gitsigns toggle_current_line_blame", + }, + ["gb"] = { + cmd = ":Git blame", + } + } + }) + end +} diff --git a/home/.config/nvim/lua/plugs/telescope.lua b/home/.config/nvim/lua/plugs/telescope.lua index 54c28c8..2baa38d 100644 --- a/home/.config/nvim/lua/plugs/telescope.lua +++ b/home/.config/nvim/lua/plugs/telescope.lua @@ -107,39 +107,6 @@ return { builtin.live_grep(dropdown_theme) end, }, - -- Git - ["gl"] = { - cmd = function() - dropdown_theme.prompt_prefix = "Log>" - dropdown_theme.previewer = true - dropdown_theme.find_command = nil - builtin.git_commits(dropdown_theme) - end, - }, - ["gs"] = { - cmd = function() - dropdown_theme.prompt_prefix = "Status>" - dropdown_theme.previewer = true - dropdown_theme.find_command = nil - builtin.git_status(dropdown_theme) - end, - }, - ["gh"] = { - cmd = function() - dropdown_theme.prompt_prefix = "History>" - dropdown_theme.previewer = true - dropdown_theme.find_command = nil - builtin.git_bcommits(dropdown_theme) - end, - }, - ["gb"] = { - cmd = function() - dropdown_theme.prompt_prefix = "Branches>" - dropdown_theme.previewer = true - dropdown_theme.find_command = nil - builtin.git_branches(dropdown_theme) - end, - }, -- Misc ["tb"] = { cmd = function()