Hacker News new | ask | show | jobs
by efnx 4696 days ago
In fish it's simple enough to start typing the command you want and then hit arrow right to autocomplete. If you have a couple often commands that start the same way just arrow up or down to cycle through them, then arrow right to put them on the command line.
1 comments

Simplified example: mkdir foo, cd foo. I type in mkdir foo then press enter, type "cd esc-.". Doesn't work. Command completion in fish doesn't help here. In real life this is of course mostly more complicated than a simple "foo".
I use zsh and for this use case I typically use "mkdir foo" followed by "cd $!".
function mkcd () { mkdir -p "$1" && cd "$1" }
as I wrote: this is a simplified example ...