Fzf: Difference between revisions

imported>Nix
m add Software/Applications subcategory
m zsh article typo fix
 
(4 intermediate revisions by 3 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 option to enable fzf bash integration
<syntaxhighlight lang="bash">if command -v fzf-share >/dev/null; then
<syntaxhighlight lang="nix">
  source "$(fzf-share)/key-bindings.bash"
programs.fzf.enableBashIntegration = true;
  source "$(fzf-share)/completion.bash"
</syntaxhighlight>
fi</syntaxhighlight>
=== Without Home-manager ===
 
To enable fzf in bash add the following line to <code>$HOME/.bashrc</code>
== zsh ==
<syntaxhighlight lang="bash">eval "$(fzf --bash)"</syntaxhighlight>
To enable fzf in zsh add the following line to .zshrc


== Zsh ==
You can enable fzf in [[zsh]].
=== With Home-manager ===
There is 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">
<syntaxhighlight lang="bash">
if [ -n "${commands[fzf-share]}" ]; then
eval "$(fzf --zsh)"
  source "$(fzf-share)/key-bindings.zsh"
  source "$(fzf-share)/completion.zsh"
fi
</syntaxhighlight>
</syntaxhighlight>


== fish ==
== Fish ==
To enable fzf in fish, add the following to $HOME/.config/fish/functions/fish_user_key_bindings.fish
To enable fzf in [[fish]].
=== With Home-manager ===
There is 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">
<syntaxhighlight lang="fish">
function fish_user_key_bindings
fzf --fish | source
  if command -s fzf-share >/dev/null
    source (fzf-share)/key-bindings.fish
  end
 
  fzf_key_bindings
end
</syntaxhighlight>
</syntaxhighlight>


Line 49: Line 55:


[[Category:Applications]]
[[Category:Applications]]
[[Category:Shell]]