Fzf: Difference between revisions

imported>HLandau
No edit summary
DHCP (talk | contribs)
m style fixes and minor corrections
 
(10 intermediate revisions by 9 users not shown)
Line 7: Line 7:
First install <code>fzf</code> in your profile, then use one of the following methods:
First install <code>fzf</code> in your profile, then use one of the following methods:


== bash ==
== Bash ==
To enable fzf in bash add the following line to .bashrc
=== With Home-manager ===
There is an option to enable fzf bash integration:
<syntaxhighlight lang="nix">
programs.fzf.enableBashIntegration = true;
</syntaxhighlight>
=== Without Home-manager ===
To enable fzf in bash add the following line to <code>$HOME/.bashrc</code>:
<syntaxhighlight lang="bash">eval "$(fzf --bash)"</syntaxhighlight>
 
== Zsh ==
You can enable fzf in [[zsh]].
=== With Home-manager ===
There is an option to enable fzf zsh integration:
<syntaxhighlight lang="nix">
programs.fzf.enableZshIntegration = true;
</syntaxhighlight>
=== Without Home-manager ===
To enable fzf in zsh add the following line to <code>$HOME/.zshrc</code>:
<syntaxhighlight lang="bash">
eval "$(fzf --zsh)"
</syntaxhighlight>
 
== Fish ==
To enable fzf in [[fish]].
=== With Home-manager ===
There is an option to enable fzf fish integration:
<syntaxhighlight lang="nix">
programs.fzf.enableFishIntegration = true;
</syntaxhighlight>
=== Without Home-Manager ===
To enable fzf in fish add the following line to <code>$HOME/.config/fish/functions/fish_user_key_bindings.fish</code>:
 
<syntaxhighlight lang="fish">
fzf --fish | source
</syntaxhighlight>
 
= Examples =


<syntaxhighlight lang="bash">if command -v fzf-share >/dev/null; then
== Search all nix packages ==
  source "$(fzf-share)/key-bindings.bash"
fi</syntaxhighlight>


== zsh ==
You can interactively search the list of available packages with:
To enable fzf in zsh add the following line to .zshrc


<syntaxhighlight lang="bash">
<syntaxhighlight lang=console>
if [ -n "${commands[fzf-share]}" ]; then
$ nix-env -qa | fzf
  source "$(fzf-share)/key-bindings.zsh"
fi
</syntaxhighlight>
</syntaxhighlight>
[[Category:Applications]]
[[Category:Shell]]