3 ms·
Since it was painful to do, here's what I put in my .emacs to bring back macOS Cmd-keybindings in Mituharu's Emacs: ; Configure shortcuts if we're using Mi
by AceJohnny2 8y ago
Since it was painful to do, here's what I put in my .emacs to bring back macOS Cmd-keybindings in Mituharu's Emacs:
; Configure shortcuts if we're using Mituharu's Mac port of Emacs
(when (eq window-system 'mac)
(progn
(message "Setting emacs-mac keybindings")
(setq mac-option-modifier 'meta)
;supposedly setting this to 'nil gives them back to OS X, but that didn't work for me
(setq mac-command-modifier 'super)
(global-set-key (kbd "s-q") 'save-buffers-kill-emacs)
;I hate ⌘-w killing a window, too close to alt-w (copy). Deactivated
;(global-set-key (kbd "s-w" 'delete-frame)
(global-set-key (kbd "s-a") 'mark-whole-buffer)
(global-set-key (kbd "s-s") 'save-buffer)
(global-set-key (kbd "s-d") 'isearch-repeat-backward)
(global-set-key (kbd "s-f") 'isearch-forward)
(global-set-key (kbd "s-g") 'isearch-repeat-forward)
(global-set-key (kbd "s-z") 'undo)
(global-set-key (kbd "s-x") 'kill-region)
(global-set-key (kbd "s-c") 'kill-ring-save) ;ns has ns-copy-including-secondary, on mac- port, kill-ring-save works the same
(global-set-key (kbd "s-v") 'yank)
(global-set-key (kbd "s-y") 'yank) ;ns-paste-secondary
(global-set-key (kbd "s-u") 'revert-buffer)
;(global-set-key (kbd "s-o") 'ns-open-file-using-panel) ;no good alternative
;(global-set-key (kbd "s-p") 'ns-print-buffer) ;no good alternative
;(global-set-key (kbd "s-h") 'ns-do-hide-emacs) ;done by default
(global-set-key (kbd "s-j") 'exchange-point-and-mark)
(global-set-key (kbd "s-k") 'kill-this-buffer)
(global-set-key (kbd "s-l") 'goto-line)
(global-set-key (kbd "s-n") 'make-frame)
(global-set-key (kbd "s-m") 'iconify-frame)
(global-set-key (kbd "s-`") 'other-frame)
(global-set-key (kbd "s-,") 'customize)
(global-set-key (kbd "s-'") 'next-multiframe-window)
)
)
- deleted 8y ago[deleted]
- roryokane 8y agoIf you use Spacemacs, it can define a similar set of keybindings for you with its ‘osx’ layer (https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bos/osx https://github.com/syl20bnr/spacemacs/tree/master/layers/%2B...). To enable that layer, open your Spacemacs dotfile with ‘SPC f e d’, then add ‘osx’ to the list within the ‘dotspacemacs-configuration-layers’ variable.