News for hackers. Stuff that matters.
Re:A Useful Thing in Bash by dig1 on Thursday October 10, 2019 @04:15AM (#21212085)
GNU Readline, for those who doesn't know, also comes with vi mode, where you can search with '/' and '?' keys. You can enable it with 'set -o vi' in bash shell or putting 'set editing-mode vi' it in ~/.inputrc.

If you put it in ~/.inputrc, you will get vi mode in all tools/shells which are using Readline like mysql, rlwrap, psql...

https://github.com/pkrumins/bash-vi-editing-mode-cheat-sheet...

Re:A Useful Thing in Bash by catalogia on Thursday October 10, 2019 @06:14AM (#21212730)
If using readline in vi-mode, I recommend also setting `set show-mode-in-prompt on` to provide visual feedback on which mode you're in. Maybe it's just me, but sometimes I walk away from a repl for quite a while (weeks sometimes) and when I come back to it I stumble for a moment because it wasn't in the mode I was expecting.
Re:A Useful Thing in Bash by brujoand on Thursday October 10, 2019 @08:16AM (#21213553)
Agreed, I just wish it could be a bit more customisable. like so https://savannah.gnu.org/support/?109610
Re:A Useful Thing in Bash by joombaga on Thursday October 10, 2019 @09:06AM (#21213929)
It's completely customizable! Just takes some creativity.

https://superuser.com/a/1467056/731833

Re:A Useful Thing in Bash by fanf2 on Thursday October 10, 2019 @08:22PM (#21220494)
vi command line editing mode is required by POSIX (see under EXTENDED DESCRIPTION at https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...)
Re:A Useful Thing in Bash by johnchristopher on Thursday October 10, 2019 @09:55AM (#21214491)
Wow ! I have been using set -o vi for years but somehow completely missed that / and ? were available ! Thanks !