How to bind Ctrl-Enter in fish? -
in order configure user binding (version 2.2.0), must in fish_user_key_bindings
function:
function fish_user_key_bindings bind \n 'commandline -f accept-autosuggestion execute' end
this works fine.
i wanted expand binding ctrl+enter, using appropriate modifier:
function fish_user_key_bindings bind \c\n 'commandline -f accept-autosuggestion execute' end
this not work: enter uses current (up cursor) suggestion (which default) but ctrl+enter well (as if action modifier not taken account)
binding \c\n
doesn't make sense because \n
control character. applying control modifier second time control character has no effect. since \n
alias \cj
you're trying equivalent of binding \c\cj
. way bind [ctrl][enter] configure terminal send unique sequence key combination.
p.s., if grab current git head source can make fish_key_reader
build handy program show lot of information different keys send (although you'll need wait few minutes time type because need merge https://github.com/fish-shell/fish-shell/pull/3012).
p.p.s., of fish 2.3.0 (currently in beta testing) tty driver no longer automatically converts \r
(aka \cm
) enter key sends \n
(aka \cj
).
Comments
Post a Comment