-
Notifications
You must be signed in to change notification settings - Fork 2
/
7-history.rc
48 lines (33 loc) · 1.13 KB
/
7-history.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# shellcheck disable=SC2148 disable=SC1090 shell=bash
### History Stuff ###
# Don't share tab history on iTerm2
#unsetopt inc_append_history
# Where it gets saved
HISTFILE=~/.history
# Remember a lot of history (AWESOME)
export SAVEHIST=2000000
export HISTSIZE=2000000
# Don't overwrite, append!
setopt APPEND_HISTORY
# Write after each command
# setopt INC_APPEND_HISTORY
# Killer: share history between multiple shells
setopt SHARE_HISTORY
# If I type cd and then cd again, only save the last one
setopt HIST_IGNORE_DUPS
# Even if there are commands in between commands that are the same, still only save the last one
setopt HIST_IGNORE_ALL_DUPS
# Pretty Obvious. Right?
setopt HIST_REDUCE_BLANKS
# If a line starts with a space, don't save it.
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
# When using a hist thing, make a newline show the change before executing it.
setopt HIST_VERIFY
# Save the time and how long a command ran
setopt EXTENDED_HISTORY
setopt HIST_SAVE_NO_DUPS
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FIND_NO_DUPS
# When outputting history, print it out with timestamps and command only
alias history="history -i"