On Mon, Aug 8, 2022 at 7:46 PM Felipe Contreras <felipe.contreras@xxxxxxxxx> wrote: > > Apparently some people want the diff mode to show differences only on > the visible windows, so turn this on only when the tab has more than one > window. > @@ -323,8 +323,20 @@ gen_cmd () { > IFS=+ > for tab in $LAYOUT > do > - test -n "$CMD" && CMD="$CMD | tabnew | silent execute 'bufdo diffthis'" > - CMD=$(gen_cmd_aux "$tab" "$CMD") > + if echo "$tab" | grep ",\|/" >/dev/null > + then > + test -n "$CMD" && CMD="$CMD | tabnew" > + CMD=$(gen_cmd_aux "$tab" "$CMD") > + CMD="$CMD | execute 'windo diffthis'" > + else > + if test -z "$CMD" > + then > + CMD="silent execute 'bufdo diffthis'" > + else > + CMD="$CMD | tabnew | silent execute 'bufdo diffthis'" > + fi > + CMD=$(gen_cmd_aux "$tab" "$CMD") > + fi > done > IFS=$oldIFS > Notice that after reorganizing the tab handling my layout becomes really simple: set hidden diffopt-=hiddenoff | silent execute 'bufdo diffthis' | 4b And your layout becomes: set hidden diffopt-=hiddenoff | echo | leftabove vertical split | 2b | wincmd l | 1b | execute 'windo diffthis' | tabnew | leftabove vertical split | 2b | wincmd l | 3b | execute 'windo diffthis' So this "works" too, right? Cheers. -- Felipe Contreras