From 54f630b84baa781dc5a4f149dd8e3ea36a7ee9dd Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sun, 1 Jan 2023 14:16:00 -0500 Subject: [PATCH] bin/e: Add rlwrap config for ed(1) new year, new ed --- .ed_inputrc | 5 +++++ Makefile | 2 +- bin/e | 11 +++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .ed_inputrc diff --git a/.ed_inputrc b/.ed_inputrc new file mode 100644 index 0000000..5f1126d --- /dev/null +++ b/.ed_inputrc @@ -0,0 +1,5 @@ +# inputrc -- readline config for rlwrap(1) for ed(1) usage +$include ~/.inputrc + +Control-n: menu-complete +TAB: self-insert diff --git a/Makefile b/Makefile index 3f37364..b01ea9b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Makefile -- to compile and install dotfiles ALL = .cwmrc .exrc .gitconfig .mbsyncrc .shrc .tmux.conf .xsession \ - .mailcap .muttrc .config/nvim .mblaze .csirc + .mailcap .muttrc .config/nvim .mblaze .csirc .ed_inputrc .inputrc # CURDIR is gmake, .CURDIR is bmake. One will exist! DOTS = $(CURDIR)$(.CURDIR) diff --git a/bin/e b/bin/e index 07325fd..7299ca7 100755 --- a/bin/e +++ b/bin/e @@ -1,6 +1,9 @@ #!/bin/sh -# NOTE: disabling rlwrap for now due to TAB being captured :( -# exec rlwrap ed -p'> ' "$@" - -exec ed -p'> ' "$@" +if command -v rlwrap >/dev/null; then + exec env INPUTRC=$HOME/.ed_inputrc rlwrap \ + --no-warnings \ + --complete-filenames ed -p'> ' "$@" +else + exec ed -p'> ' "$@" +fi -- libgit2 1.1.1