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]] - [[#future-work][Future Work]]
* Description * Description
Spacemacs is not just emacs+vim. It can have OSX keybindings too! Spacemacs is not just emacs+vim. It can have OSX keybindings too! This layer
This layer globally defines common OSX keybindings. ~⌘~ is set to globally defines common OSX keybindings. ~⌘~ is set to ~super~ and ~⌥~ is set to
~super~ and ~⌥~ is set to ~meta~. Aside from that, there's nothing ~meta~. Aside from that, there's nothing much, really.
much, really.
While in =dired= this layer will try to use =gls= instead of =ls=. While in =dired= this layer will try to use =gls= instead of =ls=.
* Philosophy * Philosophy
While this layer enables common OSX bindings, it does not implement While this layer enables common OSX bindings, it does not implement OSX
OSX navigation keybindings. Spacemacs is meant to be used with evil, navigation keybindings. Spacemacs is meant to be used with evil, and we
and we encourage you to do so :) encourage you to do so :)
* Install * Install
** Layer ** Layer
To use this configuration layer, add it to your =~/.spacemacs=. You will need to 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 add =osx= to the existing =dotspacemacs-configuration-layers= list in this file.
file.
*** Use with non-US keyboard layouts *** Use with non-US keyboard layouts
If you need the ~⌥~ key to type common characters such as ={[]}~= which is usual 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 *** 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=: You can disable it by setting =osx-use-dictionary-app= variable to =nil=:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -70,21 +79,22 @@ To get =gls= install coreutils homebrew:
* Key Bindings * Key Bindings
| Key Binding | Description | | Key Binding | Description |
|-------------+-------------------| |-------------+-----------------------------|
| ~⌘ =~ | Scale up text | | ~⌘ =~ | Scale up text |
| ~⌘ -~ | Scale down text | | ~⌘ -~ | Scale down text |
| ~⌘ q~ | Quit | | ~⌘ q~ | Quit |
| ~⌘ v~ | Paste | | ~⌘ v~ | Paste |
| ~⌘ c~ | Copy | | ~⌘ c~ | Copy |
| ~⌘ x~ | Cut | | ~⌘ x~ | Cut |
| ~⌘ a~ | Select all | | ~⌘ a~ | Select all |
| ~⌘ w~ | Close window | | ~⌘ w~ | Close window |
| ~⌘ W~ | Close frame | | ~⌘ W~ | Close frame |
| ~⌘ n~ | New frame | | ~⌘ n~ | New frame |
| ~⌘ z~ | Undo | | ~⌘ z~ | Undo |
| ~⌘ Z~ | Redo | | ~⌘ Z~ | Redo |
| ~⌃ ⌘ f~ | Toggle fullscreen | | ~⌃ ⌘ f~ | Toggle fullscreen |
| ~SPC x w d~ | Define word under the point |
* Future Work * Future Work
- Allow user to choose from either ~hyper~ or ~super~ as ~⌘~. This is an option - 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 (use-package osx-dictionary
:if osx-use-dictionary-app :if osx-use-dictionary-app
:init (spacemacs/set-leader-keys "xwd" 'osx-dictionary-search-pointer) :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 :config
(progn (progn
(evilified-state-evilify-map osx-dictionary-mode-map (evilified-state-evilify-map osx-dictionary-mode-map