3 ms·
When I am hacking something relatively simple together, I tend to do: echo '' | fzf --preview 'jq {q} < filename.json' This approach can be generalized to oth
by pawelduda 4y ago
When I am hacking something relatively simple together, I tend to do:
echo '' | fzf --preview 'jq {q} < filename.json'
This approach can be generalized to other tools, to some extent:
https://github.com/pawelduda/fzf-live-repl https://github.com/pawelduda/fzf-live-repl
- AviationAtom 4y agoYou kind of blew my mind with this simple concept. Going to see if I can incorporate it in my #kitbag
- ngorstein 4y agoOh woah, love this. Thanks for sharing. Will definitely be giving it a try.
- winter_squirrel 4y ago
- anjanb 4y agocan you explain what exactly is happening here
- corney91 4y agofzf is an interactive tool for fuzzy-finding and will take input from stdin. For example, `ls | fzf` will allow you to search through a list of files in your working directory. It also has an optional preview pane that can be used to show the output of a command. In this case, the empty string is provided as input because we're not interested in selecting options. You can then type your jq filter in fzf's query box and the command will run against filename.json in the preview pane on every kepress (the {q} is your currently typed query).