Our great sponsors
-
hstr
bash and zsh shell history suggest box - easily view, navigate, search and manage your command history.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
vi bindings aren't worth running into weird problems imo. it took me less than a minute to hit an incompatibility with fzf.
https://github.com/junegunn/fzf/issues/1238
I was doing history grep too until someone on HN told me about hstr:
https://github.com/dvorka/hstr
Friends if you dont know: you can add readline support to LOTS of things, especially custom scripts and tools with a prompt by just calling the program with rlwrap.
> rlwrap is a 'readline wrapper', a small utility that uses the GNU Readline library to allow the editing of keyboard input for any command.
https://github.com/hanslub42/rlwrap
And add search support: https://github.com/soheilpro/zsh-vi-search
I missed the shell integration when switching to Fish a couple of years ago. fzf.fish saved the day, I wouldn't be without the keybindings now (Ctrl+Alt+F is roughly the equivalent of `*`)
https://github.com/PatrickF1/fzf.fish
Ugh this destroyed my productivity too for a while. I even wrote an entire blog post about my woes and different experiments to get back to getting consistent shortcuts across terminal and GUI apps here: https://alexdav.id/2020/07/12/text-manipulation-and-modifier.... GTK key themes didn't end up working out for me, and I ended up with a custom QMK solution, but it's not great.
Note for people still using macos, you can enable many more readline shortcuts by creating a special file at ~/Library/KeyBindings/DefaultKeyBinding.dict. I made a repo that simplifies the process to just a single git clone when setting up a new machine: https://github.com/alexdavid/keybindings
keyd is a really nice key remapping daemon that support application-specific remappings. You could use it to emulate readline bindings in Chrome. Or if you can't figure out how to emulate something, at least bind it to noop so it doesn't mess you up any more.
https://github.com/rvaiya/keyd
Two issues with readline: it's GPL and it's big. For embedded systems intended to become products you really need something else. My tiny variant is this, but for sure there are many others:
https://github.com/nklabs/libnklabs
("nkreadline" has editing, tab-completion (for embedded "nkcli" commands) and history)
In a similar vein there's also Linenoise form the creator of Redis.
https://github.com/antirez/linenoise