git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: vimdiff mergetool diff mode detection in vimrc broken by commit 0041797449

From
Fernando Ramos <greenfoo@u92.eu>
Date
Jul 12, 2022, 05:56 UTC
Message-ID
<Ys0NBXe76q6Ls6OI@zacax395.localdomain>
In-Reply-To
<CAAVLcG42wom6Rf=6YZoc+iUnXDxshBfGOjqQPryGkzXxRxb-hA@mail.gmail.com>
> I check &diff in my vimrc to set various settings specifically when doing a
> diff/merge.
Hi Andrew, could using an auto command on the "DiffUpdated" event work for you?
Example: add this to .vimrc:
    au DiffUpdated * if &diff | colorscheme darkblue | endif

This function will be executed every time "diff mode" is updated in any way and seems to work both when running vimdiff directly and when entering diff mode interactively (as it is the case now when running "git mergetool").

It has the added benefit that you can also use this same "trick" to toggle the settings off when *exiting* diff mode:

    au DiffUpdated * if !&diff | colorscheme desert | endif
Let me know if this is enough for your use case.
Thanks!
Previous: Andrew Oates
Message 2 of 2 in “vimdiff mergetool diff mode detection in vimrc broken by commit 0041797449”
  1. Andrew OatesJul 12, 2022
  2. Fernando RamosJul 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.