• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/vim-55/runtime/macros/

Lines Matching refs:let

33 " TODO:  Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
43 let loaded_matchit = 1
44 let s:last_mps = ""
45 let s:last_words = ":"
47 let s:save_cpo = &cpo
71 " TODO Read :help write-plugin for the "right" way to let the user
73 " let g:match_auto = '<C-]>'
74 " let g:match_autoCR = '<C-CR>'
85 let s:notslash = '\\\@<!\%(\\\\\)*'
89 let restore_options = (&ic ? " " : " no") . "ignorecase"
91 let &ignorecase = b:match_ignorecase
93 let restore_options = " ve=" . &ve . restore_options
101 let startline = line(".")
102 let startcol = col(".")
115 let match_words = ""
118 let match_words = b:match_words
120 execute "let match_words =" b:match_words
125 let s:last_words = match_words
126 let s:last_mps = &mps
131 " let default = substitute(escape(&mps, '[$^.*~\\/?]'), '[,:]\+',
133 let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
136 let match_words = match_words . (strlen(match_words) ? "," : "") . default
138 let s:do_BR = 0
139 let s:pat = match_words
141 let s:do_BR = 1
142 let s:pat = s:ParseWords(match_words)
144 let s:all = substitute(s:pat, s:notslash . '\zs[,:]\+', '\\|', 'g')
145 let s:all = '\%(' . s:all . '\)'
146 " let s:all = '\%(' . substitute(s:all, '\\\ze[,:]', '', 'g') . '\)'
148 let b:match_pat = s:pat
159 let matchline = getline(startline)
166 let matchline = a:word
167 let curcol = 0
168 let prefix = '^\%('
169 let suffix = '\)$'
172 let regexp = s:Wholematch(matchline, s:all, startcol-1)
173 let curcol = match(matchline, regexp)
178 let endcol = matchend(matchline, regexp)
179 let suf = strlen(matchline) - endcol
180 let prefix = (curcol ? '^.*\%' . (curcol + 1) . 'c\%(' : '^\%(')
181 let suffix = (suf ? '\)\%' . (endcol + 1) . 'c.*$' : '\)$')
184 let b:match_match = matchstr(matchline, regexp)
185 let b:match_col = curcol+1
195 let patBR = substitute(match_words.',',
197 let patBR = substitute(patBR, s:notslash.'\zs:\{2,}', ':', 'g')
201 let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
202 let i = matchend(group, s:notslash . ",")
203 let groupBR = strpart(group, i)
204 let group = strpart(group, 0, i-1)
207 let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
210 let b:match_wholeBR = groupBR
211 let i = matchend(groupBR, s:notslash . ":")
212 let b:match_iniBR = strpart(groupBR, 0, i-1)
216 let i = matchend(group, s:notslash . ":")
217 let j = matchend(group, '.*' . s:notslash . ":")
218 let ini = strpart(group, 0, i-1)
219 let mid = substitute(strpart(group, i,j-i-1), s:notslash.'\zs:', '\\|', 'g')
220 let fin = strpart(group, j)
222 let ini = substitute(ini, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
223 let mid = substitute(mid, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
224 let fin = substitute(fin, s:notslash . '\zs\\\(:\|,\)', '\1', 'g')
226 let ini = substitute(ini, s:notslash . '\zs\\(', '\\%(', 'g')
227 let mid = substitute(mid, s:notslash . '\zs\\(', '\\%(', 'g')
228 let fin = substitute(fin, s:notslash . '\zs\\(', '\\%(', 'g')
232 let mid = ""
237 let flag = "bW"
239 let flag = "W"
243 let skip = b:match_skip
245 let skip = "r:" . b:match_comment
247 let skip = 's:comment\|string'
249 let skip = s:ParseSkip(skip)
251 let b:match_ini = ini
252 let b:match_tail = (strlen(mid) ? mid.'\|' : '') . fin
257 let restore_cursor = virtcol(".") . "|"
259 let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
261 let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
269 let skip = "0"
271 execute "if " . skip . "| let skip = '0' | endif"
273 let sp_return = searchpair(ini, mid, fin, flag, skip)
274 let final_position = "call cursor(" . line(".") . "," . col(".") . ")"
301 let matchline = getline(".")
302 let currcol = col(".")
303 let regexp = s:Wholematch(matchline, a:1, currcol-1)
304 let endcol = matchend(matchline, regexp)
325 let i = matchend(a:groupBR, s:notslash . ':')
326 let ini = strpart(a:groupBR, 0, i-1)
327 let tailBR = strpart(a:groupBR, i)
328 let word = s:Choose(a:group, a:matchline, ":", "", a:prefix, a:suffix,
330 let i = matchend(word, s:notslash . ":")
331 let wordBR = strpart(word, i)
332 let word = strpart(word, 0, i-1)
335 let table = s:Resolve(ini, wordBR, "table")
337 " let table = "----------"
338 let table = ""
339 let d = 0
342 " let table[d] = d
343 let table = table . d
345 let table = table . "-"
347 let d = d + 1
350 let d = 9
353 let backref = substitute(a:matchline, a:prefix.word.a:suffix,
356 let backref = escape(backref, '*,:')
358 let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len)
359 let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d,
362 let d = d-1
366 let b:match_table = table
367 let b:match_word = word
369 let b:match_table = ""
370 let b:match_word = ""
381 let groups = substitute(a:groups.",", s:notslash.'\zs[,:]*,[,:]*', ',', 'g')
382 let groups = substitute(groups, s:notslash . '\zs:\{2,}', ':', 'g')
383 let parsed = ""
385 let i = matchend(groups, s:notslash . ':')
386 let j = matchend(groups, s:notslash . ',')
387 let ini = strpart(groups, 0, i-1)
388 let tail = strpart(groups, i, j-i-1) . ":"
389 let groups = strpart(groups, j)
390 let parsed = parsed . ini
391 let i = matchend(tail, s:notslash . ':')
394 let word = strpart(tail, 0, i-1)
395 let tail = strpart(tail, i)
396 let i = matchend(tail, s:notslash . ':')
397 let parsed = parsed . ":" . s:Resolve(ini, word, "word")
399 let parsed = parsed . ","
401 let parsed = substitute(parsed, ',$', '', '')
412 " let regexp = s:Wholematch(getline("."), 'foo\|bar', col(".")-1)
413 " let i = match(getline("."), regexp)
414 " let j = matchend(getline("."), regexp)
415 " let match = matchstr(getline("."), regexp)
417 let group = '\%(' . a:pat . '\)'
418 let prefix = (a:start ? '\(^.*\%<' . (a:start + 2) . 'c\)\zs' : '^')
419 let len = strlen(a:string)
420 let suffix = (a:start+1 < len ? '\(\%>'.(a:start+1).'c.*$\)\@=' : '$')
422 let prefix = ''
434 " :let foo = s:Ref(string, d, "start")
435 " :let bar = s:Ref(string, d, "len")
437 let len = strlen(a:string)
439 let start = 0
441 let cnt = a:d
442 let match = a:string
444 let cnt = cnt - 1
445 let index = matchend(match, s:notslash . '\\(')
449 let match = strpart(match, index)
451 let start = len - strlen(match)
455 let cnt = 1
457 let index = matchend(match, s:notslash . '\\(\|\\)') - 1
462 let cnt = cnt + (match[index]=="(" ? 1 : -1) " ')'
463 " let cnt = stridx('0(', match[index]) + cnt
464 let match = strpart(match, index+1)
466 let start = start - 2
467 let len = len - start - strlen(match)
472 return "let " . a:1 . "=" . start . "| let " . a:2 . "=" . len
483 let pat = escape(a:pattern, '\\')
485 let foo = substitute(a:string, '[^'.a:pattern.']', "a:1", "g")
486 let foo = substitute(a:string, pat, a:2, "g")
487 let foo = substitute(foo, '[^' . a:2 . ']', "", "g")
490 let result = 0
491 let foo = a:string
492 let index = matchend(foo, pat)
494 let result = result + 1
495 let foo = strpart(foo, index)
496 let index = matchend(foo, pat)
509 let word = a:target
510 let i = matchend(word, s:notslash . '\\\d') - 1
511 let table = "----------"
513 let d = word[i]
514 let backref = s:Ref(a:source, d)
522 let w = s:Count(
524 let b = 1 " number of the current '\(' in backref
525 let s = d " number of the current '\(' in a:source
530 " let table[s] = w + b
531 let table = strpart(table, 0, s) . (w+b) . strpart(table, s+1)
533 let b = b + 1
534 let s = s + 1
537 let ref = strpart(backref, start, len)
538 let backref = strpart(backref, 0, start) . ":". table[s]
540 let s = s + s:Count(substitute(ref, '\\\\', '', 'g'), '\(', '1')
543 let word = strpart(word, 0, i-1) . backref . strpart(word, i+1)
544 let i = matchend(word, s:notslash . '\\\d') - 1
546 let word = substitute(word, s:notslash . '\zs:', '\\', 'g')
562 let tail = (a:patterns =~ a:comma."$" ? a:patterns : a:patterns . a:comma)
563 let i = matchend(tail, s:notslash . a:comma)
565 let alttail = (a:1 =~ a:comma."$" ? a:1 : a:1 . a:comma)
566 let j = matchend(alttail, s:notslash . a:comma)
568 let current = strpart(tail, 0, i-1)
570 let currpat = current
572 let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
575 let tail = strpart(tail, i)
576 let i = matchend(tail, s:notslash . a:comma)
580 let current = strpart(tail, 0, i-1)
582 let currpat = current
584 let currpat = substitute(current, s:notslash . a:branch, '\\|', 'g')
587 let alttail = strpart(alttail, j)
588 let j = matchend(alttail, s:notslash . a:comma)
592 let current = current . a:comma . strpart(alttail, 0, j-1)
605 let b:match_debug = 1 " Save debugging information.
629 " let m = MultiMatch("bW", "n") ... execute m
639 let restore_options = (&ic ? "" : "no") . "ignorecase"
641 let &ignorecase = b:match_ignorecase
643 let startline = line(".")
644 let startcol = col(".")
651 let default = escape(&mps, '[$^.*~\\/?]') . (strlen(&mps) ? "," : "") .
655 let match_words = b:match_words
657 execute "let match_words =" b:match_words
661 let s:last_words = match_words
662 let s:last_mps = &mps
664 let s:do_BR = 0
665 let s:pat = match_words
667 let s:do_BR = 1
668 let s:pat = s:ParseWords(match_words)
670 let s:all = '\%(' . substitute(s:pat . (strlen(s:pat)?",":"") . default,
673 let b:match_pat = s:pat
682 let cdefault = (s:pat =~ '[^,]$' ? "," : "") . default
683 let open = substitute(s:pat . cdefault,
685 let open = '\(' . substitute(open, s:notslash . '\zs:.*$', '\\)', '')
686 let close = substitute(s:pat . cdefault,
688 let close = substitute(close, '^.\{-}' . s:notslash . ':', '\\(', '') . '\)'
690 let skip = b:match_skip
692 let skip = "r:" . b:match_comment
694 let skip = 's:comment\|string'
696 let skip = s:ParseSkip(skip)
697 " let restore_cursor = line(".") . "G" . virtcol(".") . "|"
699 " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
700 let restore_cursor = virtcol(".") . "|"
702 let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
704 let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
709 let openpat = substitute(open, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
710 let openpat = substitute(openpat, ',', '\\|', 'g')
711 let closepat = substitute(close, '\(\\\@<!\(\\\\\)*\)\@<=\\(', '\\%(', 'g')
712 let closepat = substitute(closepat, ',', '\\|', 'g')
714 let skip = '0'
716 execute "if " . skip . "| let skip = '0' | endif"
719 let level = v:count1
725 let level = level - 1
743 " let startpos = s:MultiMatch("bW")
750 " let matchline = getline(".")
751 " let curcol = col(".") - 1
753 " let regexp = s:Wholematch(matchline, s:all, curcol)
754 " let suf = strlen(matchline) - matchend(matchline, regexp)
755 " let prefix = (curcol ? '^.\{' . curcol . '}\%(' : '^\%(')
756 " let suffix = (suf ? '\).\{' . suf . '}$' : '\)$')
758 " let patBR = substitute(b:match_words.',', '[,:]*,[,:]*', ',', 'g')
759 " let patBR = substitute(patBR, ':\{2,}', ':', "g")
762 " let group = s:Choose(s:pat, matchline, ",", ":", prefix, suffix, patBR)
763 " let i = matchend(group, s:notslash . ",")
764 " let groupBR = strpart(group, i)
765 " let group = strpart(group, 0, i-1)
768 " let group = s:InsertRefs(groupBR, prefix, group, suffix, matchline)
770 " " let g:group = group
773 " let fake = "end" . expand("<cword>")
780 " let close = s:Autocomplete()
783 " let close = s:Autocomplete()
793 let skip = a:str
796 let skip = "synIDattr(synID(line('.'),col('.'),1),'name') =~? '" .
799 let skip = "synIDattr(synID(line('.'),col('.'),1),'name') !~? '" .
802 let skip = "strpart(getline('.'),0,col('.'))=~'" . strpart(skip,2). "'"
804 let skip = "strpart(getline('.'),0,col('.'))!~'" . strpart(skip,2). "'"
810 let &cpo = s:save_cpo