3 ms·
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
by dig1 7y ago
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/blob/master/bash-vi-editing-mode-cheat-sheet.txt https://github.com/pkrumins/bash-vi-editing-mode-cheat-sheet...
- catalogia 7y agoIf 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.
- brujoand 7y agoAgreed, I just wish it could be a bit more customisable. like so https://savannah.gnu.org/support/?109610 https://savannah.gnu.org/support/?109610
- joombaga 7y agoIt's completely customizable! Just takes some creativity. https://superuser.com/a/1467056/731833 https://superuser.com/a/1467056/731833
- johnchristopher 7y agoWow ! I have been using set -o vi for years but somehow completely missed that / and ? were available ! Thanks !
- fanf2 7y agovi command line editing mode is required by POSIX (see under EXTENDED DESCRIPTION at https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/sh.html https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...)