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-line
  • C-n next-line
  • C-m for return
  • C-a to move cursor to the start of the line
  • C-e to move cursor to the start of end line
  • M-d to kill word
  • C-k kill line
  • C-u kill backwards line
  • C-b to backward char
  • C-f to forward char
  • C-b to backward char
  • M-f to forward word
  • M-b to backward word
  • C-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!

7 comments

  1. jtvjan
    Link
    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.

    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.

    16 votes
  2. unknown user
    Link
    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...

    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.

    8 votes
  3. [2]
    unknown user
    Link
    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...

    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.)

    7 votes
    1. Deimos
      Link Parent
      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...

      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.

      4 votes
  4. [2]
    mrbig
    Link
    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...

    it's easier to just type messages in your favorite editor and copy-paste them to the textarea.

    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.

    2 votes
    1. lugubris
      Link Parent
      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...

      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

      1 vote
  5. unknown user
    Link
    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...

    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.

    2 votes