mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2024-11-15 13:23:11 +01:00
fixed the fzf history
This commit is contained in:
parent
bfd108d5a7
commit
84c821c66a
|
@ -34,18 +34,9 @@
|
||||||
theme = "agnoster";
|
theme = "agnoster";
|
||||||
};
|
};
|
||||||
|
|
||||||
interactiveShellInit =
|
shellInit =
|
||||||
''
|
''
|
||||||
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
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() {
|
function svpn() {
|
||||||
unit=$(systemctl list-unit-files | grep "openconnect\|wg-quick\|wireguard\|openvpn" | cut -d "." -f1 | fzf --preview 'systemctl status {}')
|
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
|
if [ $(systemctl is-active $unit) = "inactive" ]; then
|
||||||
|
@ -60,6 +51,13 @@
|
||||||
}
|
}
|
||||||
cat ${../images/cat.sixel}
|
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
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue