diff options
Diffstat (limited to 'tools/init')
-rwxr-xr-x | tools/init/load-settings.sh | 11 |
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 |
10 | SHELL=$(cat /proc/$$/cmdline | tr -d '\0' | xargs basename) | 10 | shell=$(</proc/$$/cmdline tr -cd '[:alpha:]') |
11 | 11 | ||
12 | # fzf | 12 | # fzf |
13 | if which fzf &>/dev/null; then | 13 | if 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 {}'; } |
16 | fi | 16 | fi |
17 | 17 | ||
18 | if [[ $SHELL == zsh ]]; then | 18 | if [[ $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 ' |
29 | elif [[ $SHELL == bash ]]; then | 28 | elif [[ $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"' |
34 | fi | 33 | fi |
35 | 34 | ||
36 | # Add custom scripts into PATH | 35 | # Add custom scripts into PATH |