I need something like abbrev, just without any extra spaces, including spaces which trigger the replacement. I experimented with keyboard shortcuts, like this:
;;(general-auto-unbind-keys)
(global-set-key (kbd "H H") "---~")
(global-set-key (kbd "H H J") "~---")
(global-set-key (kbd "J J") "~---~")
It replaces every H, whereas I need double H (HH, uppercase only) as a trigger. I tried different shortcut descriptions; unfortunately, this is my best result. Ideally, I want also a timeout (if the second H is lagging, business as usual), and the replacement to be enabled for *.tex files only. Is there a way?
Actually I use Doom Emacs with evil mode.
UPD:
This one is unusable in a different way:
(map!
"H H" "---~"
"H J" "~---"
"J J" "~---~"
)
It firmly locks down and waits for the second key, which isn't what I need.
As a matter of fact, this is the vim script code I'm struggling to recreate:
inoremap HH ---~
inoremap HJ ~---
inoremap JJ ~---~
H
a prefix key?map!
did and you didn't want that, so no loss!