-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Could Ctrl-T override .gitignore when starting from an ignored path? #2450
Comments
It works! (In Bash; not in zsh using the The built-in fuzzy-completion has the same root issue, though; either the underlying command uses I could of course just remember to use
to Actually, the
This takes forever because it indexes everything under Of course there may be unforeseen consequences with this I haven't considered. |
Here's some progress towards a more reliable version: get_start_dir() { echo "${@[-1]}"; }
dir="$(eval get_start_dir "$(echo "$LBUFFER" | rev | awk -F'\\|\\||&&|;' '{print $1}' | rev)")"
[[ -d "$dir" ]] && cd "$dir" This works by using a function to figure out what the final word on the command line is, respecting quotes and backslashes to escape whitespace. The |
CTRL-T is the simpler one that works without any context information, so we can easily configure its behavior with a static Fuzzy completion is a more generic version with much more complexity. Its behavior is determined by what you have typed so far on the command line and the position of your cursor;
|
Gotcha. Thanks for the explanation. Looks like the magic sauce I was looking for to handle whitespace is in
It thinks my command is (This is getting slightly bit off-topic; I could open a separate issue for this if you agree.) |
OK, thanks. Will let those other issues sort out the command thing then. Let's label this property, where Some observations/questions:
|
The prefix (e.g.
https://github.com/junegunn/fzf/wiki/Configuring-fuzzy-completion#dedicated-completion-key (zsh only) |
man fzf
)Info
Problem / Steps to reproduce
This is not a bug in
fzf
, but it's a non-optimal UX. I notice when I'm in my project root and I typeI see no matches. If instead I do
I see the expected files. This is obviously because my
FZF_CTRL_T_COMMAND
isag -g ""
, andag
is ignoring stuff in my.gitignore
, which includesnode_modules/
.Thing is, that's usually exactly what I want. But clearly when I type
$ ls node_modules/
I do want to search innode_modules/
. Is there any way this could be made to work, either with some fancierag
options (or a different command altogether), or by some modification to fzf (doingcd node_modules
behind the scenes, perhaps)?The text was updated successfully, but these errors were encountered: