You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to be able to see the buffer narrowing as you type (and perhaps have tab-completion). Wrapping calls to jq in something like this would get you part of the way there, but you'd then need to reconstruct the original query:
.|with_entries(select(.key|match("^foo.*")))
*Of course, this breaks lists
The text was updated successfully, but these errors were encountered:
Let me illustrate my request with an example. Say you have a JSON file:
{"foobar": 1, "foobaz": 2, "fooquux": 3}
Currently if you type .foob, the buffer shows null. But ideally, it should wrap your query in .|with_entries(select(.key|match("^foob.*"))), so that as you type, the buffer gets narrowed to {"foobar": 1, "foobaz": 2}. You can then press a key (say, C-c C-c) to unwrap your query back to .foob, or have it done when you type a |.
From this, tab completion comes naturally. The query can be completed to the greatest common prefix using the list of matching keys.
I'll get to implementing this sometime soon. Of course, it will be configurable, and probably off by default.
It would be great to be able to see the buffer narrowing as you type (and perhaps have tab-completion). Wrapping calls to
jq
in something like this would get you part of the way there, but you'd then need to reconstruct the original query:*Of course, this breaks lists
The text was updated successfully, but these errors were encountered: