diff --git a/home/lf.nix b/home/lf.nix index adef56c..e4aba23 100644 --- a/home/lf.nix +++ b/home/lf.nix @@ -190,6 +190,21 @@ ''; }; + programs.fish.functions.lfcd.body = '' + set tmp (mktemp) + # `command` is needed in case `lfcd` is aliased to `lf` + command lf -last-dir-path=$tmp $argv + if test -f "$tmp" + set dir (cat $tmp) + rm -f $tmp + if test -d "$dir" + if test "$dir" != (pwd) + cd $dir + end + end + end + ''; + programs.fish = { shellAliases = { f = "lfcd";