From 99d59a46705ce1f9284a32130a1fe267abbe31e7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 9 Sep 2013 01:09:06 +1200 Subject: Improve ed(1) abstraction --- bash/bashrc.d/ed.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bash/bashrc.d/ed.bash (limited to 'bash/bashrc.d/ed.bash') diff --git a/bash/bashrc.d/ed.bash b/bash/bashrc.d/ed.bash new file mode 100644 index 00000000..d4d92158 --- /dev/null +++ b/bash/bashrc.d/ed.bash @@ -0,0 +1,11 @@ +# 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 +} + -- cgit v1.2.3