Add pinyin support for avy-goto-char
This commit is contained in:
parent
91588dc7a0
commit
7dca03151c
|
@ -12,6 +12,7 @@
|
||||||
- [[Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)][Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)]]
|
- [[Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)][Configure the =Chinese-pyim= Input Method(配置中文拼音输入法)]]
|
||||||
- [[Enable YouDao(有道) Dictionary(激活有道字典)][Enable YouDao(有道) Dictionary(激活有道字典)]]
|
- [[Enable YouDao(有道) Dictionary(激活有道字典)][Enable YouDao(有道) Dictionary(激活有道字典)]]
|
||||||
- [[Set monospaced font size(设置等宽字体)][Set monospaced font size(设置等宽字体)]]
|
- [[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]]
|
- [[Key Bindings][Key Bindings]]
|
||||||
- [[Youdao Dictionary][Youdao Dictionary]]
|
- [[Youdao Dictionary][Youdao Dictionary]]
|
||||||
- [[Find-by-pinyin-dired][Find-by-pinyin-dired]]
|
- [[Find-by-pinyin-dired][Find-by-pinyin-dired]]
|
||||||
|
@ -37,7 +38,7 @@ To use this contribution add it to your =~/.spacemacs=
|
||||||
** Configuration
|
** Configuration
|
||||||
*** Configure the Default Input Method(配置默认中文输入法)
|
*** Configure the Default Input Method(配置默认中文输入法)
|
||||||
The default Chinese input method is =Chinese-pyim=, if you are a Wubi(五笔) user,
|
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
|
#+begin_src emacs-lisp
|
||||||
(setq-default dotspacemacs-configuration-layers '(
|
(setq-default dotspacemacs-configuration-layers '(
|
||||||
(chinese :variables chinese-default-input-method 'wubi)))
|
(chinese :variables chinese-default-input-method 'wubi)))
|
||||||
|
@ -52,7 +53,7 @@ just press =s= to save and =R= to restart configuration.
|
||||||
|
|
||||||
*** Enable YouDao(有道) Dictionary(激活有道字典)
|
*** Enable YouDao(有道) Dictionary(激活有道字典)
|
||||||
The YouDao Dictionary is disabled by default, if you want enable it.
|
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
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq-default dotspacemacs-configuration-layers '((chinese :variables
|
(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)
|
(spacemacs//set-monospaced-font "Source Code Pro" "Hiragino Sans GB" 14 16)
|
||||||
#+END_SRC
|
#+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
|
* Key Bindings
|
||||||
Currently, there are no built-in key bindings for this layer. You could define
|
Currently, there are no built-in key bindings for this layer. You could define
|
||||||
your own preference.
|
your own preference.
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
(defvar chinese-enable-youdao-dict nil
|
(defvar chinese-enable-youdao-dict nil
|
||||||
"Enble YouDao Dict translation service.")
|
"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
|
;; Set the monospaced font size when mixed Chinese and English words
|
||||||
(defun spacemacs//set-monospaced-font (english chinese english-size chinese-size)
|
(defun spacemacs//set-monospaced-font (english chinese english-size chinese-size)
|
||||||
(set-face-attribute 'default nil :font
|
(set-face-attribute 'default nil :font
|
||||||
|
|
|
@ -79,6 +79,8 @@
|
||||||
:defer t
|
:defer t
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
|
(if chinese-enable-avy-pinyin
|
||||||
|
(setq ace-pinyin-use-avy t))
|
||||||
(ace-pinyin-global-mode t)
|
(ace-pinyin-global-mode t)
|
||||||
(spacemacs|hide-lighter ace-pinyin-mode))))
|
(spacemacs|hide-lighter ace-pinyin-mode))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue