Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit for my vim plugins & setup

  • Loading branch information...
commit 6d9c44f4c2ab6bcebd7c15c2ab2ef5eee2ee6643 0 parents
@ericj authored
Showing with 7,131 additions and 0 deletions.
  1. +3 −0  .gitmodules
  2. +142 −0 autoload/pathogen.vim
  3. +189 −0 bundle/autoclose/plugin/autoclose.vim
  4. +431 −0 bundle/autocomplpop/autoload/acp.vim
  5. +298 −0 bundle/autocomplpop/doc/acp.jax
  6. +512 −0 bundle/autocomplpop/doc/acp.txt
  7. +45 −0 bundle/autocomplpop/doc/tags
  8. +44 −0 bundle/autocomplpop/doc/tags-ja
  9. +170 −0 bundle/autocomplpop/plugin/acp.vim
  10. BIN  bundle/autocomplpop/vim-autocomplpop.zip
  11. +406 −0 bundle/matchit/doc/matchit.txt
  12. +50 −0 bundle/matchit/doc/tags
  13. BIN  bundle/matchit/matchit.zip
  14. +812 −0 bundle/matchit/plugin/matchit.vim
  15. +35 −0 bundle/snipMate/after/plugin/snipMate.vim
  16. +433 −0 bundle/snipMate/autoload/snipMate.vim
  17. +286 −0 bundle/snipMate/doc/snipMate.txt
  18. +33 −0 bundle/snipMate/doc/tags
  19. +10 −0 bundle/snipMate/ftplugin/html_snip_helper.vim
  20. +247 −0 bundle/snipMate/plugin/snipMate.vim
  21. +7 −0 bundle/snipMate/snippets/_.snippets
  22. +66 −0 bundle/snipMate/snippets/autoit.snippets
  23. +110 −0 bundle/snipMate/snippets/c.snippets
  24. +30 −0 bundle/snipMate/snippets/cpp.snippets
  25. +190 −0 bundle/snipMate/snippets/html.snippets
  26. +78 −0 bundle/snipMate/snippets/java.snippets
  27. +74 −0 bundle/snipMate/snippets/javascript.snippets
  28. +54 −0 bundle/snipMate/snippets/mako.snippets
  29. +184 −0 bundle/snipMate/snippets/objc.snippets
  30. +91 −0 bundle/snipMate/snippets/perl.snippets
  31. +216 −0 bundle/snipMate/snippets/php.snippets
  32. +86 −0 bundle/snipMate/snippets/python.snippets
  33. +420 −0 bundle/snipMate/snippets/ruby.snippets
  34. +28 −0 bundle/snipMate/snippets/sh.snippets
  35. +7 −0 bundle/snipMate/snippets/snippet.snippets
  36. +92 −0 bundle/snipMate/snippets/tcl.snippets
  37. +115 −0 bundle/snipMate/snippets/tex.snippets
  38. +32 −0 bundle/snipMate/snippets/vim.snippets
  39. +58 −0 bundle/snipMate/snippets/zsh.snippets
  40. +19 −0 bundle/snipMate/syntax/snippet.vim
  41. +1 −0  bundle/supertab
  42. +65 −0 colors/DimGreens.vim
  43. +338 −0 colors/desert256.vim
  44. +66 −0 colors/dw_green.vim
  45. +74 −0 colors/nightflight.vim
  46. +115 −0 colors/oceanblack.vim
  47. +125 −0 colors/oceanblack256.vim
  48. +168 −0 colors/yzlin256.vim
  49. +76 −0 vimrc
3  .gitmodules
@@ -0,0 +1,3 @@
+[submodule "bundle/supertab"]
+ path = bundle/supertab
+ url = https://github.com/ervandew/supertab.git
142 autoload/pathogen.vim
@@ -0,0 +1,142 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Version: 1.3
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" API is documented below.
+
+if exists("g:loaded_pathogen") || &cp
+ finish
+endif
+let g:loaded_pathogen = 1
+
+" Split a path into a list.
+function! pathogen#split(path) abort " {{{1
+ if type(a:path) == type([]) | return a:path | endif
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction " }}}1
+
+" Convert a list to a path.
+function! pathogen#join(...) abort " {{{1
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction " }}}1
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort " {{{1
+ return call('pathogen#join',[1] + a:000)
+endfunction " }}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort " {{{1
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if has_key(seen,a:list[i])
+ call remove(a:list,i)
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction " }}}1
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#separator() abort " {{{1
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction " }}}1
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort " {{{1
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort " {{{1
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
+" its 'basename()' is included in g:pathogen_disabled[]'.
+function! pathogen#is_disabled(path) " {{{1
+ if !exists("g:pathogen_disabled")
+ return 0
+ endif
+ let sep = pathogen#separator()
+ return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
+endfunction "}}}1
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories.
+function! pathogen#runtime_prepend_subdirectories(path) " {{{1
+ let sep = pathogen#separator()
+ let before = filter(pathogen#glob_directories(a:path.sep."*[^~]"), '!pathogen#is_disabled(v:val)')
+ let after = filter(pathogen#glob_directories(a:path.sep."*[^~]".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
+ let rtp = pathogen#split(&rtp)
+ let path = expand(a:path)
+ call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
+ let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
+ return &rtp
+endfunction " }}}1
+
+" For each directory in rtp, check for a subdirectory named dir. If it
+" exists, add all subdirectories of that subdirectory to the rtp, immediately
+" after the original directory. If no argument is given, 'bundle' is used.
+" Repeated calls with the same arguments are ignored.
+function! pathogen#runtime_append_all_bundles(...) " {{{1
+ let sep = pathogen#separator()
+ let name = a:0 ? a:1 : 'bundle'
+ if "\n".s:done_bundles =~# "\\M\n".name."\n"
+ return ""
+ endif
+ let s:done_bundles .= name . "\n"
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
+ else
+ let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = ''
+" }}}1
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() " {{{1
+ for dir in pathogen#split(&rtp)
+ if dir[0 : strlen($VIM)-1] !=# $VIM && isdirectory(dir.'/doc') && !empty(glob(dir.'/doc/*')) && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))
+ helptags `=dir.'/doc'`
+ endif
+ endfor
+endfunction " }}}1
+
+" vim:set ft=vim ts=8 sw=2 sts=2:
189 bundle/autoclose/plugin/autoclose.vim
@@ -0,0 +1,189 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" AutoClose.vim - Automatically close pair of characters: ( with ), [ with ], { with }, etc.
+" Version: 1.1
+" Author: Thiago Alves <thiago.salves@gmail.com>
+" Maintainer: Thiago Alves <thiago.salves@gmail.com>
+" URL: http://thiagoalves.org
+" Licence: This script is released under the Vim License.
+" Last modified: 08/25/2008
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+let s:debug = 1
+
+" check if script is already loaded
+if s:debug == 0 && exists("g:loaded_AutoClose")
+ finish "stop loading the script"
+endif
+let g:loaded_AutoClose = 1
+
+let s:global_cpo = &cpo " store compatible-mode in local variable
+set cpo&vim " go into nocompatible-mode
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Functions
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! s:GetNextChar()
+ if col('$') == col('.')
+ return "\0"
+ endif
+ return strpart(getline('.'), col('.')-1, 1)
+endfunction
+
+function! s:GetPrevChar()
+ if col('.') == 1
+ return "\0"
+ endif
+ return strpart(getline('.'), col('.')-2, 1)
+endfunction
+
+function! s:IsEmptyPair()
+ let l:prev = s:GetPrevChar()
+ let l:next = s:GetNextChar()
+ if l:prev == "\0" || l:next == "\0"
+ return 0
+ endif
+ return get(s:charsToClose, l:prev, "\0") == l:next
+endfunction
+
+function! s:GetCurrentSyntaxRegion()
+ return synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+endfunction
+
+function! s:GetCurrentSyntaxRegionIf(char)
+ let l:origin_line = getline('.')
+ let l:changed_line = strpart(l:origin_line, 0, col('.')-1) . a:char . strpart(l:origin_line, col('.')-1)
+ call setline('.', l:changed_line)
+ let l:region = synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+ call setline('.', l:origin_line)
+ return l:region
+endfunction
+
+function! s:IsForbidden(char)
+ let l:result = index(s:protectedRegions, s:GetCurrentSyntaxRegion()) >= 0
+ if l:result
+ return l:result
+ endif
+ let l:region = s:GetCurrentSyntaxRegionIf(a:char)
+ let l:result = index(s:protectedRegions, l:region) >= 0
+ return l:result && l:region == 'Comment'
+endfunction
+
+function! s:InsertPair(char)
+ let l:next = s:GetNextChar()
+ let l:result = a:char
+ if s:running && !s:IsForbidden(a:char) && (l:next == "\0" || l:next !~ '\w')
+ let l:result .= s:charsToClose[a:char] . "\<Left>"
+ endif
+ return l:result
+endfunction
+
+function! s:ClosePair(char)
+ if s:running && s:GetNextChar() == a:char
+ let l:result = "\<Right>"
+ else
+ let l:result = a:char
+ endif
+ return l:result
+endfunction
+
+function! s:CheckPair(char)
+ let l:lastpos = 0
+ let l:occur = stridx(getline('.'), a:char, l:lastpos) == 0 ? 1 : 0
+
+ while l:lastpos > -1
+ let l:lastpos = stridx(getline('.'), a:char, l:lastpos+1)
+ if l:lastpos > col('.')-2
+ break
+ endif
+ if l:lastpos >= 0
+ let l:occur += 1
+ endif
+ endwhile
+
+ if l:occur == 0 || l:occur%2 == 0
+ " Opening char
+ return s:InsertPair(a:char)
+ else
+ " Closing char
+ return s:ClosePair(a:char)
+ endif
+endfunction
+
+function! s:Backspace()
+ if s:running && s:IsEmptyPair()
+ return "\<BS>\<Del>"
+ endif
+ return "\<BS>"
+endfunction
+
+function! s:ToggleAutoClose()
+ let s:running = !s:running
+ if s:running
+ echo "AutoClose ON"
+ else
+ echo "AutoClose OFF"
+ endif
+endfunction
+
+function! s:SetVEAll()
+ let s:save_ve = &ve
+ set ve=all
+ return ""
+endfunction
+
+function! s:RestoreVE()
+ exec "set ve=" . s:save_ve
+ unlet s:save_ve
+ return ""
+endfunction
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Configuration
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" let user define which character he/she wants to autocomplete
+if exists("g:AutoClosePairs") && type(g:AutoClosePairs) == type({})
+ let s:charsToClose = g:AutoClosePairs
+ unlet g:AutoClosePairs
+else
+ let s:charsToClose = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'"}
+endif
+
+" let user define in which regions the autocomplete feature should not occur
+if exists("g:AutoCloseProtectedRegions") && type(g:AutoCloseProtectedRegions) == type([])
+ let s:protectedRegions = g:AutoCloseProtectedRegions
+ unlet g:AutoCloseProtectedRegions
+else
+ let s:protectedRegions = ["Comment", "String", "Character"]
+endif
+
+" let user define if he/she wants the plugin turned on when vim start. Defaul is YES
+if exists("g:AutoCloseOn") && type(g:AutoCloseOn) == type(0)
+ let s:running = g:AutoCloseOn
+ unlet g:AutoCloseOn
+else
+ let s:running = 1
+endif
+
+" create appropriate maps to defined open/close characters
+for key in keys(s:charsToClose)
+ if key == '"'
+ let open_func_arg = '"\""'
+ let close_func_arg = '"\""'
+ else
+ let open_func_arg = '"' . key . '"'
+ let close_func_arg = '"' . s:charsToClose[key] . '"'
+ endif
+
+ if key == s:charsToClose[key]
+ exec "inoremap <silent> " . key . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>CheckPair(" . open_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ else
+ exec "inoremap <silent> " . s:charsToClose[key] . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>ClosePair(" . close_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ exec "inoremap <silent> " . key . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>InsertPair(" . open_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ endif
+endfor
+exec "inoremap <silent> <BS> <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>Backspace()<CR><C-R>=<SID>RestoreVE()<CR>"
+
+" Define convenient commands
+command! AutoCloseOn :let s:running = 1
+command! AutoCloseOff :let s:running = 0
+command! AutoCloseToggle :call s:ToggleAutoClose()
431 bundle/autocomplpop/autoload/acp.vim
@@ -0,0 +1,431 @@
+"=============================================================================
+" Copyright (c) 2007-2009 Takeshi NISHIDA
+"
+"=============================================================================
+" LOAD GUARD {{{1
+
+if exists('g:loaded_autoload_acp') || v:version < 702
+ finish
+endif
+let g:loaded_autoload_acp = 1
+
+" }}}1
+"=============================================================================
+" GLOBAL FUNCTIONS: {{{1
+
+"
+function acp#enable()
+ call acp#disable()
+
+ augroup AcpGlobalAutoCommand
+ autocmd!
+ autocmd InsertEnter * unlet! s:posLast s:lastUncompletable
+ autocmd InsertLeave * call s:finishPopup(1)
+ augroup END
+
+ if g:acp_mappingDriven
+ call s:mapForMappingDriven()
+ else
+ autocmd AcpGlobalAutoCommand CursorMovedI * call s:feedPopup()
+ endif
+
+ nnoremap <silent> i i<C-r>=<SID>feedPopup()<CR>
+ nnoremap <silent> a a<C-r>=<SID>feedPopup()<CR>
+ nnoremap <silent> R R<C-r>=<SID>feedPopup()<CR>
+endfunction
+
+"
+function acp#disable()
+ call s:unmapForMappingDriven()
+ augroup AcpGlobalAutoCommand
+ autocmd!
+ augroup END
+ nnoremap i <Nop> | nunmap i
+ nnoremap a <Nop> | nunmap a
+ nnoremap R <Nop> | nunmap R
+endfunction
+
+"
+function acp#lock()
+ let s:lockCount += 1
+endfunction
+
+"
+function acp#unlock()
+ let s:lockCount -= 1
+ if s:lockCount < 0
+ let s:lockCount = 0
+ throw "AutoComplPop: not locked"
+ endif
+endfunction
+
+"
+function acp#meetsForSnipmate(context)
+ if g:acp_behaviorSnipmateLength < 0
+ return 0
+ endif
+ let matches = matchlist(a:context, '\(^\|\s\|\<\)\(\u\{' .
+ \ g:acp_behaviorSnipmateLength . ',}\)$')
+ return !empty(matches) && !empty(s:getMatchingSnipItems(matches[2]))
+endfunction
+
+"
+function acp#meetsForKeyword(context)
+ if g:acp_behaviorKeywordLength < 0
+ return 0
+ endif
+ let matches = matchlist(a:context, '\(\k\{' . g:acp_behaviorKeywordLength . ',}\)$')
+ if empty(matches)
+ return 0
+ endif
+ for ignore in g:acp_behaviorKeywordIgnores
+ if stridx(ignore, matches[1]) == 0
+ return 0
+ endif
+ endfor
+ return 1
+endfunction
+
+"
+function acp#meetsForFile(context)
+ if g:acp_behaviorFileLength < 0
+ return 0
+ endif
+ if has('win32') || has('win64')
+ let separator = '[/\\]'
+ else
+ let separator = '\/'
+ endif
+ if a:context !~ '\f' . separator . '\f\{' . g:acp_behaviorFileLength . ',}$'
+ return 0
+ endif
+ return a:context !~ '[*/\\][/\\]\f*$\|[^[:print:]]\f*$'
+endfunction
+
+"
+function acp#meetsForRubyOmni(context)
+ if !has('ruby')
+ return 0
+ endif
+ if g:acp_behaviorRubyOmniMethodLength >= 0 &&
+ \ a:context =~ '[^. \t]\(\.\|::\)\k\{' .
+ \ g:acp_behaviorRubyOmniMethodLength . ',}$'
+ return 1
+ endif
+ if g:acp_behaviorRubyOmniSymbolLength >= 0 &&
+ \ a:context =~ '\(^\|[^:]\):\k\{' .
+ \ g:acp_behaviorRubyOmniSymbolLength . ',}$'
+ return 1
+ endif
+ return 0
+endfunction
+
+"
+function acp#meetsForPythonOmni(context)
+ return has('python') && g:acp_behaviorPythonOmniLength >= 0 &&
+ \ a:context =~ '\k\.\k\{' . g:acp_behaviorPythonOmniLength . ',}$'
+endfunction
+
+"
+function acp#meetsForPerlOmni(context)
+ return g:acp_behaviorPerlOmniLength >= 0 &&
+ \ a:context =~ '\w->\k\{' . g:acp_behaviorPerlOmniLength . ',}$'
+endfunction
+
+"
+function acp#meetsForXmlOmni(context)
+ return g:acp_behaviorXmlOmniLength >= 0 &&
+ \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' .
+ \ g:acp_behaviorXmlOmniLength . ',}$'
+endfunction
+
+"
+function acp#meetsForHtmlOmni(context)
+ return g:acp_behaviorHtmlOmniLength >= 0 &&
+ \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' .
+ \ g:acp_behaviorHtmlOmniLength . ',}$'
+endfunction
+
+"
+function acp#meetsForCssOmni(context)
+ if g:acp_behaviorCssOmniPropertyLength >= 0 &&
+ \ a:context =~ '\(^\s\|[;{]\)\s*\k\{' .
+ \ g:acp_behaviorCssOmniPropertyLength . ',}$'
+ return 1
+ endif
+ if g:acp_behaviorCssOmniValueLength >= 0 &&
+ \ a:context =~ '[:@!]\s*\k\{' .
+ \ g:acp_behaviorCssOmniValueLength . ',}$'
+ return 1
+ endif
+ return 0
+endfunction
+
+"
+function acp#completeSnipmate(findstart, base)
+ if a:findstart
+ let s:posSnipmateCompletion = len(matchstr(s:getCurrentText(), '.*\U'))
+ return s:posSnipmateCompletion
+ endif
+ let lenBase = len(a:base)
+ let items = filter(GetSnipsInCurrentScope(),
+ \ 'strpart(v:key, 0, lenBase) ==? a:base')
+ return map(sort(items(items)), 's:makeSnipmateItem(v:val[0], v:val[1])')
+endfunction
+
+"
+function acp#onPopupCloseSnipmate()
+ let word = s:getCurrentText()[s:posSnipmateCompletion :]
+ for trigger in keys(GetSnipsInCurrentScope())
+ if word ==# trigger
+ call feedkeys("\<C-r>=TriggerSnippet()\<CR>", "n")
+ return 0
+ endif
+ endfor
+ return 1
+endfunction
+
+"
+function acp#onPopupPost()
+ " to clear <C-r>= expression on command-line
+ echo ''
+ if pumvisible()
+ inoremap <silent> <expr> <C-h> acp#onBs()
+ inoremap <silent> <expr> <BS> acp#onBs()
+ " a command to restore to original text and select the first match
+ return (s:behavsCurrent[s:iBehavs].command =~# "\<C-p>" ? "\<C-n>\<Up>"
+ \ : "\<C-p>\<Down>")
+ endif
+ let s:iBehavs += 1
+ if len(s:behavsCurrent) > s:iBehavs
+ call s:setCompletefunc()
+ return printf("\<C-e>%s\<C-r>=acp#onPopupPost()\<CR>",
+ \ s:behavsCurrent[s:iBehavs].command)
+ else
+ let s:lastUncompletable = {
+ \ 'word': s:getCurrentWord(),
+ \ 'commands': map(copy(s:behavsCurrent), 'v:val.command')[1:],
+ \ }
+ call s:finishPopup(0)
+ return "\<C-e>"
+ endif
+endfunction
+
+"
+function acp#onBs()
+ " using "matchstr" and not "strpart" in order to handle multi-byte
+ " characters
+ if call(s:behavsCurrent[s:iBehavs].meets,
+ \ [matchstr(s:getCurrentText(), '.*\ze.')])
+ return "\<BS>"
+ endif
+ return "\<C-e>\<BS>"
+endfunction
+
+" }}}1
+"=============================================================================
+" LOCAL FUNCTIONS: {{{1
+
+"
+function s:mapForMappingDriven()
+ call s:unmapForMappingDriven()
+ let s:keysMappingDriven = [
+ \ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ \ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ \ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ \ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ \ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+ \ '-', '_', '~', '^', '.', ',', ':', '!', '#', '=', '%', '$', '@', '<', '>', '/', '\',
+ \ '<Space>', '<C-h>', '<BS>', ]
+ for key in s:keysMappingDriven
+ execute printf('inoremap <silent> %s %s<C-r>=<SID>feedPopup()<CR>',
+ \ key, key)
+ endfor
+endfunction
+
+"
+function s:unmapForMappingDriven()
+ if !exists('s:keysMappingDriven')
+ return
+ endif
+ for key in s:keysMappingDriven
+ execute 'iunmap ' . key
+ endfor
+ let s:keysMappingDriven = []
+endfunction
+
+"
+function s:setTempOption(group, name, value)
+ call extend(s:tempOptionSet[a:group], { a:name : eval('&' . a:name) }, 'keep')
+ execute printf('let &%s = a:value', a:name)
+endfunction
+
+"
+function s:restoreTempOptions(group)
+ for [name, value] in items(s:tempOptionSet[a:group])
+ execute printf('let &%s = value', name)
+ endfor
+ let s:tempOptionSet[a:group] = {}
+endfunction
+
+"
+function s:getCurrentWord()
+ return matchstr(s:getCurrentText(), '\k*$')
+endfunction
+
+"
+function s:getCurrentText()
+ return strpart(getline('.'), 0, col('.') - 1)
+endfunction
+
+"
+function s:getPostText()
+ return strpart(getline('.'), col('.') - 1)
+endfunction
+
+"
+function s:isModifiedSinceLastCall()
+ if exists('s:posLast')
+ let posPrev = s:posLast
+ let nLinesPrev = s:nLinesLast
+ let textPrev = s:textLast
+ endif
+ let s:posLast = getpos('.')
+ let s:nLinesLast = line('$')
+ let s:textLast = getline('.')
+ if !exists('posPrev')
+ return 1
+ elseif posPrev[1] != s:posLast[1] || nLinesPrev != s:nLinesLast
+ return (posPrev[1] - s:posLast[1] == nLinesPrev - s:nLinesLast)
+ elseif textPrev ==# s:textLast
+ return 0
+ elseif posPrev[2] > s:posLast[2]
+ return 1
+ elseif has('gui_running') && has('multi_byte')
+ " NOTE: auto-popup causes a strange behavior when IME/XIM is working
+ return posPrev[2] + 1 == s:posLast[2]
+ endif
+ return posPrev[2] != s:posLast[2]
+endfunction
+
+"
+function s:makeCurrentBehaviorSet()
+ let modified = s:isModifiedSinceLastCall()
+ if exists('s:behavsCurrent[s:iBehavs].repeat') && s:behavsCurrent[s:iBehavs].repeat
+ let behavs = [ s:behavsCurrent[s:iBehavs] ]
+ elseif exists('s:behavsCurrent[s:iBehavs]')
+ return []
+ elseif modified
+ let behavs = copy(exists('g:acp_behavior[&filetype]')
+ \ ? g:acp_behavior[&filetype]
+ \ : g:acp_behavior['*'])
+ else
+ return []
+ endif
+ let text = s:getCurrentText()
+ call filter(behavs, 'call(v:val.meets, [text])')
+ let s:iBehavs = 0
+ if exists('s:lastUncompletable') &&
+ \ stridx(s:getCurrentWord(), s:lastUncompletable.word) == 0 &&
+ \ map(copy(behavs), 'v:val.command') ==# s:lastUncompletable.commands
+ let behavs = []
+ else
+ unlet! s:lastUncompletable
+ endif
+ return behavs
+endfunction
+
+"
+function s:feedPopup()
+ " NOTE: CursorMovedI is not triggered while the popup menu is visible. And
+ " it will be triggered when popup menu is disappeared.
+ if s:lockCount > 0 || pumvisible() || &paste
+ return ''
+ endif
+ if exists('s:behavsCurrent[s:iBehavs].onPopupClose')
+ if !call(s:behavsCurrent[s:iBehavs].onPopupClose, [])
+ call s:finishPopup(1)
+ return ''
+ endif
+ endif
+ let s:behavsCurrent = s:makeCurrentBehaviorSet()
+ if empty(s:behavsCurrent)
+ call s:finishPopup(1)
+ return ''
+ endif
+ " In case of dividing words by symbols (e.g. "for(int", "ab==cd") while a
+ " popup menu is visible, another popup is not available unless input <C-e>
+ " or try popup once. So first completion is duplicated.
+ call insert(s:behavsCurrent, s:behavsCurrent[s:iBehavs])
+ call s:setTempOption(s:GROUP0, 'spell', 0)
+ call s:setTempOption(s:GROUP0, 'completeopt', 'menuone' . (g:acp_completeoptPreview ? ',preview' : ''))
+ call s:setTempOption(s:GROUP0, 'complete', g:acp_completeOption)
+ call s:setTempOption(s:GROUP0, 'ignorecase', g:acp_ignorecaseOption)
+ " NOTE: With CursorMovedI driven, Set 'lazyredraw' to avoid flickering.
+ " With Mapping driven, set 'nolazyredraw' to make a popup menu visible.
+ call s:setTempOption(s:GROUP0, 'lazyredraw', !g:acp_mappingDriven)
+ " NOTE: 'textwidth' must be restored after <C-e>.
+ call s:setTempOption(s:GROUP1, 'textwidth', 0)
+ call s:setCompletefunc()
+ call feedkeys(s:behavsCurrent[s:iBehavs].command . "\<C-r>=acp#onPopupPost()\<CR>", 'n')
+ return '' " this function is called by <C-r>=
+endfunction
+
+"
+function s:finishPopup(fGroup1)
+ inoremap <C-h> <Nop> | iunmap <C-h>
+ inoremap <BS> <Nop> | iunmap <BS>
+ let s:behavsCurrent = []
+ call s:restoreTempOptions(s:GROUP0)
+ if a:fGroup1
+ call s:restoreTempOptions(s:GROUP1)
+ endif
+endfunction
+
+"
+function s:setCompletefunc()
+ if exists('s:behavsCurrent[s:iBehavs].completefunc')
+ call s:setTempOption(0, 'completefunc', s:behavsCurrent[s:iBehavs].completefunc)
+ endif
+endfunction
+
+"
+function s:makeSnipmateItem(key, snip)
+ if type(a:snip) == type([])
+ let descriptions = map(copy(a:snip), 'v:val[0]')
+ let snipFormatted = '[MULTI] ' . join(descriptions, ', ')
+ else
+ let snipFormatted = substitute(a:snip, '\(\n\|\s\)\+', ' ', 'g')
+ endif
+ return {
+ \ 'word': a:key,
+ \ 'menu': strpart(snipFormatted, 0, 80),
+ \ }
+endfunction
+
+"
+function s:getMatchingSnipItems(base)
+ let key = a:base . "\n"
+ if !exists('s:snipItems[key]')
+ let s:snipItems[key] = items(GetSnipsInCurrentScope())
+ call filter(s:snipItems[key], 'strpart(v:val[0], 0, len(a:base)) ==? a:base')
+ call map(s:snipItems[key], 's:makeSnipmateItem(v:val[0], v:val[1])')
+ endif
+ return s:snipItems[key]
+endfunction
+
+" }}}1
+"=============================================================================
+" INITIALIZATION {{{1
+
+let s:GROUP0 = 0
+let s:GROUP1 = 1
+let s:lockCount = 0
+let s:behavsCurrent = []
+let s:iBehavs = 0
+let s:tempOptionSet = [{}, {}]
+let s:snipItems = {}
+
+" }}}1
+"=============================================================================
+" vim: set fdm=marker:
298 bundle/autocomplpop/doc/acp.jax
@@ -0,0 +1,298 @@
+*acp.txt* 補完メニューの自動ポップアップ
+
+ Copyright (c) 2007-2009 Takeshi NISHIDA
+
+AutoComplPop *autocomplpop* *acp*
+
+概要 |acp-introduction|
+インストール |acp-installation|
+使い方 |acp-usage|
+コマンド |acp-commands|
+オプション |acp-options|
+SPECIAL THANKS |acp-thanks|
+CHANGELOG |acp-changelog|
+あばうと |acp-about|
+
+
+==============================================================================
+概要 *acp-introduction*
+
+このプラグインは、インサートモードで文字を入力したりカーソルを動かしたときに補
+完メニューを自動的に開くようにします。しかし、続けて文字を入力するのを妨げたり
+はしません。
+
+
+==============================================================================
+インストール *acp-installation*
+
+ZIPファイルをランタイムディレクトリに展開します。
+
+以下のようにファイルが配置されるはずです。
+>
+ <your runtime directory>/plugin/acp.vim
+ <your runtime directory>/doc/acp.txt
+ ...
+<
+もしランタイムディレクトリが他のプラグインとごた混ぜになるのが嫌なら、ファイル
+を新規ディレクトリに配置し、そのディレクトリのパスを 'runtimepath' に追加して
+ください。アンインストールも楽になります。
+
+その後 FuzzyFinder のヘルプを有効にするためにタグファイルを更新してください。
+詳しくは|add-local-help|を参照してください。
+
+
+==============================================================================
+使い方 *acp-usage*
+
+このプラグインがインストールされていれば、自動ポップアップは vim の開始時から
+有効になります。
+
+カーソル直前のテキストに応じて、利用する補完の種類を切り替えます。デフォルトの
+補完動作は次の通りです:
+
+ 補完モード filetype カーソル直前のテキスト ~
+ キーワード補完 * 2文字のキーワード文字
+ ファイル名補完 * ファイル名文字 + パスセパレータ
+ + 0文字以上のファイル名文字
+ オムニ補完 ruby ".", "::" or 単語を構成する文字以外 + ":"
+ オムニ補完 python "."
+ オムニ補完 xml "<", "</" or ("<" + ">"以外の文字列 + " ")
+ オムニ補完 html/xhtml "<", "</" or ("<" + ">"以外の文字列 + " ")
+ オムニ補完 css (":", ";", "{", "^", "@", or "!")
+ + 0個または1個のスペース
+
+さらに、設定を行うことで、ユーザー定義補完と snipMate トリガー補完
+(|acp-snipMate|) を自動ポップアップさせることができます。
+
+これらの補完動作はカスタマイズ可能です。
+
+ *acp-snipMate*
+snipMate トリガー補完 ~
+
+snipMate トリガー補完では、snipMate プラグイン
+(http://www.vim.org/scripts/script.php?script_id=2540) が提供するスニペットの
+トリガーを補完してそれを展開することができます。
+
+この自動ポップアップを有効にするには、次の関数を plugin/snipMate.vim に追加す
+る必要があります:
+>
+ fun! GetSnipsInCurrentScope()
+ let snips = {}
+ for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
+ call extend(snips, get(s:snippets, scope, {}), 'keep')
+ call extend(snips, get(s:multi_snips, scope, {}), 'keep')
+ endfor
+ return snips
+ endf
+<
+そして|g:acp_behaviorSnipmateLength|オプションを 1 にしてください。
+
+この自動ポップアップには制限があり、カーソル直前の単語は大文字英字だけで構成さ
+れていなければなりません。
+
+ *acp-perl-omni*
+Perl オムニ補完 ~
+
+AutoComplPop は perl-completion.vim
+(http://www.vim.org/scripts/script.php?script_id=2852) をサポートしています。
+
+この自動ポップアップを有効にするには、|g:acp_behaviorPerlOmniLength|オプション
+を 0 以上にしてください。
+
+
+==============================================================================
+コマンド *acp-commands*
+
+ *:AcpEnable*
+:AcpEnable
+ 自動ポップアップを有効にします。
+
+ *:AcpDisable*
+:AcpDisable
+ 自動ポップアップを無効にします。
+
+ *:AcpLock*
+:AcpLock
+ 自動ポップアップを一時的に停止します。
+
+ 別のスクリプトへの干渉を回避する目的なら、このコマンドと|:AcpUnlock|
+ を利用することを、|:AcpDisable|と|:AcpEnable| を利用するよりも推奨しま
+ す。
+
+ *:AcpUnlock*
+:AcpUnlock
+ |:AcpLock| で停止された自動ポップアップを再開します。
+
+
+==============================================================================
+オプション *acp-options*
+
+ *g:acp_enableAtStartup* >
+ let g:acp_enableAtStartup = 1
+<
+ 真なら vim 開始時から自動ポップアップが有効になります。
+
+ *g:acp_mappingDriven* >
+ let g:acp_mappingDriven = 0
+<
+ 真なら|CursorMovedI|イベントではなくキーマッピングで自動ポップアップを
+ 行うようにします。カーソルを移動するたびに補完が行われることで重いなど
+ の不都合がある場合に利用してください。ただし他のプラグインとの相性問題
+ や日本語入力での不具合が発生する可能性があります。(逆も然り。)
+
+ *g:acp_ignorecaseOption* >
+ let g:acp_ignorecaseOption = 1
+<
+ 自動ポップアップ時に、'ignorecase' に一時的に設定する値
+
+ *g:acp_completeOption* >
+ let g:acp_completeOption = '.,w,b,k'
+<
+ 自動ポップアップ時に、'complete' に一時的に設定する値
+
+ *g:acp_completeoptPreview* >
+ let g:acp_completeoptPreview = 0
+<
+ 真なら自動ポップアップ時に、 'completeopt' へ "preview" を追加します。
+
+ *g:acp_behaviorUserDefinedFunction* >
+ let g:acp_behaviorUserDefinedFunction = ''
+<
+ ユーザー定義補完の|g:acp_behavior-completefunc|。空ならこの補完は行わ
+ れません。。
+
+ *g:acp_behaviorUserDefinedMeets* >
+ let g:acp_behaviorUserDefinedMeets = ''
+<
+ ユーザー定義補完の|g:acp_behavior-meets|。空ならこの補完は行われません
+ 。
+
+ *g:acp_behaviorSnipmateLength* >
+ let g:acp_behaviorSnipmateLength = -1
+<
+ snipMate トリガー補完の自動ポップアップを行うのに必要なカーソルの直前
+ のパターン。
+
+ *g:acp_behaviorKeywordCommand* >
+ let g:acp_behaviorKeywordCommand = "\<C-n>"
+<
+ キーワード補完のコマンド。このオプションには普通 "\<C-n>" か "\<C-p>"
+ を設定します。
+
+ *g:acp_behaviorKeywordLength* >
+ let g:acp_behaviorKeywordLength = 2
+<
+ キーワード補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ
+ ード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorKeywordIgnores* >
+ let g:acp_behaviorKeywordIgnores = []
+<
+ 文字列のリスト。カーソル直前の単語がこれらの内いずれかの先頭部分にマッ
+ チする場合、この補完は行われません。
+
+ 例えば、 "get" で始まる補完キーワードが多過ぎて、"g", "ge", "get" を入
+ 力したときの自動ポップアップがレスポンスの低下を引き起こしている場合、
+ このオプションに ["get"] を設定することでそれを回避することができます。
+
+ *g:acp_behaviorFileLength* >
+ let g:acp_behaviorFileLength = 0
+<
+ ファイル名補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ
+ ード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorRubyOmniMethodLength* >
+ let g:acp_behaviorRubyOmniMethodLength = 0
+<
+ メソッド補完のための、Ruby オムニ補完の自動ポップアップを行うのに必要
+ なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorRubyOmniSymbolLength* >
+ let g:acp_behaviorRubyOmniSymbolLength = 1
+<
+ シンボル補完のための、Ruby オムニ補完の自動ポップアップを行うのに必要
+ なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorPythonOmniLength* >
+ let g:acp_behaviorPythonOmniLength = 0
+<
+ Python オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキ
+ ーワード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorPerlOmniLength* >
+ let g:acp_behaviorPerlOmniLength = -1
+<
+ Perl オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー
+ ワード文字数。負数ならこの補完は行われません。
+
+ See also: |acp-perl-omni|
+
+ *g:acp_behaviorXmlOmniLength* >
+ let g:acp_behaviorXmlOmniLength = 0
+<
+ XML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ
+ ード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorHtmlOmniLength* >
+ let g:acp_behaviorHtmlOmniLength = 0
+<
+ HTML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー
+ ワード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorCssOmniPropertyLength* >
+ let g:acp_behaviorCssOmniPropertyLength = 1
+<
+ プロパティ補完のための、CSS オムニ補完の自動ポップアップを行うのに必要
+ なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behaviorCssOmniValueLength* >
+ let g:acp_behaviorCssOmniValueLength = 0
+<
+ 値補完のための、CSS オムニ補完の自動ポップアップを行うのに必要なカーソ
+ ルの直前のキーワード文字数。負数ならこの補完は行われません。
+
+ *g:acp_behavior* >
+ let g:acp_behavior = {}
+<
+
+ これは内部仕様がわかっている人向けのオプションで、他のオプションでの設
+ 定より優先されます。
+
+ |Dictionary|型で、キーはファイルタイプに対応します。 '*' はデフォルト
+ を表します。値はリスト型です。補完候補が得られるまでリストの先頭アイテ
+ ムから順に評価します。各要素は|Dictionary|で詳細は次の通り:
+
+ "command": *g:acp_behavior-command*
+ 補完メニューをポップアップするためのコマンド。
+
+ "completefunc": *g:acp_behavior-completefunc*
+ 'completefunc' に設定する関数。 "command" が "<C-x><C-u>" のときだけ
+ 意味があります。
+
+ "meets": *g:acp_behavior-meets*
+ この補完を行うかどうかを判断する関数の名前。この関数はカーソル直前の
+ テキストを引数に取り、補完を行うなら非 0 の値を返します。
+
+ "onPopupClose": *g:acp_behavior-onPopupClose*
+ この補完のポップアップメニューが閉じられたときに呼ばれる関数の名前。
+ この関数が 0 を返した場合、続いて行われる予定の補完は抑制されます。
+
+ "repeat": *g:acp_behavior-repeat*
+ 真なら最後の補完が自動的に繰り返されます。
+
+
+==============================================================================
+あばうと *acp-about* *acp-contact* *acp-author*
+
+作者: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
+ライセンス: MIT Licence
+URL: http://www.vim.org/scripts/script.php?script_id=1879
+ http://bitbucket.org/ns9tks/vim-autocomplpop/
+
+バグや要望など ~
+
+こちらへどうぞ: http://bitbucket.org/ns9tks/vim-autocomplpop/issues/
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
+
512 bundle/autocomplpop/doc/acp.txt
@@ -0,0 +1,512 @@
+*acp.txt* Automatically opens popup menu for completions.
+
+ Copyright (c) 2007-2009 Takeshi NISHIDA
+
+AutoComplPop *autocomplpop* *acp*
+
+INTRODUCTION |acp-introduction|
+INSTALLATION |acp-installation|
+USAGE |acp-usage|
+COMMANDS |acp-commands|
+OPTIONS |acp-options|
+SPECIAL THANKS |acp-thanks|
+CHANGELOG |acp-changelog|
+ABOUT |acp-about|
+
+
+==============================================================================
+INTRODUCTION *acp-introduction*
+
+With this plugin, your vim comes to automatically opens popup menu for
+completions when you enter characters or move the cursor in Insert mode. It
+won't prevent you continuing entering characters.
+
+
+==============================================================================
+INSTALLATION *acp-installation*
+
+Put all files into your runtime directory. If you have the zip file, extract
+it to your runtime directory.
+
+You should place the files as follows:
+>
+ <your runtime directory>/plugin/acp.vim
+ <your runtime directory>/doc/acp.txt
+ ...
+<
+If you disgust to jumble up this plugin and other plugins in your runtime
+directory, put the files into new directory and just add the directory path to
+'runtimepath'. It's easy to uninstall the plugin.
+
+And then update your help tags files to enable fuzzyfinder help. See
+|add-local-help| for details.
+
+
+==============================================================================
+USAGE *acp-usage*
+
+Once this plugin is installed, auto-popup is enabled at startup by default.
+
+Which completion method is used depends on the text before the cursor. The
+default behavior is as follows:
+
+ kind filetype text before the cursor ~
+ Keyword * two keyword characters
+ Filename * a filename character + a path separator
+ + 0 or more filename character
+ Omni ruby ".", "::" or non-word character + ":"
+ (|+ruby| required.)
+ Omni python "." (|+python| required.)
+ Omni xml "<", "</" or ("<" + non-">" characters + " ")
+ Omni html/xhtml "<", "</" or ("<" + non-">" characters + " ")
+ Omni css (":", ";", "{", "^", "@", or "!")
+ + 0 or 1 space
+
+Also, you can make user-defined completion and snipMate's trigger completion
+(|acp-snipMate|) auto-popup if the options are set.
+
+These behavior are customizable.
+
+ *acp-snipMate*
+snipMate's Trigger Completion ~
+
+snipMate's trigger completion enables you to complete a snippet trigger
+provided by snipMate plugin
+(http://www.vim.org/scripts/script.php?script_id=2540) and expand it.
+
+
+To enable auto-popup for this completion, add following function to
+plugin/snipMate.vim:
+>
+ fun! GetSnipsInCurrentScope()
+ let snips = {}
+ for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
+ call extend(snips, get(s:snippets, scope, {}), 'keep')
+ call extend(snips, get(s:multi_snips, scope, {}), 'keep')
+ endfor
+ return snips
+ endf
+<
+And set |g:acp_behaviorSnipmateLength| option to 1.
+
+There is the restriction on this auto-popup, that the word before cursor must
+consist only of uppercase characters.
+
+ *acp-perl-omni*
+Perl Omni-Completion ~
+
+AutoComplPop supports perl-completion.vim
+(http://www.vim.org/scripts/script.php?script_id=2852).
+
+To enable auto-popup for this completion, set |g:acp_behaviorPerlOmniLength|
+option to 0 or more.
+
+
+==============================================================================
+COMMANDS *acp-commands*
+
+ *:AcpEnable*
+:AcpEnable
+ enables auto-popup.
+
+ *:AcpDisable*
+:AcpDisable
+ disables auto-popup.
+
+ *:AcpLock*
+:AcpLock
+ suspends auto-popup temporarily.
+
+ For the purpose of avoiding interruption to another script, it is
+ recommended to insert this command and |:AcpUnlock| than |:AcpDisable|
+ and |:AcpEnable| .
+
+ *:AcpUnlock*
+:AcpUnlock
+ resumes auto-popup suspended by |:AcpLock| .
+
+
+==============================================================================
+OPTIONS *acp-options*
+
+ *g:acp_enableAtStartup* >
+ let g:acp_enableAtStartup = 1
+<
+ If non-zero, auto-popup is enabled at startup.
+
+ *g:acp_mappingDriven* >
+ let g:acp_mappingDriven = 0
+<
+ If non-zero, auto-popup is triggered by key mappings instead of
+ |CursorMovedI| event. This is useful to avoid auto-popup by moving
+ cursor in Insert mode.
+
+ *g:acp_ignorecaseOption* >
+ let g:acp_ignorecaseOption = 1
+<
+ Value set to 'ignorecase' temporarily when auto-popup.
+
+ *g:acp_completeOption* >
+ let g:acp_completeOption = '.,w,b,k'
+<
+ Value set to 'complete' temporarily when auto-popup.
+
+ *g:acp_completeoptPreview* >
+ let g:acp_completeoptPreview = 0
+<
+ If non-zero, "preview" is added to 'completeopt' when auto-popup.
+
+ *g:acp_behaviorUserDefinedFunction* >
+ let g:acp_behaviorUserDefinedFunction = ''
+<
+ |g:acp_behavior-completefunc| for user-defined completion. If empty,
+ this completion will be never attempted.
+
+ *g:acp_behaviorUserDefinedMeets* >
+ let g:acp_behaviorUserDefinedMeets = ''
+<
+ |g:acp_behavior-meets| for user-defined completion. If empty, this
+ completion will be never attempted.
+
+ *g:acp_behaviorSnipmateLength* >
+ let g:acp_behaviorSnipmateLength = -1
+<
+ Pattern before the cursor, which are needed to attempt
+ snipMate-trigger completion.
+
+ *g:acp_behaviorKeywordCommand* >
+ let g:acp_behaviorKeywordCommand = "\<C-n>"
+<
+ Command for keyword completion. This option is usually set "\<C-n>" or
+ "\<C-p>".
+
+ *g:acp_behaviorKeywordLength* >
+ let g:acp_behaviorKeywordLength = 2
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt keyword completion. If negative value, this completion will be
+ never attempted.
+
+ *g:acp_behaviorKeywordIgnores* >
+ let g:acp_behaviorKeywordIgnores = []
+<
+ List of string. If a word before the cursor matches to the front part
+ of one of them, keyword completion won't be attempted.
+
+ E.g., when there are too many keywords beginning with "get" for the
+ completion and auto-popup by entering "g", "ge", or "get" causes
+ response degradation, set ["get"] to this option and avoid it.
+
+ *g:acp_behaviorFileLength* >
+ let g:acp_behaviorFileLength = 0
+<
+ Length of filename characters before the cursor, which are needed to
+ attempt filename completion. If negative value, this completion will
+ be never attempted.
+
+ *g:acp_behaviorRubyOmniMethodLength* >
+ let g:acp_behaviorRubyOmniMethodLength = 0
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt ruby omni-completion for methods. If negative value, this
+ completion will be never attempted.
+
+ *g:acp_behaviorRubyOmniSymbolLength* >
+ let g:acp_behaviorRubyOmniSymbolLength = 1
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt ruby omni-completion for symbols. If negative value, this
+ completion will be never attempted.
+
+ *g:acp_behaviorPythonOmniLength* >
+ let g:acp_behaviorPythonOmniLength = 0
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt python omni-completion. If negative value, this completion
+ will be never attempted.
+
+ *g:acp_behaviorPerlOmniLength* >
+ let g:acp_behaviorPerlOmniLength = -1
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt perl omni-completion. If negative value, this completion will
+ be never attempted.
+
+ See also: |acp-perl-omni|
+
+ *g:acp_behaviorXmlOmniLength* >
+ let g:acp_behaviorXmlOmniLength = 0
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt XML omni-completion. If negative value, this completion will
+ be never attempted.
+
+ *g:acp_behaviorHtmlOmniLength* >
+ let g:acp_behaviorHtmlOmniLength = 0
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt HTML omni-completion. If negative value, this completion will
+ be never attempted.
+
+ *g:acp_behaviorCssOmniPropertyLength* >
+ let g:acp_behaviorCssOmniPropertyLength = 1
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt CSS omni-completion for properties. If negative value, this
+ completion will be never attempted.
+
+ *g:acp_behaviorCssOmniValueLength* >
+ let g:acp_behaviorCssOmniValueLength = 0
+<
+ Length of keyword characters before the cursor, which are needed to
+ attempt CSS omni-completion for values. If negative value, this
+ completion will be never attempted.
+
+ *g:acp_behavior* >
+ let g:acp_behavior = {}
+<
+ This option is for advanced users. This setting overrides other
+ behavior options. This is a |Dictionary|. Each key corresponds to a
+ filetype. '*' is default. Each value is a list. These are attempted in
+ sequence until completion item is found. Each element is a
+ |Dictionary| which has following items:
+
+ "command": *g:acp_behavior-command*
+ Command to be fed to open popup menu for completions.
+
+ "completefunc": *g:acp_behavior-completefunc*
+ 'completefunc' will be set to this user-provided function during the
+ completion. Only makes sense when "command" is "<C-x><C-u>".
+
+ "meets": *g:acp_behavior-meets*
+ Name of the function which dicides whether or not to attempt this
+ completion. It will be attempted if this function returns non-zero.
+ This function takes a text before the cursor.
+
+ "onPopupClose": *g:acp_behavior-onPopupClose*
+ Name of the function which is called when popup menu for this
+ completion is closed. Following completions will be suppressed if
+ this function returns zero.
+
+ "repeat": *g:acp_behavior-repeat*
+ If non-zero, the last completion is automatically repeated.
+
+
+==============================================================================
+SPECIAL THANKS *acp-thanks*
+
+- Daniel Schierbeck
+- Ingo Karkat
+
+
+==============================================================================
+CHANGELOG *acp-changelog*
+
+2.14.1
+ - Changed the way of auto-popup for avoiding an issue about filename
+ completion.
+ - Fixed a bug that popup menu was opened twice when auto-popup was done.
+
+2.14
+ - Added the support for perl-completion.vim.
+
+2.13
+ - Changed to sort snipMate's triggers.
+ - Fixed a bug that a wasted character was inserted after snipMate's trigger
+ completion.
+
+2.12.1
+ - Changed to avoid a strange behavior with Microsoft IME.
+
+2.12
+ - Added g:acp_behaviorKeywordIgnores option.
+ - Added g:acp_behaviorUserDefinedMeets option and removed
+ g:acp_behaviorUserDefinedPattern.
+ - Changed to do auto-popup only when a buffer is modified.
+ - Changed the structure of g:acp_behavior option.
+ - Changed to reflect a change of behavior options (named g:acp_behavior*)
+ any time it is done.
+ - Fixed a bug that completions after omni completions or snipMate's trigger
+ completion were never attempted when no candidate for the former
+ completions was found.
+
+2.11.1
+ - Fixed a bug that a snipMate's trigger could not be expanded when it was
+ completed.
+
+2.11
+ - Implemented experimental feature which is snipMate's trigger completion.
+
+2.10
+ - Improved the response by changing not to attempt any completion when
+ keyword characters are entered after a word which has been found that it
+ has no completion candidate at the last attempt of completions.
+ - Improved the response by changing to close popup menu when <BS> was
+ pressed and the text before the cursor would not match with the pattern of
+ current behavior.
+
+2.9
+ - Changed default behavior to support XML omni completion.
+ - Changed default value of g:acp_behaviorKeywordCommand option.
+ The option with "\<C-p>" cause a problem which inserts a match without
+ <CR> when 'dictionary' has been set and keyword completion is done.
+ - Changed to show error message when incompatible with a installed vim.
+
+2.8.1
+ - Fixed a bug which inserted a selected match to the next line when
+ auto-wrapping (enabled with 'formatoptions') was performed.
+
+2.8
+ - Added g:acp_behaviorUserDefinedFunction option and
+ g:acp_behaviorUserDefinedPattern option for users who want to make custom
+ completion auto-popup.
+ - Fixed a bug that setting 'spell' on a new buffer made typing go crazy.
+
+2.7
+ - Changed naming conventions for filenames, functions, commands, and options
+ and thus renamed them.
+ - Added g:acp_behaviorKeywordCommand option. If you prefer the previous
+ behavior for keyword completion, set this option "\<C-n>".
+ - Changed default value of g:acp_ignorecaseOption option.
+
+ The following were done by Ingo Karkat:
+
+ - ENH: Added support for setting a user-provided 'completefunc' during the
+ completion, configurable via g:acp_behavior.
+ - BUG: When the configured completion is <C-p> or <C-x><C-p>, the command to
+ restore the original text (in on_popup_post()) must be reverted, too.
+ - BUG: When using a custom completion function (<C-x><C-u>) that also uses
+ an s:...() function name, the s:GetSidPrefix() function dynamically
+ determines the wrong SID. Now calling s:DetermineSidPrefix() once during
+ sourcing and caching the value in s:SID.
+ - BUG: Should not use custom defined <C-X><C-...> completion mappings. Now
+ consistently using unmapped completion commands everywhere. (Beforehand,
+ s:PopupFeeder.feed() used mappings via feedkeys(..., 'm'), but
+ s:PopupFeeder.on_popup_post() did not due to its invocation via
+ :map-expr.)
+
+2.6:
+ - Improved the behavior of omni completion for HTML/XHTML.
+
+2.5:
+ - Added some options to customize behavior easily:
+ g:AutoComplPop_BehaviorKeywordLength
+ g:AutoComplPop_BehaviorFileLength
+ g:AutoComplPop_BehaviorRubyOmniMethodLength
+ g:AutoComplPop_BehaviorRubyOmniSymbolLength
+ g:AutoComplPop_BehaviorPythonOmniLength
+ g:AutoComplPop_BehaviorHtmlOmniLength
+ g:AutoComplPop_BehaviorCssOmniPropertyLength
+ g:AutoComplPop_BehaviorCssOmniValueLength
+
+2.4:
+ - Added g:AutoComplPop_MappingDriven option.
+
+2.3.1:
+ - Changed to set 'lazyredraw' while a popup menu is visible to avoid
+ flickering.
+ - Changed a behavior for CSS.
+ - Added support for GetLatestVimScripts.
+
+2.3:
+ - Added a behavior for Python to support omni completion.
+ - Added a behavior for CSS to support omni completion.
+
+2.2:
+ - Changed not to work when 'paste' option is set.
+ - Fixed AutoComplPopEnable command and AutoComplPopDisable command to
+ map/unmap "i" and "R".
+
+2.1:
+ - Fixed the problem caused by "." command in Normal mode.
+ - Changed to map "i" and "R" to feed completion command after starting
+ Insert mode.
+ - Avoided the problem caused by Windows IME.
+
+2.0:
+ - Changed to use CursorMovedI event to feed a completion command instead of
+ key mapping. Now the auto-popup is triggered by moving the cursor.
+ - Changed to feed completion command after starting Insert mode.
+ - Removed g:AutoComplPop_MapList option.
+
+1.7:
+ - Added behaviors for HTML/XHTML. Now supports the omni completion for
+ HTML/XHTML.
+ - Changed not to show expressions for CTRL-R =.
+ - Changed not to set 'nolazyredraw' while a popup menu is visible.
+
+1.6.1:
+ - Changed not to trigger the filename completion by a text which has
+ multi-byte characters.
+
+1.6:
+ - Redesigned g:AutoComplPop_Behavior option.
+ - Changed default value of g:AutoComplPop_CompleteOption option.
+ - Changed default value of g:AutoComplPop_MapList option.
+
+1.5:
+ - Implemented continuous-completion for the filename completion. And added
+ new option to g:AutoComplPop_Behavior.
+
+1.4:
+ - Fixed the bug that the auto-popup was not suspended in fuzzyfinder.
+ - Fixed the bug that an error has occurred with Ruby-omni-completion unless
+ Ruby interface.
+
+1.3:
+ - Supported Ruby-omni-completion by default.
+ - Supported filename completion by default.
+ - Added g:AutoComplPop_Behavior option.
+ - Added g:AutoComplPop_CompleteoptPreview option.
+ - Removed g:AutoComplPop_MinLength option.
+ - Removed g:AutoComplPop_MaxLength option.
+ - Removed g:AutoComplPop_PopupCmd option.
+
+1.2:
+ - Fixed bugs related to 'completeopt'.
+
+1.1:
+ - Added g:AutoComplPop_IgnoreCaseOption option.
+ - Added g:AutoComplPop_NotEnableAtStartup option.
+ - Removed g:AutoComplPop_LoadAndEnable option.
+1.0:
+ - g:AutoComplPop_LoadAndEnable option for a startup activation is added.
+ - AutoComplPopLock command and AutoComplPopUnlock command are added to
+ suspend and resume.
+ - 'completeopt' and 'complete' options are changed temporarily while
+ completing by this script.
+
+0.4:
+ - The first match are selected when the popup menu is Opened. You can insert
+ the first match with CTRL-Y.
+
+0.3:
+ - Fixed the problem that the original text is not restored if 'longest' is
+ not set in 'completeopt'. Now the plugin works whether or not 'longest' is
+ set in 'completeopt', and also 'menuone'.
+
+0.2:
+ - When completion matches are not found, insert CTRL-E to stop completion.
+ - Clear the echo area.
+ - Fixed the problem in case of dividing words by symbols, popup menu is
+ not opened.
+
+0.1:
+ - First release.
+
+
+==============================================================================
+ABOUT *acp-about* *acp-contact* *acp-author*
+
+Author: Takeshi NISHIDA <ns9tks@DELETE-ME.gmail.com>
+Licence: MIT Licence
+URL: http://www.vim.org/scripts/script.php?script_id=1879
+ http://bitbucket.org/ns9tks/vim-autocomplpop/
+
+Bugs/Issues/Suggestions/Improvements ~
+
+Please submit to http://bitbucket.org/ns9tks/vim-autocomplpop/issues/ .
+
+==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
+
45 bundle/autocomplpop/doc/tags
@@ -0,0 +1,45 @@
+:AcpDisable acp.txt /*:AcpDisable*
+:AcpEnable acp.txt /*:AcpEnable*
+:AcpLock acp.txt /*:AcpLock*
+:AcpUnlock acp.txt /*:AcpUnlock*
+acp acp.txt /*acp*
+acp-about acp.txt /*acp-about*
+acp-author acp.txt /*acp-author*
+acp-changelog acp.txt /*acp-changelog*
+acp-commands acp.txt /*acp-commands*
+acp-contact acp.txt /*acp-contact*
+acp-installation acp.txt /*acp-installation*
+acp-introduction acp.txt /*acp-introduction*
+acp-options acp.txt /*acp-options*
+acp-perl-omni acp.txt /*acp-perl-omni*
+acp-snipMate acp.txt /*acp-snipMate*
+acp-thanks acp.txt /*acp-thanks*
+acp-usage acp.txt /*acp-usage*
+acp.txt acp.txt /*acp.txt*
+autocomplpop acp.txt /*autocomplpop*
+g:acp_behavior acp.txt /*g:acp_behavior*
+g:acp_behavior-command acp.txt /*g:acp_behavior-command*
+g:acp_behavior-completefunc acp.txt /*g:acp_behavior-completefunc*
+g:acp_behavior-meets acp.txt /*g:acp_behavior-meets*
+g:acp_behavior-onPopupClose acp.txt /*g:acp_behavior-onPopupClose*
+g:acp_behavior-repeat acp.txt /*g:acp_behavior-repeat*
+g:acp_behaviorCssOmniPropertyLength acp.txt /*g:acp_behaviorCssOmniPropertyLength*
+g:acp_behaviorCssOmniValueLength acp.txt /*g:acp_behaviorCssOmniValueLength*
+g:acp_behaviorFileLength acp.txt /*g:acp_behaviorFileLength*
+g:acp_behaviorHtmlOmniLength acp.txt /*g:acp_behaviorHtmlOmniLength*
+g:acp_behaviorKeywordCommand acp.txt /*g:acp_behaviorKeywordCommand*
+g:acp_behaviorKeywordIgnores acp.txt /*g:acp_behaviorKeywordIgnores*
+g:acp_behaviorKeywordLength acp.txt /*g:acp_behaviorKeywordLength*
+g:acp_behaviorPerlOmniLength acp.txt /*g:acp_behaviorPerlOmniLength*
+g:acp_behaviorPythonOmniLength acp.txt /*g:acp_behaviorPythonOmniLength*
+g:acp_behaviorRubyOmniMethodLength acp.txt /*g:acp_behaviorRubyOmniMethodLength*
+g:acp_behaviorRubyOmniSymbolLength acp.txt /*g:acp_behaviorRubyOmniSymbolLength*
+g:acp_behaviorSnipmateLength acp.txt /*g:acp_behaviorSnipmateLength*
+g:acp_behaviorUserDefinedFunction acp.txt /*g:acp_behaviorUserDefinedFunction*
+g:acp_behaviorUserDefinedMeets acp.txt /*g:acp_behaviorUserDefinedMeets*
+g:acp_behaviorXmlOmniLength acp.txt /*g:acp_behaviorXmlOmniLength*
+g:acp_completeOption acp.txt /*g:acp_completeOption*
+g:acp_completeoptPreview acp.txt /*g:acp_completeoptPreview*
+g:acp_enableAtStartup acp.txt /*g:acp_enableAtStartup*
+g:acp_ignorecaseOption acp.txt /*g:acp_ignorecaseOption*
+g:acp_mappingDriven acp.txt /*g:acp_mappingDriven*
44 bundle/autocomplpop/doc/tags-ja
@@ -0,0 +1,44 @@
+!_TAG_FILE_ENCODING utf-8 //
+:AcpDisable acp.jax /*:AcpDisable*
+:AcpEnable acp.jax /*:AcpEnable*
+:AcpLock acp.jax /*:AcpLock*
+:AcpUnlock acp.jax /*:AcpUnlock*
+acp acp.jax /*acp*
+acp-about acp.jax /*acp-about*
+acp-author acp.jax /*acp-author*
+acp-commands acp.jax /*acp-commands*
+acp-contact acp.jax /*acp-contact*
+acp-installation acp.jax /*acp-installation*
+acp-introduction acp.jax /*acp-introduction*
+acp-options acp.jax /*acp-options*
+acp-perl-omni acp.jax /*acp-perl-omni*
+acp-snipMate acp.jax /*acp-snipMate*
+acp-usage acp.jax /*acp-usage*
+acp.txt acp.jax /*acp.txt*
+autocomplpop acp.jax /*autocomplpop*
+g:acp_behavior acp.jax /*g:acp_behavior*
+g:acp_behavior-command acp.jax /*g:acp_behavior-command*
+g:acp_behavior-completefunc acp.jax /*g:acp_behavior-completefunc*
+g:acp_behavior-meets acp.jax /*g:acp_behavior-meets*
+g:acp_behavior-onPopupClose acp.jax /*g:acp_behavior-onPopupClose*
+g:acp_behavior-repeat acp.jax /*g:acp_behavior-repeat*
+g:acp_behaviorCssOmniPropertyLength acp.jax /*g:acp_behaviorCssOmniPropertyLength*
+g:acp_behaviorCssOmniValueLength acp.jax /*g:acp_behaviorCssOmniValueLength*
+g:acp_behaviorFileLength acp.jax /*g:acp_behaviorFileLength*
+g:acp_behaviorHtmlOmniLength acp.jax /*g:acp_behaviorHtmlOmniLength*
+g:acp_behaviorKeywordCommand acp.jax /*g:acp_behaviorKeywordCommand*
+g:acp_behaviorKeywordIgnores acp.jax /*g:acp_behaviorKeywordIgnores*
+g:acp_behaviorKeywordLength acp.jax /*g:acp_behaviorKeywordLength*
+g:acp_behaviorPerlOmniLength acp.jax /*g:acp_behaviorPerlOmniLength*
+g:acp_behaviorPythonOmniLength acp.jax /*g:acp_behaviorPythonOmniLength*
+g:acp_behaviorRubyOmniMethodLength acp.jax /*g:acp_behaviorRubyOmniMethodLength*
+g:acp_behaviorRubyOmniSymbolLength acp.jax /*g:acp_behaviorRubyOmniSymbolLength*
+g:acp_behaviorSnipmateLength acp.jax /*g:acp_behaviorSnipmateLength*
+g:acp_behaviorUserDefinedFunction acp.jax /*g:acp_behaviorUserDefinedFunction*
+g:acp_behaviorUserDefinedMeets acp.jax /*g:acp_behaviorUserDefinedMeets*
+g:acp_behaviorXmlOmniLength acp.jax /*g:acp_behaviorXmlOmniLength*
+g:acp_completeOption acp.jax /*g:acp_completeOption*
+g:acp_completeoptPreview acp.jax /*g:acp_completeoptPreview*
+g:acp_enableAtStartup acp.jax /*g:acp_enableAtStartup*
+g:acp_ignorecaseOption acp.jax /*g:acp_ignorecaseOption*
+g:acp_mappingDriven acp.jax /*g:acp_mappingDriven*
170 bundle/autocomplpop/plugin/acp.vim
@@ -0,0 +1,170 @@
+"=============================================================================
+" Copyright (c) 2007-2009 Takeshi NISHIDA
+"
+" GetLatestVimScripts: 1879 1 :AutoInstall: AutoComplPop
+"=============================================================================
+" LOAD GUARD {{{1
+
+if exists('g:loaded_acp')
+ finish
+elseif v:version < 702
+ echoerr 'AutoComplPop does not support this version of vim (' . v:version . ').'
+ finish
+endif
+let g:loaded_acp = 1
+
+" }}}1
+"=============================================================================
+" FUNCTION: {{{1
+
+"
+function s:defineOption(name, default)
+ if !exists(a:name)
+ let {a:name} = a:default
+ endif
+endfunction
+
+"
+function s:makeDefaultBehavior()
+ let behavs = {
+ \ '*' : [],
+ \ 'ruby' : [],
+ \ 'python' : [],
+ \ 'perl' : [],
+ \ 'xml' : [],
+ \ 'html' : [],
+ \ 'xhtml' : [],
+ \ 'css' : [],
+ \ }
+ "---------------------------------------------------------------------------
+ if !empty(g:acp_behaviorUserDefinedFunction) &&
+ \ !empty(g:acp_behaviorUserDefinedMeets)
+ for key in keys(behavs)
+ call add(behavs[key], {
+ \ 'command' : "\<C-x>\<C-u>",
+ \ 'completefunc' : g:acp_behaviorUserDefinedFunction,
+ \ 'meets' : g:acp_behaviorUserDefinedMeets,
+ \ 'repeat' : 0,
+ \ })
+ endfor
+ endif
+ "---------------------------------------------------------------------------
+ for key in keys(behavs)
+ call add(behavs[key], {
+ \ 'command' : "\<C-x>\<C-u>",
+ \ 'completefunc' : 'acp#completeSnipmate',
+ \ 'meets' : 'acp#meetsForSnipmate',
+ \ 'onPopupClose' : 'acp#onPopupCloseSnipmate',
+ \ 'repeat' : 0,
+ \ })
+ endfor
+ "---------------------------------------------------------------------------
+ for key in keys(behavs)
+ call add(behavs[key], {
+ \ 'command' : g:acp_behaviorKeywordCommand,
+ \ 'meets' : 'acp#meetsForKeyword',
+ \ 'repeat' : 0,
+ \ })
+ endfor
+ "---------------------------------------------------------------------------
+ for key in keys(behavs)
+ call add(behavs[key], {
+ \ 'command' : "\<C-x>\<C-f>",
+ \ 'meets' : 'acp#meetsForFile',
+ \ 'repeat' : 1,
+ \ })
+ endfor
+ "---------------------------------------------------------------------------
+ call add(behavs.ruby, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForRubyOmni',
+ \ 'repeat' : 0,
+ \ })
+ "---------------------------------------------------------------------------
+ call add(behavs.python, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForPythonOmni',
+ \ 'repeat' : 0,
+ \ })
+ "---------------------------------------------------------------------------
+ call add(behavs.perl, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForPerlOmni',
+ \ 'repeat' : 0,
+ \ })
+ "---------------------------------------------------------------------------
+ call add(behavs.xml, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForXmlOmni',
+ \ 'repeat' : 1,
+ \ })
+ "---------------------------------------------------------------------------
+ call add(behavs.html, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForHtmlOmni',
+ \ 'repeat' : 1,
+ \ })
+ "---------------------------------------------------------------------------
+ call add(behavs.xhtml, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForHtmlOmni',
+ \ 'repeat' : 1,
+ \ })
+ "---------------------------------------------------------------------------
+ call add(behavs.css, {
+ \ 'command' : "\<C-x>\<C-o>",
+ \ 'meets' : 'acp#meetsForCssOmni',
+ \ 'repeat' : 0,
+ \ })
+ "---------------------------------------------------------------------------
+ return behavs
+endfunction
+
+" }}}1
+"=============================================================================
+" INITIALIZATION {{{1
+
+"-----------------------------------------------------------------------------
+call s:defineOption('g:acp_enableAtStartup', 1)
+call s:defineOption('g:acp_mappingDriven', 0)
+call s:defineOption('g:acp_ignorecaseOption', 1)
+call s:defineOption('g:acp_completeOption', '.,w,b,k')
+call s:defineOption('g:acp_completeoptPreview', 0)
+call s:defineOption('g:acp_behaviorUserDefinedFunction', '')
+call s:defineOption('g:acp_behaviorUserDefinedMeets', '')
+call s:defineOption('g:acp_behaviorSnipmateLength', -1)
+call s:defineOption('g:acp_behaviorKeywordCommand', "\<C-n>")
+call s:defineOption('g:acp_behaviorKeywordLength', 2)
+call s:defineOption('g:acp_behaviorKeywordIgnores', [])
+call s:defineOption('g:acp_behaviorFileLength', 0)
+call s:defineOption('g:acp_behaviorRubyOmniMethodLength', 0)
+call s:defineOption('g:acp_behaviorRubyOmniSymbolLength', 1)
+call s:defineOption('g:acp_behaviorPythonOmniLength', 0)
+call s:defineOption('g:acp_behaviorPerlOmniLength', -1)
+call s:defineOption('g:acp_behaviorXmlOmniLength', 0)
+call s:defineOption('g:acp_behaviorHtmlOmniLength', 0)
+call s:defineOption('g:acp_behaviorCssOmniPropertyLength', 1)
+call s:defineOption('g:acp_behaviorCssOmniValueLength', 0)
+call s:defineOption('g:acp_behavior', {})
+"-----------------------------------------------------------------------------
+call extend(g:acp_behavior, s:makeDefaultBehavior(), 'keep')
+"-----------------------------------------------------------------------------
+command! -bar -narg=0 AcpEnable call acp#enable()
+command! -bar -narg=0 AcpDisable call acp#disable()
+command! -bar -narg=0 AcpLock call acp#lock()
+command! -bar -narg=0 AcpUnlock call acp#unlock()
+"-----------------------------------------------------------------------------
+" legacy commands
+command! -bar -narg=0 AutoComplPopEnable AcpEnable
+command! -bar -narg=0 AutoComplPopDisable AcpDisable
+command! -bar -narg=0 AutoComplPopLock AcpLock
+command! -bar -narg=0 AutoComplPopUnlock AcpUnlock
+"-----------------------------------------------------------------------------
+if g:acp_enableAtStartup
+ AcpEnable
+endif
+"-----------------------------------------------------------------------------
+
+" }}}1
+"=============================================================================
+" vim: set fdm=marker:
BIN  bundle/autocomplpop/vim-autocomplpop.zip
Binary file not shown
406 bundle/matchit/doc/matchit.txt
@@ -0,0 +1,406 @@
+*matchit.txt* Extended "%" matching
+
+For instructions on installing this file, type
+ :help matchit-install
+inside Vim.
+
+For Vim version 6.3. Last change: 2007 Aug 29
+
+
+ VIM REFERENCE MANUAL by Benji Fisher
+
+*matchit* *matchit.vim*
+
+1. Extended matching with "%" |matchit-intro|
+2. Activation |matchit-activate|
+3. Configuration |matchit-configure|
+4. Supporting a New Language |matchit-newlang|
+5. Known Bugs and Limitations |matchit-bugs|
+
+The functionality mentioned here is a plugin, see |add-plugin|.
+This plugin is only available if 'compatible' is not set.
+You can avoid loading this plugin by setting the "loaded_matchit" variable
+in your |vimrc| file: >
+ :let loaded_matchit = 1
+
+{Vi does not have any of this}
+
+==============================================================================
+1. Extended matching with "%" *matchit-intro*
+
+ *matchit-%*
+% Cycle forward through matching groups, such as "if", "else", "endif",
+ as specified by |b:match_words|.
+
+ *g%* *v_g%* *o_g%*
+g% Cycle backwards through matching groups, as specified by
+ |b:match_words|. For example, go from "if" to "endif" to "else".
+
+ *[%* *v_[%* *o_[%*
+[% Go to [count] previous unmatched group, as specified by
+ |b:match_words|. Similar to |[{|.
+
+ *]%* *v_]%* *o_]%*
+]% Go to [count] next unmatched group, as specified by
+ |b:match_words|. Similar to |]}|.
+
+ *v_a%*
+a% In Visual mode, select the matching group, as specified by
+ |b:match_words|, containing the cursor. Similar to |v_a[|.
+ A [count] is ignored, and only the first character of the closing
+ pattern is selected.
+
+In Vim, as in plain vi, the percent key, |%|, jumps the cursor from a brace,
+bracket, or paren to its match. This can be configured with the 'matchpairs'
+option. The matchit plugin extends this in several ways:
+
+ You can match whole words, such as "if" and "endif", not just
+ single characters. You can also specify a |regular-expression|.
+ You can define groups with more than two words, such as "if",
+ "else", "endif". Banging on the "%" key will cycle from the "if" to
+ the first "else", the next "else", ..., the closing "endif", and back
+ to the opening "if". Nested structures are skipped. Using |g%| goes
+ in the reverse direction.
+ By default, words inside comments and strings are ignored, unless
+ the cursor is inside a comment or string when you type "%". If the
+ only thing you want to do is modify the behavior of "%" so that it
+ behaves this way, you do not have to define |b:match_words|, since the
+ script uses the 'matchpairs' option as well as this variable.
+
+See |matchit-details| for details on what the script does, and |b:match_words|
+for how to specify matching patterns.
+
+MODES: *matchit-modes* *matchit-v_%* *matchit-o_%*
+
+Mostly, % and related motions (|g%| and |[%| and |]%|) work just like built-in
+|motion| commands in |Operator-pending| and |Visual| modes. However, you
+cannot make these motions |linewise| or |characterwise|, since the |:omap|s
+that define them start with "v" in order to make the default behavior
+inclusive. (See |o_v|.) In other words, "dV%" will not work. The
+work-around is to go through Visual mode: "V%d" will work.
+
+LANGUAGES: *matchit-languages*
+
+Currently, the following languages are supported: Ada, ASP with VBS, Csh,
+DTD, Entity, Essbase, Fortran, HTML, JSP (same as HTML), LaTeX, Lua, Pascal,
+SGML, Shell, Tcsh, Vim, XML. Other languages may already have support via
+the default |filetype-plugin|s in the standard vim distribution.
+
+To support a new language, see |matchit-newlang| below.
+
+DETAILS: *matchit-details* *matchit-parse*
+
+Here is an outline of what matchit.vim does each time you hit the "%" key. If
+there are |backref|s in |b:match_words| then the first step is to produce a
+version in which these back references have been eliminated; if there are no
+|backref|s then this step is skipped. This step is called parsing. For
+example, "\(foo\|bar\):end\1" is parsed to yield
+"\(foo\|bar\):end\(foo\|bar\)". This can get tricky, especially if there are
+nested groups. If debugging is turned on, the parsed version is saved as
+|b:match_pat|.
+
+ *matchit-choose*
+Next, the script looks for a word on the current line that matches the pattern
+just constructed. It includes the patterns from the 'matchpairs' option.
+The goal is to do what you expect, which turns out to be a little complicated.
+The script follows these rules:
+
+ Insist on a match that ends on or after the cursor.
+ Prefer a match that includes the cursor position (that is, one that
+ starts on or before the cursor).
+ Prefer a match that starts as close to the cursor as possible.
+ If more than one pattern in |b:match_words| matches, choose the one
+ that is listed first.
+
+Examples:
+
+ Suppose you >
+ :let b:match_words = '<:>,<tag>:</tag>'
+< and hit "%" with the cursor on or before the "<" in "a <tag> is born".
+ The pattern '<' comes first, so it is preferred over '<tag>', which
+ also matches. If the cursor is on the "t", however, then '<tag>' is
+ preferred, because this matches a bit of text containing the cursor.
+ If the two groups of patterns were reversed then '<' would never be
+ preferred.
+
+ Suppose you >
+ :let b:match_words = 'if:end if'
+< (Note the space!) and hit "%" with the cursor at the end of "end if".
+ Then "if" matches, which is probably not what you want, but if the
+ cursor starts on the "end " then "end if" is chosen. (You can avoid
+ this problem by using a more complicated pattern.)
+
+If there is no match, the cursor does not move. (Before version 1.13 of the
+script, it would fall back on the usual behavior of |%|). If debugging is
+turned on, the matched bit of text is saved as |b:match_match| and the cursor
+column of the start of the match is saved as |b:match_col|.
+
+Next, the script looks through |b:match_words| (original and parsed versions)
+for the group and pattern that match. If debugging is turned on, the group is
+saved as |b:match_ini| (the first pattern) and |b:match_tail| (the rest). If
+there are |backref|s then, in addition, the matching pattern is saved as
+|b:match_word| and a table of translations is saved as |b:match_table|. If
+there are |backref|s, these are determined from the matching pattern and
+|b:match_match| and substituted into each pattern in the matching group.
+
+The script decides whether to search forwards or backwards and chooses
+arguments for the |searchpair()| function. Then, the cursor is moved to the
+start of the match, and |searchpair()| is called. By default, matching
+structures inside strings and comments are ignored. This can be changed by
+setting |b:match_skip|.
+
+==============================================================================
+2. Activation *matchit-activate*
+
+You can use this script as a plugin, by copying it to your plugin directory.
+See |add-global-plugin| for instructions. You can also add a line to your
+|vimrc| file, such as >
+ :source $VIMRUNTIME/macros/matchit.vim
+or >
+ :runtime macros/matchit.vim
+Either way, the script should start working the next time you start up Vim.
+
+(Earlier versions of the script did nothing unless a |buffer-variable| named
+|b:match_words| was defined. Even earlier versions contained autocommands
+that set this variable for various file types. Now, |b:match_words| is
+defined in many of the default |filetype-plugin|s instead.)
+
+For a new language, you can add autocommands to the script or to your vimrc
+file, but the recommended method is to add a line such as >
+ let b:match_words = '\<foo\>:\<bar\>'
+to the |filetype-plugin| for your language. See |b:match_words| below for how
+this variable is interpreted.
+
+TROUBLESHOOTING *matchit-troubleshoot*
+
+The script should work in most installations of Vim. It may not work if Vim
+was compiled with a minimal feature set, for example if the |+syntax| option
+was not enabled. If your Vim has support for syntax compiled in, but you do
+not have |syntax| highlighting turned on, matchit.vim should work, but it may
+fail to skip matching groups in comments and strings. If the |filetype|
+mechanism is turned off, the |b:match_words| variable will probably not be
+defined automatically.
+
+==============================================================================
+3. Configuration *matchit-configure*
+
+There are several variables that govern the behavior of matchit.vim. Note
+that these are variables local to the buffer, not options, so use |:let| to
+define them, not |:set|. Some of these variables have values that matter; for
+others, it only matters whether the variable has been defined. All of these
+can be defined in the |filetype-plugin| or autocommand that defines
+|b:match_words| or "on the fly."
+
+The main variable is |b:match_words|. It is described in the section below on
+supporting a new language.
+
+ *MatchError* *matchit-hl* *matchit-highlight*
+MatchError is the highlight group for error messages from the script. By
+default, it is linked to WarningMsg. If you do not want to be bothered by
+error messages, you can define this to be something invisible. For example,
+if you use the GUI version of Vim and your command line is normally white, you
+can do >
+ :hi MatchError guifg=white guibg=white
+<
+ *b:match_ignorecase*
+If you >
+ :let b:match_ignorecase = 1
+then matchit.vim acts as if 'ignorecase' is set: for example, "end" and "END"
+are equivalent. If you >
+ :let b:match_ignorecase = 0
+then matchit.vim treats "end" and "END" differently. (There will be no
+b:match_infercase option unless someone requests it.)
+
+ *b:match_debug*
+Define b:match_debug if you want debugging information to be saved. See
+|matchit-debug|, below.
+
+ *b:match_skip*
+If b:match_skip is defined, it is passed as the skip argument to
+|searchpair()|. This controls when matching structures are skipped, or
+ignored. By default, they are ignored inside comments and strings, as
+determined by the |syntax| mechanism. (If syntax highlighting is turned off,
+nothing is skipped.) You can set b:match_skip to a string, which evaluates to
+a non-zero, numerical value if the match is to be skipped or zero if the match
+should not be skipped. In addition, the following special values are
+supported by matchit.vim:
+ s:foo becomes (current syntax item) =~ foo
+ S:foo becomes (current syntax item) !~ foo
+ r:foo becomes (line before cursor) =~ foo
+ R:foo becomes (line before cursor) !~ foo
+(The "s" is meant to suggest "syntax", and the "r" is meant to suggest
+"regular expression".)
+
+Examples:
+
+ You can get the default behavior with >
+ :let b:match_skip = 's:comment\|string'
+<
+ If you want to skip matching structures unless they are at the start
+ of the line (ignoring whitespace) then you can >
+ :let b:match_skip = 'R:^\s*'
+< Do not do this if strings or comments can span several lines, since
+ the normal syntax checking will not be done if you set b:match_skip.
+
+ In LaTeX, since "%" is used as the comment character, you can >
+ :let b:match_skip = 'r:%'
+< Unfortunately, this will skip anything after "\%", an escaped "%". To
+ allow for this, and also "\\%" (an excaped backslash followed by the
+ comment character) you can >
+ :let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
+<
+ See the $VIMRUNTIME/ftplugin/vim.vim for an example that uses both
+ syntax and a regular expression.
+
+==============================================================================
+4. Supporting a New Language *matchit-newlang*
+ *b:match_words*
+In order for matchit.vim to support a new language, you must define a suitable
+pattern for |b:match_words|. You may also want to set some of the
+|matchit-configure| variables, as described above. If your language has a
+complicated syntax, or many keywords, you will need to know something about
+Vim's |regular-expression|s.
+
+The format for |b:match_words| is similar to that of the 'matchpairs' option:
+it is a comma (,)-separated list of groups; each group is a colon(:)-separated
+list of patterns (regular expressions). Commas and backslashes that are part
+of a pattern should be escaped with backslashes ('\:' and '\,'). It is OK to
+have only one group; the effect is undefined if a group has only one pattern.
+A simple example is >
+ :let b:match_words = '\<if\>:\<endif\>,'
+ \ . '\<while\>:\<continue\>:\<break\>:\<endwhile\>'
+(In Vim regular expressions, |\<| and |\>| denote word boundaries. Thus "if"
+matches the end of "endif" but "\<if\>" does not.) Then banging on the "%"
+key will bounce the cursor between "if" and the matching "endif"; and from
+"while" to any matching "continue" or "break", then to the matching "endwhile"
+and back to the "while". It is almost always easier to use |literal-string|s
+(single quotes) as above: '\<if\>' rather than "\\<if\\>" and so on.
+
+Exception: If the ":" character does not appear in b:match_words, then it is
+treated as an expression to be evaluated. For example, >
+ :let b:match_words = 'GetMatchWords()'
+allows you to define a function. This can return a different string depending
+on the current syntax, for example.
+
+Once you have defined the appropriate value of |b:match_words|, you will
+probably want to have this set automatically each time you edit the
+appropriate file type. The recommended way to do this is by adding the
+definition to a |filetype-plugin| file.
+
+Tips: Be careful that your initial pattern does not match your final pattern.
+See the example above for the use of word-boundary expressions. It is usually
+better to use ".\{-}" (as many as necessary) instead of ".*" (as many as
+possible). See |\{-|. For example, in the string "<tag>label</tag>", "<.*>"
+matches the whole string whereas "<.\{-}>" and "<[^>]*>" match "<tag>" and
+"</tag>".
+
+ *matchit-spaces* *matchit-s:notend*
+If "if" is to be paired with "end if" (Note the space!) then word boundaries
+are not enough. Instead, define a regular expression s:notend that will match
+anything but "end" and use it as follows: >
+ :let s:notend = '\%(\<end\s\+\)\@<!'
+ :let b:match_words = s:notend . '\<if\>:\<end\s\+if\>'
+< *matchit-s:sol*
+This is a simplified version of what is done for Ada. The s:notend is a
+|script-variable|. Similarly, you may want to define a start-of-line regular
+expression >
+ :let s:sol = '\%(^\|;\)\s*'
+if keywords are only recognized after the start of a line or after a
+semicolon (;), with optional white space.
+
+ *matchit-backref* *matchit-\1*
+In any group, the expressions |\1|, |\2|, ..., |\9| refer to parts of the
+INITIAL pattern enclosed in |\(|escaped parentheses|\)|. These are referred
+to as back references, or backrefs. For example, >
+ :let b:match_words = '\<b\(o\+\)\>:\(h\)\1\>'
+means that "bo" pairs with "ho" and "boo" pairs with "hoo" and so on. Note
+that "\1" does not refer to the "\(h\)" in this example. If you have
+"\(nested \(parentheses\)\) then "\d" refers to the d-th "\(" and everything
+up to and including the matching "\)": in "\(nested\(parentheses\)\)", "\1"
+refers to everything and "\2" refers to "\(parentheses\)". If you use a
+variable such as |s:notend| or |s:sol| in the previous paragraph then remember
+to count any "\(" patterns in this variable. You do not have to count groups
+defined by |\%(\)|.
+
+It should be possible to resolve back references from any pattern in the
+group. For example, >
+ :let b:match_words = '\(foo\)\(bar\):more\1:and\2:end\1\2'
+would not work because "\2" cannot be determined from "morefoo" and "\1"
+cannot be determined from "andbar". On the other hand, >
+ :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
+should work (and have the same effect as "foobar:barfoo:endfoobar"), although
+this has not been thoroughly tested.
+
+You can use |zero-width| patterns such as |\@<=| and |\zs|. (The latter has
+not been thouroughly tested in matchit.vim.) For example, if the keyword "if"
+must occur at the start of the line, with optional white space, you might use
+the pattern "\(^\s*\)\@<=if" so that the cursor will end on the "i" instead of
+at the start of the line. For another example, if HTML had only one tag then
+one could >
+ :let b:match_words = '<:>,<\@<=tag>:<\@<=/tag>'
+so that "%" can bounce between matching "<" and ">" pairs or (starting on
+"tag" or "/tag") between matching tags. Without the |\@<=|, the script would
+bounce from "tag" to the "<" in "</tag>", and another "%" would not take you
+back to where you started.
+
+DEBUGGING *matchit-debug* *:MatchDebug*
+
+If you are having trouble figuring out the appropriate definition of
+|b:match_words| then you can take advantage of the same information I use when
+debugging the script. This is especially true if you are not sure whether
+your patterns or my script are at fault! To make this more convenient, I have
+made the command :MatchDebug, which defines the variable |b:match_debug| and
+creates a Matchit menu. This menu makes it convenient to check the values of
+the variables described below. You will probably also want to read
+|matchit-details| above.
+
+Defining the variable |b:match_debug| causes the script to set the following
+variables, each time you hit the "%" key. Several of these are only defined
+if |b:match_words| includes |backref|s.
+
+ *b:match_pat*
+The b:match_pat variable is set to |b:match_words| with |backref|s parsed.
+ *b:match_match*
+The b:match_match variable is set to the bit of text that is recognized as a
+match.
+ *b:match_col*
+The b:match_col variable is set to the cursor column of the start of the
+matching text.
+ *b:match_wholeBR*
+The b:match_wholeBR variable is set to the comma-separated group of patterns
+that matches, with |backref|s unparsed.
+ *b:match_iniBR*
+The b:match_iniBR variable is set to the first pattern in |b:match_wholeBR|.
+ *b:match_ini*
+The b:match_ini variable is set to the first pattern in |b:match_wholeBR|,
+with |backref|s resolved from |b:match_match|.
+ *b:match_tail*
+The b:match_tail variable is set to the remaining patterns in
+|b:match_wholeBR|, with |backref|s resolved from |b:match_match|.
+ *b:match_word*
+The b:match_word variable is set to the pattern from |b:match_wholeBR| that
+matches |b:match_match|.
+ *b:match_table*
+The back reference '\'.d refers to the same thing as '\'.b:match_table[d] in
+|b:match_word|.
+
+==============================================================================
+5. Known Bugs and Limitations *matchit-bugs*
+
+Just because I know about a bug does not mean that it is on my todo list. I
+try to respond to reports of bugs that cause real problems. If it does not
+cause serious problems, or if there is a work-around, a bug may sit there for
+a while. Moral: if a bug (known or not) bothers you, let me know.
+
+The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
+have undesired effects in Select mode |Select-mode-mapping|. At least, if you
+want to replace the selection with any character in "ag%[]" there will be a
+pause of |'updatetime'| first.
+
+It would be nice if "\0" were recognized as the entire pattern. That is, it
+would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may
+try to implement this in a future version. (This is not so easy to arrange as
+you might think!)
+
+==============================================================================
+vim:tw=78:fo=tcq2:
50 bundle/matchit/doc/tags
@@ -0,0 +1,50 @@
+:MatchDebug matchit.txt /*:MatchDebug*
+MatchError matchit.txt /*MatchError*
+[% matchit.txt /*[%*
+]% matchit.txt /*]%*
+b:match_col matchit.txt /*b:match_col*
+b:match_debug matchit.txt /*b:match_debug*
+b:match_ignorecase matchit.txt /*b:match_ignorecase*
+b:match_ini matchit.txt /*b:match_ini*
+b:match_iniBR matchit.txt /*b:match_iniBR*
+b:match_match matchit.txt /*b:match_match*
+b:match_pat matchit.txt /*b:match_pat*
+b:match_skip matchit.txt /*b:match_skip*
+b:match_table matchit.txt /*b:match_table*
+b:match_tail matchit.txt /*b:match_tail*
+b:match_wholeBR matchit.txt /*b:match_wholeBR*
+b:match_word matchit.txt /*b:match_word*
+b:match_words matchit.txt /*b:match_words*
+g% matchit.txt /*g%*
+matchit matchit.txt /*matchit*
+matchit-% matchit.txt /*matchit-%*
+matchit-\1 matchit.txt /*matchit-\\1*
+matchit-activate matchit.txt /*matchit-activate*
+matchit-backref matchit.txt /*matchit-backref*
+matchit-bugs matchit.txt /*matchit-bugs*
+matchit-choose matchit.txt /*matchit-choose*
+matchit-configure matchit.txt /*matchit-configure*
+matchit-debug matchit.txt /*matchit-debug*
+matchit-details matchit.txt /*matchit-details*
+matchit-highlight matchit.txt /*matchit-highlight*
+matchit-hl matchit.txt /*matchit-hl*
+matchit-intro matchit.txt /*matchit-intro*
+matchit-languages matchit.txt /*matchit-languages*
+matchit-modes matchit.txt /*matchit-modes*
+matchit-newlang matchit.txt /*matchit-newlang*
+matchit-o_% matchit.txt /*matchit-o_%*
+matchit-parse matchit.txt /*matchit-parse*
+matchit-s:notend matchit.txt /*matchit-s:notend*
+matchit-s:sol matchit.txt /*matchit-s:sol*
+matchit-spaces matchit.txt /*matchit-spaces*
+matchit-troubleshoot matchit.txt /*matchit-troubleshoot*
+matchit-v_% matchit.txt /*matchit-v_%*
+matchit.txt matchit.txt /*matchit.txt*
+matchit.vim matchit.txt /*matchit.vim*
+o_[% matchit.txt /*o_[%*
+o_]% matchit.txt /*o_]%*
+o_g% matchit.txt /*o_g%*
+v_[% matchit.txt /*v_[%*
+v_]% matchit.txt /*v_]%*
+v_a% matchit.txt /*v_a%*
+v_g% matchit.txt /*v_g%*
BIN  bundle/matchit/matchit.zip
Binary file not shown
812 bundle/matchit/plugin/matchit.vim
@@ -0,0 +1,812 @@
+" matchit.vim: (global plugin) Extended "%" matching
+" Last Change: Fri Jan 25 10:00 AM 2008 EST
+" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
+" Version: 1.13.2, for Vim 6.3+
+" URL: http://www.vim.org/script.php?script_id=39
+
+" Documentation:
+" The documentation is in a separate file, matchit.txt .
+
+" Credits:
+" Vim editor by Bram Moolenaar (Thanks, Bram!)
+" Original script and design by Raul Segura Acevedo
+" Support for comments by Douglas Potts
+" Support for back references and other improvements by Benji Fisher
+" Support for many languages by Johannes Zellner
+" Suggestions for improvement, bug reports, and support for additional
+" languages by Jordi-Albert Batalla, Neil Bird, Servatius Brandt, Mark
+" Collett, Stephen Wall, Dany St-Amant, Yuheng Xie, and Johannes Zellner.
+
+" Debugging:
+" If you'd like to try the built-in debugging commands...
+" :MatchDebug to activate debugging for the current buffer
+" This saves the values of several key script variables as buffer-local
+" variables. See the MatchDebug() function, below, for details.
+
+" TODO: I should think about multi-line patterns for b:match_words.
+" This would require an option: how many lines to scan (default 1).
+" This would be useful for Python, maybe also for *ML.
+" TODO: Maybe I should add a menu so that people will actually use some of
+" the features that I have implemented.
+" TODO: Eliminate the MultiMatch function. Add yet another argument to
+" Match_wrapper() instead.
+" TODO: Allow :let b:match_words = '\(\(foo\)\(bar\)\):\3\2:end\1'
+" TODO: Make backrefs safer by using '\V' (very no-magic).
+" TODO: Add a level of indirection, so that custom % scripts can use my
+" work but extend it.
+
+" allow user to prevent loading
+" and prevent duplicate loading
+if exists("loaded_matchit") || &cp
+ finish
+endif
+let loaded_matchit = 1
+let s:last_mps = ""
+let s:last_words = ":"
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+nnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'n') <CR>
+nnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'n') <CR>
+vnoremap <silent> % :<C-U>call <SID>Match_wrapper('',1,'v') <CR>m'gv``
+vnoremap <silent> g% :<C-U>call <SID>Match_wrapper('',0,'v') <CR>m'gv``
+onoremap <silent> % v:<C-U>call <SID>Match_wrapper('',1,'o') <CR>
+onoremap <silent> g% v:<C-U>call <SID>Match_wrapper('',0,'o') <CR>
+
+" Analogues of [{ and ]} using matching patterns:
+nnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "n") <CR>
+nnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "n") <CR>
+vmap [% <Esc>[%m'gv``
+vmap ]% <Esc>]%m'gv``
+" vnoremap <silent> [% :<C-U>call <SID>MultiMatch("bW", "v") <CR>m'gv``
+" vnoremap <silent> ]% :<C-U>call <SID>MultiMatch("W", "v") <CR>m'gv``
+onoremap <silent> [% v:<C-U>call <SID>MultiMatch("bW", "o") <CR>
+onoremap <silent> ]% v:<C-U>call <SID>MultiMatch("W", "o") <CR>
+
+" text object:
+vmap a% <Esc>[%v]%
+
+" Auto-complete mappings: (not yet "ready for prime time")
+" TODO Read :help write-plugin for the "right" way to let the user
+" specify a key binding.
+" let g:match_auto = '<C-]>'
+" let g:match_autoCR = '<C-CR>'
+" if exists("g:match_auto")
+" execute "inoremap " . g:match_auto . ' x<Esc>"=<SID>Autocomplete()<CR>Pls'
+" endif
+" if exists("g:match_autoCR")
+" execute "inoremap " . g:match_autoCR . ' <CR><C-R>=<SID>Autocomplete()<CR>'
+" endif
+" if exists("g:match_gthhoh")
+" execute "inoremap " . g:match_gthhoh . ' <C-O>:call <SID>Gthhoh()<CR>'
+" endif " gthhoh = "Get the heck out of here!"
+
+let s:notslash = '\\\@<!\%(\\\\\)*'
+
+function! s:Match_wrapper(word, forward, mode) range
+ " In s:CleanUp(), :execute "set" restore_options .
+ let restore_options = (&ic ? " " : " no") . "ignorecase"
+ if exists("b:match_ignorecase")
+ let &ignorecase = b:match_ignorecase
+ endif
+ let restore_options = " ve=" . &ve . restore_options
+ set ve=
+ " If this function was called from Visual mode, make sure that the cursor
+ " is at the correct end of the Visual range:
+ if a:mode == "v"
+ execute "normal! gv\<Esc>"
+ endif
+ " In s:CleanUp(), we may need to check whether the cursor moved forward.
+ let startline = line(".")
+ let startcol = col(".")
+ " Use default behavior if called with a count.
+ if v:count
+ exe "normal! " . v:count . "%"
+ return s:CleanUp(restore_options, a:mode, startline, startcol)
+ end
+
+ " First step: if not already done, set the script variables
+ " s:do_BR flag for whether there are backrefs
+ " s:pat parsed version of b:match_words
+ " s:all regexp based on s:pat and the default groups
+ "
+ if !exists("b:match_words") || b:match_words == ""
+ let match_words = ""
+ " Allow b:match_words = "GetVimMatchWords()" .
+ elseif b:match_words =~ ":"
+ let match_words = b:match_words
+ else
+ execute "let match_words =" b:match_words
+ endif
+" Thanks to Preben "Peppe" Guldberg and Bram Moolenaar for this suggestion!
+ if (match_words != s:last_words) || (&mps != s:last_mps) ||
+ \ exists("b:match_debug")
+ let s:last_words = match_words
+ let s:last_mps = &mps
+ " The next several lines were here before
+ " BF started messing with this script.
+ " quote the special chars in 'matchpairs', replace [,:] with \| and then