Add pinyin support for avy-goto-char

This commit is contained in:
codefalling 2015-11-08 16:59:51 +08:00 committed by syl20bnr
parent 91588dc7a0
commit 7dca03151c
3 changed files with 17 additions and 2 deletions

View File

@ -12,6 +12,7 @@
- [[Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)][Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)]]
- [[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=]]
- [[Key Bindings][Key Bindings]]
- [[Youdao Dictionary][Youdao Dictionary]]
- [[Find-by-pinyin-dired][Find-by-pinyin-dired]]
@ -37,7 +38,7 @@ To use this contribution add it to your =~/.spacemacs=
** 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:
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)))
@ -52,7 +53,7 @@ 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`.
You should set =chinese-enable-youdao-dict= to =t=.
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((chinese :variables
@ -73,6 +74,15 @@ Example configuration:
(spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16)
#+END_SRC
*** Enable/Disable ace-pinyin in =avy-goto-char=
You can use =avy-goto-char= with pinyin supported by default, if you want to
disable it.You can set =chinese-enable-avy-pinyin= to =nil=.
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '((chinese :variables
chinese-enable-avy-pinyin nil)))
#+END_SRC
* Key Bindings
Currently, there are no built-in key bindings for this layer. You could define
your own preference.

View File

@ -18,6 +18,9 @@
(defvar chinese-enable-youdao-dict nil
"Enble YouDao Dict translation service.")
(defvar chinese-enable-avy-pinyin t
"Enable ace-pinyin in avy-goto-char")
;; 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

@ -79,6 +79,8 @@
:defer t
:init
(progn
(if chinese-enable-avy-pinyin
(setq ace-pinyin-use-avy t))
(ace-pinyin-global-mode t)
(spacemacs|hide-lighter ace-pinyin-mode))))