delimitMate has some nice logic for doing per-filetype mappings, but
this logic can't be used when users provide mappings directly. To remedy
this, add two User events `delimitMate_map` and `delimitMate_unmap` that
are fired at the appropriate times. Users can use these events to define
per-filetype mappings just as delimitMate does.
Restrict unmapping to check for '^<Plug>delimitMate' (case sensitive)
instead of 'delimitMate' (case insensitive). This should make it less
likely to accidentally trigger on custom user keybinds that reference
delimitMate.
When indentation is controlled by 'smartindent', the expand_cr behavior
doesn't end up producing the same results that you would get without
delimitMate. The following behavior results instead:
Before: {|}
After: {
|
}
The expected behavior is to produce the following:
Before: {|}
After: {
|
}
To that end, detect when indentation is controlled by 'smartindent' and
adjust the indentation of the close line to match.