-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings
64 lines (46 loc) · 2.12 KB
/
settings
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## ZSH Settings
# Vim mode
bindkey -v
# This binds Up and Down (or j/k in vim cmd mode)
# to a substring history search, backwards and forwards,
# based upon what has already been entered at the prompt.
# Run cat -v in your favorite terminal emulator to observe key codes.
# (NOTE: In some cases, cat -v shows the wrong key codes.
# If the key codes shown by cat -v don't work for you,
# press <C-v><UP> and <C-v><DOWN> at your ZSH command line prompt for correct key codes.)
# For example, if you observed ^[[A for UP and ^[[B for DOWN, then
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# However, if the observed values don't work, you can try using terminfo:
bindkey "$terminfo[kcuu1]" history-substring-search-up
bindkey "$terminfo[kcud1]" history-substring-search-down
bindkey -M vicmd 'k' history-substring-search-up
bindkey -M vicmd 'j' history-substring-search-down
## History
HISTFILE=$ZSH_CONFIG/history
HISTSIZE=1200 # lines of history to maintain memory
SAVEHIST=1000 # lines of history to maintain in history file.
# Write the history file in the ":start:elapsed;command" format.
setopt EXTENDED_HISTORY
# Write to the history file immediately, not when the shell exits.
setopt INC_APPEND_HISTORY
# Share history between all sessions.
# setopt SHARE_HISTORY
# Expire duplicate entries first when trimming history.
setopt HIST_EXPIRE_DUPS_FIRST
# Don't record an entry that was just recorded again.
setopt HIST_IGNORE_DUPS
# Delete old recorded entry if new entry is a duplicate.
setopt HIST_IGNORE_ALL_DUPS
# Do not display a line previously found.
setopt HIST_FIND_NO_DUPS
# Don't record an entry starting with a space.
setopt HIST_IGNORE_SPACE
# Don't write duplicate entries in the history file.
setopt HIST_SAVE_NO_DUPS
# Remove superfluous blanks before recording entry.
setopt HIST_REDUCE_BLANKS
# Don't execute immediately upon history expansion.
setopt HIST_VERIFY
# Beep when accessing nonexistent history.
setopt HIST_BEEP