-
Notifications
You must be signed in to change notification settings - Fork 126
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
Cannot install when current directory is not $HOME #57
Comments
…ent directory instead of $HOME; see #57
Thanks for the report! Fixed. By the way, there are a few things in zsh4humans that you might want to copy over to fzf-tab. At some point I wanted to upstream them but when I stopped using fzf-tab it was harder to justify the time cost for doing so. It's also hard work because fzf-tab has a lot of users, so backward compatibility is a thing. There is a stream-based file colorized that's very fast. You can try it within z4h by pasting this: # usage: colorize context
function colorize() {
[[ -o list_types ]]
local -i list_types=$((! $?))
-z4h-set-list-colors "$1" $list_types
local -i list_colors=$((! $?))
-z4h-present-files $list_colors $list_types
} And running it like this: find . | colorize :complete:ls:: This outputs two columns separated by The way you can customize fzf is nice. See When completing files, directories are recursed automatically. These completions appear below the normal ones. Suffix match in fzf (e.g., There is no Tab inserts unambiguous prefix automatically. If you set The query in fzf is based on the command line and not on the longest prefix among completion candidates. This way, if you have The support for groups is completely lost though. It's possible to add them but I couldn't design a UI that would work well. |
One more thing. If you'd like to switch to zsh4humans, check out #35. It's super long but has a ton of useful info for advanced users. The default At the very least please read #35 (comment). I'd love to have you onboard and would welcome feedback and bug reports from you! |
Yes. I am very interested in it. But this may take much time since I have lots of things to do but little free time.
That's amazing. I will look into it later to check whether I can replace zsh-ls-colors with it.
Nice design! I always regret putting all parameters together, it exposes all parameters to users and makes it hard for me to add/remove parameters.
I'd like to use fd + zsh-tmux-capture here. Listing all files seems messy.
To be honest, I haven't used suffix match before. I use This may be useful when combining with the feature above (directories are recursed automatically).
That's really nice! I will also look into it later.
That's good. I think it is time for me to fix Aloxaf/fzf-tab#8...
Yes, my ideal UI is like Another approach is Aloxaf/fzf-tab#127 (comment). But this need users to write code themselves.
Thanks! This project is awesome. I will try it more later and decide whether I can switch my configuration to zsh4humans. Your project inspired me a lot! I really should remove some rarely used features from fzf-tab to reduce its complexity and speed. It used to be simple, but now it is very compelx and not so efficient. Streaming completion is cool. But it's getting more and more hard for me to implement it since I have built too many functions on the top of this feature (like Aloxaf/fzf-tab#130). I think I won't implement it in the short term. |
It won't be easy because the new API is stream-based. This works in z4h because I colorize completion candidates only when all of them are files. In fzf-tab you colorize files even if not all candidates are files (this is extremely rare in practice).
Initially I was afraid of this myself but now I like this a lot. Since the normal completions are always displayed at the top, the recursive completions are extra. If you don't want them, they are easy to ignore. On the other hand, I'm now frequently relying on "deep completion". E.g., when I want to look at a
Indeed, searching becomes more important when you have a lot of files to choose from. Suffix match is not only for extensions though. It's just is a fast way to trim the number of matches.
This one may not be possible to implement in fzf-tab, or at least not as nicely as in z4h. This is because z4h has full control over all widget-wrapping plugins such as zsh-syntax-highlighting, zsh-autosuggestions and powerlevel10k. This control has a ton of advantages. E.g., in z4h highlighting is correct in corner cases where it would be wrong when using zsh-syntax-highlighting with zsh-autosuggestions in the officially approved way. In addition, highlighting is twice as fast.
Wow! This is super cool!! I don't use tmux because I really like having native terminal scrollback, so I cannot just use |
So embarrassed, it seems that all the features I am interested in is hard to port to fzf-tab. I planned to port more part of fzf-tab to C to imporve its speed. LOL, It seems that we finally go to two different paths.
That sounds attractive. I will give it a try. It's a pity that fzf-tab has no chance to integrate it (at least, in the short term). BTW, a compromise solution is using
Yes, I also don't like tmux at first. It invalidates some special features of the terminal emulator--if you use tmux, all terminal emulator will have nearly the same experience. I started use it just because alacritty doesn't support splitting window. Your solution is interesting. I will waiting for you finish it. |
I'm not sure we are taking different paths. Moving stuff to C is definitely on the table in zsh4humans. In fact, it's much easier to do in zsh4humans than in fzf-tab. fzf-tab currently doesn't have the machinery to ship compiled binaries and cannot utilize zsh modules. I know you are providing a script to compile a zsh module locally but this is both cumbersome and unreliable. Zsh modules have no stable ABI, so they only work with the same version of zsh compiled with the same libc and the same compiler flags. Since fzf-tab has no control over how the local zsh was compiled, it cannot produce a module that would be compatible with it. z4h has several tools that make it much easier to utilize native code. There is infrastructure for building and releasing naively compiled binaries for all popular architectures. E.g., the latest release of gitstatusd has binaries for 12 architectures: https://github.com/romkatv/gitstatus/releases/tag/v1.3.1. z4h can install zsh if necessary. This allows zsh4humans to put requirements on the local zsh that are infeasible for a regular zsh plugin. Right now z4h code can assume the following:
If at least one of these requirements is not satisfied, z4h simply installs its own zsh. That last requirement about terminfo means that you can use a terminal with an exotic terminfo (Alacritty, Kitty, Termite, etc.) without suffering the consequences. When you The list of requirements can be easily extended. E.g., z4h can require a custom zsh module. z4h also has the infrastructure to patch its dependencies similar to how Linux distributions maintain patches for their packages. E.g., syntax highlighting is much faster in z4h thanks to custom patches. The same approach can be used to add features to fzf if required. Since z4h has control over the "packages", it can provide custom plumbing that integrates them better than when each part is left to their own devices. Syntax highlighting, autosuggestions, completions and prompt are all integrated manually in z4h. This yields better performance, smoother rendering and fewer glitches. Think of the issues you've faced in fzf-tab with widget wrapping done in the wrong order, the defensive Overall, building a nice shell experience is easier in z4h than in a plugin like fzf-tab. It gives you (as a developer) so much more freedom in terms of tools you can use. The downside is that it's a much larger project, requiring more time and effort to maintain and develop. |
Disscussing with you inspires me again! In fact, I doesn't need to stick with zsh module. I can write a custom fzf which can process the output from _ftb_compadd directly. In this way, I don't need to use C anymore (I love Rust) and streaming completion is also possible. I can even write a new UI to support groups. |
This sounds awesome! Whether you'll end up with a special binary tailored for displaying zsh completions, or an extended fzf with new generally-useful capabilities, this can have dramatic improvements on zsh UX. Cannot wait to see what you come up with. |
You always create impressive projects. 👍
Full log:
The text was updated successfully, but these errors were encountered: