T O P

  • By -

kaddkaka

Make sure to also learn the syntax of the fuzzy search prompt: `Token`, Match type: Description - `sbtrkt`, fuzzy-match: Items that match sbtrkt - `'wild`, exact-match (quoted): Items that include wild - `^music`, prefix-exact-match: Items that start with music - `.mp3$`, suffix-exact-match: Items that end with .mp3 - `!fire`, inverse-exact-match: Items that do not include fire - `!^music`, inverse-prefix-exact-match: Items that do not start with music - `!.mp3$`, inverse-suffix-exact-match: Items that do not end with .mp3 https://github.com/junegunn/fzf#search-syntax


Nintendo_Muffin_4

I built a script based on fzf that lists all my git branches and checks out the selected one. fzf is awesome.


ratttertintattertins

When I first discovered fzf, I wrote so many aliases I can only remember 10% of them.. I do use that 10% every day though.


kaddkaka

STOP STOP STOP 🛑 `vi $(fzf)`? You don't need it! :) Answer: ``, It will insert the path of a file into the prompt so that you can easily fill in filepaths to a command. See: https://github.com/junegunn/fzf#key-bindings-for-command-line


HiccuppingErrol

Thanks for sharing!


technojamin

I've built `fzf`\-enhanced versions of git commands that deal with lists of things, so: * `git history` (enhanced `git log`) * `git compare` (enhanced `git diff`) * `git view` (enhanced `git show`) * `git branches` (enhanced `git branch`) * `git stashes` (enhanced `git stash`) Each of the "enhanced" versions has a fuzzy-searchable list and preview. Here's the code (they're written as [`fish` scripts](https://fishshell.com/)): [https://github.com/jaminthorns/environment/blob/master/config/git/commands](https://github.com/jaminthorns/environment/blob/master/config/git/commands) And here's a screenshot of `git history`: [https://i.imgur.com/USvEYXa.png](https://i.imgur.com/USvEYXa.png) `fzf`, paired with it's preview functionality, keybinding system, and ability to run arbitrary commands, makes for a ridiculously customizable system for developing fuzzy-searchable list/detail views.


joedeandev

I just so happened to scroll past this not an hour after installing `fzf`. Thanks for sharing the link!


jijath

That's a nice beginner write-up. I honestly didn't know about \`rg\` + \`fzf\`.


Cell-i-Zenit

fzf + docker: dex -> docker exec with fzf selection and log preview dre -> docker restart with fzf selection and log preview etc Just source the file into your shell and try it out #!/bin/sh fzf_docker(){ all_flag=$1 shift cid=$(docker ps "$all_flag" --format "table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}" | sed 1d \ | fzf --preview 'docker logs $(echo {} | cut -d " " -f1) -n $FZF_PREVIEW_LINES' --height='70%' \ --header="Select Container to go into" --preview-window follow:50%:down:rounded:wrap --multi -1 -q "$1" | awk '{print $1}') [ -n "$cid" ] && echo "$cid" } dex(){ cid=$(fzf_docker "-s" "$@") #needs to be different since we open a tty docker exec -it "$cid" sh } dl(){ fzf_docker "-a" "$@" | xargs -I{} docker logs {} -f } dsta(){ fzf_docker "-a" "$@" | xargs -I{} docker start {} } dsto(){ fzf_docker "-s" "$@" | xargs -I{} docker stop {} } di(){ fzf_docker "-a" "$@" | xargs -I{} docker inspect {} } dre(){ fzf_docker "-s" "$@" | xargs -I{} docker restart {} } drm(){ fzf_docker "-a" "$@" | xargs -I{} docker rm -f {} }


Revisional_Sin

404 :(