From 7318cef45a63c0ef2aec0165d63bc5761a935ef9 Mon Sep 17 00:00:00 2001 From: Stefan Liebl Date: Mon, 14 Mar 2022 14:15:36 +0100 Subject: [PATCH] improve flog cp mappings --- vimfiles.stefan/after/ftplugin/floggraph.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vimfiles.stefan/after/ftplugin/floggraph.vim b/vimfiles.stefan/after/ftplugin/floggraph.vim index c5cab40..f65a4e0 100644 --- a/vimfiles.stefan/after/ftplugin/floggraph.vim +++ b/vimfiles.stefan/after/ftplugin/floggraph.vim @@ -1,7 +1,13 @@ " settings for flog -nmap rb :call flog#run_command('Git reset %h', 1, 1) -nmap rbh :call flog#run_command('Git reset --hard %h', 1, 1) +" Only for testing +function Flog_echo_command(command, ...) + echom flog#format_command(a:command) +endfunction -nmap cp :call flog#run_command('Git cherry-pick %h', 1, 1) -"nmap d :call flog#run_command('Git cherry-pick %h', 1, 1) +nnoremap rb :call flog#run_command('Git reset %h', 1, 1) +nnoremap rbh :call flog#run_command('Git reset --hard %h', 1, 1) + +nnoremap cp :call flog#run_command('Git cherry-pick %h', 1, 1) +vnoremap cp :call flog#run_command("Git cherry-pick %(h'>)^..%(h'<)", 1, 1) +"vnoremap cp :call Flog_echo_command("Git cherry-pick %(h'>)^..%(h'<)", 1, 1)