Bozhidar Batsov has a post up about Little known macOS keybindings. It’s great with one large caveat: it’s only true for some Emacsen on macOS. There are two basic ports (not to be confused with macports or similar): NextStep (ns) and Cocoa (mac). A quick search will explain the names, but one might recognize the abbreviations if one has ever added some Mac-specific code in their config that includes something like:
;; FILE MANAGEMENT (use-package emacs :if (memq window-system '(mac ns)) :custom (mac-system-move-file-to-trash-use-finder t) )
Anywho, if you’re like me and running Mitsuharu Yamamoto’s emacs-mac port (homebrew macports), that is the Cocoa (mac) variant. Batsov’s post only applies to the NextStep (ns) variant. He told me uses the regular GNU Emacs, none of the ports. TBF Batsov’s post probably applies to most Emacs on macOS users regardless. ※ I might be totally wrong about this, so please, YMMV.
Here is a sample of what I do in my config to get (most) of these keybindings in my Emacs suited to my needs:
;; My Super (s-) maps
(use-package emacs
:bind
(
("C-s-SPC" . nil ) ; blocked by Alfred for me; ns-do-show-character-palette in NS port
("M-s-h" . nil ) ; ns-do-hide-others in NS port
("s-&" . kill-current-buffer )
("s-'" . next-window-any-frame )
("s-'" . other-frame )
("s-," . customize )
("s-0" . text-scale-reset )
("s-:" . ispell )
("s-<" . text-scale-decrease )
("s-<down>" . end-of-buffer )
("s-<left>" . backward-sentence ) ; move-beginning-of-line in NS port
("s-<right>" . forward-sentence ) ; move-end-of-line in NS port
("s-<up>" . beginning-of-buffer )
("s->" . text-scale-increase )
("s-?" . info ) ; conflicts w/ MacOS
("s-C" . nil ) ; conflicts w/ Named Keyboard Switcher; ns-popup-color-panel in NS port
("s-D" . dired )
("s-E" . edit-abbrevs )
("s-H" . nil ) ; ns-do-hide-others in NS port
("s-L" . shell-command )
("s-M" . manual-entry )
("s-S" . write-file ) ; ns-write-file-using-panel in NS port
("s-Z" . redo )
("s-a" . mark-whole-buffer )
("s-c" . my-smart-copy-dwim ) ; ns-copy-including-secondary in NS port
("s-d" . nil ) ; isearch-repeat-backward in NS port
("s-e" . isearch-yank-kill ) ; blocked by my Keyboard Maestro macro top open Finder window
("s-f" . consult-line-multi ) ; isearch-forward in NS port
("s-g" . er-keyboard-quit )
("s-h" . nil ) ; ns-do-hide-emacs in NS port
("s-j" . exchange-point-and-mark )
("s-k" . kill-current-buffer ) ; Xah has a better function for this
("s-l" . goto-line )
("s-m" . iconify-frame )
("s-n" . make-frame )
("s-o" . mac-open-file-using-panel ) ; ns-open-file-using-panel in NS port
("s-p" . print-buffer ) ; conflicts w/ MacOS print
("s-q" . save-buffers-kill-emacs ) ; TODO make this safer
("s-s" . save-buffer )
("s-t" . menu-set-font )
("s-u" . revert-buffer )
("s-v" . xah-paste-or-paste-previous) ; yank in NS port
("s-w" . xah-close-current-buffer ) ; delete-frame in NS port
("s-x" . my-smart-cut-dwim )
("s-y" . nil ) ; ns-paste-secondary on NS port
("s-z" . undo )
("s-|" . nil ) ; shell-command-on-region in NS port
("s-~" . previous-frame )
:map org-mode-map
(
("s-'" . org-single-quote-region-or-point)
("s-+" . cc/emphasize-strike-through )
("s--" . org-subscript-region-or-point ) ; center-line in NS port
("s-<tab>" . completion-at-point )
("s-=" . cc/emphasize-verbatim )
("s-C" . cc/emphasize-code )
("s-\"" . org-double-quote-region-or-point)
("s-^" . org-superscript-region-or-point ) ; orig. kill-some-buffer
("s-_" . cc/emphasize-underline )
("s-b" . cc/emphasize-bold )
("s-e" . cc/emphasize-dwim )
("s-i" . cc/emphasize-italic )
("s-r" . cc/emphasize-remove )
("s-l" . org-goto-line )
)
:map markdown-mode-map
(
("s-<tab>" . completion-at-point )
("s-=" . cc/emphasize-verbatim )
("s-C" . cc/emphasize-code )
("s-_" . cc/emphasize-underline )
("s-b" . cc/emphasize-bold )
("s-e" . cc/emphasize-dwim )
("s-i" . cc/emphasize-italic )
("s-s" . cc/emphasize-strike-through)
)
)
)
Some of the functions I call come from other bits of my config. ※ Where one sees ‘nil’ above is where there’s a conflict or where I’m not sure what I want on that keybinding yet.
Here’s a neat one that opens a file using the macOS dialog:
(defun mac-open-file-using-panel ()
"A quick way to open files with your system file picker,
URL `https://christiantietze.de/posts/2022/12/use-file-open-dialog-for-file-actions/'
Created: 2025-06-04
Version: 2025-06-04"
(interactive)
(let ((last-nonmenu-event nil)
(use-dialog-box t)
(use-file-dialog t))
(call-interactively #'find-file))
)
It is bound to s-o.
As before, one can tailor this to their needs.
If you do this or have a better approach, let me know!
[…] has his own post on the matter that goes into a bit more detail. As far as I can tell, unless your using Mitsuharu […]