-
Notifications
You must be signed in to change notification settings - Fork 40
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
[Feature Request] Option to direct cd bookmark in case of exact match #53
Comments
Hi, Many thanks for the feedback. In my configuration I define # You will need to change the first line
FZF_MARKS_PLUGIN_ZSH=$HOME/dotfiles/plugins/fzf-marks/fzf-marks.plugin.zsh
source "$FZF_MARKS_PLUGIN_ZSH"
FZF_MARKS_COMMAND="$FZF_MARKS_COMMAND -e -n 1'" The option |
Thank you for the suggestion. Hmm FZF_MARKS_COMMAND="$FZF_MARKS_COMMAND -e -n 1'" is not valid because the single quote before the last double quote. I would assume that you mean FZF_MARKS_COMMAND="$FZF_MARKS_COMMAND -e -n -1'" I'm not sure what the the -1, --select-1
If there is only one match for the initial query (--query), do not start interactive finder and automatically select the only match
[...]
-n, --nth=N[,..]
Comma-separated list of field index expressions for limiting search scope. See FIELD INDEX EXPRESSION for the details.
[...]
FIELD INDEX EXPRESSION
A field index expression can be a non-zero integer or a range expression ([BEGIN]..[END]). --nth and --with-nth take a comma-separated list of field index expressions.
Examples
1 The 1st field
2 The 2nd field
-1 The last field When using this
However if I remove the FZF_MARKS_COMMAND="$FZF_MARKS_COMMAND -e -1'" it works slightly better. With this, jump is done directly to exact match, but only if there are no other matches. E.g. with marks $ fzm abc # Jumps directly to destination of abc
$ fzm def # shows fzf selection window with result def & defg. However is exact match and should jump to def destination directly! Edit.I figured that you maybe meant FZF_MARKS_COMMAND="$FZF_MARKS_COMMAND -e -n 1 -1" which with spelled out long-names is FZF_MARKS_COMMAND="$FZF_MARKS_COMMAND --exact --nth=1 --select-1" However the behavior is still the same that an initial query for an exact bookmark |
Hi, Sorry, I responded a little bit too fast. It is indeed the I also understand your issue better: you would like the plugin to auto-accept on exact match even if the initial query is an exact substring of one of the other marks. It's not unreasonable, and I'll take a look at this when I get the time.
Yes, just set |
Exactly! :). As maybe not everyone would like this behavior, I think it could be an opt-in e.g.
Just perfect. Now I can continue using ctrl+d consistently in all fzf-plugins. Thanks! |
Hey,
first thank you for this cool plugin!
As I just started to use it I already noticed a part of my workflow from a previous shell plugin manager that did not translate well to fzf-marks for me. If I type
$ fzm abc
and there are many bookmarks who's bookmark name matches abc, it's completely reasonable to open up the FZF selector window (current behaviour).However in the case it's already an exact match of a bookmark, that is I have a bookmark with name
abc
, I would expect that I directlycd
to that bookmark instead of showing suggestions for other partial matches.This is important to be able to work fast in the shell. If I know that I want to go to bookmark
abc
, then$ fzm abc
should be enough to take me there. Currently the window will pop up on a exact name match and I need to press enter to go there.As this is maybe not the behaviour that everyone desires, I would propose that we introduce a new opt-in configuration option:
FZF_MARKS_JUMP_EXACT_MATCH
false
fzm
, cd to bookmark directly if the optional-initial-query is an exact match for a bookmarkThe text was updated successfully, but these errors were encountered: