aboutsummaryrefslogblamecommitdiff
path: root/bash/bashrc.d/ed.bash
blob: 9f5fb5f295c077182232f33a398e6d9f1270bf76 (plain) (tree)
1
2
3
4
5




                              










                                                                             
# 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
}