LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

readline

Line editing and input history library

TLDR

View readline keybindings
$ bind -P
copy
Edit inputrc
$ vi ~/.inputrc
copy
Set vi mode
$ set -o vi
copy
Set emacs mode
$ set -o emacs
copy

SYNOPSIS

GNU Readline library and configuration

DESCRIPTION

Readline is a library providing command-line editing, history, and tab completion. It's used by bash, gdb, python, and many other programs. Configuration is via ~/.inputrc.

EXAMPLES

$ # List current bindings
bind -P | grep search

# Bind key in session
bind '"\e[A": history-search-backward'

# Check editing mode
echo $SHELLOPTS | tr ':' '\n' | grep -E 'vi|emacs'
copy

INPUTRC CONFIGURATION

$ # ~/.inputrc

# Case insensitive completion
set completion-ignore-case on

# Show all completions on first tab
set show-all-if-ambiguous on

# Vi mode
set editing-mode vi

# Key bindings
"\e[A": history-search-backward
"\e[B": history-search-forward
"\C-p": history-search-backward
copy

COMMON KEYBINDINGS (Emacs mode)

$ Ctrl+a    - Beginning of line
Ctrl+e    - End of line
Ctrl+k    - Kill to end of line
Ctrl+u    - Kill to beginning
Ctrl+w    - Kill word backward
Ctrl+y    - Yank (paste)
Ctrl+r    - Reverse search history
Ctrl+l    - Clear screen
Alt+f     - Forward word
Alt+b     - Backward word
copy

INSTALL

sudo dnf install readline
copy
sudo pacman -S readline
copy
brew install readline
copy
nix profile install nixpkgs#readline
copy

CAVEATS

Configuration varies by application. Some programs use libedit instead. Reload: source ~/.inputrc or Ctrl+x Ctrl+r.

HISTORY

GNU Readline was written by Brian Fox for the GNU Project, becoming the standard line editing library.

SEE ALSO

bash(1), bind(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid