flutter_ecommerce_app
flutter_ecommerce_app copied to clipboard
Invoke fzf with tab completion in zsh
I understand that you can use tab completion in both zsh
and bash
. For bash
, you can change the z.lua initialisation to invoke fzf
, but this doesn't seem to work for zsh
.
(I don't run bash
, but if I understand correctly, z -I foo
works the same as the bash
tab-completion.) Using fzf
lists the candidates in order of frecency. However, the zsh
tab-completion appears to list candidates in alphabetical order instead. Is it possible to make the zsh
tab-completion use fzf
?
The bundled zsh plugin doesn't auto-detect fzf installation. z.lua.plugin.zsh#L25
How about auto use fzf when it's found in the path, or add an option to let the user choose.
The bundled zsh plugin doesn't auto-detect fzf installation. z.lua.plugin.zsh#L25
How about auto use fzf when it's found in the path, or add an option to let the user choose.
Sorry, I was wrong, it's not the zsh plugin's problem, the Lua code does not contain init script for zsh fzf complete.
According to FZF's wiki, define a function _fzf_complete_z
may help, but it seems to have a limitation, users have to type the complete trigger (default to **
) then press tab to trigger completion. I'll take some more research to see if I can make a pull request.
I find this plugin fzf-tab, turn default zsh complete menu to fzf. Solved my problem.
Thanks for the comments @mmqmzk . Unfortunately fzf-tab is a bit too much for me. I don't want to replace tab-completion everywhere! Hopefully this is useful for other people though.