2015-12-02 14:23:39 +00:00
|
|
|
#+TITLE: OSX layer
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2019-05-02 21:49:30 +00:00
|
|
|
#+TAGS: layer|os
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
[[file:img/apple.png]]
|
|
|
|
|
2019-05-07 20:05:06 +00:00
|
|
|
* Table of Contents :TOC_5_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
2017-10-04 20:45:43 +00:00
|
|
|
- [[#features][Features:]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#philosophy][Philosophy]]
|
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#layer][Layer]]
|
|
|
|
- [[#use-with-non-us-keyboard-layouts][Use with non-US keyboard layouts]]
|
2019-10-13 05:27:17 +00:00
|
|
|
- [[#define-words-using-macos-dictionary][Define words using macOS Dictionary]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#coreutils][Coreutils]]
|
2018-12-05 03:03:03 +00:00
|
|
|
- [[#key-bindings][Key bindings]]
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#future-work][Future Work]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Description
|
Various documentation copy-edits
Follow up the changes in the previous commit with some minor improvements
to formatting, grammar, spelling, and wording.
* layers/+distributions/spacemacs-docker/README.org: Replace "+" with
"and".
* layers/+email/mu4e/README.org: Use full sentences in the comments in the
mu4e-alert example.
* layers/+intl/japanese/README.org: Use verbatim markers for names of
files, functions, packages, and variables. Capitalize "Linux".
* layers/+os/osx/README.org: Capitalize "Emacs", "Vim", and "Evil".
* layers/+os/osx/config.el (osx-command-as, osx-use-dictionary-app):
* layers/+os/osx/keybindings.el (spacemacs/system-is-mac): Improve
docstrings.
* layers/+readers/dash/README.org: Capitalize "API", "Helm", and "Ivy".
* layers/+spacemacs/spacemacs-defaults/config.el
(delete-by-moving-to-trash): Use full sentences in comment.
* layers/+spacemacs/spacemacs-defaults/funcs.el
(spacemacs/toggle-frame-fullscreen-non-native): Improve docstrings.
2019-10-13 06:03:09 +00:00
|
|
|
Spacemacs is not just Emacs plus Vim. It can have macOS key bindings too! This
|
|
|
|
layer globally defines common macOS key bindings.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2017-10-04 20:45:43 +00:00
|
|
|
** Features:
|
2018-09-19 03:54:47 +00:00
|
|
|
- ~⌘~ is set to ~hyper~ and ~⌥~ is set to ~meta~
|
|
|
|
- In =dired= use =gls= instead of =ls=
|
|
|
|
- Fix separator colors of Spaceline mode-line
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Philosophy
|
2019-10-13 05:27:17 +00:00
|
|
|
While this layer enables common macOS bindings, it does not implement macOS
|
Various documentation copy-edits
Follow up the changes in the previous commit with some minor improvements
to formatting, grammar, spelling, and wording.
* layers/+distributions/spacemacs-docker/README.org: Replace "+" with
"and".
* layers/+email/mu4e/README.org: Use full sentences in the comments in the
mu4e-alert example.
* layers/+intl/japanese/README.org: Use verbatim markers for names of
files, functions, packages, and variables. Capitalize "Linux".
* layers/+os/osx/README.org: Capitalize "Emacs", "Vim", and "Evil".
* layers/+os/osx/config.el (osx-command-as, osx-use-dictionary-app):
* layers/+os/osx/keybindings.el (spacemacs/system-is-mac): Improve
docstrings.
* layers/+readers/dash/README.org: Capitalize "API", "Helm", and "Ivy".
* layers/+spacemacs/spacemacs-defaults/config.el
(delete-by-moving-to-trash): Use full sentences in comment.
* layers/+spacemacs/spacemacs-defaults/funcs.el
(spacemacs/toggle-frame-fullscreen-non-native): Improve docstrings.
2019-10-13 06:03:09 +00:00
|
|
|
navigation key bindings. Spacemacs is meant to be used with Evil, and we
|
2016-08-28 10:38:34 +00:00
|
|
|
encourage you to do so :)
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Install
|
|
|
|
** Layer
|
2017-03-15 03:54:13 +00:00
|
|
|
Layer has been updated for new config variables. The variable =osx-use-option-as-meta=
|
|
|
|
is still available for backwards compatibility and will take precedence if set.
|
|
|
|
|
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.
|
2017-03-15 03:54:13 +00:00
|
|
|
The different modifier keys can be set as follows:
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
2020-09-18 18:57:09 +00:00
|
|
|
(setq-default dotspacemacs-configuration-layers '(
|
2017-04-11 20:43:54 +00:00
|
|
|
(osx :variables osx-command-as 'hyper
|
2017-03-15 03:54:13 +00:00
|
|
|
osx-option-as 'meta
|
|
|
|
osx-control-as 'control
|
2018-05-27 21:38:13 +00:00
|
|
|
osx-function-as nil
|
2017-03-15 03:54:13 +00:00
|
|
|
osx-right-command-as 'left
|
|
|
|
osx-right-option-as 'left
|
2019-06-16 15:49:33 +00:00
|
|
|
osx-right-control-as 'left
|
2020-09-18 18:57:09 +00:00
|
|
|
osx-swap-option-and-command nil)))
|
2017-03-15 03:54:13 +00:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
These are also the default values. Setting the right modifier to =left=
|
|
|
|
will equal the left modifier. Allowed values are: =super=, =meta=, =control=,
|
2018-05-27 21:38:13 +00:00
|
|
|
=alt= and =nil=.
|
2017-03-15 03:54:13 +00:00
|
|
|
Setting =nil= for modifiers will leave the left modifiers as emacs default.
|
2019-06-16 15:49:33 +00:00
|
|
|
Setting =osx-swap-option-and-command= to =t= will swap =command= and =option= key.
|
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
|
2019-05-26 20:58:52 +00:00
|
|
|
for e.g. Finnish and Swedish keyboard layouts, you'll probably want to leave the
|
2017-03-15 03:54:13 +00:00
|
|
|
~⌥~ key unchanged by setting the =osx-option-as= variable to =none=:
|
2015-06-12 17:25:20 +00:00
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq-default dotspacemacs-configuration-layers '(
|
2017-03-15 03:54:13 +00:00
|
|
|
(osx :variables osx-option-as 'none)))
|
2015-06-12 17:25:20 +00:00
|
|
|
#+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
|
2017-03-15 03:54:13 +00:00
|
|
|
set the variables as follows. This will allow you to use
|
2016-02-23 19:55:50 +00:00
|
|
|
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
|
2017-03-15 03:54:13 +00:00
|
|
|
(setq-default dotspacemacs-configuration-layers '(
|
|
|
|
(osx :variables osx-option-as 'meta
|
|
|
|
osx-right-option-as 'none)))
|
2016-02-22 21:28:48 +00:00
|
|
|
#+END_SRC
|
|
|
|
|
2019-10-13 05:27:17 +00:00
|
|
|
*** Define words using macOS Dictionary
|
|
|
|
This layer by default enables defining words under point ~SPC x w d~ using macOS
|
2016-08-28 10:38:34 +00:00
|
|
|
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
|
|
|
|
|
2018-12-05 03:03:03 +00:00
|
|
|
* Key bindings
|
2015-06-10 16:44:30 +00:00
|
|
|
|
2018-12-05 03:03:03 +00:00
|
|
|
| Key binding | Description |
|
2016-08-28 10:38:34 +00:00
|
|
|
|-------------+-----------------------------|
|
|
|
|
| ~⌘ =~ | 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 |
|
2017-04-11 20:43:54 +00:00
|
|
|
| ~⌘ `~ | Other frame |
|
2016-08-28 10:38:34 +00:00
|
|
|
| ~⌘ 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.
|
2019-10-13 05:27:17 +00:00
|
|
|
- Configurable option to keep the macOS and Spacemacs clipboards separate.
|