restore lfcd fish function that was removed by mistake
Some checks failed
/ build-all (push) Has been cancelled
Some checks failed
/ build-all (push) Has been cancelled
This commit is contained in:
parent
064e0683d0
commit
c3ba849207
1 changed files with 15 additions and 0 deletions
15
home/lf.nix
15
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 = {
|
programs.fish = {
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
f = "lfcd";
|
f = "lfcd";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue