Comments (4)
It should be as straightforward as something like
fzf-tab-partial-and-complete() {
if [[ $LASTWIDGET = 'fzf-tab-partial-and-complete' ]]; then
fzf-tab-complete
else
zle complete-word
fi
}
zle -N fzf-tab-partial-and-complete
bindkey '^I' fzf-tab-partial-and-complete
but I'm not sure if it ideally should be a separate widget like the above, or a zstyle governing fzf-tab-complete
.
from fzf-tab.
TL;DR:
Use alt+enter
to print the partial match prefix.
After way too long, I notice this line (and later the wiki documentation for it):
126: -ftb-zstyle -s print-query print_query || print_query=alt-enter
Basically, a combination of print-query
=alt+enter
and query-string
=prefix
means fzf will auto-populate the query with the longest partial match prefix and pressing alt+enter
will autocomplete your command with the current query.
It's not perfect, it might add a space at the end or a slash if one of the matches is a folder.
And obviously "1st tab auto-completes to the partial match prefix, 2nd tab opens fzf" would be much more desirable.
But it does make life a bit easier without any modification to the existing code.
Relevant doco:
https://github.com/Aloxaf/fzf-tab/wiki/Configuration#print-query
from fzf-tab.
@rolandwalker That function doesn't work as intended when there is no common prefix:
from fzf-tab.
I would love this as well... Is there any (custom) solution out there that will enable this behavior? Thanks!
from fzf-tab.
Related Issues (20)
- [BUG] Void Linux: command not found: _complete HOT 1
- [FR] add aliased command to `$desc`
- [BUG] fzf-tab gives a weird error HOT 2
- Trouble getting fzf-tab to work without nvm [BUG] HOT 1
- [BUG] zsh: command not found: enable-fzf-tab HOT 1
- [FR] Allow to disable default bindings HOT 2
- [FR]
- [Q] Can tab complete to the longest common prefix, then open fzf? HOT 1
- [Q] can not use regex character, such as $ and . HOT 2
- [Q] Why does sourcing fzf-tab.zsh from a script cause syntax errors? HOT 1
- [Q] Some programs cannot be completed, how to solve it? HOT 1
- kitty +kitten icat works with FZF but does not work with fzf-preview [BUG] HOT 2
- [Q] Is there a quick way to tell whether build-fzf-tab-module has already been run? HOT 1
- Weird bash error in fzf-preview: "/bin/bash: line 2: zmodload: command not found" HOT 2
- [BUG] Fzf-tab not working for oh-my-zsh `aws` plugin when running commands like `asp`, `acp` HOT 1
- [FR] Could fzf-tab builds the binary without zsh source code like past? HOT 1
- [BUG] TAB key presses are reversed in specific scenarios when using `ftb-tmux-popup` HOT 6
- [Q] how to get color git Tab as shown in the Readme? HOT 1
- [BUG] source directory name confliction on case-insensitive filessytem such as APFS for macos HOT 3
- [Q] How to set the sort of all commands to most frequently used, not alphabetical?
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-tab.