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
cab460dcb1
commit
394a641341
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 = {
|
||||
shellAliases = {
|
||||
f = "lfcd";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue