No, Git config does not support checks or conditional statements. But your underlying shell probably does, so you can use something like:
[core]
editor = "if [[ $IS_REMOTE -eq 1 ]]; then ED='vim'; else ED='subl -n -w'; fi; $ED"
If you need to do something more complicated than that, you could just throw the shell code into a script, of course, like
[core]
editor = "my_edi_script.sh"
with my_edit_script.sh
containing something like:
#!/bin/bash
if [[ $IS_REMOTE -eq 1 ]]; then
ED="vim"
else
ED="subl -n -w"
fi
$ED some argument or other
Edit: The my_edit_script.sh
would have to be in the $PATH, of course :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…