Comments (8)
for example,
cd <TAB>
doesn't invoke fzf
Try
cd ** <TAB>
or modify FZF_COMPLETION_TRIGGER
1
export FZF_COMPLETION_TRIGGER=""
cd <TAB>
Lines 322 to 326 in c4a9ccd
Footnotes
from fzf.
The completion widget from zsh4humans
goes much further with its functionality, allowing for the things you desire, like completion of env variables and CLI arguments.
![](https://private-user-images.githubusercontent.com/92653266/341983279-246bce43-6529-4f34-bece-ee2f08d05cb8.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExNDgzMjMsIm5iZiI6MTcyMTE0ODAyMywicGF0aCI6Ii85MjY1MzI2Ni8zNDE5ODMyNzktMjQ2YmNlNDMtNjUyOS00ZjM0LWJlY2UtZWUyZjA4ZDA1Y2I4LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDE2NDAyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ1NTAxN2M3ZThlZDQ3MmM2MDI1YzQyODgxNjQxNDE4ODFjOGE1MjJhNmIyMzQ4NTRhMzU2ZDgwNTZjODIzNDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vkCHLFKyTlg9awFqPNw3ejuyrewb-UhdHbCX-vkuM7Q)
The fzf
completion widget is kept minimal for a reason.
Related comment by the maintainer:
There is some customization one can easily do for additional commands, for example doge
1.
![](https://private-user-images.githubusercontent.com/92653266/341983463-4f02df9e-5c3d-4ee2-a5fc-abbd05b444f2.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExNDgzMjMsIm5iZiI6MTcyMTE0ODAyMywicGF0aCI6Ii85MjY1MzI2Ni8zNDE5ODM0NjMtNGYwMmRmOWUtNWMzZC00ZWUyLWE1ZmMtYWJiZDA1YjQ0NGYyLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDE2NDAyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE4ZjU4ZDU5ZmIyNWEzYWJiNjNkOGQ1ZTA1NTI3NzJjOTljM2JlYzRhNmExODQ5ZGEwZTFkZmEzYmZjYzhlMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._LJS_iCTctWbzln0g83px18nHQyjJpc8WcAxLQ0CFTU)
But completion of environment variables or CLI arguments seems to require more changes to the actual *zsh
file. Usually, one has to write it themselves or use popular plugins.
Footnotes
from fzf.
Thank you @LangLangBart that works. I came across this video in the meantime that mentions FZF_COMPLETION_TRIGGER
as well, but I would struggle to find out whether setting it to an empty string is a supported use case. I couldn't find it set explicitly in my current zsh framework (z4h), so thank you.
Can I ask you by the way if you know how to set it to also fuzzy search completion of command line arguments? It doesn't seem to work right now when I try to get information on ls
flags for example:
ls -<TAB>
but it also didn't work when I tried:
ls -**<TAB>
so is it not supported out of the box by fzf's completion.zsh
script?
from fzf.
also is there a list of completions that fzf-completion
supports? kill is supported for example (kill <TAB>
), but variables don't seem to work (echo $FZF_<TAB>
)
from fzf.
zsh framework (z4h),
I use zsh4humans
as well, what is the output of the following command ?
bindkey | grep -F '^I'
try
z4h bindkey z4h-fzf-complete Tab
from fzf.
sorry, I've used z4h on the previous machine, but I'm trying to write .zshrc from scratch now (hence confusion)
on z4h Tab triggers fzf completion out of the box, but when sourcing fzf zsh scripts without any framework, while export FZF_COMPLETION_TRIGGER=""
does work for path completions (e.g. cd <TAB>
) it still doesn't seem to complete in some contexts that worked in z4h (e.g. echo $FZF_<TAB>
or ls -<TAB>
mentioned above)
from fzf.
Perfect, thank you. That explains a lot. The lines between the z4h framework and fzf weren't clear to me until now.
I will see if it will be worth installing something like fzf-tab to compensate for missing completions.
I've also noticed that export FZF_COMPLETION_TRIGGER=""
now breaks some zsh completions - instead of listing the usual completions on ls -<TAB>
for example fzf kicks in showing file names (instead of flags and their explanations).
One might argue though that ls --help | fzf
would yield the same or even better result. So I might just stay with vanilla fzf's completion.zsh in the end
from fzf.
I've decided to give fzf-tab a try - the author seems to have thought the problem through well and the first attempts at running it showed a lot of desirable properties (straightforward frontend to the zsh's default compsys; simple zsh codebase). Maybe it will turn out not to be as "robust" as completion integration in zsh4humans, but fingers crossed it will work for my use cases.
from fzf.
Related Issues (20)
- Allow CTRL-C to cancel transform actions
- --marker '═' --marker-multi-line '╔║╚' does not take effect? HOT 1
- "panic: runtime error" if tty is 1 line high HOT 1
- panic: runtime error: invalid memory address or nil pointer dereference HOT 21
- fzf `CTRL+R` only working in zsh `vicmd` mode HOT 1
- Crash when piping output from node/nodemon web server HOT 6
- Running `fzf -f whatever` with an `i3` keybinding fails HOT 1
- Re-evaluate --bind each time bindkey pressed HOT 1
- Select candidate if it's multi lines? HOT 1
- Option to show --marker and --marker-multi-line if it's multi lines? HOT 1
- Constraint to only exit fzf if processes base on key press are done? HOT 6
- History search not working HOT 7
- fzf executing before sudo prompts for password HOT 1
- How to restore old execute behavior? (so it doesn't output to /dev/tty) HOT 2
- [Feature] Enhance ctrl-t behaviour
- `--bind=… execute` works differently in 0.53.0, breaks functionality HOT 1
- Repository tag name HOT 1
- Allow filtering on un-rendered fields. HOT 2
- Cygwin reports ps: unknown option -- o for wildcard completion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fzf.