3
votes
Emacs/readline-like keys on text fields
This should be simple fairly simple to explain:
Even though the Vim front is well covered by things like Vimium
, Vimium+
and qutebrowser
(and it would probably be too much trouble to create a Vim mode for Tildes' text fields - especially when wasavi exists), Emacs-like keys might be a great addition for some people. Tildes seem to have a high number of Emacs
and command-line
users right now. I frequently find myself hitting keys such as:
C-p
previous-lineC-n
next-lineC-m
for returnC-a
to move cursor to the start of the lineC-e
to move cursor to the start of end lineM-d
to kill wordC-k
kill lineC-u
kill backwards lineC-b
to backward charC-f
to forward charC-b
to backward charM-f
to forward wordM-b
to backward wordC-w
delete-backward-word- not a default Emacs keybinding but it's on readline and I think it makes sense
And so on.
There are, of course, alternatives such as Emacs Anywhere and Atomic Chrome, but they require an Emacs daemon to be running and are not a good alternative for quick edits since which switching to another editor is not practical.
So here's my suggestion!
I don't think Tildes should change or add keybindings for editing text. It would be better to implement this at the browser or add-on level.
The problem with this is that the browser itself probably uses most of those combinations itself. For example,
C-w
closes the tab in most browsers I've used, and certainly in Chrome there's no way for a website to override that.Not the answer you're probably looking for, but I've come to the conclusion that it's easier to just type messages in your favourite editor and copy-paste them to the textarea. In fact, I'm writing this exact comment in Vim right now. Besides using all the power-editor tools that you're used to, that provides the additional benefit of keeping your draft intact in case of a power failure or a random computer hick-up. (That is, if you save often and if your OS, file system, and hardware aren't crap.)
There are also extensions that automate this, like Edit with Emacs (which it sounds like can work with other editors too). I haven't used that one in particular, but for another similar one I used to use, you would just push a keyboard shortcut in a textarea and it would open your editor (including any text that was already in the textarea), and when you saved and quit it would update the textarea with whatever you had written in the editor.
Nothing revolutionary, but makes it a little smoother and saves you from manually copy-pasting back and forth.
Thanks. I already do that (atomic-chrome... it's great). But sometimes I need to perform quick edits and it doesn't make sense to open Emacs. I also use Grammarly on Chrome (English is not my first language and it helps me a lot), and it's nice getting instant feedback instead of switching between Chrome and Emacs. There's also little synchronization bugs. That's the main reason for my request.
There are also people that are familiar with Emacs/readline, and prefer to type in the text field 100% of the time.
If you want replying to this comment [0] then click on reply below the comment, this way the original commenter doesn't get any notification about your reply.
I don't think a website should mess with how users use textarea, that would be very bad idea. I am sure @Deimos would never implement this kind of thing. If you still want to use emacs keybindings then you can use EXWM (iirc works well) or use eww to read tildes or better create a mode like md4rd is for reddit.
[0] -> https://tildes.net/~tildes/hi7/request_emacs_readline_like_keys_on_text_fields#comment-3wme
If you are on linux you can set your GTK key theme to Emacs and have Emacs keys in all GTK apps, including Firefox (IDK about Chrome). I'm on mobile so can't give an exact how to, but it should be fairly simple both with Gnome Tweak Tools and by editing the relevant setting in ~/.config/gtk-3.0/settings.ini.