Context
So I finally give a try to Fish, and as one would expect I encounter some frictions due to differences with my usual routines.
The most astonishing for me, as for many other, was the absence of the bang operator. I'm fine with the lose of sudo !!
, as the suggested function replacement seems even better to me, I named it gar
which means "To make, compel (someone to do something); to cause (something to be done." However I'll need a replacement for !<abc><enter>
which grab the last history line starting with <abc>
and run it without further ado, suggestions are welcome.
Now, for the more personal things: - I use a Typematrix 2030 keyboard - I use a bépo layout - I like to configure default finger position keys with the most used actions
Aims
As on my keybord <enter>
is well positioned and is semantically relevant for that, ideally I would like to achieve the following key binding:
- ctrl-enter: accept the whole suggestion and run it without further confirmation
- ctrl-tab: accept the whole suggestion and wait for further edit
- alt-enter: redo the last command without further confirmation
But according to xev
it appears that, at least with Gnome-terminal, this combinations are not recognized. Are they terminal that supports it? For now I remapped these three to <ctrl>-i
, <alt>-i
and <alt>-I
respectively:
bind --preset \ci forward-char execute
bind --preset \ei forward-char
bind --preset \eI forward-word
This works as expected, but it seems that now the tab
key will also map to the first item. I guess that tab
map to <alt>-i
at some point in the shell stack. I wasn't aware of that, so I don't know yet if it will be possible for Fish to separate each of them.
To manage jobs, I also came with
bind --preset \es fg
bind --preset \eS bg
The first works as expected, but the second one doesn't. With application like vim
, the binding should be operated in the application configuration itself of course. But for things as trivial as yes
, <alt>-S
won't work as expected while <crl>-z
continue to operate normally.
I also would like to bind some commands like ls -alh
and git status --short
to a directly executed command, showing the result bellow the currently edited line, allowing to further type seamlessly, but didn't find the way to do it yet.
Summary of remaining question
So here are my more precise questions summarised:
- how do I bind the sleep signal to
<alt>-S
? - is there a terminal I can use where
<alt>-<enter>
and<ctrl>-<enter>
works? - how to seamlessly run command while maintaining the current line edition in place?
- can you bind something to
<alt>-i
without altering<tab>
?