diff options
author | a1346054 <36859588+a1346054@users.noreply.github.com> | 2021-08-14 11:33:21 +0000 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2021-08-15 16:03:26 +0900 |
commit | 8f899aaf8a1af43e40862bdc6bfa18b307eb6729 (patch) | |
tree | 4a35ece9112dd774ed0346d7a37dadf1cfc2f313 /shell | |
parent | e53b4bb4398a3ed8950d6709bf207f4b9b4e1cbc (diff) |
use proper bash-style notation
Diffstat (limited to 'shell')
-rw-r--r-- | shell/key-bindings.bash | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash index 0cfc4239..3ea8e765 100644 --- a/shell/key-bindings.bash +++ b/shell/key-bindings.bash @@ -27,7 +27,7 @@ __fzf_select__() { if [[ $- =~ i ]]; then __fzfcmd() { - [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; } && + [[ -n "$TMUX_PANE" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "$FZF_TMUX_OPTS" ]]; } && echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" } @@ -52,7 +52,7 @@ __fzf_history__() { FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m --read0" $(__fzfcmd) --query "$READLINE_LINE" ) || return READLINE_LINE=${output#*$'\t'} - if [ -z "$READLINE_POINT" ]; then + if [[ -z "$READLINE_POINT" ]]; then echo "$READLINE_LINE" else READLINE_POINT=0x7fffffff @@ -66,7 +66,7 @@ bind -m vi-command '"\C-z": emacs-editing-mode' bind -m vi-insert '"\C-z": emacs-editing-mode' bind -m emacs-standard '"\C-z": vi-editing-mode' -if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then +if (( BASH_VERSINFO[0] < 4 )); then # CTRL-T - Paste the selected file path into the command line bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select__`\e\C-e\er\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"' bind -m vi-command '"\C-t": "\C-z\C-t\C-z"' |