diff --git a/gitcommands.go b/gitcommands.go index d28263a60..6dbc41c28 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -271,6 +271,11 @@ func editFile(g *gocui.Gui, filename string) (string, error) { if editor == "" { editor = os.Getenv("EDITOR") } + if editor == "" { + if _, err := runCommand("which vi"); err == nil { + editor = "vi" + } + } if editor == "" { return "", createErrorPanel(g, "No editor defined in $VISUAL, $EDITOR, or git config.") }