This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinit.zsh
63 lines (50 loc) · 1.71 KB
/
init.zsh
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
#!/bin/zsh
zmodload zsh/stat
zmodload zsh/datetime
export ZSH_HISTORY_FILE=${ZSH_HISTORY_FILE:-"$HOME/.zsh_history.db"}
ZSH_HISTORY_BACKUP_DIR=${ZSH_HISTORY_BACKUP_DIR:-"$HOME/.zsh/history/backup"}
ZSH_HISTORY_FILTER=${ZSH_HISTORY_FILTER:-"fzy:fzf-tmux:fzf:peco"}
ZSH_HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND="bg=magenta,fg=white,bold"
ZSH_HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND="bg=red,fg=white,bold"
ZSH_HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS="i"
#
# Keybindings
#
if [[ -n $ZSH_HISTORY_KEYBIND_GET_BY_DIR ]]; then
zle -N "__zsh_history::keybind::get_by_dir"
bindkey "$ZSH_HISTORY_KEYBIND_GET_BY_DIR" "__zsh_history::keybind::get_by_dir"
fi
if [[ -n $ZSH_HISTORY_KEYBIND_GET_ALL ]]; then
zle -N "__zsh_history::keybind::get_all"
bindkey "$ZSH_HISTORY_KEYBIND_GET_ALL" "__zsh_history::keybind::get_all"
fi
if [[ -n $ZSH_HISTORY_KEYBIND_SCREEN ]]; then
zle -N "__zsh_history::keybind::screen"
bindkey "$ZSH_HISTORY_KEYBIND_SCREEN" "__zsh_history::keybind::screen"
fi
if [[ -n $ZSH_HISTORY_KEYBIND_ARROW_UP ]]; then
zle -N "__zsh_history::keybind::arrow_up"
bindkey "$ZSH_HISTORY_KEYBIND_ARROW_UP" "__zsh_history::keybind::arrow_up"
fi
if [[ -n $ZSH_HISTORY_KEYBIND_ARROW_DOWN ]]; then
zle -N "__zsh_history::keybind::arrow_down"
bindkey "$ZSH_HISTORY_KEYBIND_ARROW_DOWN" "__zsh_history::keybind::arrow_down"
fi
#
# Configurations
#
if [[ $ZSH_HISTORY_CASE_SENSITIVE == true ]]; then
unset ZSH_HISTORY_SUBSTRING_SEARCH_GLOBBING_FLAGS
fi
if [[ $ZSH_HISTORY_DISABLE_COLOR == true ]]; then
unset ZSH_HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND
unset ZSH_HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND
fi
#
# Loading
#
for f in "${0:A:h}"/zsh/*.zsh(N-.)
do
source "$f"
done
unset f