Skip to content
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

Improve auto-completion of filenames #2547

Open
benjaminweb opened this issue Nov 13, 2015 · 4 comments
Open

Improve auto-completion of filenames #2547

benjaminweb opened this issue Nov 13, 2015 · 4 comments

Comments

@benjaminweb
Copy link

There are file1.py and file1_test.py only.

hg add file1.py file1…

There, fish could see that file1.py has been provided earlier.
As it makes no sense to repeat the same file name, fish could auto-suggest file1_test.py.

@eush77
Copy link
Contributor

eush77 commented Nov 13, 2015

Counter-example:

$ seq 1 5 >one
$ seq 1 2 10 >two
$ cat one two two |sort |uniq -u
2
4

Suppose you have another file two_something in the same directory, then Fish auto-completing two the second time to two_something would make it harder to select just two.

@faho
Copy link
Member

faho commented Nov 13, 2015

Yes, this isn't something that could be enabled for all completions - there would need to be a way to opt-out or opt-in (I think opt-out might be okay for file-completion).

It also can't be done for all kinds of completions in general, since e.g. options might be specified multiple times (rather common for "-v" or "--verbose" options).

Doing it correctly would also be suprisingly hard - since filenames are almost completely unrestricted on UNIXy systems, and since there's quite a variety of cases in which something that looks like a filename may appear in a different context. Long story short: This would pretty much require something like #478.

For suggestions, however, which don't need to be 100% correct - only very likely to be, I think it'd be okay to enable, even without an option to disable.

@pickfire
Copy link
Contributor

Yeah, I would like this features sometimes althought it could cost a bit of performance.

I would be nice to just ignore the repeated pattern for some command so that it doesn't affect mv file.txt file.txt.old.

@benjaminweb
Copy link
Author

I specifically address this case: file1.py file1_test.py
+1

@zanchey zanchey added this to the fish-future milestone Feb 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants