Vim Tips Wiki

Use this page to discuss script 2754 delimitMate: auto-balancing and expansions for parens, quotes, etc

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on
  • This page may be out of date: check the script's page above, and its release notes.

The delimitMate plugin tries to provide some not so dumb help in the work with delimiters (brackets, quotes, etc.), with some optional auto-balancing and expansions. It's highly customizable and supports FileType autocmd events. Check the script's page for more info.

Leave your comments, suggestions or report any issues below, or at GitHub.

--Raimondi 20:38, March 5, 2010 (UTC)


See also Automatically append closing characters

Hi. After the closing delimiter gets inserted, and the cursor is placed in the middle of the pair, you can't seem to move the cursor backwards (using the left arrow) over the inserted text and if you try moving it to the right, it inserts the closing delimiter again. Works fine if you leave and reenter insert mode. Tried it with auto-close both on and off and got the same behavior.

I think I fixed the bug, if you want to test it, download the source files from the following link:
Works fine now.
Thanks a lot!

Hi. I've got an error while trying your script. To reproduce error start gvim with new file, enter in insert mode, type quote e.g. ' (actually this happens with any quotes, parenthesis, brackets, etc.). After closing quote gets inserted try using Shift+Backspace to remove only one quote. I've got this error messages

Error detected while processing function delimitMate#IsForbidden..delimitMate#GetCurrentSyntaxRegionIf:
line    4:
E523: Not allowed here
Press ENTER or type command to continue
Error detected while processing function delimitMate#IsForbidden..delimitMate#GetCurrentSyntaxRegionIf:
line    6:
E523: Not allowed here

I'm using

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 7 2010 02:02:04)
MS-Windows 32-bit GUI version
Included patches: 1-411
Modified by Vim extended
I fixed the problem and uploaded the changes to GitHub.

-- 21:10, June 22, 2010 (UTC)

Hi. I've fetched latest version from GitHub and i can't see options delimitMate_expand_cr & delimitMate_expand_space available. -- 07:53, June 23, 2010 (UTC)

I'm not sure what you mean, could you elaborate on how you can't see them?


Actually I need to enable expansion of space & car return. As written in delimitMate help to enable this functionality one must change ::value of delimitMate_expand_cr or let delimitMate_expand_space variables to 1. In command line type ":let b:delimitMate_" than press Ctrl-D ::and look on var list. I can't see there delimitMate_expand_cr & delimitMate_expand_space only delimitMate_l_expand_cr & ::delimitMate_l_expand_space and them is locked. Even so I can do assignment :let delimitMate_expand_cr=1<CR> or :let ::delimitMate_expand_cr=1<CR> and it succeeds but after that i don't get expand functionality. --Rusmaslov 07:31, June 24, 2010 (UTC)
You need to use :DelimitMateReload after setting any option in the current buffer for it to take effect. If you set it in your vimrc it'll be detected automatically. --Raimondi 16:38, June 24, 2010 (UTC)

It is unclear from the docs whether multi-character delimiters can be used in delimitMate_matchpairs, .e.g. PHP's '<?:?>'.

This is from the doc:
Values: A string with |matchpairs| syntax.
The documentation for 'matchpairs' is quite clear, in my opinion, that's why I used it as reference. What do you suggest?
--Raimondi 08:30, July 16, 2010 (UTC)