Skip to content

Instantly share code, notes, and snippets.

@luisgerhorst
Created January 20, 2015 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisgerhorst/b768a780ad4952b8f8fd to your computer and use it in GitHub Desktop.
Save luisgerhorst/b768a780ad4952b8f8fd to your computer and use it in GitHub Desktop.
Emacs: Find file in directory currently open in OS X Finder.
;; ido-find-file-in-dir but start in directory currently open in Finder.
(defun ido-find-file-in-finder-dir ()
(interactive)
(let ((finder-dir (do-applescript "tell application \"Finder\"\nreturn POSIX path of (target of window 1 as alias)\nend tell")))
(ido-find-file-in-dir finder-dir)))
;; Bind to C-x C-o
(global-set-key (kbd "C-x C-o") 'ido-find-file-in-finder-dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment