sponsor Vim development Vim logo Vim Book Ad

PinyinSearch : Allow you to search Chinese by the first letter of Chinese pinyin

 script karma  Rating 56/16, Downloaded by 2112  Comments, bugs, improvements  Vim wiki

created by
Yuxin Wu
 
script type
utility
 
description
INTRODUCTION:
=============
Allow searching of Chinese in VIM by the first letter of Chinese pinyin.
Vim中允许使用拼音首字母搜索中文.

USAGE:
======
call PinyinSearch() and enter the target chars(first letters of the word),all the matching words will be highlighted, you can use 'n' and 'N' to jump.

During a normal searching (i.e. you are searching for pure english), call PinyinNext() and all the matching Chinese will also be highlighted.

------------------------------------------------------------------------------------------

PinyinSearch()函数接受首字母输入,将高亮所有匹配的中英文,并允许用n,N跳转搜索结果.

正在用'/'搜索英文时,调用PinyinNext()函数可以将匹配的中文也加入搜索.

EXAMPLE:
========

----------START OF EXAMPLE FILE----------------
今天是个好日子,心想的事儿都能成,

大能猫dn
----------END OF EXAMPLE FILE----------------
In normal mode, enter '/dn' , then "dn" will be highlighted.
Then, call PinyinNext(), then "大能" and "都能" will also be highlighted, and the cursor will jump to "大能".

Or you can just simply call PinyinSearch() and enter 'dn', both English and Chinese will be searched.




The Project is maintained at
http://github.com/ppwwyyxx/vim-PinyinSearch
 
install details
1. copy PinyinSearch.vim to your plugin directory

2. specify the location of dict file in your .vimrc, e.g.:

let g:PinyinSearch_Dict = '/home/wyx/.vim/PinyinSearch.dict'

3. (optional)add your custom key map, e.g.:

                nnoremap ? :call PinyinSearch()<CR>
                " I suggest use '?' to search Pinyin (since we have 'N', why using ? to search backward)
                nnoremap <Leader>pn :call PinyinNext()<CR>
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
PinyinSearch.tar.gz 0.8 2013-01-28 7.0 Yuxin Wu change to a new dict; fix highlight problem
PinyinSearch.tar.gz 0.7 2012-11-28 7.0 Yuxin Wu fix bug on nomatch
vim-PinyinSearch.tar.gz 0.6 2012-10-27 7.0 Yuxin Wu easier to use with n/N navigate
PinyinSearch.tar.gz 0.5 2012-09-11 7.0 Yuxin Wu Initial upload
ip used for rating: 18.97.14.83

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github