add: lf fzf script & eza tree fish alias

This commit is contained in:
ooks-io 2023-12-01 22:15:55 +13:00
parent 670bd22ca6
commit 6142f13a33
3 changed files with 29 additions and 4 deletions

View file

@ -30,11 +30,11 @@ in
fe = mkIf hasHelix "cd $FLAKE; hx $FLAKE";
tree = mkIf hasEza "eza -aT --icons --group-directories-first";
tree = mkIf hasEza "eza -T --icons --group-directories-first";
ls = mkIf hasEza "eza -a --icons --group-directories-first";
lsd = mkIf hasEza "eza -al --icons --group-directories-first";
lst = mkIf hasEza "eza -aT -L 5 --icons --group-directories-first";
lsta = mkIf hasEza "eza -aT --icons --group-directories-first";
lst = mkIf hasEza "eza -T -L 5 --icons --group-directories-first";
lsta = mkIf hasEza "eza -T --icons --group-directories-first";
cat = mkIf hasBat "bat";

View file

@ -16,6 +16,32 @@ programs.lf = {
keybinding = "i";
source = "${pkgs.ctpv}/bin/ctpv";
};
commands = {
fzf-lf = ''
''${{
res="$(find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m)"
if [ -d "$res" ] ; then
cmd="cd"
elif [ -f "$res" ] ; then
cmd="select"
else
exit 0
fi
lf -remote "send $id $cmd \"$res\""
}}
'';
mkdir = ''
''${{
printf "Directory Name: "
read DIR
mkdir $DIR
}}
'';
};
keybindings = {
c = "mkdir";
"<a-f>" = "fzf-lf";
};
extraConfig = ''
&${pkgs.ctpv}/bin/ctpv -s $id
cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id

View file

@ -20,7 +20,6 @@
# fi - # FILE
# file types (with matching order)
home 󱂵 # HOME
ln  # LINK
or  # ORPHAN
tw t # STICKY_OTHER_WRITABLE