I am using Bash in Linux, inside Termius on a smartphone.
I would like to make reaching for particular symbols as fast as possible, by customizing bash to interpret certain character sequences as those symbols.
On a smartphone, maximum speed is using your thumbs on the primary (alphabet) keyboard and not requiring 1-2 additional keypresses to toggle the keyboard to display available symbols.
It appears that aliases are like macros in that they get substituted before any commands and run (except inside strings), so this works:
$ alias zz=#
$ zz a comment
but not this:
$ echo A hash: zz
A hash: zz
$
I could in addition do:
zz=#
echo $zz
But it requires 2 additional key presses to add in that dollar sign.
I may be able to install custom smartphone keyboards, but I want to focus on a more generalizable solution where I can customize Bash.
Is there any feature where Bash will immediately substitute a sequence of characters in the input line?
Before you’ve even hit enter, if you type “ii”, you actually see # in the command line:
user types one i
$ i
user types second i
$ #
Bash immediately substituted the code.
Is this possible? If not, what’s a good workaround?