summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/git.lua
diff options
context:
space:
mode:
authorJoel Palmer <joelpalmer@users.noreply.github.com>2021-07-29 16:16:45 -0500
committerGitHub <noreply@github.com>2021-07-30 00:16:45 +0300
commitb742c50bf119d7c442a553cc52e8afde0086ae02 (patch)
tree5d3fa49aa54a157394d2328b3ce8d48754cedb6a /lua/telescope/builtin/git.lua
parent82f4d3028b64ad930123a5c713c538c872185a80 (diff)
feat: add git reset action for git commits picker (#999)
Diffstat (limited to 'lua/telescope/builtin/git.lua')
-rw-r--r--lua/telescope/builtin/git.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/telescope/builtin/git.lua b/lua/telescope/builtin/git.lua
index 4bf0283..513dbed 100644
--- a/lua/telescope/builtin/git.lua
+++ b/lua/telescope/builtin/git.lua
@@ -65,8 +65,14 @@ git.commits = function(opts)
previewers.git_commit_message.new(opts),
},
sorter = conf.file_sorter(opts),
- attach_mappings = function()
+ attach_mappings = function(_, map)
actions.select_default:replace(actions.git_checkout)
+ map("i", "<c-r>m", actions.git_reset_mixed)
+ map("n", "<c-r>m", actions.git_reset_mixed)
+ map("i", "<c-r>s", actions.git_reset_soft)
+ map("n", "<c-r>s", actions.git_reset_soft)
+ map("i", "<c-r>h", actions.git_reset_hard)
+ map("n", "<c-r>h", actions.git_reset_hard)
return true
end,
}):find()