This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/chinese
andyque c737da5952 chinese layer: fixes
- fix Source Code Pro not found issue
- add option to toggle youdao dict package.
- and also improve IM package installation.

use push instead of add-to-list
2015-07-23 22:51:17 -04:00
..
img Add Chinese layer to spacemacs. 2015-07-05 00:20:04 -04:00
config.el chinese layer: fixes 2015-07-23 22:51:17 -04:00
packages.el chinese layer: fixes 2015-07-23 22:51:17 -04:00
README.org chinese layer: fixes 2015-07-23 22:51:17 -04:00

Chinese contribution layer for Spacemacs

/TakeV/spacemacs/media/commit/6e549cbe2a1de8206f726ac538e7da58991ea92f/contrib/chinese/img/China.png /TakeV/spacemacs/media/commit/6e549cbe2a1de8206f726ac538e7da58991ea92f/contrib/chinese/img/Chinese.png

Description

This Layer adds Chinese related packages:

Install

Layer

To use this contribution add it to your ~/.spacemacs

  (setq-default dotspacemacs-configuration-layers '(chinese))

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:

  (setq-default dotspacemacs-configuration-layers '(
    (chinese :variables chinese-default-input-method 'wubi)))

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.

Enable YouDao(有道) Dictionary(激活有道字典)

The YouDao Dictionary is disabled by default, if you want enable it. You should set `chinese-enable-youdao-dict` to `t`.

  (setq-default dotspacemacs-configuration-layers '((chinese :variables
                                                             chinese-enable-youdao-dict t)))

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:

;; 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)

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 (remember that SPC o is reserved for personal usage, spacemacs won´t put any binding under this prefix):

Youdao Dictionary

Bind SPC o y to youdao-dictionary-search-at-point+.

Find-by-pinyin-dired

Bind SPC o d to find-by-pinyin-dired