Skip to content

jump to chinese character base on its Pinyin #267

@jdhao

Description

@jdhao

It would be great if we can also jump to Chinese characters using the first letter of its Pinyin, because if we use the Chinese character itself for jumping, we have to type several key strokes (which is usually the Pinyin of a Chinese character, of course, there are other ways, but pinyin is the most used way) to get the character.

A crude translation of the above English text:

如果能用汉字的拼音首字母来跳转到对应的汉字就更好了,因为如果我们直接使用汉字来搜索,我们必须先使用拼音打出这个汉字,这样有点繁琐,会导致我们需要敲击更多键盘。

Suppose we have the above Chinese texts and we want to jump to the Chinese words 汉语 (the corresponding pinyin is han yu), it would be great if we can type the sneak shortcut, and then press hy to jump to the position where words 汉语 exist.

Some thought on how this may be implemented:

  • Find the first alphabet of the pinyin for each Chinese character in the current buffer or viewport.
  • when the user provides the sneak character for the Chinese character using the first alphabet of its Pinyin, find the consecutive Chinese characters whose pinyin match the sneak character, bookmark their locations, and give them labels
  • Jump to a location when the user provides the sneak label.

A similar discussion about this feature for vim-easymotion is here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions