Chinese layer: add fcitx support

This commit is contained in:
zilongshanren 2015-11-17 08:23:02 +08:00 committed by syl20bnr
parent 410d3d9572
commit 81aea286ad
3 changed files with 30 additions and 6 deletions

View File

@ -10,6 +10,7 @@
- [[Configuration][Configuration]]
- [[Configure the Default Input Method(配置默认中文输入法)][Configure the Default Input Method(配置默认中文输入法)]]
- [[Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)][Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)]]
- [[Enable fcitx][Enable fcitx]]
- [[Enable YouDao(有道) Dictionary(激活有道字典)][Enable YouDao(有道) Dictionary(激活有道字典)]]
- [[Set monospaced font size(设置等宽字体)][Set monospaced font size(设置等宽字体)]]
- [[Enable/Disable ace-pinyin in =avy-goto-char=][Enable/Disable ace-pinyin in =avy-goto-char=]]
@ -21,6 +22,7 @@
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/cute-jumper/fcitx.el][cute-jumper/fcitx.el]]: This package provides a set of functions to make fcitx work better in Emacs.
- [[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'.
@ -50,6 +52,18 @@ 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 fcitx
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((chinese :variables
chinese-enable-fcitx t)))
#+END_SRC
If you dont need to type Chinese in minibuffer, you could temporarily disable fcitx in minibuffer
with the following configuration.
#+BEGIN_SRC emacs-lisp
(fcitx-aggressive-setup)
#+END_SRC
*** Enable YouDao(有道) Dictionary(激活有道字典)
The YouDao Dictionary is disabled by default, if you want enable it.

View File

@ -21,6 +21,9 @@
(defvar chinese-enable-avy-pinyin t
"Enable ace-pinyin in avy-goto-char")
(defvar chinese-enable-fcitx nil
"Enable fcitx to help writing Chinese in Evil mode.")
;; Set the monospaced font size when mixed Chinese and English words
(defun spacemacs//set-monospaced-font (english chinese english-size chinese-size)
(set-face-attribute 'default nil :font

View File

@ -13,12 +13,11 @@
;; List of all packages to install and/or initialize. Built-in packages
;; which require an initialization must be listed explicitly in the list.
(setq chinese-packages
'(
find-by-pinyin-dired
ace-pinyin
pangu-spacing
org
))
'(
find-by-pinyin-dired
ace-pinyin
pangu-spacing
org))
(if chinese-enable-youdao-dict
(push 'youdao-dictionary chinese-packages))
@ -27,6 +26,14 @@
(push 'chinese-wbim chinese-packages)
(push 'chinese-pyim chinese-packages))
(if chinese-enable-fcitx
(push 'fcitx chinese-packages))
(defun chinese/init-fcitx ()
(use-package fcitx
:init
(fcitx-evil-turn-on)))
(defun chinese/init-chinese-wbim ()
"Initialize chinese-wubi"
(use-package chinese-wbim