Fzf – a command-line fuzzy finder
61–70 of 93 posts
Re: Fzf – a command-line fuzzy finder
#62Here they are some alternatives: https://www.libhunt.com/junegunn/fzf
Re: Fzf – a command-line fuzzy finder
#63It has replaced vim’s “open file” and “switch to buffer” for me. I occasionally use it in the command line, by expanding *. Not that often as in Vim, but very useful. I still need to find a satisfactory way to do “find in files” with vim. I use a custom script to call ag and it’s enough, but a bit clunky at times.
If you're using fzf.vim ( https://github.com/junegunn/fzf.vim ) then you can use :Rg or :Ag. This will run ripgrep or silver-searcher and present the results in a fuzzy finder window.
I also use vim-grepper (mapped to leader-g) for finding in files and populating the quickfix list.
Re: Fzf – a command-line fuzzy finder
#64If you still don't know how useful fzf is, you should start with integrating fzf and ctrl+r (reverse search).
I tried it, and removed the next day. In my experience it's too fuzzy, and makes it impossible to find anything.
~/books_and_papers/causal_inference.pdf
^^ ^ ^^ ^ ^^^Re: Fzf – a command-line fuzzy finder
#65It has replaced vim’s “open file” and “switch to buffer” for me. I occasionally use it in the command line, by expanding *. Not that often as in Vim, but very useful. I still need to find a satisfactory way to do “find in files” with vim. I use a custom script to call ag and it’s enough, but a bit clunky at times.
For find and replace, I use spectre.
Re: Fzf – a command-line fuzzy finder
#66It has replaced vim’s “open file” and “switch to buffer” for me. I occasionally use it in the command line, by expanding *. Not that often as in Vim, but very useful. I still need to find a satisfactory way to do “find in files” with vim. I use a custom script to call ag and it’s enough, but a bit clunky at times.
You can use zsh's fzf-tab as a supercharged tab-completion. e.g. you can just do
some-command
and it will put a fzf interface where the tab-completions would usually be, and you can pick whatever files you want. And if you instead do some-command -
it will instead show you all the possible flags and their descriptions, which you can also pick from.I use this all the time on the terminal now. It cuts out so much pointless flow-breaking invocations of ls and man and --help.
Re: Fzf – a command-line fuzzy finder
#67Another wonderful tool is "entr". It just runs a program when files change. It's incredible. I use it 20-40 times an hour to do very fast Dev/DevOps development: - "run Pytest when Python files change" - "I forgot how to use ps, run my-ps.sh when it changes and show me the output" - "rebuild all these Kubernetes resources when I edit the YAML files" - "run fast lint, then unit test Python files, then invoke one and s…
I use https://watchexec.github.io/ for this, which looks similar. Anyone who tried both and knows which one is better?
Re: Fzf – a command-line fuzzy finder
#68It has replaced vim’s “open file” and “switch to buffer” for me. I occasionally use it in the command line, by expanding *. Not that often as in Vim, but very useful. I still need to find a satisfactory way to do “find in files” with vim. I use a custom script to call ag and it’s enough, but a bit clunky at times.
I bind Ctrl-J to ":Ag " so I'll simply have to type in roughly what I'm searching for and then get the pop-up to refine the search and do selections. I imagine you have a similar approach, what's clunky about it for you?
Re: Fzf – a command-line fuzzy finder
#69Another wonderful tool is "entr". It just runs a program when files change. It's incredible. I use it 20-40 times an hour to do very fast Dev/DevOps development: - "run Pytest when Python files change" - "I forgot how to use ps, run my-ps.sh when it changes and show me the output" - "rebuild all these Kubernetes resources when I edit the YAML files" - "run fast lint, then unit test Python files, then invoke one and s…
I just use inotifywait for that. What does entr do differently? This will run a binary when any file on the directory tree changes: #!/usr/bin/env sh set -e while true; do inotifywait -e modify,create,delete,move -r $1 $2 done and then just call it: run_on_modify path/to/dir path/to/bin If someone thinks this is magic or wizardy, instead of teaching them that fire exists (entr), teach them how to make fire first (ino…
You can improve the basic loop somewhat, but a more thoroughly written program (whatever the language) rather than a 3 LOC loop is going to have more features and be more ergonomic. In particular, to truly be useful, it should be able to kill the command and restart it every time the file is saved.