diff options
author | xyz <gky44px1999@gmail.com> | 2021-11-01 16:01:32 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-11-01 16:01:32 -0700 |
commit | fceb79834e0bedb5c195d530da449c36c4d0d9ef (patch) | |
tree | b9e23058c731cffd6c84aed649a5a16a34fc8080 /home/xyz/.bashrc | |
parent | 9deeeb84723980bca83c589ea0bb7cf57777d292 (diff) |
bashrc zqui keybinding escape with single quotes
Diffstat (limited to 'home/xyz/.bashrc')
-rw-r--r-- | home/xyz/.bashrc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/home/xyz/.bashrc b/home/xyz/.bashrc index af46c839..f4653a03 100644 --- a/home/xyz/.bashrc +++ b/home/xyz/.bashrc @@ -84,8 +84,12 @@ zi () { } # steal from fzf: https://github.com/junegunn/fzf/blob/master/shell/key-bindings.bash +# READLINE_LINE and READLINE_POINT see `man bash` zqi_key () { - selected="$(zoxide query -i)" + # 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)'" READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}" READLINE_POINT=$((READLINE_POINT+${#selected})) } |