Evil’s f/F/t/T commands with Pinyin support, with optional evil-snipe integration.
让 Evil 的 f/F/t/T 命令支持拼音首字母搜索。 可选的对 evil-snipe 的支持。
Recommendation: Install from melpa.
If you install this package manually:
(add-to-list 'load-path "/path/to/evil-find-char-pinyin.el") (require 'evil-find-char-pinyin)
To enable the mode:
(evil-find-char-pinyin-mode +1)
After you enable the mode, evil
’s f/F/t/T commands are able to jump to
Chinese characters by their Pinyin. You can also use ;
and ,
to repeat
the last f/F/t/T command.
For example (|
is the location of the cursor):
|我能吞下玻璃而不伤身体。
dft
will delete 我能吞
.
It also supports Chinese punctuactions:
|我能吞下玻璃而不伤身体。
dt.
will delete up to 。
.
This package uses pinyinlib.el behind the scene to translate the letter to Simplified/Traditional Chinese characters and English punctuations to Chinese punctuations. To see the full list of Chinese punctuations that are supported, look at pinyinlib.el.
If you’re using evil-snipe for 2-char searching in evil, you can enable
evil-snipe
integration:
(evil-find-char-pinyin-toggle-snipe-integration t)
Use nil
as the parameter to disable the integration.
After enabling this feature, all of evil-snipe
’s commands:
evil-snipe-repeat
andevil-snipe-repeat-reverse
evil-snipe-s
andevil-snipe-S
evil-snipe-x
andevil-snipe-X
evil-snipe-f
andevil-snipe-F
evil-snipe-t
andevil-snipe-T
are able to search Chinese characters by letters.
By default, only Simplifed Chinese charaters are supported. To enable Traditional Chinese support:
(setq evil-find-char-pinyin-only-simplified nil)
If you don’t want the punctuation support, use:
(setq evil-find-char-pinyin-enable-punctuation-translation nil)