Last active
December 11, 2015 10:58
-
-
Save ryseto/4589945 to your computer and use it in GitHub Desktop.
Emacs で編集中のファイルが入っているフォルダ(ディレクトリ)を Finder/Terminal で開く。
ショートカットは ⌘-Shift-Option-F と ⌘-Shift-Option-T。
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
;;; Finder でフォルダを開く | |
;; ショートカット: ⌘-option-shift-F | |
;; (ショートカットは USキーボードで確認) | |
(define-key global-map [?\s-Ï] 'MyTool-open-folder-in-finder) | |
(defun MyTool-open-folder-in-finder () | |
"open -a Finder.app CURRENT-DIRECTORY" | |
(interactive) | |
(process-query-on-exit-flag | |
(start-process-shell-command "open folder in Finder" nil "open ."))) | |
;;; Terminal でフォルダを開く | |
;; ショートカット: ⌘-option-shift-T | |
;; (ショートカットは USキーボードで確認) | |
(define-key global-map [?\s-ˇ] 'MyTool-open-Terminal) | |
(defun MyTool-open-Terminal() | |
"open -a Terminal.app CURRENT-DIRECTORY" | |
(interactive) | |
(let* ((cmd "open -a Terminal.app")) | |
(process-kill-without-query | |
(start-process-shell-command | |
"Open directory" nil cmd default-directory)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment