aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2022-04-20 15:49:53 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2022-04-20 15:49:53 +0800
commit745e676af25657568be3b83cfafd56a833e46442 (patch)
tree54ce69e57bec61da5db526d34d74bcb0132e0f26
parent1c7c101f71628a129f160c0e69d44eb7ebc4dd5a (diff)
Update
-rwxr-xr-xtools/init/load-settings.sh41
1 files changed, 25 insertions, 16 deletions
diff --git a/tools/init/load-settings.sh b/tools/init/load-settings.sh
index f60c7d4..bfe643b 100755
--- a/tools/init/load-settings.sh
+++ b/tools/init/load-settings.sh
@@ -7,22 +7,31 @@ 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') 10SHELL=$(cat /proc/$$/cmdline | tr -d '\0' | xargs basename)
11case $shell in 11
12 *zsh*) 12# fzf
13 setopt extended_glob 13if which fzf &>/dev/null; then
14 fpath=($SETTING_DIR/zsh $fpath) 14 [ -f ~/.fzf.$SHELL ] && source ~/.fzf.$SHELL
15 compinit 15 fzf_preview() { fzf --preview 'cat {}'; }
16 autoload -U deer 16fi
17 zle -N deer 17
18 bindkey '\ek' deer 18if [[ $SHELL == zsh ]]; then
19 alias history='history -i' 19 setopt extended_glob
20 ;; 20 fpath=($SETTING_DIR/zsh $fpath)
21 *bash*) 21 compinit
22 shopt -s extglob 22 autoload -U deer
23 HISTTIMEFORMAT='%Y-%m-%d %T ' 23 zle -N deer
24 ;; 24 bindkey '\ek' deer
25esac 25 alias history='history -i'
26
27 #zle -N fzf_preview
28 bindkey -s "^I" 'fzf_preview '
29elif [[ $SHELL == bash ]]; then
30 shopt -s extglob
31 HISTTIMEFORMAT='%Y-%m-%d %T '
32
33 bind -x '"\C-i": "fzf_preview"'
34fi
26 35
27# Add custom scripts into PATH 36# Add custom scripts into PATH
28BIN_DIR=$HOME/bin 37BIN_DIR=$HOME/bin