![]() I just learned how to better to search/find-and-replace in multiple files from you.Ripgrep (command name rg) is a grep tool, but supports search and replace as well. You're probably familiar with these as one of your links discusses fzf and ripgrep. change to a project directory (can't remember where): $ cd ** (followed by tab).search all files in current working directory (with ripgrep): $ rg -files | fzf.open file in vim anchoring from a directory: $ vim foo/bar/** (followed by tab).open file in vim that is somewhere from current working dir: $ vim ** (followed by tab).If you're using bash along with fzf's bash/zsh-completion, it provides globbed search that you can prefix with many Unix utilities including ripgrep: I'd been using fzf for a couple years in Vim, but it was only recently (beginning of the year) that I discovered its powers as a CLI utility. Shameless disclaimer: if you enjoy this, there's a 98.39% (not scientifically proven) you will also enjoy my Vim Cookbook: Gourmet Vim. optimizing your workflow with fzf and ripgrep.How FZF and ripgrep improved my workflow.Once everything is set up, we can now search quickly in Vim like modern editors/ IDEs. I also shared some tips to perform more complicated searches, like search-and-replace. This article shows how to set up necessary tools and configs to get FZF running in Vim. Instead of performing substitution on all quickfix ( cfdo) entries, we perform our substitution on all buffer ( bufdo) entries.įZF.vim is a game-changer. ![]() Our command :bufdo %s/pizza/donut/g | update looks similar to :cfdo %s/pizza/donut/g | update. This is only possible if we have -m in FZF_DEFAULT_OPTS. To select multiple files, use Tab / Shift+Tab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |