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

How to switch mappings? #255

Open alok opened 7 years ago

alok commented 7 years ago

When I'm writing C, I use { far more than [, so I swapped them in insert mode.

How would I swap their delimitMate mappings as well?

imap <buffer><silent> [ <Plug>DelimitMate{ didn't work.

adriaanzon commented 7 years ago

You'd have to set them up just before delimitMate defines its mappings.

Something like this:

autocmd User delimitMate_map imap <buffer> ( <Plug>delimitMate[
autocmd User delimitMate_map imap <buffer> [ <Plug>delimitMate(

Or only for C:

autocmd User delimitMate_map if &ft ==# 'c' | imap <buffer> ( <Plug>delimitMate[| endif
autocmd User delimitMate_map if &ft ==# 'c' | imap <buffer> [ <Plug>delimitMate(| endif