Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

byebye delimitmate.

  • Loading branch information...
commit 155a6bcd38341c1393e8bb0fe1d5fd0dfa57669b 1 parent 52c2605
romainl authored March 24, 2013
586  bundle/delimitmate/autoload/delimitMate.vim
... ...
@@ -1,586 +0,0 @@
1  
-" File:        autoload/delimitMate.vim
2  
-" Version:     2.6
3  
-" Modified:    2011-01-14
4  
-" Description: This plugin provides auto-completion for quotes, parens, etc.
5  
-" Maintainer:  Israel Chauca F. <israelchauca@gmail.com>
6  
-" Manual:      Read ":help delimitMate".
7  
-" ============================================================================
8  
-
9  
-" Utilities {{{
10  
-
11  
-let delimitMate_loaded = 1
12  
-
13  
-function! delimitMate#ShouldJump() "{{{
14  
-	" Returns 1 if the next character is a closing delimiter.
15  
-	let col = col('.')
16  
-	let lcol = col('$')
17  
-	let char = getline('.')[col - 1]
18  
-
19  
-	" Closing delimiter on the right.
20  
-	for cdel in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
21  
-		if char == cdel
22  
-			return 1
23  
-		endif
24  
-	endfor
25  
-
26  
-	" Closing delimiter with space expansion.
27  
-	let nchar = getline('.')[col]
28  
-	if b:_l_delimitMate_expand_space && char == " "
29  
-		for cdel in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
30  
-			if nchar == cdel
31  
-				return 1
32  
-			endif
33  
-		endfor
34  
-	endif
35  
-
36  
-	" Closing delimiter with CR expansion.
37  
-	let uchar = getline(line('.') + 1)[0]
38  
-	if b:_l_delimitMate_expand_cr && char == ""
39  
-		for cdel in b:_l_delimitMate_right_delims + b:_l_delimitMate_quotes_list
40  
-			if uchar == cdel
41  
-				return 1
42  
-			endif
43  
-		endfor
44  
-	endif
45  
-
46  
-	return 0
47  
-endfunction "}}}
48  
-
49  
-function! delimitMate#IsEmptyPair(str) "{{{
50  
-	for pair in b:_l_delimitMate_matchpairs_list
51  
-		if a:str == join( split( pair, ':' ),'' )
52  
-			return 1
53  
-		endif
54  
-	endfor
55  
-	for quote in b:_l_delimitMate_quotes_list
56  
-		if a:str == quote . quote
57  
-			return 1
58  
-		endif
59  
-	endfor
60  
-	return 0
61  
-endfunction "}}}
62  
-
63  
-function! delimitMate#IsCRExpansion() " {{{
64  
-	let nchar = getline(line('.')-1)[-1:]
65  
-	let schar = getline(line('.')+1)[:0]
66  
-	let isEmpty = getline('.') == ""
67  
-	if index(b:_l_delimitMate_left_delims, nchar) > -1 &&
68  
-				\ index(b:_l_delimitMate_left_delims, nchar) == index(b:_l_delimitMate_right_delims, schar) &&
69  
-				\ isEmpty
70  
-		return 1
71  
-	elseif index(b:_l_delimitMate_quotes_list, nchar) > -1 &&
72  
-				\ index(b:_l_delimitMate_quotes_list, nchar) == index(b:_l_delimitMate_quotes_list, schar) &&
73  
-				\ isEmpty
74  
-		return 1
75  
-	else
76  
-		return 0
77  
-	endif
78  
-endfunction " }}} delimitMate#IsCRExpansion()
79  
-
80  
-function! delimitMate#IsSpaceExpansion() " {{{
81  
-	let line = getline('.')
82  
-	let col = col('.')-2
83  
-	if col > 0
84  
-		let pchar = line[col - 1]
85  
-		let nchar = line[col + 2]
86  
-		let isSpaces = (line[col] == line[col+1] && line[col] == " ")
87  
-
88  
-		if index(b:_l_delimitMate_left_delims, pchar) > -1 &&
89  
-				\ index(b:_l_delimitMate_left_delims, pchar) == index(b:_l_delimitMate_right_delims, nchar) &&
90  
-				\ isSpaces
91  
-			return 1
92  
-		elseif index(b:_l_delimitMate_quotes_list, pchar) > -1 &&
93  
-				\ index(b:_l_delimitMate_quotes_list, pchar) == index(b:_l_delimitMate_quotes_list, nchar) &&
94  
-				\ isSpaces
95  
-			return 1
96  
-		endif
97  
-	endif
98  
-	return 0
99  
-endfunction " }}} IsSpaceExpansion()
100  
-
101  
-function! delimitMate#WithinEmptyPair() "{{{
102  
-	let cur = strpart( getline('.'), col('.')-2, 2 )
103  
-	return delimitMate#IsEmptyPair( cur )
104  
-endfunction "}}}
105  
-
106  
-function! delimitMate#WriteBefore(str) "{{{
107  
-	let len = len(a:str)
108  
-	let line = getline('.')
109  
-	let col = col('.')-2
110  
-	if col < 0
111  
-		call setline('.',line[(col+len+1):])
112  
-	else
113  
-		call setline('.',line[:(col)].line[(col+len+1):])
114  
-	endif
115  
-	return a:str
116  
-endfunction " }}}
117  
-
118  
-function! delimitMate#WriteAfter(str) "{{{
119  
-	let len = len(a:str)
120  
-	let line = getline('.')
121  
-	let col = col('.')-2
122  
-	if (col) < 0
123  
-		call setline('.',a:str.line)
124  
-	else
125  
-		call setline('.',line[:(col)].a:str.line[(col+len):])
126  
-	endif
127  
-	return ''
128  
-endfunction " }}}
129  
-
130  
-function! delimitMate#GetSyntaxRegion(line, col) "{{{
131  
-	return synIDattr(synIDtrans(synID(a:line, a:col, 1)), 'name')
132  
-endfunction " }}}
133  
-
134  
-function! delimitMate#GetCurrentSyntaxRegion() "{{{
135  
-	let col = col('.')
136  
-	if  col == col('$')
137  
-		let col = col - 1
138  
-	endif
139  
-	return delimitMate#GetSyntaxRegion(line('.'), col)
140  
-endfunction " }}}
141  
-
142  
-function! delimitMate#GetCurrentSyntaxRegionIf(char) "{{{
143  
-	let col = col('.')
144  
-	let origin_line = getline('.')
145  
-	let changed_line = strpart(origin_line, 0, col - 1) . a:char . strpart(origin_line, col - 1)
146  
-	call setline('.', changed_line)
147  
-	let region = delimitMate#GetSyntaxRegion(line('.'), col)
148  
-	call setline('.', origin_line)
149  
-	return region
150  
-endfunction "}}}
151  
-
152  
-function! delimitMate#IsForbidden(char) "{{{
153  
-	if b:_l_delimitMate_excluded_regions_enabled == 0
154  
-		return 0
155  
-	endif
156  
-	"let result = index(b:_l_delimitMate_excluded_regions_list, delimitMate#GetCurrentSyntaxRegion()) >= 0
157  
-	if index(b:_l_delimitMate_excluded_regions_list, delimitMate#GetCurrentSyntaxRegion()) >= 0
158  
-		"echom "Forbidden 1!"
159  
-		return 1
160  
-	endif
161  
-	let region = delimitMate#GetCurrentSyntaxRegionIf(a:char)
162  
-	"let result = index(b:_l_delimitMate_excluded_regions_list, region) >= 0
163  
-	"return result || region == 'Comment'
164  
-	"echom "Forbidden 2!"
165  
-	return index(b:_l_delimitMate_excluded_regions_list, region) >= 0
166  
-endfunction "}}}
167  
-
168  
-function! delimitMate#FlushBuffer() " {{{
169  
-	let b:_l_delimitMate_buffer = []
170  
-	return ''
171  
-endfunction " }}}
172  
-
173  
-function! delimitMate#BalancedParens(char) "{{{
174  
-	" Returns:
175  
-	" = 0 => Parens balanced.
176  
-	" > 0 => More opening parens.
177  
-	" < 0 => More closing parens.
178  
-
179  
-	let line = getline('.')
180  
-	let col = col('.') - 2
181  
-	let col = col >= 0 ? col : 0
182  
-	let list = split(line, '\zs')
183  
-	let left = b:_l_delimitMate_left_delims[index(b:_l_delimitMate_right_delims, a:char)]
184  
-	let right = a:char
185  
-	let opening = 0
186  
-	let closing = 0
187  
-
188  
-	" If the cursor is not at the beginning, count what's behind it.
189  
-	if col > 0
190  
-		  " Find the first opening paren:
191  
-		  let start = index(list, left)
192  
-		  " Must be before cursor:
193  
-		  let start = start < col ? start : col - 1
194  
-		  " Now count from the first opening until the cursor, this will prevent
195  
-		  " extra closing parens from being counted.
196  
-		  let opening = count(list[start : col - 1], left)
197  
-		  let closing = count(list[start : col - 1], right)
198  
-		  " I don't care if there are more closing parens than opening parens.
199  
-		  let closing = closing > opening ? opening : closing
200  
-	endif
201  
-
202  
-	" Evaluate parens from the cursor to the end:
203  
-	let opening += count(list[col :], left)
204  
-	let closing += count(list[col :], right)
205  
-
206  
-	"echom "–––––––––"
207  
-	"echom line
208  
-	"echom col
209  
-	""echom left.":".a:char
210  
-	"echom string(list)
211  
-	"echom string(list[start : col - 1]) . " : " . string(list[col :])
212  
-	"echom opening . " - " . closing . " = " . (opening - closing)
213  
-
214  
-	" Return the found balance:
215  
-	return opening - closing
216  
-endfunction "}}}
217  
-
218  
-function! delimitMate#RmBuffer(num) " {{{
219  
-	if len(b:_l_delimitMate_buffer) > 0
220  
-	   call remove(b:_l_delimitMate_buffer, 0, (a:num-1))
221  
-	endif
222  
-	return ""
223  
-endfunction " }}}
224  
-
225  
-" }}}
226  
-
227  
-" Doers {{{
228  
-function! delimitMate#SkipDelim(char) "{{{
229  
-	if delimitMate#IsForbidden(a:char)
230  
-		return a:char
231  
-	endif
232  
-	let col = col('.') - 1
233  
-	let line = getline('.')
234  
-	if col > 0
235  
-		let cur = line[col]
236  
-		let pre = line[col-1]
237  
-	else
238  
-		let cur = line[col]
239  
-		let pre = ""
240  
-	endif
241  
-	if pre == "\\"
242  
-		" Escaped character
243  
-		return a:char
244  
-	elseif cur == a:char
245  
-		" Exit pair
246  
-		"return delimitMate#WriteBefore(a:char)
247  
-		return a:char . delimitMate#Del()
248  
-	elseif delimitMate#IsEmptyPair( pre . a:char )
249  
-		" Add closing delimiter and jump back to the middle.
250  
-		call insert(b:_l_delimitMate_buffer, a:char)
251  
-		return delimitMate#WriteAfter(a:char)
252  
-	else
253  
-		" Nothing special here, return the same character.
254  
-		return a:char
255  
-	endif
256  
-endfunction "}}}
257  
-
258  
-function! delimitMate#ParenDelim(char) " {{{
259  
-	if delimitMate#IsForbidden(a:char)
260  
-		return ''
261  
-	endif
262  
-	" Try to balance matchpairs
263  
-	if b:_l_delimitMate_balance_matchpairs &&
264  
-				\ delimitMate#BalancedParens(a:char) <= 0
265  
-		return ''
266  
-	endif
267  
-	let line = getline('.')
268  
-	let col = col('.')-2
269  
-	let left = b:_l_delimitMate_left_delims[index(b:_l_delimitMate_right_delims,a:char)]
270  
-	let smart_matchpairs = substitute(b:_l_delimitMate_smart_matchpairs, '\\!', left, 'g')
271  
-	let smart_matchpairs = substitute(smart_matchpairs, '\\#', a:char, 'g')
272  
-	"echom left.':'.smart_matchpairs . ':' . matchstr(line[col+1], smart_matchpairs)
273  
-	if b:_l_delimitMate_smart_matchpairs != '' &&
274  
-				\ line[col+1:] =~ smart_matchpairs
275  
-		return ''
276  
-	elseif (col) < 0
277  
-		call setline('.',a:char.line)
278  
-		call insert(b:_l_delimitMate_buffer, a:char)
279  
-	else
280  
-		"echom string(col).':'.line[:(col)].'|'.line[(col+1):]
281  
-		call setline('.',line[:(col)].a:char.line[(col+1):])
282  
-		call insert(b:_l_delimitMate_buffer, a:char)
283  
-	endif
284  
-	return ''
285  
-endfunction " }}}
286  
-
287  
-function! delimitMate#QuoteDelim(char) "{{{
288  
-	if delimitMate#IsForbidden(a:char)
289  
-		return a:char
290  
-	endif
291  
-	let line = getline('.')
292  
-	let col = col('.') - 2
293  
-	if line[col] == "\\"
294  
-		" Seems like a escaped character, insert one quotation mark.
295  
-		return a:char
296  
-	elseif line[col + 1] == a:char &&
297  
-				\ index(b:_l_delimitMate_nesting_quotes, a:char) < 0
298  
-		" Get out of the string.
299  
-		return a:char . delimitMate#Del()
300  
-	elseif (line[col] =~ '\w' && a:char == "'") ||
301  
-				\ (b:_l_delimitMate_smart_quotes &&
302  
-				\ (line[col] =~ '\w' ||
303  
-				\ line[col + 1] =~ '\w'))
304  
-		" Seems like an apostrophe or a smart quote case, insert a single quote.
305  
-		return a:char
306  
-	elseif (line[col] == a:char && line[col + 1 ] != a:char) && b:_l_delimitMate_smart_quotes
307  
-		" Seems like we have an unbalanced quote, insert one quotation mark and jump to the middle.
308  
-		call insert(b:_l_delimitMate_buffer, a:char)
309  
-		return delimitMate#WriteAfter(a:char)
310  
-	else
311  
-		" Insert a pair and jump to the middle.
312  
-		call insert(b:_l_delimitMate_buffer, a:char)
313  
-		call delimitMate#WriteAfter(a:char)
314  
-		return a:char
315  
-	endif
316  
-endfunction "}}}
317  
-
318  
-function! delimitMate#JumpOut(char) "{{{
319  
-	if delimitMate#IsForbidden(a:char)
320  
-		return a:char
321  
-	endif
322  
-	let line = getline('.')
323  
-	let col = col('.')-2
324  
-	if line[col+1] == a:char
325  
-		return a:char . delimitMate#Del()
326  
-	else
327  
-		return a:char
328  
-	endif
329  
-endfunction " }}}
330  
-
331  
-function! delimitMate#JumpAny(key) " {{{
332  
-	if delimitMate#IsForbidden('')
333  
-		return a:key
334  
-	endif
335  
-	if !delimitMate#ShouldJump()
336  
-		return a:key
337  
-	endif
338  
-	" Let's get the character on the right.
339  
-	let char = getline('.')[col('.')-1]
340  
-	if char == " "
341  
-		" Space expansion.
342  
-		"let char = char . getline('.')[col('.')] . delimitMate#Del()
343  
-		return char . getline('.')[col('.')] . delimitMate#Del() . delimitMate#Del()
344  
-		"call delimitMate#RmBuffer(1)
345  
-	elseif char == ""
346  
-		" CR expansion.
347  
-		"let char = "\<CR>" . getline(line('.') + 1)[0] . "\<Del>"
348  
-		let b:_l_delimitMate_buffer = []
349  
-		return "\<CR>" . getline(line('.') + 1)[0] . "\<Del>"
350  
-	else
351  
-		"call delimitMate#RmBuffer(1)
352  
-		return char . delimitMate#Del()
353  
-	endif
354  
-endfunction " delimitMate#JumpAny() }}}
355  
-
356  
-function! delimitMate#JumpMany() " {{{
357  
-	let line = getline('.')[col('.') - 1 : ]
358  
-	let len = len(line)
359  
-	let rights = ""
360  
-	let found = 0
361  
-	let i = 0
362  
-	while i < len
363  
-		let char = line[i]
364  
-		if index(b:_l_delimitMate_quotes_list, char) >= 0 ||
365  
-					\ index(b:_l_delimitMate_right_delims, char) >= 0
366  
-			let rights .= "\<Right>"
367  
-			let found = 1
368  
-		elseif found == 0
369  
-			let rights .= "\<Right>"
370  
-		else
371  
-			break
372  
-		endif
373  
-		let i += 1
374  
-	endwhile
375  
-	if found == 1
376  
-		return rights
377  
-	else
378  
-		return ''
379  
-	endif
380  
-endfunction " delimitMate#JumpMany() }}}
381  
-
382  
-function! delimitMate#ExpandReturn() "{{{
383  
-	if delimitMate#IsForbidden("")
384  
-		return "\<CR>"
385  
-	endif
386  
-	if delimitMate#WithinEmptyPair()
387  
-		" Expand:
388  
-		call delimitMate#FlushBuffer()
389  
-		"return "\<Esc>a\<CR>x\<CR>\<Esc>k$\"_xa"
390  
-		return "\<CR>\<UP>\<Esc>o"
391  
-	else
392  
-		return "\<CR>"
393  
-	endif
394  
-endfunction "}}}
395  
-
396  
-function! delimitMate#ExpandSpace() "{{{
397  
-	if delimitMate#IsForbidden("\<Space>")
398  
-		return "\<Space>"
399  
-	endif
400  
-	if delimitMate#WithinEmptyPair()
401  
-		" Expand:
402  
-		call insert(b:_l_delimitMate_buffer, 's')
403  
-		return delimitMate#WriteAfter(' ') . "\<Space>"
404  
-	else
405  
-		return "\<Space>"
406  
-	endif
407  
-endfunction "}}}
408  
-
409  
-function! delimitMate#BS() " {{{
410  
-	if delimitMate#IsForbidden("")
411  
-		return "\<BS>"
412  
-	endif
413  
-	if delimitMate#WithinEmptyPair()
414  
-		"call delimitMate#RmBuffer(1)
415  
-		return "\<BS>" . delimitMate#Del()
416  
-"        return "\<Right>\<BS>\<BS>"
417  
-	elseif delimitMate#IsSpaceExpansion()
418  
-		"call delimitMate#RmBuffer(1)
419  
-		return "\<BS>" . delimitMate#Del()
420  
-	elseif delimitMate#IsCRExpansion()
421  
-		return "\<BS>\<Del>"
422  
-	else
423  
-		return "\<BS>"
424  
-	endif
425  
-endfunction " }}} delimitMate#BS()
426  
-
427  
-function! delimitMate#Del() " {{{
428  
-	if len(b:_l_delimitMate_buffer) > 0
429  
-		let line = getline('.')
430  
-		let col = col('.') - 2
431  
-		call delimitMate#RmBuffer(1)
432  
-		call setline('.', line[:col] . line[col+2:])
433  
-		return ''
434  
-	else
435  
-		return "\<Del>"
436  
-	endif
437  
-endfunction " }}}
438  
-
439  
-function! delimitMate#Finish(move_back) " {{{
440  
-	let len = len(b:_l_delimitMate_buffer)
441  
-	if len > 0
442  
-		let buffer = join(b:_l_delimitMate_buffer, '')
443  
-		let len2 = len(buffer)
444  
-		" Reset buffer:
445  
-		let b:_l_delimitMate_buffer = []
446  
-		let line = getline('.')
447  
-		let col = col('.') -2
448  
-		"echom 'col: ' . col . '-' . line[:col] . "|" . line[col+len+1:] . '%' . buffer
449  
-		if col < 0
450  
-			call setline('.', line[col+len2+1:])
451  
-		else
452  
-			call setline('.', line[:col] . line[col+len2+1:])
453  
-		endif
454  
-		let i = 1
455  
-		let lefts = ""
456  
-		while i <= len && a:move_back
457  
-			let lefts = lefts . "\<Left>"
458  
-			let i += 1
459  
-		endwhile
460  
-		return substitute(buffer, "s", "\<Space>", 'g') . lefts
461  
-	endif
462  
-	return ''
463  
-endfunction " }}}
464  
-
465  
-" }}}
466  
-
467  
-" Tools: {{{
468  
-function! delimitMate#TestMappings() "{{{
469  
-	let options = sort(keys(delimitMate#OptionsList()))
470  
-	let optoutput = ['delimitMate Report', '==================', '', '* Options: ( ) default, (g) global, (b) buffer','']
471  
-	for option in options
472  
-		exec 'call add(optoutput, ''('.(exists('b:delimitMate_'.option) ? 'b' : exists('g:delimitMate_'.option) ? 'g' : ' ').') delimitMate_''.option.'' = ''.string(b:_l_delimitMate_'.option.'))'
473  
-	endfor
474  
-	call append(line('$'), optoutput + ['--------------------',''])
475  
-
476  
-	" Check if mappings were set. {{{
477  
-	let imaps = b:_l_delimitMate_right_delims
478  
-	let imaps = imaps + ( b:_l_delimitMate_autoclose ? b:_l_delimitMate_left_delims : [] )
479  
-	let imaps = imaps +
480  
-				\ b:_l_delimitMate_quotes_list +
481  
-				\ b:_l_delimitMate_apostrophes_list +
482  
-				\ ['<BS>', '<S-BS>', '<Del>', '<S-Tab>', '<Esc>'] +
483  
-				\ ['<Up>', '<Down>', '<Left>', '<Right>', '<LeftMouse>', '<RightMouse>'] +
484  
-				\ ['<Home>', '<End>', '<PageUp>', '<PageDown>', '<S-Down>', '<S-Up>', '<C-G>g']
485  
-	let imaps = imaps + ( b:_l_delimitMate_expand_cr ?  ['<CR>'] : [] )
486  
-	let imaps = imaps + ( b:_l_delimitMate_expand_space ?  ['<Space>'] : [] )
487  
-
488  
-	let vmaps =
489  
-				\ b:_l_delimitMate_right_delims +
490  
-				\ b:_l_delimitMate_left_delims +
491  
-				\ b:_l_delimitMate_quotes_list
492  
-
493  
-	let ibroken = []
494  
-	for map in imaps
495  
-		if maparg(map, "i") !~? 'delimitMate'
496  
-			let output = ''
497  
-			if map == '|'
498  
-				let map = '<Bar>'
499  
-			endif
500  
-			redir => output | execute "verbose imap ".map | redir END
501  
-			let ibroken = ibroken + [map.": is not set:"] + split(output, '\n')
502  
-		endif
503  
-	endfor
504  
-
505  
-	unlet! output
506  
-	if ibroken == []
507  
-		let output = ['* Mappings:', '', 'All mappings were set-up.', '--------------------', '', '']
508  
-	else
509  
-		let output = ['* Mappings:', ''] + ibroken + ['--------------------', '']
510  
-	endif
511  
-	call append('$', output+['* Showcase:', ''])
512  
-	" }}}
513  
-	if b:_l_delimitMate_autoclose
514  
-		" {{{
515  
-		for i in range(len(b:_l_delimitMate_left_delims))
516  
-			exec "normal Go0\<C-D>Open: " . b:_l_delimitMate_left_delims[i]. "|"
517  
-			exec "normal o0\<C-D>Delete: " . b:_l_delimitMate_left_delims[i] . "\<BS>|"
518  
-			exec "normal o0\<C-D>Exit: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "|"
519  
-			if b:_l_delimitMate_expand_space == 1
520  
-				exec "normal o0\<C-D>Space: " . b:_l_delimitMate_left_delims[i] . " |"
521  
-				exec "normal o0\<C-D>Delete space: " . b:_l_delimitMate_left_delims[i] . " \<BS>|"
522  
-			endif
523  
-			if b:_l_delimitMate_expand_cr == 1
524  
-				exec "normal o0\<C-D>Car return: " . b:_l_delimitMate_left_delims[i] . "\<CR>|"
525  
-				exec "normal Go0\<C-D>Delete car return: " . b:_l_delimitMate_left_delims[i] . "\<CR>0\<C-D>\<BS>|"
526  
-			endif
527  
-			call append(line('$'), '')
528  
-		endfor
529  
-		for i in range(len(b:_l_delimitMate_quotes_list))
530  
-			exec "normal Go0\<C-D>Open: " . b:_l_delimitMate_quotes_list[i]	. "|"
531  
-			exec "normal o0\<C-D>Delete: " . b:_l_delimitMate_quotes_list[i] . "\<BS>|"
532  
-			exec "normal o0\<C-D>Exit: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "|"
533  
-			if b:_l_delimitMate_expand_space == 1
534  
-				exec "normal o0\<C-D>Space: " . b:_l_delimitMate_quotes_list[i] . " |"
535  
-				exec "normal o0\<C-D>Delete space: " . b:_l_delimitMate_quotes_list[i] . " \<BS>|"
536  
-			endif
537  
-			if b:_l_delimitMate_expand_cr == 1
538  
-				exec "normal o0\<C-D>Car return: " . b:_l_delimitMate_quotes_list[i] . "\<CR>|"
539  
-				exec "normal Go0\<C-D>Delete car return: " . b:_l_delimitMate_quotes_list[i] . "\<CR>\<BS>|"
540  
-			endif
541  
-			call append(line('$'), '')
542  
-		endfor
543  
-		"}}}
544  
-	else
545  
-		"{{{
546  
-		for i in range(len(b:_l_delimitMate_left_delims))
547  
-			exec "normal GoOpen & close: " . b:_l_delimitMate_left_delims[i]	. b:_l_delimitMate_right_delims[i] . "|"
548  
-			exec "normal oDelete: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "\<BS>|"
549  
-			exec "normal oExit: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . b:_l_delimitMate_right_delims[i] . "|"
550  
-			if b:_l_delimitMate_expand_space == 1
551  
-				exec "normal oSpace: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . " |"
552  
-				exec "normal oDelete space: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . " \<BS>|"
553  
-			endif
554  
-			if b:_l_delimitMate_expand_cr == 1
555  
-				exec "normal oCar return: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "\<CR>|"
556  
-				exec "normal GoDelete car return: " . b:_l_delimitMate_left_delims[i] . b:_l_delimitMate_right_delims[i] . "\<CR>\<BS>|"
557  
-			endif
558  
-			call append(line('$'), '')
559  
-		endfor
560  
-		for i in range(len(b:_l_delimitMate_quotes_list))
561  
-			exec "normal GoOpen & close: " . b:_l_delimitMate_quotes_list[i]	. b:_l_delimitMate_quotes_list[i] . "|"
562  
-			exec "normal oDelete: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "\<BS>|"
563  
-			exec "normal oExit: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "|"
564  
-			if b:_l_delimitMate_expand_space == 1
565  
-				exec "normal oSpace: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . " |"
566  
-				exec "normal oDelete space: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . " \<BS>|"
567  
-			endif
568  
-			if b:_l_delimitMate_expand_cr == 1
569  
-				exec "normal oCar return: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "\<CR>|"
570  
-				exec "normal GoDelete car return: " . b:_l_delimitMate_quotes_list[i] . b:_l_delimitMate_quotes_list[i] . "\<CR>\<BS>|"
571  
-			endif
572  
-			call append(line('$'), '')
573  
-		endfor
574  
-	endif "}}}
575  
-	redir => setoptions | set | filetype | redir END
576  
-	call append(line('$'), split(setoptions,"\n")
577  
-				\ + ['--------------------'])
578  
-	setlocal nowrap
579  
-endfunction "}}}
580  
-
581  
-function! delimitMate#OptionsList() "{{{
582  
-	return {'autoclose' : 1,'matchpairs': &matchpairs, 'quotes' : '" '' `', 'nesting_quotes' : [], 'expand_cr' : 0, 'expand_space' : 0, 'smart_quotes' : 1, 'smart_matchpairs' : '\w', 'balance_matchpairs' : 0, 'excluded_regions' : 'Comment', 'excluded_ft' : '', 'apostrophes' : ''}
583  
-endfunction " delimitMate#OptionsList }}}
584  
-"}}}
585  
-
586  
-" vim:foldmethod=marker:foldcolumn=4
818  bundle/delimitmate/doc/delimitMate.txt
... ...
@@ -1,818 +0,0 @@
1  
-*delimitMate.txt*   Trying to keep those beasts at bay! v2.6     *delimitMate*
2  
-
3  
-
4  
-
5  
-  MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
6  
-  MMMM  MMMMMMMMM  MMMMMMMMMMMMMMMMMMMMMMMMMM  MMMMM  MMMMMMMMMMMMMMMMMMMMM  ~
7  
-  MMMM  MMMMMMMMM  MMMMMMMMMMMMMMMMMMMMMMMMMM   MMM   MMMMMMMMMMMMMMMMMMMMM
8  
-  MMMM  MMMMMMMMM  MMMMMMMMMMMMMMMMMMMMM  MMM  M   M  MMMMMMMMMM  MMMMMMMMM  ~
9  
-  MMMM  MMM   MMM  MM  MM  M  M MMM  MM    MM  MM MM  MMM   MMM    MMM   MM
10  
-  MM    MM  M  MM  MMMMMM        MMMMMMM  MMM  MMMMM  MM  M  MMM  MMM  M  M  ~
11  
-  M  M  MM     MM  MM  MM  M  M  MM  MMM  MMM  MMMMM  MMMMM  MMM  MMM     M
12  
-  M  M  MM  MMMMM  MM  MM  M  M  MM  MMM  MMM  MMMMM  MMM    MMM  MMM  MMMM  ~
13  
-  M  M  MM  M  MM  MM  MM  M  M  MM  MMM  MMM  MMMMM  MM  M  MMM  MMM  M  M
14  
-  MM    MMM   MMM  MM  MM  M  M  MM  MMM   MM  MMMMM  MMM    MMM   MMM   MM  ~
15  
-  MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
16  
-
17  
-
18  
-
19  
-==============================================================================
20  
- 0.- CONTENTS                                           *delimitMate-contents*
21  
-
22  
-    1. Introduction____________________________|delimitMateIntro|
23  
-    2. Customization___________________________|delimitMateOptions|
24  
-        2.1 Options summary____________________|delimitMateOptionSummary|
25  
-        2.2 Options details____________________|delimitMateOptionDetails|
26  
-    3. Functionality___________________________|delimitMateFunctionality|
27  
-        3.1 Automatic closing & exiting________|delimitMateAutoClose|
28  
-        3.2 Expansion of space and CR__________|delimitMateExpansion|
29  
-        3.3 Backspace__________________________|delimitMateBackspace|
30  
-        3.4 Smart Quotes_______________________|delimitMateSmartQuotes|
31  
-        3.5 Balancing matching pairs___________|delimitMateBalance|
32  
-        3.6 FileType based configuration_______|delimitMateFileType|
33  
-        3.7 Syntax awareness___________________|delimitMateSyntax|
34  
-    4. Commands________________________________|delimitMateCommands|
35  
-    5. Mappings________________________________|delimitMateMappings|
36  
-    6. Functions_______________________________|delimitMateFunctions|
37  
-    7. TODO list_______________________________|delimitMateTodo|
38  
-    8. Maintainer______________________________|delimitMateMaintainer|
39  
-    9. Credits_________________________________|delimitMateCredits|
40  
-   10. History_________________________________|delimitMateHistory|
41  
-
42  
-==============================================================================
43  
- 1.- INTRODUCTION                                           *delimitMateIntro*
44  
-
45  
-This plug-in provides automatic closing of quotes, parenthesis, brackets,
46  
-etc.; besides some other related features that should make your time in insert
47  
-mode a little bit easier.
48  
-
49  
-Most of the features can be modified or disabled permanently, using global
50  
-variables, or on a FileType basis, using autocommands. With a couple of
51  
-exceptions and limitations, this features don't brake undo, redo or history.
52  
-
53  
-NOTE 1: If you have any trouble with this plugin, please run |:DelimitMateTest|
54  
-in a new buffer to see what is not working.
55  
-
56  
-NOTE 2: |'timeout'| needs to be set when working in the terminal, otherwise you
57  
-might find weird behaviour with mappings including <Esc> or arrow keys.
58  
-
59  
-NOTE 3: Abbreiations set with |:iabbrev| will not be expanded by delimiters
60  
-used on delimitMate, you should use <C-]> (read |i_CTRL-]|) to expand them on
61  
-the go.
62  
-
63  
-==============================================================================
64  
- 2. CUSTOMIZATION                                         *delimitMateOptions*
65  
-
66  
-You can create your own mappings for some features using the global functions.
67  
-Read |DelimitMateFunctions| for more info.
68  
-
69  
-------------------------------------------------------------------------------
70  
-   2.1 OPTIONS SUMMARY                              *delimitMateOptionSummary*
71  
-
72  
-The behaviour of this script can be customized setting the following options
73  
-in your vimrc file. You can use local options to set the configuration for
74  
-specific file types, see |delimitMateOptionDetails| for examples.
75  
-
76  
-|'loaded_delimitMate'|            Turns off the script.
77  
-
78  
-|'delimitMate_autoclose'|         Tells delimitMate whether to automagically
79  
-                                insert the closing delimiter.
80  
-
81  
-|'delimitMate_matchpairs'|        Tells delimitMate which characters are
82  
-                                matching pairs.
83  
-
84  
-|'delimitMate_quotes'|            Tells delimitMate which quotes should be
85  
-                                used.
86  
-
87  
-|'delimitMate_nesting_quotes'|    Tells delimitMate which quotes should be
88  
-                                allowed to be nested.
89  
-
90  
-|'delimitMate_expand_cr'|         Turns on/off the expansion of <CR>.
91  
-
92  
-|'delimitMate_expand_space'|      Turns on/off the expansion of <Space>.
93  
-
94  
-|'delimitMate_smart_quotes'|      Turns on/off the "smart quotes" feature.
95  
-
96  
-|'delimitMate_smart_matchpairs'|  Turns on/off the "smart matchpairs" feature.
97  
-
98  
-|'delimitMate_balance_matchpairs'|Turns on/off the "balance matching pairs"
99  
-                                feature.
100  
-
101  
-|'delimitMate_excluded_regions'|  Turns off the script for the given regions or
102  
-                                syntax group names.
103  
-
104  
-|'delimitMate_excluded_ft'|       Turns off the script for the given file types.
105  
-
106  
-|'delimitMate_apostrophes'|       Tells delimitMate how it should "fix"
107  
-                                balancing of single quotes when used as
108  
-                                apostrophes. NOTE: Not needed any more, kept
109  
-                                for compatibility with older versions.
110  
-
111  
-------------------------------------------------------------------------------
112  
-   2.2 OPTIONS DETAILS                              *delimitMateOptionDetails*
113  
-
114  
-Add the shown lines to your vimrc file in order to set the below options.
115  
-Buffer variables take precedence over global ones and can be used along with
116  
-autocmd to modify delimitMate's behavior for specific file types, read more in
117  
-|delimitMateFileType|.
118  
-
119  
-Note: Use buffer variables only to set options for specific file types using
120  
-:autocmd, use global variables to set options for every buffer. Read more in
121  
-|g:var| and |b:var|.
122  
-
123  
-------------------------------------------------------------------------------
124  
-                                                        *'loaded_delimitMate'*
125  
-                                                      *'b:loaded_delimitMate'*
126  
-This option prevents delimitMate from loading.
127  
-e.g.: >
128  
-        let loaded_delimitMate = 1
129  
-        au FileType mail let b:loaded_delimitMate = 1
130  
-<
131  
-------------------------------------------------------------------------------
132  
-                                                     *'delimitMate_autoclose'*
133  
-                                                   *'b:delimitMate_autoclose'*
134  
-Values: 0 or 1.                                                              ~
135  
-Default: 1                                                                   ~
136  
-
137  
-If this option is set to 0, delimitMate will not add a closing delimiter
138  
-automagically. See |delimitMateAutoClose| for details.
139  
-e.g.: >
140  
-        let delimitMate_autoclose = 0
141  
-        au FileType mail let b:delimitMate_autoclose = 0
142  
-<
143  
-------------------------------------------------------------------------------
144  
-                                                    *'delimitMate_matchpairs'*
145  
-                                                  *'b:delimitMate_matchpairs'*
146  
-Values: A string with |'matchpairs'| syntax, plus support for multi-byte~
147  
-        characters.~
148  
-Default: &matchpairs                                                         ~
149  
-
150  
-Use this option to tell delimitMate which characters should be considered
151  
-matching pairs. Read |delimitMateAutoClose| for details.
152  
-e.g: >
153  
-        let delimitMate_matchpairs = "(:),[:],{:},<:>"
154  
-        au FileType vim,html let b:delimitMate_matchpairs = "(:),[:],{:},<:>"
155  
-<
156  
-------------------------------------------------------------------------------
157  
-                                                        *'delimitMate_quotes'*
158  
-                                                      *'b:delimitMate_quotes'*
159  
-Values: A string of characters separated by spaces.                          ~
160  
-Default: "\" ' `"                                                            ~
161  
-
162  
-Use this option to tell delimitMate which characters should be considered as
163  
-quotes. Read |delimitMateAutoClose| for details.
164  
-e.g.: >
165  
-        let delimitMate_quotes = "\" ' ` *"
166  
-        au FileType html let b:delimitMate_quotes = "\" '"
167  
-<
168  
-------------------------------------------------------------------------------
169  
-                                                *'delimitMate_nesting_quotes'*
170  
-                                              *'b:delimitMate_nesting_quotes'*
171  
-Values: A list of quotes.                                                    ~
172  
-Default: []                                                                  ~
173  
-
174  
-Quotes listed here will not be able to jump out of the empty pair, thus
175  
-allowing the autoclosed quotes to be nested.
176  
-e.g.: >
177  
-        let delimitMate_nesting_quotes = ['"','`']
178  
-        au FileType python let b:delimitMate_nesting_quotes = ['"']
179  
-<
180  
-------------------------------------------------------------------------------
181  
-                                                     *'delimitMate_expand_cr'*
182  
-                                                   *'b:delimitMate_expand_cr'*
183  
-Values: 1 or 0                                                               ~
184  
-Default: 0                                                                   ~
185  
-
186  
-This option turns on/off the expansion of <CR>. Read |delimitMateExpansion|
187  
-for details. NOTE This feature requires that 'backspace' is either set to 2 or
188  
-has "eol" and "start" as part of its value.
189  
-e.g.: >
190  
-        let delimitMate_expand_cr = 1
191  
-        au FileType mail let b:delimitMate_expand_cr = 1
192  
-<
193  
-------------------------------------------------------------------------------
194  
-                                                  *'delimitMate_expand_space'*
195  
-                                                *'b:delimitMate_expand_space'*
196  
-Values: 1 or 0                                                               ~
197  
-Default: 0                                                                   ~
198  
-This option turns on/off the expansion of <Space>. Read |delimitMateExpansion|
199  
-for details.
200  
-e.g.: >
201  
-        let delimitMate_expand_space = 1
202  
-        au FileType tcl let b:delimitMate_expand_space = 1
203  
-<
204  
-------------------------------------------------------------------------------
205  
-                                                  *'delimitMate_smart_quotes'*
206  
-                                                *'b:delimitMate_smart_quotes'*
207  
-Values: 1 or 0                                                               ~
208  
-Default: 1                              ~
209  
-
210  
-This option turns on/off the smart quotes feature. Read
211  
-|delimitMateSmartQuotes| for details.
212  
-e.g.: >
213  
-        let delimitMate_smart_quotes = 0
214  
-        au FileType tcl let b:delimitMate_smart_quotes = 1
215  
-<
216  
-------------------------------------------------------------------------------
217  
-                                              *'delimitMate_smart_matchpairs'*
218  
-                                            *'b:delimitMate_smart_matchpairs'*
219  
-Values: Regexp                                                               ~
220  
-Default: '^\%(\w\|\!\|£\|\$\|_\|["'']\s*\S\)'                                ~
221  
-
222  
-This regex is matched against the text to the right of cursor, if it's not
223  
-empty and there is a match delimitMate will not autoclose the pair. At the
224  
-moment to match the text, an escaped bang (\!) in the regex will be replaced
225  
-by the character being inserted, while an escaped number symbol (\#) will be
226  
-replaced by the closing pair.
227  
-e.g.: >
228  
-        let delimitMate_smart_matchpairs = ''
229  
-        au FileType tcl let b:delimitMate_smart_matchpairs = '^\%(\w\|\$\)'
230  
-<
231  
-------------------------------------------------------------------------------
232  
-                                            *'delimitMate_balance_matchpairs'*
233  
-                                          *'b:delimitMate_balance_matchpairs'*
234  
-Values: 1 or 0                                                               ~
235  
-Default: 0                                                                   ~
236  
-
237  
-This option turns on/off the balancing of matching pairs. Read
238  
-|delimitMateBalance| for details.
239  
-e.g.: >
240  
-        let delimitMate_balance_matchpairs = 1
241  
-        au FileType tcl let b:delimitMate_balance_matchpairs = 1
242  
-<
243  
-------------------------------------------------------------------------------
244  
-                                              *'delimitMate_excluded_regions'*
245  
-Values: A string of syntax group names names separated by single commas.     ~
246  
-Default: Comment                                                             ~
247  
-
248  
-This options turns delimitMate off for the listed regions, read |group-name|
249  
-for more info about what is a region.
250  
-e.g.: >
251  
-        let delimitMate_excluded_regions = "Comments,String"
252  
-<
253  
-------------------------------------------------------------------------------
254  
-                                                   *'delimitMate_excluded_ft'*
255  
-Values: A string of file type names separated by single commas.              ~
256  
-Default: Empty.                                                              ~
257  
-
258  
-This options turns delimitMate off for the listed file types, use this option
259  
-only if you don't want any of the features it provides on those file types.
260  
-e.g.: >
261  
-        let delimitMate_excluded_ft = "mail,txt"
262  
-<
263  
-------------------------------------------------------------------------------
264  
-                                                   *'delimitMate_apostrophes'*
265  
-Values: Strings separated by ":".                                            ~
266  
-Default: No longer used.                                                     ~
267  
-
268  
-NOTE: This feature is turned off by default, it's been kept for compatibility
269  
-with older version, read |delimitMateSmartQuotes| for details.
270  
-If auto-close is enabled, this option tells delimitMate how to try to fix the
271  
-balancing of single quotes when used as apostrophes. The values of this option
272  
-are strings of text where a single quote would be used as an apostrophe (e.g.:
273  
-the "n't" of wouldn't or can't) separated by ":". Set it to an empty string to
274  
-disable this feature.
275  
-e.g.: >
276  
-        let delimitMate_apostrophes = ""
277  
-        au FileType tcl let delimitMate_apostrophes = ""
278  
-<
279  
-==============================================================================
280  
- 3. FUNCTIONALITY                                   *delimitMateFunctionality*
281  
-
282  
-------------------------------------------------------------------------------
283  
-   3.1 AUTOMATIC CLOSING AND EXITING                    *delimitMateAutoClose*
284  
-
285  
-With automatic closing enabled, if an opening delimiter is inserted the plugin
286  
-inserts the closing delimiter and places the cursor between the pair. With
287  
-automatic closing disabled, no closing delimiters is inserted by delimitMate,
288  
-but when a pair of delimiters is typed, the cursor is placed in the middle.
289  
-
290  
-When the cursor is inside an empty pair or located next to the left of a
291  
-closing delimiter, the cursor is placed outside the pair to the right of the
292  
-closing delimiter.
293  
-
294  
-When |'delimitMate_smart_matchpairs'| is not empty and it matches the text to
295  
-the right of the cursor, delimitMate will not automatically insert the closing
296  
-pair.
297  
-
298  
-Unless |'delimitMate_matchpairs'| or |'delimitMate_quotes'| are set, this
299  
-script uses the values in '&matchpairs' to identify the pairs, and ", ' and `
300  
-for quotes respectively.
301  
-
302  
-<S-Tab> will jump over a single closing delimiter or quote, <C-G>g will jump
303  
-over contiguous delimiters and/or quotes.
304  
-
305  
-The following table shows the behaviour, this applies to quotes too (the final
306  
-position of the cursor is represented by a "|"):
307  
-
308  
-With auto-close: >
309  
-                          Type     |  You get
310  
-                        =======================
311  
-                           (       |    (|)
312  
-                        –––––––––––|–––––––––––
313  
-                           ()      |    ()|
314  
-                        –––––––––––|–––––––––––
315  
-                        (<S-Tab>   |    ()|
316  
-                        –––––––––––|–––––––––––
317  
-                        {("<C-G>g  |  {("")}|
318  
-<
319  
-Without auto-close: >
320  
-
321  
-                          Type        |  You get
322  
-                        =========================
323  
-                           ()         |    (|)
324  
-                        –––––––––-----|––––––––––
325  
-                           ())        |    ()|
326  
-                        –––––––––-----|––––––––––
327  
-                        ()<S-Tab>     |    ()|
328  
-                        ––––––––––––––|–––––––––––
329  
-                        {}()""<C-G>g  |  {("")}|
330  
-<
331  
-NOTE: Abbreviations will not be expanded by delimiters used on delimitMate,
332  
-you should use <C-]> (read |i_CTRL-]|) to expand them on the go.
333  
-
334  
-------------------------------------------------------------------------------
335  
-   3.2 EXPANSION OF SPACE AND CAR RETURN                *delimitMateExpansion*
336  
-
337  
-When the cursor is inside an empty pair of delimiters, <Space> and <CR> can be
338  
-expanded, see |'delimitMate_expand_space'| and
339  
-|'delimitMate_expand_cr'|:
340  
-
341  
-Expand <Space> to: >
342  
-
343  
-                    <Space><Space><Left>  |  You get
344  
-                  ====================================
345  
-                              (|)         |    ( | )
346  
-<
347  
-Expand <CR> to: >
348  
-
349  
-                      <CR><CR><Up>  |  You get
350  
-                    ============================
351  
-                           (|)      |    (
352  
-                                    |    |
353  
-                                    |    )
354  
-<
355  
-
356  
-NOTE that the expansion of <CR> will brake the redo command.
357  
-
358  
-Since <Space> and <CR> are used everywhere, I have made the functions involved
359  
-in expansions global, so they can be used to make custom mappings. Read
360  
-|delimitMateFunctions| for more details.
361  
-
362  
-------------------------------------------------------------------------------
363  
-   3.3 BACKSPACE                                        *delimitMateBackspace*
364  
-
365  
-If you press backspace inside an empty pair, both delimiters are deleted. When
366  
-expansions are enabled, <BS> will also delete the expansions. NOTE that
367  
-deleting <CR> expansions will brake the redo command.
368  
-
369  
-If you type <S-BS> (shift + backspace) instead, only the closing delimiter
370  
-will be deleted. NOTE that this will not usually work when using Vim from the
371  
-terminal, see 'delimitMate#JumpAny()' below to see how to fix it.
372  
-
373  
-e.g. typing at the "|": >
374  
-
375  
-                  What  |      Before       |      After
376  
-               ==============================================
377  
-                  <BS>  |  call expand(|)   |  call expand|
378  
-               ---------|-------------------|-----------------
379  
-                  <BS>  |  call expand( | ) |  call expand(|)
380  
-               ---------|-------------------|-----------------
381  
-                  <BS>  |  call expand(     |  call expand(|)
382  
-                        |  |                |
383  
-                        |  )                |
384  
-               ---------|-------------------|-----------------
385  
-                 <S-BS> |  call expand(|)   |  call expand(|
386  
-<
387  
-
388  
-------------------------------------------------------------------------------
389  
-   3.4 SMART QUOTES                                   *delimitMateSmartQuotes*
390  
-
391  
-Only one quote will be inserted following a quote, a "\" or, following or
392  
-preceding a keyword character. This should cover closing quotes after a
393  
-string, opening quotes before a string, escaped quotes and apostrophes. Except
394  
-for apostrophes, this feature can be disabled setting the option
395  
-|'delimitMate_smart_quotes'| to 0.
396  
-
397  
-e.g. typing at the "|": >
398  
-
399  
-                     What |    Before    |     After
400  
-                  =======================================
401  
-                      "   |  Text |      |  Text "|"
402  
-                      "   |  "String|    |  "String"|
403  
-                      "   |  let i = "|  |  let i = "|"
404  
-                      'm  |  I|          |  I'm|
405  
-<
406  
-------------------------------------------------------------------------------
407  
-   3.4 SMART MATCHPAIRS                           *delimitMateSmartMatchpairs*
408  
-
409  
-This is similar to "smart quotes", but applied to the characters in
410  
-|'delimitMate_matchpairs'|. The difference is that delimitMate will not
411  
-auto-close the pair when the regex matches the text on the right of the
412  
-cursor. See |'delimitMate_smart_matchpairs'| for more details.
413  
-
414  
-
415  
-e.g. typing at the "|": >
416  
-
417  
-                     What |    Before    |     After
418  
-                  =======================================
419  
-                      (   |  function|   |  function(|)
420  
-                      (   |  |var        |  (|var
421  
-<
422  
-------------------------------------------------------------------------------
423  
-   3.5 BALANCING MATCHING PAIRS                           *delimitMateBalance*
424  
-
425  
-When inserting an opening paren and |'delimitMate_balance_matchpairs'| is
426  
-enabled, delimitMate will try to balance the closing pairs in the current
427  
-line.
428  
-
429  
-e.g. typing at the "|": >
430  
-
431  
-                     What |    Before    |     After
432  
-                  =======================================
433  
-                      (   |      |       |     (|)
434  
-                      (   |      |)      |     (|)
435  
-                      ((  |      |)      |    ((|))
436  
-<
437  
-------------------------------------------------------------------------------
438  
-   3.6 FILE TYPE BASED CONFIGURATION                     *delimitMateFileType*
439  
-
440  
-delimitMate options can be set globally for all buffers using global
441  
-("regular") variables in your |vimrc| file. But |:autocmd| can be used to set
442  
-options for specific file types (see |'filetype'|) using buffer variables in
443  
-the following way: >
444  
-
445  
-   au FileType mail,text let b:delimitMate_autoclose = 0
446  
-         ^       ^           ^            ^            ^
447  
-         |       |           |            |            |
448  
-         |       |           |            |            - Option value.
449  
-         |       |           |            - Option name.
450  
-         |       |           - Buffer variable.
451  
-         |       - File types for which the option will be set.
452  
-         - Don't forget to put this event.
453  
-<
454  
-NOTE that you should use buffer variables (|b:var|) only to set options with
455  
-|:autocmd|, for global options use regular variables (|g:var|) in your vimrc.
456  
-
457  
-------------------------------------------------------------------------------
458  
-   3.7 SYNTAX AWARENESS                                    *delimitMateSyntax*
459  
-
460  
-The features of this plug-in might not be always helpful, comments and strings
461  
-usualy don't need auto-completion. delimitMate monitors which region is being
462  
-edited and if it detects that the cursor is in a comment it'll turn itself off
463  
-until the cursor leaves the comment. The excluded regions can be set using the
464  
-option |'delimitMate_excluded_regions'|. Read |group-name| for a list of
465  
-regions or syntax group names.
466  
-
467  
-NOTE that this feature relies on a proper syntax file for the current file
468  
-type, if the appropiate syntax file doesn't define a region, delimitMate won't
469  
-know about it.
470  
-
471  
-==============================================================================
472  
- 4. COMMANDS                                             *delimitMateCommands*
473  
-
474  
-------------------------------------------------------------------------------
475  
-:DelimitMateReload                                        *:DelimitMateReload*
476  
-
477  
-Re-sets all the mappings used for this script, use it if any option has been
478  
-changed or if the filetype option hasn't been set yet.
479  
-
480  
-------------------------------------------------------------------------------
481  
-:DelimitMateSwitch                                        *:DelimitMateSwitch*
482  
-
483  
-Switches the plug-in on and off.
484  
-
485  
-------------------------------------------------------------------------------
486  
-:DelimitMateTest                                            *:DelimitMateTest*
487  
-
488  
-This command tests every mapping set-up for this script, useful for testing
489  
-custom configurations.
490  
-
491  
-The following output corresponds to the default values, it will be different
492  
-depending on your configuration. "Open & close:" represents the final result
493  
-when the closing delimiter has been inserted, either manually or
494  
-automatically, see |delimitMateExpansion|. "Delete:" typing backspace in an
495  
-empty pair, see |delimitMateBackspace|. "Exit:" typing a closing delimiter
496  
-inside a pair of delimiters, see |delimitMateAutoclose|. "Space:" the
497  
-expansion, if any, of space, see |delimitMateExpansion|. "Visual-L",
498  
-"Visual-R" and "Visual" shows visual wrapping, see
499  
-|delimitMateVisualWrapping|. "Car return:" the expansion of car return, see
500  
-|delimitMateExpansion|. The cursor's position at the end of every test is
501  
-represented by an "|": >
502  
-
503  
-            * AUTOCLOSE:
504  
-            Open & close: (|)
505  
-            Delete: |
506  
-            Exit: ()|
507  
-            Space: ( |)
508  
-            Visual-L: (v)
509  
-            Visual-R: (v)
510  
-            Car return: (
511  
-            |)
512  
-
513  
-            Open & close: {|}
514  
-            Delete: |
515  
-            Exit: {}|
516  
-            Space: { |}
517  
-            Visual-L: {v}