aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/ed.bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash/bashrc.d/ed.bash')
-rw-r--r--bash/bashrc.d/ed.bash11
1 files changed, 11 insertions, 0 deletions
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
+}
+