恩......你把<c-x><c-n>改成<c-x><c-u>试试看,其他的可以不变......我是用c-n做测试的,因为我的vim文件类型没有
completefunc,没法试验c-u。
我也不知道啊,我用火狐浏览器,不知道是不是Bug......

by the way, we speak chinese here, may be not good...

On 1月11日, 下午4时15分, "Yue Wu" <[email protected]> wrote:
> It works fine, thank you!
>
> 为什么你的每封信都发了相同的两份?小心被骂。。。
>
>
>
> On Sun, 11 Jan 2009 15:35:53 +0800, StarWing wrote:
>
> > sorry for my lazy, i use chinese to explain it...
> > 好吧,你应该可以这么做:
>
> > function! Space()
> >     if getline('.')[col('.')-2] !~ '\a'
> >         " 加入下面这一行,防止变成继续补全,见:h ctrl-x_ctrl-n
> >                     \ || pumvisible()
> >         return ' '
> >     else
> >         let g:old_col = col('.')
> >         return "\<c-x>\<c-n>"
> >     endif
> > endfunction
>
> > function! ResultOfSpace()
> >     " 如果出现列表,自动选中第一个
> >     if pumvisible()
> >         return "\<c-n>"
>
> >     "  
> > 如果当前只有唯一匹配,返回如下字符串,防止再次按空格键时产生连续补全
> >     elseif col('.') != g:old_col
> >         return " \<bs>"
>
> >     " 补全失败,补上一个空格
> >     else
> >         return " "
> >     endif
> > endfunction
>
> > ino <space> <c-r>=Space()<cr><c-r>=ResultOfSpace()<cr>
>
> > On 1月11日, 上午9时18分, "Yue Wu" <[email protected]> wrote:
> >> On Sun, 11 Jan 2009 09:10:12 +0800, StarWing <[email protected]>  
> >> wrote:
>
> >> > just a problem, in your words,
> >> > app|
> >> > "|" places the location of cursor, now you press <space>, and it spead
> >> > to <C-X><C-U><C-U>, but can't find match.then you will find, you can't
> >> > input space in this place.
> >> > you can have a try.
>
> >> Yes, that's the correct respond of vim. That's not a problem for me.
> >> I just want that:
>
> >> In condition "app|<space>", <space> will do <C-x><C-u><C-u> for me,
> >> say there is a completion "程" for app, result will be "程|"
>
> >> In condition "程|<space>", <space> will insert a <space> for me,
> >> so result will be "程 |"
>
> >> Any easy solution?
>
> >> --
> >> Regards,
> >> Van.
>
> --
> 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