[mini.pick:grep] Live globs #2171
Replies: 2 comments 3 replies
-
|
Thanks for sharing! Looks useful indeed. My problem with "in query parsing" of this sort of information is that this requires a design to ignore it. For example, to actually search for a |
Beta Was this translation helpful? Give feedback.
-
|
I've updated the code to handle escaping properly and changed the behavior to toggle glob mode with Alternatively, the query could be split by commas (escaped as |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is an override of
MiniPick.builtin.grep_liveviaMiniPick.registry.grep_live.For easier navigation use #2169.
Glob mode (NEW!)
Description
The
<C-o>mapping is used to toggle a secondary mode that allows modifying multiple globs on the fly, rather than just adding them as in the defaultmini.nvimbehavior.Parsing notes
In
glob_mode, the query is split by spaces%s+. If you need to include a space delimiter, you must escape it with a backslash\:You can change the logic for parsing globs in the
parse_globsfunction. For example, instead of using a space () as the separator, you can use a comma (,) instead. For additional information, see #2171 (comment).Code
Glob in the query
Hide
Description
Write globs directly inside the input instead of using
<C-o>, because it’s easier to visualize changes immediately:Parsing notes
The trailing space at the end of the pattern is removed, so if you need a space in the pattern, use two spaces instead of one:
The globs pattern is split by commas
,, and empty globs are skipped. Also, each individual glob is trimmed by one space on both sides. Therefore, if you need an empty string at the start of the individual glob, use two spaces:Code
Beta Was this translation helpful? Give feedback.
All reactions