2015-12-02 14:23:39 +00:00
|
|
|
#+TITLE: OSX layer
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
[[file:img/apple.png]]
|
|
|
|
|
2016-03-31 02:59:55 +00:00
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
|
|
|
- [[#description][Description]]
|
|
|
|
- [[#philosophy][Philosophy]]
|
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#layer][Layer]]
|
|
|
|
- [[#use-with-non-us-keyboard-layouts][Use with non-US keyboard layouts]]
|
2016-08-27 15:28:27 +00:00
|
|
|
- [[#define-words-using-os-x-dictionary][Define words using OS X Dictionary]]
|
2016-03-31 02:59:55 +00:00
|
|
|
- [[#coreutils][Coreutils]]
|
|
|
|
- [[#key-bindings][Key Bindings]]
|
|
|
|
- [[#future-work][Future Work]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Description
|
2016-08-28 10:38:34 +00:00
|
|
|
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.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
While in =dired= this layer will try to use =gls= instead of =ls=.
|
|
|
|
|
|
|
|
* Philosophy
|
2016-08-28 10:38:34 +00:00
|
|
|
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 :)
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Install
|
|
|
|
** Layer
|
2016-01-06 05:21:55 +00:00
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
2016-08-28 10:38:34 +00:00
|
|
|
add =osx= to the existing =dotspacemacs-configuration-layers= list in this file.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2015-06-12 17:25:20 +00:00
|
|
|
*** Use with non-US keyboard layouts
|
2016-01-09 20:52:40 +00:00
|
|
|
If you need the ~⌥~ key to type common characters such as ={[]}~= which is usual
|
2015-06-12 17:25:20 +00:00
|
|
|
for e.g. Finnish and Swedish keyboard layouts, you'll probably want to leave the
|
|
|
|
~⌥~ key unchanged by setting the =osx-use-option-as-meta= variable to =nil=:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default dotspacemacs-configuration-layers '(
|
|
|
|
(osx :variables osx-use-option-as-meta nil)))
|
|
|
|
#+END_SRC
|
|
|
|
|
2016-02-23 19:55:50 +00:00
|
|
|
If you have problem entering symbols that are behind the ~⌥~ key you may want to
|
|
|
|
added this to the user-init in the .spacemacs-File. This will allow you to use
|
|
|
|
the right ~⌥~ key to write symbols. The left ~⌥~ key can be used as the Meta
|
|
|
|
key.
|
2016-02-22 21:28:48 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default mac-right-option-modifier nil)
|
|
|
|
#+END_SRC
|
|
|
|
|
2016-08-27 15:28:27 +00:00
|
|
|
*** Define words using OS X Dictionary
|
|
|
|
|
2016-08-28 10:38:34 +00:00
|
|
|
This layer by default enables defining words under point ~SPC x w d~ using OS X
|
|
|
|
Dictionary. In some cases you might want to manually setup dictionary to use.
|
|
|
|
For example,
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default dotspacemacs-configuration-layers '(
|
|
|
|
(osx :variables osx-dictionary-dictionary-choice "English")))
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
To get the list of available dictionaries call =osx/list-available-dictionaries=
|
|
|
|
function.
|
|
|
|
|
2016-08-27 15:28:27 +00:00
|
|
|
You can disable it by setting =osx-use-dictionary-app= variable to =nil=:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default dotspacemacs-configuration-layers '(
|
|
|
|
(osx :variables osx-use-dictionary-app nil)))
|
|
|
|
#+END_SRC
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
** Coreutils
|
|
|
|
To get =gls= install coreutils homebrew:
|
|
|
|
|
|
|
|
#+BEGIN_SRC sh
|
|
|
|
brew install coreutils
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
* Key Bindings
|
|
|
|
|
2016-08-28 10:38:34 +00:00
|
|
|
| Key Binding | Description |
|
|
|
|
|-------------+-----------------------------|
|
|
|
|
| ~⌘ =~ | Scale up text |
|
|
|
|
| ~⌘ -~ | Scale down text |
|
|
|
|
| ~⌘ q~ | Quit |
|
|
|
|
| ~⌘ v~ | Paste |
|
|
|
|
| ~⌘ c~ | Copy |
|
|
|
|
| ~⌘ x~ | Cut |
|
|
|
|
| ~⌘ a~ | Select all |
|
|
|
|
| ~⌘ w~ | Close window |
|
|
|
|
| ~⌘ W~ | Close frame |
|
|
|
|
| ~⌘ n~ | New frame |
|
|
|
|
| ~⌘ z~ | Undo |
|
|
|
|
| ~⌘ Z~ | Redo |
|
|
|
|
| ~⌃ ⌘ f~ | Toggle fullscreen |
|
|
|
|
| ~SPC x w d~ | Define word under the point |
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Future Work
|
2015-06-12 01:23:07 +00:00
|
|
|
- Allow user to choose from either ~hyper~ or ~super~ as ~⌘~. This is an option
|
2015-06-10 16:44:30 +00:00
|
|
|
that is supported cross-platform.
|
|
|
|
- Configurable option to keep the OSX and spacemacs clipboards separate
|