add notes about setting up osx dictionary

Also fill paragraphs in osx layer readme file.
This commit is contained in:
d12frosted 2016-08-28 13:38:34 +03:00
parent 78d76758e5
commit 89137bb482
No known key found for this signature in database
GPG Key ID: 8D33A3B1A4AF7D30
3 changed files with 56 additions and 25 deletions

View File

@ -14,23 +14,21 @@
- [[#future-work][Future Work]]
* 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.
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.
While in =dired= this layer will try to use =gls= instead of =ls=.
* 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 :)
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
** Layer
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =osx= to the existing =dotspacemacs-configuration-layers= list in this
file.
add =osx= to the existing =dotspacemacs-configuration-layers= list in this file.
*** Use with non-US keyboard layouts
If you need the ~⌥~ key to type common characters such as ={[]}~= which is usual
@ -53,7 +51,18 @@ key.
*** Define words using OS X Dictionary
This layer by default enables defining words under point ~SPC x w d~ using OS X Dictionary.
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.
You can disable it by setting =osx-use-dictionary-app= variable to =nil=:
#+BEGIN_SRC emacs-lisp
@ -70,21 +79,22 @@ To get =gls= install coreutils homebrew:
* Key Bindings
| 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 |
| 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 |
* Future Work
- Allow user to choose from either ~hyper~ or ~super~ as ~⌘~. This is an option

18
layers/+os/osx/funcs.el Normal file
View File

@ -0,0 +1,18 @@
;;; config.el --- OSX Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: Boris Buliga <boris@d12frosted.io>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun osx/list-available-dictionaries ()
"Get list of available dictionaries.
Useful when setting `osx-dictionary-dictionary-choice'."
(interactive)
(message (shell-command-to-string
(format "%s -l" (osx-dictionary-cli-find-or-recompile)))))

View File

@ -84,6 +84,9 @@
(use-package osx-dictionary
:if osx-use-dictionary-app
:init (spacemacs/set-leader-keys "xwd" 'osx-dictionary-search-pointer)
:commands (osx-dictionary-search-pointer
osx-dictionary-search-input
osx-dictionary-cli-find-or-recompile)
:config
(progn
(evilified-state-evilify-map osx-dictionary-mode-map