bhauman / rebel-readline

Terminal readline library for Clojure dialects
Eclipse Public License 1.0
680 stars 37 forks source link

Bind enter in :emacs #184

Open mwgkgk opened 5 years ago

mwgkgk commented 5 years ago

A snippet from https://github.com/bhauman/rebel-readline/issues/101#issuecomment-400018676 doesn't seem to work for me:

{:key-bindings {:emacs [[(13) :clojure-force-accept-line]]}}

"^M" does not work either. "^G", for example, does work. It's okay to force-accept on plain enter because ctrl-j is also bound to accept-line. The functionality itself does work, on "^X^M".

Tested on xterm, urxvt, alacritty, in and out of tmux; Rebel-readline version 0.1.4.

Bonus round: Can't seem to bind "^J" either, both like that (which is how it's listed in :repl/key-bindings), nor as "^@" (which is what Vim gives me on C-v C-j, which inserts the terminal code for ctrl-j).

Also might make sense to allow force-accept on enter through an option. This sounds like a point of confusion. I understand that there's been a lot of thought put into this given the discussion in #101, but since C-j is duplicating accept-line, Enter could act closer to what is expected from a line editor, not from text editor.

cldwalker commented 4 years ago

Fwiw https://github.com/cldwalker/dotfiles/blob/master/.clojure/rebel_readline.edn works for me with emacs keybindings on osx with iterm2