On Wed, 07 Jan 2009 09:48:05 +0800, Sean <[email protected]> wrote:

>
> An updated version of ChineseIM.vim and data file are available.
> Following are improvements:
>
> (1) Made new naming
>     (a) Plugin File =>  ChineseIM.vim
>     (b) Data File =>  http://maxiangjiang.googlepages.com/ChineseIM.dict
>     (c) global-variable =>  g:ChineseIM_InsertMode_Toggle
>     (d) global-variable =>  g:ChineseIM_Ctrl6_Toggle
>
> (2) Added a quick demo, to play without data file installed.
>     (a) Assumption: vim is configured to show Chinese
>     (b) source this script file by :source %
>     (c) when in Insert mode, type:
>         ma<C-X><C-U>
>         chin<C-X><C-U>
>
> (3) Showing more information on the popup menu:
>     It is great when we have English Data File.
>     To demo the usage, I added 2 entries ("english", "chinese") to the
> new data file.  Now type:
>         engl<C-X><C-U>
>         chin<C-X><C-U>
>
> (4) In ChineseIM_InsertMode, made punctuation intelligent :))
>
>     ,  ==> Chinese , plus <Space>
>     .  ==> Chinese . plus <Space>
>     :  ==> Chinese : plus <Space>
>     ;  ==> Chinese ; plus <Space>
>     ?  ==> Chinese ? plus <Space>
>     \  ==> Chinese \ plus <Space>
>
> (5) In ChineseIM_InsertMode, added one more indication
>     (a) cursor color turns to green
>     (d) Status line shows  " -- INSERT (lang) --"
>
> (6) uploaded a new data file, adding pinyin with tones to limit
> selection.
>     For example, "ma1", "ma2", "ma3", "ma4" works now
>
> (7) Downloading:
>     (a) Data File:  http://maxiangjiang.googlepages.com/ChineseIM.dict
>     (b) Plugin:   
> http://vim.sourceforge.net/scripts/script.php?script_id=2506

Didn't you see my reply? your script still use imap-local
so it would work just for [no name] buffer or the file
you start vim to edit from command line.

>
> Again, feedback is always welcome.

1. I think you can define a variable to toggle inputting Chinese
or English punctations.

2. The searching still need some improvings, say if "ww" and "www"
has no Chinese charator but "wwww" has, then typing "ww" should search for
the longer list instead of saying no pattern found.

3. If the charactor that cursor is on isn't non-black-space ascii,
then <space> just do normal <space> i.e. insert a real <space>
instead of saying "pattern not found" that is really useless. And I think
it's more intelligent.

4. Add an autocmd to toggle IME off when escape from insert mode.
Something like this:

au InsertLeave * call ChineseIM_InsertMode_ToggleOff()

function ChineseIM_InsertMode_ToggleOff()
     " -----------------------------------  options
     let &pumheight=s:saved_pumheight
     let &completeopt=s:saved_completeopt
     let &lazyredraw=s:saved_lazyredraw
     " -----------------------------------  IM mode indication
     let &iminsert=s:saved_iminsert
     highlight Cursor guifg=bg guibg=fg
     " -----------------------------------  <Space>
     imap <Space> <Space>
     " -----------------------------------  bracket
     imap (  (
                 imap )  )
     imap <  <
     imap >  >
     imap [  [
     imap ]  ]
     " -----------------------------------  punctuation
     imap ,  ,
     imap .  .
     imap :  :
     imap ;  ;
     imap ?  ?
     imap \\ \\
     " -----------------------------------
     let s:n += 1
endfunction


-- 
Regards,
Van.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to