I know that you can define the preferred editor by setting the
EDITOR environment variable.
My question is if there is a similar solution for setting the preferred merge or diff tool.
As far as I know, there isn't any universal way; it depends on which version control system you are using, e.g.: