Last active
August 29, 2015 14:04
-
-
Save niedhui/f2757ac23056284672d1 to your computer and use it in GitHub Desktop.
~/.config/fish/functions/cdf.fish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cdf | |
cd (finder_path ) | |
end | |
function finder_path | |
echo ' | |
tell application "Finder" | |
if (1 <= (count Finder windows)) then | |
get POSIX path of (target of window 1 as alias) | |
else | |
get POSIX path of (desktop as alias) | |
end if | |
end tell | |
' | osascript 2>/dev/null - | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good stuff, man! I've already become your fan now!