Hacker News new | ask | show | jobs
by bogdan 1940 days ago
Fish is my favourite shell because among other things, it has the best support for vi key bindings. I have been using the master version of it without any issues for more than half a year now for the undo / redo support and I'm glad the team has finally released it to stable. Thanks to everyone who worked on this! If anyone is reading this and is using vi mode with bash or zsh, give fish a try, it's so much better!
3 comments

That's odd. bash and zsh had leagues better vi bindings the last time I tried. fish had tons of weird errors, most notably that things like `d2w` simply don't work. I actually had to stop using fish and go back to zsh because I couldn't get past the lack of vi support.

Apparently, https://github.com/fish-shell/fish-shell/issues/4019 still has not been fixed. There's no similar issue in bash/zsh.

> If anyone is reading this and is using vi mode with bash or zsh, give fish a try, it's so much better!

Great to hear that. I am using vi key bindings wherever it's possible, for example, text editing, Firefox(vimium) and file manager(ranger). But I have never been able to figure out how to use vi mode effectively in the shell prompt. The last time since I tried vi mode in shell was at least 5 years ago. I could roughly remember that vi mode bindings conflicted with certain oh-my-fish plugins I had installed. Even worse factor was that, I didn't know how to do certain things in vi mode, for example "M-." key to yank last argument from previous command. So I gave it up in the end.

Would you mind sharing what plugins do you use? And how do you work efficiently with vi mode? Thanks ahead.

I’m a die-hard vim user and a fish developer but (gasp!) I don’t use vi mode in fish or any other shell. Alt-V will open $EDITOR with the command line contents preloaded into the buffer and update the prompt on exit, I find that to be good enough without the frustration of trying to convert the prompt into a text editor when it’s not.
This alone might convince me to start using fish again. Thanks for the tip!
> it has the best support for vi key bindings

Yeah, maybe not the best. Once could say they're improving though.

> Vi mode bindings now support dh, dl, c0, cf, ct, cF, cT, ch, cl, y0, ci, ca, yi, ya, di, da, d;, d,, o, O and Control+left/right keys to navigate by word