From 61d9a73873a38b72ebfeb1cb3f511f66291e0ece Mon Sep 17 00:00:00 2001 From: BarbUk Date: Sun, 10 Feb 2019 11:47:09 +0400 Subject: [PATCH] Replace /home/barbuk by ~ and complete with frequency --- z.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/z.lua b/z.lua index 78bdcbc..0a50f80 100755 --- a/z.lua +++ b/z.lua @@ -1883,9 +1883,7 @@ if [ "$TERM" != "dumb" ] && command -v fzf >/dev/null 2>&1; then _zlua_fzf_complete() { local query="${COMP_WORDS[COMP_CWORD]}" - local selected=$(_zlua --complete | $zlua_fzf --query "$query") - - printf '\e[5n' + local selected=$(_zlua | sed "s|$HOME|\~|" | $zlua_fzf --query "$query") if [ -n "$selected" ]; then COMPREPLY=("$selected") @@ -1938,7 +1936,7 @@ function z_shell_init(opts) end print(script_complete_bash) if opts.fzf ~= nil then - fzf_cmd = "fzf --reverse --inline-info +s" + fzf_cmd = "fzf --nth 2 --reverse --inline-info +s --tac" if not os.getenv('_ZL_FZF_FULLSCR') then fzf_cmd = fzf_cmd .. ' --height 35%' end