- Shell 60.8%
- Makefile 39.2%
aed(1) is a more interactive ed(1)
Of course, it stands for "aartaka’s ed." (Or is it just me liking æspa? Should it be æd then? Sounds cool, actually.)
The features are:
- Colorful contextual prompt
- Syntax highlighting
- Readline
- Custom commands/macros
- Slashes as word separators
- History of commands
Here’s how aed’s syntax highlighting looks:
Example of C code Example of Lisp code Example of Lamber code
Overall, aed is a comfier version of ed. Yet, aed is not trying to rewrite or re-implement any part of ed. All the changes are non-invasive, focusing on e.g. Readline wrapping. In most regards, aed behaves exactly like ed.
Getting Started
Clone the repo
git clone https://codeberg.org/aartaka/aed
cd aed
Then you can install aed (and xed, see below)
make install
Bear in mind these side-effects:
- It creates ~/.local/bin/ and aed + aed*coloring scripts in it
- So that you can prepend ~/.local/bin to your PATH in e.g. .bashrc:
export PATH="${HOME}/.local/bin:${PATH}"
- It also puts xed (see below) into ~/.local/bin/
- It puts some auxiliary files into .local/share/aed/:
-
*_coloring.ed that’s used for syntax highlighting
-
inputrc that you can include into your actual .inputrc
$include ~/.local/share/aed/inputrc
-
What’s xed
xed (for "executing ed") comes bundled with aed. It’s a wrapper for ed that’s much easier to invoke in scripts. Say, instead of grep or sed:
$ xed "g|aed|p" aed
mkdir -p /tmp/aed/
cp 1ドル /tmp/aed/$filename-completions
touch /tmp/aed/$filename-completions
echo "This is aartaka's aed, enjoy!"
-C aed \
-z "outfilter aed_code_coloring" \
-f /tmp/aed/$filename-completions \
-C aed \
-z "outfilter aed_markup_coloring" \
-f /tmp/aed/$filename-completions \
-C aed \
-f /tmp/aed/$filename-completions \
The first arg is either
- A printf-ready format string (meaning you can do escape sequences like \n and inject vars)
- Or a name of the .ed file to execute
The (optional) second, third, fourth etc. arguments are files to act on. If they are not provided, xed acts on standard input, much like sed.
aed’s prompt might be implemented with xed too. Instead of
dirname=$(printf "a
1ドル.
g|/|s|.*/||
p
Q\n" | ed -s)
one might use
# echo here is a gag for xed to not wait for stdin
dirname=$(echo "" | xed "a\n1ドル\n.\ng|/|s|.*/||\np")