Skip to content

cute-jumper/evil-find-char-pinyin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

evil-find-char-pinyin

Evil’s f/F/t/T commands with Pinyin support, with optional evil-snipe integration.

让 Evil 的 f/F/t/T 命令支持拼音首字母搜索。 可选的对 evil-snipe 的支持。

Installation

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)

Usage

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.

Optional evil-snipe Integration

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 and evil-snipe-repeat-reverse
  • evil-snipe-s and evil-snipe-S
  • evil-snipe-x and evil-snipe-X
  • evil-snipe-f and evil-snipe-F
  • evil-snipe-t and evil-snipe-T

are able to search Chinese characters by letters.

Config

Enable Traditional Chinese Support

By default, only Simplifed Chinese charaters are supported. To enable Traditional Chinese support:

(setq evil-find-char-pinyin-only-simplified nil)

Disable Punctuaction Support

If you don’t want the punctuation support, use:

(setq evil-find-char-pinyin-enable-punctuation-translation nil)

Related Packages

About

Evil's f/F/t/T/evil-snipe commands with Pinyin support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages