fzf

fzf is a general-purpose command-line fuzzy finder.

Installation

Install the fzf package. The development version is fzf-gitAUR.

Configuration

Shells

Optional fzf keybindings and completion are available for various shells:

  • Ctrl+t list files+folders in current directory (e.g., type git add , press Ctrl+t, select a few files using Tab, finally Enter)
  • Ctrl+r search history of shell commands
  • fuzzy change directory

Bash

Source the desired files from your .bashrc:

Zsh

Source the desired files from your .zshrc (after vi-mode, if using that, too):

fish

For fish, keybindings are in:

    fish will source this by default but the bindings have to be enabled manually:

    ~/.config/fish/functions/fish_user_key_bindings.fish
    function fish_user_key_bindings
    	fzf_key_bindings
    end
    

    fzf completion in fish can be enabled with custom functions: https://github.com/junegunn/fzf/wiki/Examples-(fish)

    Vim

    The basic Vim plugin is already included within the package and installed to Vim's global plugin directory. Thus, you do not need to add anything to your .vimrc to be able to use it. It only provides the FZF command, though. There is an additional Vim plugin made by the author of fzf that defines some convenience functions, see https://github.com/junegunn/fzf.vim.

    Arch specific fzf uses

    Pacman

    Try this to fuzzy-search through all available packages, with package info shown in a preview window, and then install selected packages:

    $ pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S

    List all your installed packages, and then remove selected packages:

    $ pacman -Qq | fzf --multi --preview 'pacman -Qi {1}' | xargs -ro sudo pacman -Rns

    If you want to add package file list in preview – may be a bit slower updating preview window (make sure you run with root privileges at least once before invocation to sync the pacman file database):

    $ pacman -Slq | fzf --multi --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' | xargs -ro sudo pacman -S

    The package also provides a fzf terminal UI for and pacman.

    Alternatives

    • – fuzzy finder written in Rust
    • – fuzzy finder/selector
    gollark: I don't actually eat pizza, but my profile picture is not an example of pizza.
    gollark: Nonsense. It was in the Wikipedia article. You just can't recognize the full set of possible pizzae.
    gollark: You clearly *specifically* picked a similar pizza image.
    gollark: As you can see, while the color schemes are *somewhat* similar, my profile picture is not equivalent to a pizza, unlike <@356209633313947648>.
    gollark: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Eq_it-na_pizza-margherita_sep2005_sml.jpg/640px-Eq_it-na_pizza-margherita_sep2005_sml.jpg
    This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.