diff options
author | xyz <gky44px1999@gmail.com> | 2021-11-06 00:42:04 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-11-06 00:42:04 -0700 |
commit | 1429d9bdf446c2d6272925a4dc029215a24ea81b (patch) | |
tree | cb868c75bdf8d45e1a369c3e2c9010a9ddbf7736 /home/xyz/.bashrc | |
parent | ea1d5f4388a793ea1c1c1d13b978fe7881147789 (diff) |
use printf %q
Diffstat (limited to 'home/xyz/.bashrc')
-rw-r--r-- | home/xyz/.bashrc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index 1812f253..070f969c 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -79,7 +79,8 @@ alias zqi='zoxide query -i' # all green color, no auto turn off color when pipe to nvim #alias pactree='pactree -c' -eval "$(zoxide init posix --hook prompt --no-aliases)" +#eval "$(zoxide init posix --hook prompt --no-aliases)" +eval "$(zoxide init bash)" z () { __zoxide_z "$@" && l @@ -93,9 +94,8 @@ zi () { # READLINE_LINE and READLINE_POINT see `man bash` zqi_key () { # fzf uses printf '%q' to escape output, but attention %q is not POSIX - # well we use bashism here so whatever, but use single quotes here also seems work fine so whatever - # maybe consider deal with FZF_DEFAULT_COMMAND not escape path at .profile instead - selected="'$(zoxide query -i)'" + # well we use bash here so whatever + selected=$(printf '%q ' "$(zoxide query -i)") READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}" READLINE_POINT=$((READLINE_POINT+${#selected})) } |