mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
Add support for custom timestamp format in history
This commit is contained in:
parent
9cd3701ac0
commit
7f29de4726
2 changed files with 14 additions and 7 deletions
|
|
@ -19,12 +19,16 @@ function omz_history {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Timestamp format
|
# Timestamp format
|
||||||
case $HIST_STAMPS in
|
if [ ! -z "$HIST_STAMPS" ]; then
|
||||||
"mm/dd/yyyy") alias history='omz_history -f' ;;
|
case $HIST_STAMPS in
|
||||||
"dd.mm.yyyy") alias history='omz_history -E' ;;
|
"mm/dd/yyyy") alias history='omz_history -f' ;;
|
||||||
"yyyy-mm-dd") alias history='omz_history -i' ;;
|
"dd.mm.yyyy") alias history='omz_history -E' ;;
|
||||||
*) alias history='omz_history' ;;
|
"yyyy-mm-dd") alias history='omz_history -i' ;;
|
||||||
esac
|
*) alias history='omz_history -t "$HIST_STAMPS"' ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
alias history='omz_history'
|
||||||
|
fi
|
||||||
|
|
||||||
## History file configuration
|
## History file configuration
|
||||||
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
|
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,10 @@ ZSH_THEME="robbyrussell"
|
||||||
|
|
||||||
# Uncomment the following line if you want to change the command execution time
|
# Uncomment the following line if you want to change the command execution time
|
||||||
# stamp shown in the history command output.
|
# stamp shown in the history command output.
|
||||||
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
# You can set one of the optional three formats:
|
||||||
|
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
|
||||||
|
# or set a custom format using the strftime function format specifications,
|
||||||
|
# see 'man strftime' for details.
|
||||||
# HIST_STAMPS="mm/dd/yyyy"
|
# HIST_STAMPS="mm/dd/yyyy"
|
||||||
|
|
||||||
# Would you like to use another custom folder than $ZSH/custom?
|
# Would you like to use another custom folder than $ZSH/custom?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue