]> git.sur5r.net Git - i3/i3/blob - i3-sensible-editor
4e7456b705129a9ea022d073efe51b6e21946abb
[i3/i3] / i3-sensible-editor
1 #!/bin/sh
2 #
3 # This code is released in public domain by Han Boetes <han@mijncomputer.nl>
4 #
5 # This script tries to exec an editor by trying some known editors if $EDITOR is
6 # not set.
7 #
8 # Distributions/packagers can enhance this script with a distribution-specific
9 # mechanism to find the preferred editor
10
11 # Hopefully one of these is installed (no flamewars about preference please!):
12 for editor in $VISUAL $EDITOR nano vim vi emacs pico qe mg jed gedit mc-edit; do
13     if command -v $editor > /dev/null 2>&1; then
14         exec $editor "$@"
15     fi
16 done