OSX contribution layer

This commit is contained in:
Evan Dale Aromin 2014-12-13 01:31:55 +08:00 committed by syl20bnr
parent f7b8bdfe7d
commit 91b900c437
2 changed files with 57 additions and 0 deletions

40
contrib/osx/README.md Normal file
View file

@ -0,0 +1,40 @@
# OSX contribution layer for Spacemacs
## Description
Spacemacs is not just emacs+vim. It can have OSX keybindings too!
This layer globally defines common OSX keybindings. ⌘ is set to
`super` and ⌥ is set to `meta`. Aside from that, there's nothing
much, really.
## Philosophy
While this layer enables common OSX bindings, it does not implement
OSX navigation keybindings. Spacemacs is meant to be used with evil,
and we encourage you to do so :)
## Install
To use this configuration layer, add it to your `~/.spacemacs`
```
(setq-default dotspacemacs-configuration-layers '(osx)
"List of contribution to load."
)
```
## Key Bindings
- ⌘ q: Quit
- ⌘ v: Paste
- ⌘ c: Copy
- ⌘ x: Cut
- ⌘ w: Close window
- ⌘ z: Undo
- ⌘ Z: Redo
- ⌃ ⌘ f: Toggle fullscreen
## Future Work
- Allow user to choose from either `hyper` or `super` as ⌘. This is an option that is supported cross-platform.
- Configurable option to keep the OSX and spacemacs clipboards separate

View file

@ -0,0 +1,17 @@
(when (equal system-type 'darwin)
;; Treat option as meta and command as super
(setq mac-option-key-is-meta t)
(setq mac-command-key-is-meta nil)
(setq mac-command-modifier 'super)
(setq mac-option-modifier 'meta)
;; Keybindings
(global-set-key (kbd "s-q") 'save-buffers-kill-terminal)
(global-set-key (kbd "s-v") 'yank)
(global-set-key (kbd "s-c") 'kill-ring-save)
(global-set-key (kbd "s-x") 'kill-region)
(global-set-key (kbd "s-w") 'kill-this-buffer)
(global-set-key (kbd "s-z") 'undo-tree-undo)
(global-set-key (kbd "s-s") 'save-buffer)
(global-set-key (kbd "s-Z") 'undo-tree-redo)
(global-set-key (kbd "C-s-f") 'toggle-frame-fullscreen))