diff options
Diffstat (limited to 'tools/init')
-rwxr-xr-x | tools/init/load-settings.sh | 41 |
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 |
10 | shell=$(cat /proc/$$/cmdline | tr -d '\0') | 10 | SHELL=$(cat /proc/$$/cmdline | tr -d '\0' | xargs basename) |
11 | case $shell in | 11 | |
12 | *zsh*) | 12 | # fzf |
13 | setopt extended_glob | 13 | if 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 | 16 | fi |
17 | zle -N deer | 17 | |
18 | bindkey '\ek' deer | 18 | if [[ $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 |
25 | esac | 25 | alias history='history -i' |
26 | |||
27 | #zle -N fzf_preview | ||
28 | bindkey -s "^I" 'fzf_preview ' | ||
29 | elif [[ $SHELL == bash ]]; then | ||
30 | shopt -s extglob | ||
31 | HISTTIMEFORMAT='%Y-%m-%d %T ' | ||
32 | |||
33 | bind -x '"\C-i": "fzf_preview"' | ||
34 | fi | ||
26 | 35 | ||
27 | # Add custom scripts into PATH | 36 | # Add custom scripts into PATH |
28 | BIN_DIR=$HOME/bin | 37 | BIN_DIR=$HOME/bin |