Created
January 20, 2015 17:11
-
-
Save luisgerhorst/b768a780ad4952b8f8fd to your computer and use it in GitHub Desktop.
Emacs: Find file in directory currently open in OS X Finder.
This file contains 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
;; 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