Mention `!...` history shortcuts in "coming from..." pages
The !!, !$, !<number>, !-<number>, and possibly other history shortcuts work in Reedline roughly the way they do in Bash (though Bash's behavior is complicated and it seems some features are not supported, such as substitutions with s^...^...). This is probably worth mentioning in the "coming from ... " pages for different shells.
PowerShell's equivalent for !$ is $$; I'm not sure if it has an equivalent for the others. I don't think cmd.exe supports this feature at all.
Good idea. They should be mentioned.
One major difference is that by default, Enter performs the substitution rather than running the command as usual. In a recent-enough Bash, you can configure Space to do this (see this blog post).
ya, that would be cool to have space expand it. i really wish we could combine this stuff with an fish abbrev-like functionality. they're very similar, one gets that last commands and one just expands aliases.
Is it possible to map !$ to some other key combination? Unfortunately on my keyboard layout to execute !$<Enter> requires 5 key presses (shift to get !, alt to get $). I am longing for bash <Esc>. all the time (2 key presses). A user defined combination would be great..
I am longing for bash
<Esc>.all the time (2 key presses). A user defined combination would be great..
Worth checking the https://github.com/nushell/reedline/issues and adding a feature request there, maybe someone is interested in figuring this out :)
@orr721 I believe this works
{
name: insert_last_token
modifier: alt
keycode: char_.
mode: [emacs vi_normal vi_insert]
event: [
{ edit: InsertString, value: " !$" }
{ send: Enter }
]
}
yes! I'm on a mac though, so I had to change the modifier to control and keycode to other key. but finally it works, thank you!👍
yes! I'm on a mac though, so I had to change the modifier to control and keycode to other key. but finally it works, thank you!👍
been there. done that. i use a mac too during the evenings and weekends. keybindings are sometimes hard to get recognized. it's why i wrote keybindings listen and someone else wrote input listen.
Should be closeable once #1502 is committed.
And the Alt+. keybinding was worth the price of going through all of these old issues ;-). I've been missing that one desperately since transitioning from Fish.
@fdncred I think this can be closed now that #1502 is in place.