threads / patch / 17230

patchmergetool: put the cursor on the editable file for Vim

Subject: [PATCH] mergetool: put the cursor on the editable file for Vim

## tl;dr

4 messages between Jan 17, 2009 and Jan 18, 2009. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Markus Heidelberg· Jan 17, 2009, 21:28 UTC · lore

When resolving conflicts, you only need to edit the $MERGED file. Put the cursor automatically into its window for vimdiff and gvimdiff to avoid doing <C-w>l every time.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 git-mergetool.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
Show changes to git-mergetool.sh +7 −2
diff --git a/git-mergetool.sh b/git-mergetool.sh
index b2d5375..00e1337 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -200,14 +200,19 @@ merge_file () {
 	    fi
 	    status=$?
 	    ;;
-	meld|vimdiff)
+	meld)
 	    touch "$BACKUP"
 	    "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE"
 	    check_unchanged
 	    ;;
+	vimdiff)
+	    touch "$BACKUP"
+	    "$merge_tool_path" -c "wincmd l" "$LOCAL" "$MERGED" "$REMOTE"
+	    check_unchanged
+	    ;;
 	gvimdiff)
 	    touch "$BACKUP"
-	    "$merge_tool_path" -f "$LOCAL" "$MERGED" "$REMOTE"
+	    "$merge_tool_path" -c "wincmd l" -f "$LOCAL" "$MERGED" "$REMOTE"
 	    check_unchanged
 	    ;;
 	xxdiff)
-- 
1.6.1.154.g97e2f
Junio C Hamano· Jan 18, 2009, 01:35 UTC · re: Markus Heidelberg · lore

Re: [PATCH] mergetool: put the cursor on the editable file for Vim

Markus Heidelberg <markus.heidelberg@web.de> writes:
> When resolving conflicts, you only need to edit the $MERGED file. Put
> the cursor automatically into its window for vimdiff and gvimdiff to
> avoid doing <C-w>l every time.
I think this is sensible.

I do not use vim, and I do not know if the patch does what it claims to do, though.

SZEDER Gábor· Jan 18, 2009, 14:18 UTC · re: Junio C Hamano · lore

Re: [PATCH] mergetool: put the cursor on the editable file for Vim

On Sat, Jan 17, 2009 at 05:35:22PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Markus Heidelberg <markus.heidelberg@web.de> writes:
> 
> > When resolving conflicts, you only need to edit the $MERGED file. Put
> > the cursor automatically into its window for vimdiff and gvimdiff to
> > avoid doing <C-w>l every time.
> 
> I think this is sensible.
> 
> I do not use vim, and I do not know if the patch does what it claims to
> do, though.
It does.
Tested-by: SZEDER Gábor <szeder@ira.uka.de>
Junio C Hamano· Jan 18, 2009, 20:29 UTC · re: SZEDER Gábor · lore

Re: [PATCH] mergetool: put the cursor on the editable file for Vim

SZEDER Gábor <szeder@ira.uka.de> writes:
Show 15 quoted lines
> On Sat, Jan 17, 2009 at 05:35:22PM -0800, Junio C Hamano wrote:
>> Markus Heidelberg <markus.heidelberg@web.de> writes:
>> 
>> > When resolving conflicts, you only need to edit the $MERGED file. Put
>> > the cursor automatically into its window for vimdiff and gvimdiff to
>> > avoid doing <C-w>l every time.
>> 
>> I think this is sensible.
>> 
>> I do not use vim, and I do not know if the patch does what it claims to
>> do, though.
>
> It does.
>
> Tested-by: SZEDER Gábor <szeder@ira.uka.de>
Thanks, both.

← back to recent threads