Difference between revisions of "Fzf"

From NixOS Wiki
Jump to: navigation, search
(Add warning about the new wiki)
m (rollback unauthorized mass edits)
Tag: Rollback
 
Line 1: Line 1:
{{warning|1=You are reading an article on the deprecated unofficial wiki. For the up to date version of this article, see https://wiki.nixos.org/wiki/Fzf.}}
 
 
 
{{DISPLAYTITLE:fzf}}
 
{{DISPLAYTITLE:fzf}}
 
[https://github.com/junegunn/fzf fzf] is a general-purpose command-line fuzzy finder.
 
[https://github.com/junegunn/fzf fzf] is a general-purpose command-line fuzzy finder.

Latest revision as of 10:54, 6 April 2024

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

Shell extensions

fzf provides additional key bindings (CTRL-T, CTRL-R, and ALT-C) for shells

First install fzf in your profile, then use one of the following methods:

bash

To enable fzf in bash add the following line to .bashrc

if command -v fzf-share >/dev/null; then
  source "$(fzf-share)/key-bindings.bash"
  source "$(fzf-share)/completion.bash"
fi

zsh

To enable fzf in zsh add the following line to .zshrc

if [ -n "${commands[fzf-share]}" ]; then
  source "$(fzf-share)/key-bindings.zsh"
  source "$(fzf-share)/completion.zsh"
fi

fish

To enable fzf in fish, add the following to $HOME/.config/fish/functions/fish_user_key_bindings.fish

function fish_user_key_bindings
  if command -s fzf-share >/dev/null
    source (fzf-share)/key-bindings.fish
  end

  fzf_key_bindings
end

Examples

Search all nix packages

You can interactively search the list of available packages with:

nix-env -qa | fzf