Back to articles
How I Made fzf Feel Snappy Again in Large Repositories
How-ToTools

How I Made fzf Feel Snappy Again in Large Repositories

via Dev.toJerry Schneider

Most of the time when I’m working in the terminal, I’m navigating files. Usually that looks like some combination of: cd ls find grep Which works fine… until a project gets large. Then it turns into: cd src ls cd components ls cd something find . -iname something I wanted something closer to Ctrl+P in an editor. A quick fuzzy search that lets me jump to files or directories instantly. So I added a small function to my .bashrc that lets me browse the filesystem with fzf like a tiny interactive file browser: fuzzy search files and directories preview files preview directory contents open files in $EDITOR cd into directories The Function Here’s the function from my dotfiles . # Browse files and directories with fzf - cd to directories, open files with $EDITOR function browse () { command -v fzf > /dev/null || { echo "fzf not found" > &2 ; return 1 ; } local selection fifo = "/tmp/browse_ $$ " # Create named pipe mkfifo " $fifo " # Run find (or fd if available) in background, writing to na

Continue reading on Dev.to

Opens in a new tab

Read Full Article
7 views

Related Articles