Emacs 24 OS X Fullscreen Keyboard Shortcut
Most applications on OS X Lion allow the user to toggle fullscreen mode via ⌘-ESC. While Emacs 24.3 supports native fullscreen, this keyboard shortcut is not defined by default.
To toggle fullscreen via ⌘-ESC, add the following to your .emacs
or .init.el
:
;; Shortcut for full screen
(defun toggle-fullscreen (&optional f)
(interactive)
(let ((current-value (frame-parameter nil 'fullscreen)))
(set-frame-parameter nil 'fullscreen
(if (equal 'fullboth current-value)
(if (boundp 'old-fullscreen) old-fullscreen nil)
(progn (setq old-fullscreen current-value)
'fullboth)))))
(global-set-key [s-escape] 'toggle-fullscreen)
Original Source: Juan Céspedes
Written by Ryan C
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Emacs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#