Closed LangLangBart closed 2 months ago
The idea is that you can press SPACE if you want to type a keyword to search for, or just keep typing if you want to continue with the word you've already started. Have you tried that?
Using SPACE works also, but I then have to press this additional character.
In the GIF below, I try to complete a flag with "civ", and using no anchor suits me better.
When you type "-" and press TAB
, the list contains only entries that start with "-". From your sceencast it appears as if you expect it too include all things that contain "-". It just so happens that the entry you are looking for in the screencast both starts with "-" and contains it in the middle. This isn't common. Do you have another use case?
This isn't common. Do you have another use case?
When ignoring the case and making it not exact, it allows the description of the flag to be searched.
zstyle ':z4h:fzf-complete' fzf-flags --height '~20%' --ignore-case --no-exact
zstyle ':z4h:fzf-complete' anchored-match-comp-words false
The inserted ^
character was initially annoying when completing environment variables. Since fzf
uses smart-case by default, completing uppercase variables requires uppercase input; --ignore-case
addressed this.
Then, with flags for completion, it restricts itself to the exact word, so if you have typed the end of a long flag name, it won't show it to you, hence making the anchor optional.
Is that what you actually want to do?
Do you see my point? The anchor is there for a good reason.
Absolutely, I often see the point of including the anchor, but I find myself frequently annoyed by it, so I thought giving the user an easy option would be a good idea. However, based on your hesitation, I will maintain a local workaround and close this PR.
That's fine with me. I can merge it if you submit the PR. It's making things inconsistent but won't burden me with extra maintenance.
Description
This PR adds the ability to make the insertion of the anchored match character
^
in completions optional.Reason
For completing words, I prefer to have it disabled as I frequently press the
backspace
key and then enter words to search for a keyword in the description of flags. I thought adding an option would better serve my use case. Thecomp-files
widget was modified only for completeness sake.