Raimondi / delimitMate

Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
http://www.vim.org/scripts/script.php?script_id=2754
1.98k stars 117 forks source link

Is there a way of making this plugin work together with echofunc? #75

Closed skeept closed 12 years ago

skeept commented 12 years ago

Hi

I really like this plugin. I would also be able to use together with another plugin echofunc that displays the prototype of the function when I type (.

Is there a way of using both together?

Thanks.

Raimondi commented 12 years ago

I'm not sure, echofunc overwrites previous mappings from what I could see. If you can prevent that from happening you could try something like this:

ino <Plug>echofunc( (<c-r>=EchoFunc()<cr>
ino <Plug>echofunc)<c-r>=EchoFuncClear()<cr>)
imap <silent> ( <Plug>echofunc(<Plug>delimitMate(
imap <silent> ) <Plug>echofunc)<Plug>delimitMate)

Good luck!

skeept commented 12 years ago

Thanks, based on your suggestions I did the following: First I went to echofunc and commented the lines where the mappings for ( and ) are defined. Next I created a file in after/plugin with the contents:

imap <silent> ( <Plug>delimitMate(<c-r>=EchoFunc()<cr>

and now I can use both plugins together. I don't understand why but in the line above I have to use imap instead of inoremap. If I use inoremap it doesn't work.

Thanks again.

Raimondi commented 12 years ago

The reason is that you need to expand the mappings, inoremap doesn't allow further expanding while imap does.