aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d/visual.sh
blob: eb3c1143e10d364af940aceb72524410ee9b778b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# For a visual editor, use Vim explicitly if we've got it, but otherwise any vi
# implementation will be fine
if command -v vim >/dev/null 2>&1 ; then
    VISUAL='vim'
else
    VISUAL='vi'
fi
export VISUAL

# If systemctl is installed, use $VISUAL as its editor, not $EDITOR
if command -v systemctl >/dev/null 2>&1 ; then
    SYSTEMD_EDITOR=$VISUAL
    export SYSTEMD_EDITOR
fi