This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/osx/keybindings.el
sooheon 79c4a81af6 Add duplicate keybinding for toggle fullscreen
On my mac, using the left command key results in emacs registering the
command differently.
2015-08-04 23:13:50 -04:00

35 lines
1.4 KiB
EmacsLisp

(when (system-is-mac)
(evil-leader/set-key "bf" 'reveal-in-osx-finder)
;; this is only applicable to GUI mode
(when (display-graphic-p)
;; Treat command as super
(setq mac-command-key-is-meta nil)
(setq mac-command-modifier 'super)
(when osx-use-option-as-meta
;; Treat option as meta
(setq mac-option-key-is-meta t)
(setq mac-option-modifier 'meta))
;; Keybindings
(global-set-key (kbd "s-=") 'spacemacs/scale-up-font)
(global-set-key (kbd "s--") 'spacemacs/scale-down-font)
(global-set-key (kbd "s-0") 'spacemacs/reset-font-size)
(global-set-key (kbd "s-q") 'save-buffers-kill-terminal)
(global-set-key (kbd "s-v") 'yank)
(global-set-key (kbd "s-c") 'evil-yank)
(global-set-key (kbd "s-a") 'mark-whole-buffer)
(global-set-key (kbd "s-x") 'kill-region)
(global-set-key (kbd "s-w") 'delete-window)
(global-set-key (kbd "s-W") 'delete-frame)
(global-set-key (kbd "s-n") 'new-frame)
(global-set-key (kbd "s-z") 'undo-tree-undo)
(global-set-key (kbd "s-s")
(lambda ()
(interactive)
(call-interactively (key-binding "\C-x\C-s"))))
(global-set-key (kbd "s-Z") 'undo-tree-redo)
(global-set-key (kbd "C-s-f") 'spacemacs/toggle-frame-fullscreen)
;; Emacs sometimes registers C-s-f as this weird keycode
(global-set-key (kbd "<C-s-268632070>") 'spacemacs/toggle-frame-fullscreen)))