From 84c821c66a7d8688479f68653867fad603f69560 Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Fri, 21 Apr 2023 20:32:30 +0200 Subject: [PATCH] fixed the fzf history --- shared/zsh.nix | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/shared/zsh.nix b/shared/zsh.nix index 7c466c4..af366a5 100644 --- a/shared/zsh.nix +++ b/shared/zsh.nix @@ -34,18 +34,9 @@ theme = "agnoster"; }; - interactiveShellInit = + shellInit = '' source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh - - function c() { - if [ $# -eq 0 ]; then - cd $(find -maxdepth 4 -not -path '*[cC]ache*' -not -path '*[tT]rash*' -type d | fzf --preview '${pkgs.tree}/bin/tree -C {}') - else - $1 $(find -maxdepth 5 -not -path '*[cC]ache*' -not -path '*[tT]rash*' | fzf --preview '${pkgs.tree}/bin/tree -C {}') - fi - } - function svpn() { unit=$(systemctl list-unit-files | grep "openconnect\|wg-quick\|wireguard\|openvpn" | cut -d "." -f1 | fzf --preview 'systemctl status {}') if [ $(systemctl is-active $unit) = "inactive" ]; then @@ -60,6 +51,13 @@ } cat ${../images/cat.sixel} ''; + + # Hacky way to bind Ctrl+R to fzf. Otherwise it will be overridden + promptInit = + '' + source ${pkgs.fzf}/share/fzf/completion.zsh + source ${pkgs.fzf}/share/fzf/key-bindings.zsh + ''; }; }