Keyboard Shortcuts every Command Line Hacker should know about GNU Readline

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • fzf

    :cherry_blossom: A command-line fuzzy finder

  • 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

  • hstr

    bash and zsh shell history suggest box - easily view, navigate, search and manage your command history.

  • I was doing history grep too until someone on HN told me about hstr:

    https://github.com/dvorka/hstr

  • 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.

    WorkOS logo
  • rlwrap

    A readline wrapper

  • 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

  • fzf-fish-integration

    🔍🐟 Fzf plugin for Fish

  • 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

  • keybindings

    Bring basic readline/emacs keybindings to every text-input in MacOS (by alexdavid)

  • 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

    A key remapping daemon for linux.

  • 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

  • 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.

    InfluxDB logo
  • libnklabs

    NK Labs Common Library

  • 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)

  • linenoise

    A small self-contained alternative to readline and libedit

  • In a similar vein there's also Linenoise form the creator of Redis.

    https://github.com/antirez/linenoise

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts