2010/12/1 Ben Fritz <[email protected]>
>
>
> On Nov 30, 5:47 am, zhang listar <[email protected]> wrote:
> > :inoremap ( ()<ESC>i
> > :inoremap ) <c-r>=ClosePair(')')<CR>
> > :inoremap { {}<ESC>i
> > :inoremap } <c-r>=ClosePair('}')<CR>
> > :inoremap [ []<ESC>i
> > :inoremap ] <c-r>=ClosePair(']')<CR>
> > :inoremap < <><ESC>i
> > :inoremap > <c-r>=ClosePair('>')<CR>
> >
> > function ClosePair(char)
> > if getline('.')[col('.') - 1] == a:char
> > return "\<Right>"
> > else
> > return a:char
> > endif
> > endf
> >
> > I have added the lines above to my vimrc, but vim does't automatically
> > complete bracket,
> > What's wrong with my vim?
> > The vimrc is as follows:
> >
> I don't see the content above in your .vimrc you posted. Are you sure
> you added it?
> On a related note, I like using <Left> instead of <Esc>i in the
> mappings I have that do similar things. Fewer side effects.
> See our tip on the subject:
> http://vim.wikia.com/wiki/Automatically_append_closing_characters
> <http://www.vim.org/maillist.php>
>
I am sure that I have added the content to my vimrc. Now, the character {, [
works fine.
But when I type (, vim can't automatically append ) for me. Instead, the
plugin acp or neocomplcache(I am not sure which one)
take effect, and pops up a menu to choose the item.
I doubt that some plugin of vim has affect inoremap of ( .
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php