Skip to content

Instantly share code, notes, and snippets.

@niedhui
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save niedhui/f2757ac23056284672d1 to your computer and use it in GitHub Desktop.

Select an option

Save niedhui/f2757ac23056284672d1 to your computer and use it in GitHub Desktop.
~/.config/fish/functions/cdf.fish
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
@Arthraim
Copy link
Copy Markdown

Good stuff, man! I've already become your fan now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment