spacemacs/contrib/chinese/README.org

71 lines
3.4 KiB
Org Mode
Raw Normal View History

2015-06-27 15:12:43 +00:00
#+TITLE: Chinese contribution layer for Spacemacs
[[file:img/China.png]] [[file:img/Chinese.png]]
* Table of Contents :TOC@4:
- [[#description][Description]]
- [[#install][Install]]
- [[#layer][Layer]]
- [[#configuration][Configuration]]
- [[#configure-the-default-input-method配置默认中文输入法][Configure the Default Input Method(配置默认中文输入法)]]
- [[#configure-the-chinese-pyim-input-method配置中文拼音输入法][Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)]]
- [[#set-monospaced-font-size设置等宽字体][Set monospaced font size(设置等宽字体)]]
- [[#key-bindings][Key Bindings]]
- [[#youdao-dictionrary][Youdao Dictionrary]]
- [[#find-by-pinyin-dired][Find-by-pinyin-dired]]
* Description
This Layer adds Chinese related packages:
- [[https://github.com/tumashu/chinese-pyim][chinese-pyim]] : The best Chinese Pinyin(拼音) input method.
- [[https://github.com/andyque/chinese-wbim][chinese-wbim]]: The best Chinese Wubi(五笔) input method.
- [[https://github.com/xuchunyang/youdao-dictionary.el][youdao-dictionary]]: The Youdao(有道) Dictionary interface for Emacs.
- [[https://github.com/redguardtoo/find-by-pinyin-dired][find-by-pinyin-dired]]: Find file by first Pinyin characters of Chinese Hanzi.
- [[https://github.com/cute-jumper/ace-pinyin][ace-pinyin]]: Jump to Chinese character by pinyin with `ace-jump-mode'.
* Install
** Layer
To use this contribution add it to your =~/.spacemacs=
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(chinese))
#+END_SRC
** Configuration
*** Configure the Default Input Method(配置默认中文输入法)
The default Chinese input method is =Chinese-pyim=, if you are a Wubi(五笔) user,
you could set the variable `chinese-default-input-method` to 'wubi:
#+begin_src emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(chinese :variables chinese-default-input-method 'wubi)))
#+end_src
*** Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)
When the first time you use =Chinese-pyim=, you should install the lexicon(词库) file.
You could call =pyim-dicts-manager= to open up the settings buffer and press =i e= to install the default lexicon.
The lexicon is about 20M, so you should be patient when downloading starts.
After the lexicon file is downloaded, just press =s= to save and =R= to restart configuration.
*** Set monospaced font size(设置等宽字体)
If you are mixing Chinese words with English words, the text is not perfectly aligned in org table.
That's because normally the Chinese font size is not equal to the English font size.
You could call =spacemacs//set-monospaced-font= with your own Chinese font name in =dotspacemacs/config= function.
Example configuration:
#+begin_src emacs-lisp
;;Note: The Hiragino Sans GB is bundled with MacOS X.
;;If you are not using MacOS X, you should change it to another Chinese font name.
(spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16)
#+end_src
* Key Bindings
Currently, there are no built-in key bindings for this layer. You could define your own preference.
Here are a few suggested key bindings:
** Youdao Dictionrary
Bind ~<SPC> o y~ to =youdao-dictionary-search-at-point+=.
** Find-by-pinyin-dired
Bind ~<SPC> o d~ to =find-by-pinyin-dired=