-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzshrc
executable file
·77 lines (66 loc) · 1.93 KB
/
zshrc
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
65
66
67
68
69
70
71
72
73
74
75
76
77
# Uncomment the line below for profiling to start
# to see the profiling results, run `zprof` after shell load
# zmodload zsh/zprof
#
# User configuration sourced by interactive shells
#
# Change default zim location
export ZIM_HOME=${ZDOTDIR:-${HOME}}/.zim
# load custom executable functions
for function in ~/.zsh/functions/*; do
source $function
done
# extra files in ~/.zsh/configs/pre , ~/.zsh/configs , and ~/.zsh/configs/post
# these are loaded first, second, and third, respectively.
_load_settings() {
_dir="$1"
if [ -d "$_dir" ]; then
if [ -d "$_dir/pre" ]; then
for config in "$_dir"/pre/**/*(N-.); do
. $config
done
fi
for config in "$_dir"/**/*(N-.); do
case "$config" in
"$_dir"/pre/*)
:
;;
"$_dir"/post/*)
:
;;
*)
if [ -f $config ]; then
. $config
fi
;;
esac
done
if [ -d "$_dir/post" ]; then
for config in "$_dir"/post/**/*(N-.); do
. $config
done
fi
fi
}
_load_settings "$HOME/.zsh/configs"
# The time the shell waits, in hundredths of seconds, for another key
# to be pressed when reading bound multi-character sequences.
export KEYTIMEOUT=1
# Bind Ctrl-X Ctrl-E to edit the current command line in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey '' edit-command-line
# Bind Opt-M to copy previous shell word
bindkey "^[m" copy-prev-shell-word
# direnv
eval "$(direnv hook zsh)"
# aliases
[[ -f ~/.aliases ]] && source ~/.aliases
# fzf
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh
# --files: List files that would be searched but do not search
# --hidden: Search hidden files and folders
# --follow: Follow symlinks
# --glob: Additional conditions for search (in this case ignore everything in the .git/ folder)
export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"