Comments (4)
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 -e
enables exact matching, and the option -1
enables auto-accept when there is only one match. Might this solve your issue?
from fzf-marks.
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 -n
is supposed to do. From the fzf manual I see
-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 FZF_MARKS_COMMAND
above,
- Bookmarks are not found at all
They are actually being deleted from themarks
file after failed lookup (!!). I needed to add my bookmarks back many times trying this out.- Turns out that I usually do ctrl+d to close/discard fzf selection. However in fzf-marks, ctrl+d means delete mark. Is there a way to change this to another key combination? :P It would be nice if fzf selection window consistently as usual.
However if I remove the -n
to make it
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 abc
, def
, defg
$ 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 def
still shows selection window for def
& defg
instead of going to def
directly
from fzf-marks.
Hi,
Sorry, I responded a little bit too fast. It is indeed the -1
flag, which is enabled by default in the code of the plugin, that is responsible for the "auto-accept on exact match" behavior.
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.
Turns out that I usually do ctrl+d to close/discard fzf selection. However in fzf-marks, ctrl+d means delete mark. Is there a way to change this to another key combination? :P It would be nice if fzf selection window consistently as usual.
Yes, just set FZF_MARKS_DELETE
to the key you want to use.
from fzf-marks.
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.
Exactly! :). As maybe not everyone would like this behavior, I think it could be an opt-in e.g. FZF_MARKS_JUMP_EXACT_MATCH=true
Yes, just set
FZF_MARKS_DELETE
to the key you want to use.
Just perfect. Now I can continue using ctrl+d consistently in all fzf-plugins. Thanks!
from fzf-marks.
Related Issues (19)
- Adding bash install instructions HOT 5
- Unwanted indent after deleting the last mark
- Use `fzf --expect` to delete and jump to mark with same keybinding
- Dup marks HOT 17
- readlink -f is not portable HOT 8
- Upgrade fzf min version ('fzf --header') HOT 1
- Fish shell plugin is currently broken HOT 13
- front end to fzm HOT 5
- (Feature Request) Open marked files with default $EDITOR HOT 5
- fzf-marks.plugin.zsh:177 command not found: compdef HOT 3
- Use case with tmux - add new window based on marks HOT 1
- (feature request) Inserting marked directory in cmd rather than jump to it HOT 2
- fzf-marks complains if FZF_MARKS_FILE points at a readonly file HOT 2
- [Feature Request] Move to the next line item automatically on ctrl-t(toggle) HOT 4
- could not delete multiple marks, and not showing delete marks HOT 1
- keybinding disable HOT 1
- cd hooks aren't triggered after jumping HOT 2
- The last 3 lines of output are cut off
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-marks.