tip: quickly visit all conflicts in vim
John Arbash Meinel
john at arbash-meinel.com
Sun Apr 1 15:06:16 BST 2007
Martin Pool wrote:
> Maybe this is obvious but I don't mind saying I hadn't thought of it
> before:
>
> :grep '^>>>>>>>' **/*
>
> then :cnext to go through all the conflicts. I have f12 set to do that:
>
> nmap <F12> :cnext
> ^Mzz
> nmap <S-F12> :cprev
> ^Mzz
>
> It might be nice if bzr conflicts (optionally) reported in a style
> more similar to compiler or grep output...
>
Interesting. I actually usually use:
/<<<<\|====\|>>>>
Since that lets me jump to the 3 portions of a conflict marker. (I use 4
because we use 7 conflict markers, and 4 makes us only match 1 time per
conflict but is easier to type.)
I frequently use this to start a range, and then use "nVndndd" (next,
Visual Select Line, next, delete, next, delete line)
It always looks a little bit funny to show vim commands, but it is quite
useful and quick to resolve one conflict region in favor of the other
(possibly after you have merged in the appropriate changes).
John
=:->
More information about the bazaar
mailing list