Skip to content

Instantly share code, notes, and snippets.

@hamsolodev
Created July 15, 2012 04:45
Show Gist options
  • Save hamsolodev/3115030 to your computer and use it in GitHub Desktop.
Save hamsolodev/3115030 to your computer and use it in GitHub Desktop.
;; use OSX's Quick Look to browse file:/// URLs
(defun osx-qlook (url &optional some-stuff)
(message "Launching Quick Look preview...")
(start-process
"qlmanage"
(get-buffer-create "*qlmanage*")
"/usr/bin/qlmanage"
"-p"
;; strip “file://” from URL
(substring url 7)))
(setq browse-url-browser-function (quote (("^file://." . osx-qlook) ("." . browse-url-default-macosx-browser))))
@hamsolodev
Copy link
Author

…adding (interactive) immediately after the (defun… line would make the function interactive, allowing it to be bound to a key…

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