aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/init/load-settings.sh
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2022-04-20 16:33:15 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2022-04-20 16:33:15 +0800
commita6d320f51d80a9f456fa65f8c715b5c0074a8ce4 (patch)
tree3efbaa1a5e0b96fdd075bb367f12e902a45c7e19 /tools/init/load-settings.sh
parent745e676af25657568be3b83cfafd56a833e46442 (diff)
Update
Diffstat (limited to 'tools/init/load-settings.sh')
-rwxr-xr-xtools/init/load-settings.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/init/load-settings.sh b/tools/init/load-settings.sh
index bfe643b..64bd4e5 100755
--- a/tools/init/load-settings.sh
+++ b/tools/init/load-settings.sh
@@ -7,15 +7,15 @@ source $SETTING_DIR/alias
7[[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done 7[[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done
8 8
9# Config shell 9# Config shell
10SHELL=$(cat /proc/$$/cmdline | tr -d '\0' | xargs basename) 10shell=$(</proc/$$/cmdline tr -cd '[:alpha:]')
11 11
12# fzf 12# fzf
13if which fzf &>/dev/null; then 13if which fzf &>/dev/null; then
14 [ -f ~/.fzf.$SHELL ] && source ~/.fzf.$SHELL 14 [ -f ~/.fzf.$shell ] && source ~/.fzf.$shell
15 fzf_preview() { fzf --preview 'cat {}'; } 15 fzf_preview() { fzf --preview 'cat {}'; }
16fi 16fi
17 17
18if [[ $SHELL == zsh ]]; then 18if [[ $shell == zsh ]]; then
19 setopt extended_glob 19 setopt extended_glob
20 fpath=($SETTING_DIR/zsh $fpath) 20 fpath=($SETTING_DIR/zsh $fpath)
21 compinit 21 compinit
@@ -24,13 +24,12 @@ if [[ $SHELL == zsh ]]; then
24 bindkey '\ek' deer 24 bindkey '\ek' deer
25 alias history='history -i' 25 alias history='history -i'
26 26
27 #zle -N fzf_preview
28 bindkey -s "^I" 'fzf_preview ' 27 bindkey -s "^I" 'fzf_preview '
29elif [[ $SHELL == bash ]]; then 28elif [[ $shell == bash ]]; then
30 shopt -s extglob 29 shopt -s extglob
31 HISTTIMEFORMAT='%Y-%m-%d %T ' 30 HISTTIMEFORMAT='%Y-%m-%d %T '
32 31
33 bind -x '"\C-i": "fzf_preview"' 32 bind -x '"\C-i":"fzf_preview"'
34fi 33fi
35 34
36# Add custom scripts into PATH 35# Add custom scripts into PATH