-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: ctrl-t start with current word in search #4276
Comments
Have you tried using fuzzy completion? i.e.
This is quite different from our current recommendation. Could you share how you ended up with it? |
I probably invented I removed that and tried with In a folder with this content:
|
Does |
Yes, it shows a function: $ complete | fzf
complete -F _firefox firefox
$ declare -f _firefox
_firefox ()
{
local cur prev words cword split;
_init_completion -s || return;
[[ $cur == -MOZ_LOG*=* ]] && prev=${cur%%=*} cur=${cur#*=};
case $prev in
--help | --version | --display | --UILocale | -MOZ_LOG | --new-window | --new-tab | --private-window | --window-size | --search | --start-debug
return
;;
--profile | --screenshot)
_filedir -d;
return
;;
-MOZ_LOG_FILE)
_filedir log;
return
;;
--recording-file)
_filedir;
return
;;
--debugger | -d)
COMPREPLY=($(compgen -c -- "$cur"));
return
;;
esac;
$split && return;
if [[ $cur == -* ]]; then
COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur"));
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace;
return;
fi;
_filedir "@(?([xs])htm?(l)|pdf|txt)"
} |
That explains. In bash, fuzzy completion only works for a predefined set of commands and commands with no completion defined. Because firefox has its own completion in your environment, fuzzy completion is not triggered. To enable fuzzy completion for |
Checklist
man fzf
)Output of
fzf --version
0.58.0 (65db735)
OS
Shell
Problem / Steps to reproduce
This is a new request for an existing closed issue: #3195 "Option for Ctrl-T to use current command-line content as a search pattern"
I believe I have a usecase that wasn't discussed in the previous issue where invoking ctrl-T and using the current WORD as a starting point would be useful: Opening png files with firefox.
The issue is that firefox tries to be helpful and among the completions doesn't include files it thinks you don't want to open. Example:
Result: potato.png does not get completed.
My FZF configuration:
Firefox does support opening png:s so this is arguably an issue with firefox, but it would be nice to circumvent it by invoking ctrl-t as described here.
Questions: Are there situations when one would prefer that
[a-z/]
followed by<TAB>
doesn't include the current word in the search pattern?The text was updated successfully, but these errors were encountered: