File: em-hist.el.html

Eshell's history facility imitates the syntax used by bash
([(bash)History Interaction]). Thus:

  !ls ; repeat the last command beginning with 'ls'
  !?ls ; repeat the last command containing ls
  echo !ls:2 ; echo the second arg of the last 'ls' command
  !ls<tab> ; complete against all possible words in this
                ; position, by looking at the history list
  !ls<C-c SPC> ; expand any matching history input at point

Also, most of comint-modes keybindings are accepted:

  M-r ; search backward for a previous command by regexp
  M-p ; access the last command entered, repeatable
  M-n ; access the first command entered, repeatable

  C-c M-r ; using current input, find a matching command thus, with
          ; 'ls' as the current input, it will go back to the same
          ; command that '!ls' would have selected
  C-c M-s ; same, but in reverse order

Note that some of these keybindings are only available if the eshell-rebind is not in use, in which case M-p does what C-c M-r normally would do, and C-p is used instead of M-p. It may seem confusing, but the intention is to make the most useful functionality the most easily accessible. If eshell-rebind is not being used, history navigation will use comint's keybindings; if it is, history navigation tries to use similar keybindings to bash. This is all configurable, of course.

Defined variables (21)

eshell--force-history-isearchNon-nil means to force searching in input history.
eshell--history-isearch-message-overlayOverlay for Isearch message when searching through input history.
eshell--stored-incomplete-inputStored input for history cycling.
eshell-hist--new-itemsThe number of new history items that have not been written to
eshell-hist-event-designatorThe regexp used to identifier history event designators.
eshell-hist-ignoredupsIf non-nil, don’t add input matching the last on the input ring.
eshell-hist-load-hookA list of functions to call when loading ‘eshell-hist’.
eshell-hist-match-partialIf non-nil, movement through history is constrained by current input.
eshell-hist-modeNon-nil if Eshell-Hist mode is enabled.
eshell-hist-mode-hookHook run after entering or leaving ‘eshell-hist-mode’.
eshell-hist-modifierThe regexp used to identity history modifiers.
eshell-hist-move-to-endIf non-nil, move to the end of the buffer before cycling history.
eshell-hist-rebind-keys-alistHistory keys to bind differently if point is in input text.
eshell-hist-unload-hookA hook that gets run when ‘eshell-hist’ is unloaded.
eshell-hist-word-designatorThe regexp used to identify history word designators.
eshell-history-appendIf non-nil, append new entries to the history file when saving history.
eshell-history-file-nameIf non-nil, name of the file to read/write input history.
eshell-history-isearchIf non-nil, Isearch searches in Eshell input history.
eshell-history-sizeSize of the input history ring. If nil, use envvar HISTSIZE.
eshell-input-filterPredicate for filtering additions to input history.
eshell-save-history-on-exitDetermine if history should be automatically saved.

Defined functions (47)

eshell--isearch-setup()
eshell--save-history()
eshell-add-input-to-history(INPUT)
eshell-add-to-history()
eshell-complete-history-reference()
eshell-expand-history-references(BEG END)
eshell-get-history(INDEX &optional RING)
eshell-get-next-from-history()
eshell-goto-history(POS)
eshell-hist--update-keymap(SYMBOL VALUE)
eshell-hist-initialize()
eshell-hist-mode(&optional ARG)
eshell-hist-parse-arguments(&optional B E)
eshell-hist-parse-event-designator(REFERENCE)
eshell-hist-parse-modifier(HIST REFERENCE)
eshell-hist-parse-word-designator(HIST REFERENCE)
eshell-hist-word-reference(REF)
eshell-history-isearch-end()
eshell-history-isearch-message(&optional C-Q-HACK ELLIPSIS)
eshell-history-isearch-push-state()
eshell-history-isearch-search()
eshell-history-isearch-wrap()
eshell-history-reference(REFERENCE)
eshell-history-substitution(LINE)
eshell-input-filter-default(INPUT)
eshell-input-filter-initial-space(INPUT)
eshell-isearch-backward(&optional INVERT)
eshell-isearch-backward-regexp(&optional INVERT)
eshell-isearch-forward()
eshell-isearch-forward-regexp()
eshell-list-history()
eshell-next-input(ARG)
eshell-next-matching-input(REGEXP ARG)
eshell-next-matching-input-from-input(ARG)
eshell-previous-input(ARG)
eshell-previous-input-string(ARG)
eshell-previous-matching-input(REGEXP ARG)
eshell-previous-matching-input-from-input(ARG)
eshell-previous-matching-input-string(REGEXP ARG)
eshell-previous-matching-input-string-position(REGEXP ARG &optional START)
eshell-put-history(INPUT &optional RING AT-BEGINNING)
eshell-read-history(&optional FILENAME SILENT)
eshell-save-some-history()
eshell-search-arg(ARG)
eshell-search-start(ARG)
eshell-write-history(&optional FILENAME APPEND)
eshell/history(&rest ARGS)

Defined faces (0)