aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ed.bash
blob: 7cef29e608911d2a8f1332f4eb0b295298dc9234 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Bail if no ed(1)
if ! hash ed 2>/dev/null ; then
    return
fi

# Add a colon prompt to ed when a command is expected rather than text; makes
# it feel a lot more like using ex. Only do this when stdin is a terminal,
# however.
ed() {
    if [[ -t 0 ]] ; then
        command ed -p: "$@"
    else
        command ed "$@"
    fi
}