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 to disable delimitMate for certain characters? #232

Closed dorserg closed 8 years ago

dorserg commented 8 years ago

Is there a way to disable delimitMate functionality for certain characters (but keep it enabled for all the other characters)? E.g. it would make sense to disable autoclosing for "<" in C++ files, as operators << and >> are used quite often.

This can be emulated somewhat by delimitMate_matchpairs (list default matchpairs minus the characters you want to disable delimitMate for), but this feels like a workaround. Something like (non-yet-existent) delimitMate_disabled_matchpairs would be more explicit and convenient.

Or maybe there is an existing option that I've missed that achieves this?

Raimondi commented 8 years ago

You can use something like

au FileType cpp let b:delimitMate_matchpairs = '(:),{:},[:]'

that will affect c++ files only.

dorserg commented 8 years ago

Ah, yes, this works. I thought matchpairs also affects all other characters like single or double quotes, but since that's not the case, specifying delimitMate_matchpairs = '(:),{:},[:]' is relatively as easy as (non-existent) delimitMate_disabled_matchpairs = '<:>'.