Comments (9)
I'm assuming you're a bash user, and you can set it up as explained in https://github.com/junegunn/fzf?tab=readme-ov-file#supported-commands
from fzf.
I know, what I suggested is to add it to the built-in command completions.
from fzf.
I see, but if we add more commands to the default list, the time it takes to load the script increases accordingly, and it affects the other users who don't really use pytest (which I'm one of them), so I'm reluctant to grow the default list beyond a set of universal tools.
from fzf.
I see, but then I don't understand why I'm having python and java already registered, since I don't use java either.
from fzf.
Yeah, it's already not ideal, so let's not make it worse.
from fzf.
Having said that, maybe we could provide path
as the default completion.
https://stackoverflow.com/a/49069150/755334
from fzf.
complete -D -F _fzf_path_completion -o default -o bashdefault 2> /dev/null
Hmm, unfortunately, this will likely break bash-completion, which sets its dynamic completion loader as the default completion function.
from fzf.
__fzf_default_completion() {
__fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@"
if [[ $? -eq 124 ]]; then
_fzf_setup_completion path "$1"
return 124
fi
}
complete -D -F __fzf_default_completion -o default -o bashdefault 2> /dev/null
This version works slightly better, that it handles dynamic completion loader.
# No completion is defined
complete | grep pytest
# Fuzzy completion works
pytest **<tab>
# Regular completion; triggers dynamic completion loader
pytest <tab>
# Completion function for pytest is loaded
complete | grep pytest
# complete -F _comp_cmd_pytest py.test
# complete -F _comp_cmd_pytest py.test-3
# complete -F _comp_cmd_pytest py.test-2
# complete -F _comp_cmd_pytest pytest-3
# complete -F _comp_cmd_pytest pytest-2
# complete -F _fzf_path_completion pytest
# Fuzzy completion still works
pytest **<tab>
# Regular completion also works
pytest <tab>
# However, fuzzy completion for pytest-2, pytest-3, etc stops working
pytest-2 **<tab>
from fzf.
See #3958
from fzf.
Related Issues (20)
- Commit 83b60339 broke use of pbogut/fzf-mru.vim plugin HOT 6
- arrow up keybinding is showing no scrollable list HOT 11
- unknown option --no-tmux error HOT 1
- consider adding `--head` option? HOT 1
- Security Alert: Potential Trojan Detected in Windows Release v0.54.1 HOT 5
- [Feature Request] Line numbers for selectable results HOT 4
- Fzf 0.54.1 mac arm64 release contains a `._fzf` file HOT 3
- Using `FZF_POS` has a high impact on performance HOT 6
- Change tagline
- Request: Add a match whole word option HOT 3
- FZF + interactive RipGrep deadlock HOT 5
- Fzf window not showing in process substitution using zsh HOT 1
- `fzf --tmux bottom` opens tmux popup on the top HOT 5
- Impossible to get "sudo su" to be prioritized HOT 4
- Wrong list scrolling with --read0 and --height HOT 2
- Help creating custom fuzzy seach command script. HOT 1
- Requires tmux 3.2 or above not only popup window
- Support comments within FZF_DEFAULT_OPTS_FILE content HOT 2
- Matching with word boundaries HOT 7
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.