$histchars  –  Definition of History Expansion and Comment Parsing

$histchars defines how the Zsh shell handles history expansion and how it parses line comments.

The value contains three ASCII characters:

  1. Character for a history expansion. Default: !.
  2. Character for a quick history substitution. Default: ^.
  3. Character to start a line comment. Default: #.

Examples

Change line comment character for a script
1
2
3
4
5
#!/usr/bin/env zsh
# Tell Zsh that underscore _ now start a line comment
histchars[3]='_'
_ new line comment
echo hello world
Output:
1
hello world
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $histchars - probieren Sie es jetzt aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches