✨ add lfcd script 💥 no check for LF
This commit is contained in:
parent
129dfd32e6
commit
a3584c6211
1 changed files with 15 additions and 0 deletions
15
.zshrc
15
.zshrc
|
|
@ -125,3 +125,18 @@ fi
|
||||||
|
|
||||||
alias pbpaste="powershell.exe -noprofile Get-Clipboard"
|
alias pbpaste="powershell.exe -noprofile Get-Clipboard"
|
||||||
alias pbcopy="clip.exe"
|
alias pbcopy="clip.exe"
|
||||||
|
|
||||||
|
# on exit from lf this function changes directory to last browser fir in lf
|
||||||
|
lfcd () {
|
||||||
|
tmp="$(mktemp)"
|
||||||
|
lf -last-dir-path="$tmp" "$@"
|
||||||
|
if [ -f "$tmp" ]; then
|
||||||
|
dir="$(cat "$tmp")"
|
||||||
|
rm -f "$tmp"
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
if [ "$dir" != "$(pwd)" ]; then
|
||||||
|
cd "$dir"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue