Skip to content

Default Binds & Options

maxlandon edited this page May 12, 2023 · 11 revisions

This page contains an .inputrc-compliant list of global options and binds for all keymaps. When a keymap needs additional explanations on its role, as small paragraph is added below the title.

Options

Some global options have not been implemented: so because they were not useful anymore (some completion ones), out of the library scope (other completion ones), or not yet faced by the library author. Some of those might be implemented in the future if the need arises.

Notation: <option-name> <value> [NI/S] ([NI]: not implemented, [S]: specific to this library).

set active-region-start-color "\e[44m"
set autocomplete true [S]
set autopairs true [S]
set bell-style none [NI]
set bind-tty-special-chars false
set blink-matching-paren true
set byte-oriented false
set colored-completion-prefix true
set colored-stats false [NI]
set comment-begin #
set completion-display-width -1
set completion-ignore-case false
set completion-map-case false
set completion-prefix-display-length 0
set completion-query-items 100
set convert-meta true
set disable-completion false
set echo-control-characters true
set editing-mode vi
set emacs-mode-string @
set enable-bracketed-paste true [NI]
set enable-keypad false [NI]
set enable-meta-key true [NI]
set expand-tilde false [NI]
set history-autosuggest true [S]
set history-preserve-point false
set history-size 0
set horizontal-scroll-mode false [NI]
set input-meta true
set keymap emacs
set keyseq-timeout 50
set mark-directories true [NI]
set mark-modified-lines false [NI]
set mark-symlinked-directories true [NI]
set match-hidden-files true [NI]
set menu-complete-display-prefix true
set meta-flag true
set output-meta true
set page-completions true [NI]
set prefer-visible-bell true [NI]
set print-completions-horizontally false
set prompt-transient false [S]
set revert-all-at-newline false
set show-all-if-ambiguous false [NI]
set show-all-if-unmodified false [NI]
set show-mode-in-prompt true
set skip-completed-text true
set usage-hint-always true [S]
set vi-cmd-mode-string "[N]"
set vi-ins-mode-string "[I]"
set visible-stats false [NI]

Emacs keymaps

Emacs standard

The emacs keymap is a combination of both emacs-ctrlx and emacs-meta keymaps below, but additionally includes/overwrites some of the binds by the list below:

"C-@" set-mark
"C-A" beginning-of-line
"C-B" backward-char
"C-D" delete-char
"C-E" end-of-line
"C-F" forward-char
"C-G" abort
"C-H" backward-delete-char
"C-I" complete
"C-J" accept-line
"C-K" kill-line
"C-L" clear-screen
"C-M" accept-line
"C-N" next-history
"C-P" previous-history
"C-Q" quoted-insert
"C-R" reverse-search-history
"C-S" forward-search-history
"C-T" transpose-chars
"C-U" unix-line-discard
"C-V" quoted-insert
"C-W" unix-word-rubout
"C-Y" yank
"C-]" character-search
"C-_" undo
" " to "/" self-insert
"0" to "9" self-insert
":" to "~" self-insert
"C-?" backward-delete-char

Emacs Meta

"M-C-G" abort
"M-C-H" backward-kill-word
"M-C-I" tab-insert
"M-C-J" vi-editing-mode
"M-C-L" clear-display
"M-C-M" vi-editing-mode
"M-C-R" revert-line
"M-C-Y" yank-nth-arg
"M-C-[" complete
"M-C-]" character-search-backward
"M-C-^" copy-prev-word
"M-space" set-mark
"M-#" insert-comment
"M-&" tilde-expand
"M-*" insert-completions
"M--" digit-argument
"M-." yank-last-arg
"M-'" quote-line
"M-0" digit-argument
"M-1" digit-argument
"M-2" digit-argument
"M-3" digit-argument
"M-4" digit-argument
"M-5" digit-argument
"M-6" digit-argument
"M-7" digit-argument
"M-8" digit-argument
"M-9" digit-argument
"M-<" beginning-of-buffer-or-history
"M-=" possible-completions
"M->" end-of-buffer-or-history
"M-?" possible-completions
"M-B" backward-word
"M-C" capitalize-word
"M-D" kill-word
"M-F" forward-word
"M-L" downcase-word
"M-M" copy-prev-shell-word
"M-N" history-search-forward
"M-P" history-search-backward
"M-R" revert-line
"M-T" transpose-words
"M-U" upcase-word
"M-W" kill-region
"M-Y" yank-pop
"M-|" vi-goto-column
"M-" delete-horizontal-space
"M-~" tilde-expand
"M-C-?" backward-kill-word
"M-_" yank-last-arg
"M-[A" up-line-or-search
"M-[B" down-line-or-select

Emacs CtrlX

"C-XC-G" abort
"C-XC-R" re-read-init-file
"C-XC-U" undo
"C-XC-X" exchange-point-and-mark
"C-Xr" reverse-search-history
"C-Xs" forward-search-history
"C-Xu" undo
"C-X(" start-kbd-macro
"C-X)" end-kbd-macro
"C-XE" call-last-kbd-macro
"C-XC-?" backward-kill-line
"C-xC-b" vi-match
"C-xC-e" edit-command-line
"C-xC-n" infer-next-history
"C-xC-o" overwrite-mode

Vim keymaps

The various Vim keymaps have been significantly enhanced, either with new binds, new keymaps (Operator pending), or better in-code functionality.

Insert

"C-A" beginning-of-line
"C-B" backward-char
"C-D" vi-eof-maybe
"C-F" forward-char
"C-H" backward-delete-char
"C-I" complete
"C-J" accept-line
"C-K" kill-line
"C-L" clear-screen
"C-M" accept-line
"C-N" down-line-or-history
"C-O" operate-and-get-next
"C-P" up-line-or-history
"C-Q" accept-and-infer-next-history
"C-R" reverse-search-history
"C-S" forward-search-history
"C-T" transpose-chars
"C-U" unix-line-discard
"C-V" quoted-insert
"C-W" unix-word-rubout
"C-Y" yank
"C-[" vi-movement-mode
"C-_" undo
" " to "~" self-insert
"C-?" backward-delete-char
"M-q" macro-toggle-record
"M-@" macro-run
"M-'" vi-registers-complete
"M-[3~" delete-char
"M-[H" beginning-of-line
"M-[F" end-of-line
"M-[A" up-line-or-search
"M-[B" down-line-or-search

Command

"C-A" switch-keyword
"C-D" vi-eof-maybe
"C-E" emacs-editing-mode
"C-G" abort
"C-H" backward-char
"C-J" accept-line
"C-K" kill-line
"C-L" clear-screen
"C-M" accept-line
"C-N" next-history
"C-P" previous-history
"C-Q" quoted-insert
"C-R" reverse-search-history
"C-S" forward-search-history
"C-T" transpose-chars
"C-U" unix-line-discard
"C-V" quoted-insert
"C-W" unix-word-rubout
"C-X" switch-keyword
"C-Y" yank
"C-_" vi-undo
"M-<" beginning-of-buffer-or-history
"M->" end-of-buffer-or-history
"M-'" quote-line
"\M-[3~" delete-char
"\M-[6~" down-line-or-history
"\M-[5~" up-line-or-history
"\M-[H" beginning-of-line
"\M-[F" end-of-line
"\M-[A" history-search-backward
"\M-[B" menu-select
"\M-[C" vi-forward-char
"\M-[D" vi-backward-char
"\M-[3;5~" kill-word
"\M-[1;5C" forward-word
"\M-[1;5D" backward-word
" " vi-forward-char
"#" insert-comment
"$" vi-end-of-line
"%" vi-match
"&" vi-tilde-expand
"*" vi-complete
"+" next-history
"," vi-char-search
"-" previous-history
"." vi-redo
"/" vi-search
"0" beginning-of-line
"1" to "9" vi-arg-digit
";" vi-char-search
"=" vi-complete
"?" vi-search
"A" vi-append-eol
"B" vi-backward-bigword
"C" vi-change-to
"D" vi-delete-to
"E" vi-end-bigword
"F" vi-char-search
"G" vi-fetch-history
"I" vi-insert-beg
"N" vi-search-again
"O" vi-open-line-above
"P" vi-put
"R" vi-replace
"S" vi-subst
"T" vi-char-search
"U" revert-line
"V" vi-visual-line-mode
"W" vi-forward-bigword
"X" vi-backward-delete-char
"Y" vi-yank-to
"" vi-complete
"^" vi-first-print
""" vi-set-buffer
"_" vi-yank-arg
"`" vi-goto-mark
"a" vi-append-mode
"b" vi-prev-word
"c" vi-change-to
"d" vi-delete-to
"e" vi-end-word
"f" vi-char-search
"gg" beginning-of-buffer-or-history
"ge" vi-backward-end-word
"gE" vi-backward-end-bigword
"gu" vi-down-case
"gU" vi-up-case
"h" backward-char
"i" vi-insertion-mode
"j" down-line-or-history
"k" up-line-or-history
"l" forward-char
"m" vi-set-mark
"n" vi-search-again
"o" vi-open-line-below
"p" vi-put
"q" macro-toggle-record
"r" vi-change-char
"s" vi-subst
"t" vi-char-search
"u" vi-undo
"v" vi-visual-mode
"w" vi-next-word
"x" vi-delete
"y" vi-yank-to
"|" vi-column
"~" vi-change-case
"@" macro-run

Visual

The vi-visual keymap enables classic Vim-style visual selection, either in visual line mode or in normal visual mode. This keymap is a local keymap: all movement commands from the vi-command keymap also work while in this mode.

"M-]" vi-movement-mode
"aW" select-a-blank-word
"aa" select-a-shell-word
"aw" select-a-word
"iW" select-in-blank-word
"ia" select-in-shell-word
"iw" select-in-word
"a" vi-select-inside
"c" vi-change-to
"d" vi-delete-to
"i" vi-select-inside
"j" next-screen-line
"k" previous-screen-line
"s" vi-subst
"S" vi-add-surround
"u" vi-down-case
"v" vi-edit-command-line
"x" vi-delete-to
"y" vi-yank-to
"~" vi-swap-case

Operator Pending

The operator-pending is the lesser known Vim keymap. It is used for more complex actions often starting with yank/delete/change operations, and involving a text object. A few examples are:

  • diW to delete the bigword under cursor.
  • ya" to yank everything around two surrounding double quotes.
  • cs"' to change surrounding double quotes into single ones.

This keymap is also a local keymap: all movement commands from the vi-command keymap also work while in this mode.

"M-]" vi-movement-mode
"a" vi-select-inside
"aW" select-a-blank-word
"aa" select-a-shell-word
"aw" select-a-word
"i" vi-select-inside
"iW" select-in-blank-word
"ia" select-in-shell-word
"iw" select-in-word
"s" vi-select-surround
"j" down-line
"k" up-line

Completion & Incremental-search keymaps

Menu-Select

The menu-select is only enabled when completions have been requested by the user. It is by default populated with keys for reverse cycling, tag-cycling, and arrow keys for directional cycling,

"TAB" menu-complete
"Shift+Tab" menu-complete-backward
"C-@" accept-and-menu-complete
"C-F" menu-incremental-search
"C-N" menu-complete
"C-P" menu-complete-backward
"\e[A" menu-complete-backward
"\e[B" menu-complete
"\e[C" menu-complete
"\e[D" menu-complete-backward
"\e[1;5A" menu-complete-prev-tag
"\e[1;5B" menu-complete-next-tag

Incremental & Non-incremental Search

The isearch keymap is a special, empty keymap: when incrementally-searching in the history lines or available completions, only a subset of the emacs/vi-insert commands are available, and will directly be looked into their corresponding keymap. Any other command will exit the incremental search.

Clone this wiki locally