From fa14911e953f0d2c8db43538647c9413cca2d5a3 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Tue, 16 Apr 2013 16:35:38 +0200 Subject: .functions: Add `cdf` `cdf` changes the working directory to the top-most Finder window location. Thanks to @sindresorhus and @paulirish! --- .functions | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.functions') diff --git a/.functions b/.functions index 90373ae..001e3d9 100644 --- a/.functions +++ b/.functions @@ -21,6 +21,11 @@ function mkd() { mkdir -p "$@" && cd "$@" } +# Change working directory to the top-most Finder window location +function cdf() { # short for `cdfinder` + cd "$(osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)')" +} + # Determine size of a file or total size of a directory function fs() { if du -b /dev/null > /dev/null 2>&1; then -- cgit v1.2.3