Commits

Alfredo Deza  committed 652c23b

adding new .vim structure

  • Participants
  • Parent commits b2a66ce

Comments (0)

Files changed (37)

File .vim/autoload/acp.vim

-"=============================================================================
-" 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:

File .vim/autoload/fuf.vim

-"=============================================================================
-" Copyright (c) 2007-2009 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if exists('g:loaded_autoload_fuf') || v:version < 702
-  finish
-endif
-let g:loaded_autoload_fuf = 1
-
-" }}}1
-"=============================================================================
-" GLOBAL FUNCTIONS {{{1
-
-
-
-function fuf#getPathSeparator()
-  return (!&shellslash && (has('win32') || has('win64')) ? '\' : '/')
-endfunction
-
-" Removes duplicates
-" this function doesn't change list of argument.
-function fuf#unique(items)
-  let sorted = sort(a:items)
-  if len(sorted) < 2
-    return sorted
-  endif
-  let last = remove(sorted, 0)
-  let result = [last]
-  for item in sorted
-    if item != last
-      call add(result, item)
-      let last = item
-    endif
-  endfor
-  return result
-endfunction
-
-" [ [0], [1,2], [3] ] -> [ 0, 1, 2, 3 ]
-" this function doesn't change list of argument.
-function fuf#concat(items)
-  let result = []
-  for l in a:items
-    let result += l
-  endfor
-  return result
-endfunction
-
-" filter() with the maximum number of items
-" this function doesn't change list of argument.
-function fuf#filterWithLimit(items, expr, limit)
-  if a:limit <= 0
-    return filter(copy(a:items), a:expr)
-  endif
-  let result = []
-  let stride = a:limit * 3 / 2 " x1.5
-  for i in range(0, len(a:items) - 1, stride)
-    let result += filter(a:items[i : i + stride - 1], a:expr)
-    if len(result) >= a:limit
-      return remove(result, 0, a:limit - 1)
-    endif
-  endfor
-  return result
-endfunction
-
-"
-function fuf#countModifiedFiles(files, time)
-  return len(filter(copy(a:files), 'getftime(v:val) > a:time'))
-endfunction
-
-"
-function fuf#getCurrentTagFiles()
-  return sort(filter(map(tagfiles(), 'fnamemodify(v:val, '':p'')'), 'filereadable(v:val)'))
-endfunction
-
-"
-function fuf#mapToSetSerialIndex(in, offset)
-  for i in range(len(a:in))
-    let a:in[i].index = i + a:offset
-  endfor
-  return a:in
-endfunction
-
-"
-function fuf#updateMruList(mrulist, newItem, maxItem, exclude)
-  let result = copy(a:mrulist)
-  let result = filter(result,'v:val.word != a:newItem.word')
-  let result = insert(result, a:newItem)
-  let result = filter(result, 'v:val.word !~ a:exclude')
-  return result[0 : a:maxItem - 1]
-endfunction
-
-" takes suffix number. if no digits, returns -1
-function fuf#suffixNumber(str)
-  let s = matchstr(a:str, '\d\+$')
-  return (len(s) ? str2nr(s) : -1)
-endfunction
-
-" "foo/bar/buz/hoge" -> { head: "foo/bar/buz/", tail: "hoge" }
-function fuf#splitPath(path)
-  let head = matchstr(a:path, '^.*[/\\]')
-  return  {
-        \   'head' : head,
-        \   'tail' : a:path[strlen(head):]
-        \ }
-endfunction
-
-" "foo/.../bar/...hoge" -> "foo/.../bar/../../hoge"
-function fuf#expandTailDotSequenceToParentDir(pattern)
-  return substitute(a:pattern, '^\(.*[/\\]\)\?\zs\.\(\.\+\)\ze[^/\\]*$',
-        \           '\=repeat(".." . fuf#getPathSeparator(), len(submatch(2)))', '')
-endfunction
-
-"
-function fuf#hash224(str)
-  let a = 0x00000800 " shift 11 bit 
-  let b = 0x001fffff " extract 11 bit
-  let nHash = 7
-  let hashes = repeat([0], nHash)
-  for i in range(len(a:str))
-    let iHash = i % nHash
-    let hashes[iHash] = hashes[iHash] * a + hashes[iHash] / b
-    let hashes[iHash] += char2nr(a:str[i])
-  endfor
-  return join(map(hashes, 'printf("%08x", v:val)'), '')
-endfunction
-
-"
-function fuf#formatPrompt(prompt, partialMatching)
-  let indicator = (a:partialMatching ? '!' : '')
-  return substitute(a:prompt, '[]', indicator, 'g')
-endfunction
-
-"
-function fuf#getFileLines(file)
-  let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$'))
-  let lines = getbufline(bufnr, 1, '$')
-  if !empty(lines)
-    return lines
-  endif
-  try
-    return readfile(expand(a:file))
-  catch /.*/ 
-  endtry
-  return []
-endfunction
-
-"
-function fuf#makePreviewLinesAround(lines, indices, page, maxHeight)
-  let index = ((empty(a:indices) ? 0 : a:indices[0])
-        \ + a:page * a:maxHeight) % len(a:lines)
-  if empty(a:lines) || a:maxHeight <= 0
-    return []
-  endif
-  let beg = max([0, index - a:maxHeight / 2])
-  let end = min([beg + a:maxHeight, len(a:lines)])
-  let beg = max([0, end - a:maxHeight])
-  let lines = []
-  for i in range(beg, end - 1)
-    let mark = (count(a:indices, i) ? '>' : ' ')
-    call add(lines, printf('%s%4d ', mark, i + 1) . a:lines[i])
-  endfor
-  return lines
-endfunction
-
-" a:file: a path string or a buffer number
-function fuf#makePreviewLinesForFile(file, count, maxHeight)
-  let lines = fuf#getFileLines(a:file)
-  if empty(lines)
-    return []
-  endif
-  let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$'))
-  if exists('s:bufferCursorPosMap[bufnr]')
-    let indices = [s:bufferCursorPosMap[bufnr][1] - 1]
-  else
-    let indices = []
-  endif
-  return fuf#makePreviewLinesAround(
-        \ lines, indices, a:count, a:maxHeight)
-endfunction
-
-"
-function fuf#echoWithHl(msg, hl)
-  execute "echohl " . a:hl
-  echo a:msg
-  echohl None
-endfunction
-
-"
-function fuf#inputHl(prompt, text, hl)
-  execute "echohl " . a:hl
-  let s = input(a:prompt, a:text)
-  echohl None
-  return s
-endfunction
-
-"
-function fuf#openBuffer(bufNr, mode, reuse)
-  if a:reuse && ((a:mode == s:OPEN_TYPE_SPLIT &&
-        \         s:moveToWindowOfBufferInCurrentTabPage(a:bufNr)) ||
-        \        (a:mode == s:OPEN_TYPE_VSPLIT &&
-        \         s:moveToWindowOfBufferInCurrentTabPage(a:bufNr)) ||
-        \        (a:mode == s:OPEN_TYPE_TAB &&
-        \         s:moveToWindowOfBufferInOtherTabPage(a:bufNr)))
-    return
-  endif
-  execute printf({
-        \   s:OPEN_TYPE_CURRENT : '%sbuffer'          ,
-        \   s:OPEN_TYPE_SPLIT   : '%ssbuffer'         ,
-        \   s:OPEN_TYPE_VSPLIT  : 'vertical %ssbuffer',
-        \   s:OPEN_TYPE_TAB     : 'tab %ssbuffer'     ,
-        \ }[a:mode], a:bufNr)
-endfunction
-
-"
-function fuf#openFile(path, mode, reuse)
-  let bufNr = bufnr('^' . a:path . '$')
-  if bufNr > -1
-    call fuf#openBuffer(bufNr, a:mode, a:reuse)
-  else
-    execute {
-          \   s:OPEN_TYPE_CURRENT : 'edit '   ,
-          \   s:OPEN_TYPE_SPLIT   : 'split '  ,
-          \   s:OPEN_TYPE_VSPLIT  : 'vsplit ' ,
-          \   s:OPEN_TYPE_TAB     : 'tabedit ',
-          \ }[a:mode] . fnameescape(fnamemodify(a:path, ':~:.'))
-  endif
-endfunction
-
-"
-function fuf#openTag(tag, mode)
-  execute {
-        \   s:OPEN_TYPE_CURRENT : 'tjump '          ,
-        \   s:OPEN_TYPE_SPLIT   : 'stjump '         ,
-        \   s:OPEN_TYPE_VSPLIT  : 'vertical stjump ',
-        \   s:OPEN_TYPE_TAB     : 'tab stjump '     ,
-        \ }[a:mode] . a:tag
-endfunction
-
-"
-function fuf#openHelp(tag, mode)
-  execute {
-        \   s:OPEN_TYPE_CURRENT : 'help '         ,
-        \   s:OPEN_TYPE_SPLIT   : 'help '         ,
-        \   s:OPEN_TYPE_VSPLIT  : 'vertical help ',
-        \   s:OPEN_TYPE_TAB     : 'tab help '   ,
-        \ }[a:mode] . a:tag
-endfunction
-
-"
-function fuf#prejump(mode)
-  execute {
-        \   s:OPEN_TYPE_CURRENT : ''         ,
-        \   s:OPEN_TYPE_SPLIT   : 'split'    ,
-        \   s:OPEN_TYPE_VSPLIT  : 'vsplit'   ,
-        \   s:OPEN_TYPE_TAB     : 'tab split',
-        \ }[a:mode] 
-endfunction
-
-"
-function fuf#compareRanks(i1, i2)
-  if exists('a:i1.ranks') && exists('a:i2.ranks')
-    for i in range(min([len(a:i1.ranks), len(a:i2.ranks)]))
-      if     a:i1.ranks[i] > a:i2.ranks[i]
-        return +1
-      elseif a:i1.ranks[i] < a:i2.ranks[i]
-        return -1
-      endif
-    endfor
-  endif
-  return 0
-endfunction
-
-"
-function fuf#makePathItem(fname, menu, appendsDirSuffix)
-  let pathPair = fuf#splitPath(a:fname)
-  let dirSuffix = (a:appendsDirSuffix && isdirectory(a:fname)
-        \          ? fuf#getPathSeparator()
-        \          : '')
-  return {
-        \   'word'              : a:fname . dirSuffix,
-        \   'wordForPrimaryHead': s:toLowerForIgnoringCase(pathPair.head),
-        \   'wordForPrimaryTail': s:toLowerForIgnoringCase(pathPair.tail),
-        \   'wordForBoundary'   : s:toLowerForIgnoringCase(s:getWordBoundaries(pathPair.tail)),
-        \   'wordForRefining'   : s:toLowerForIgnoringCase(a:fname . dirSuffix),
-        \   'wordForRank'       : s:toLowerForIgnoringCase(pathPair.tail),
-        \   'menu'              : a:menu,
-        \ }
-endfunction
-
-"
-function fuf#makeNonPathItem(word, menu)
-  let wordL = s:toLowerForIgnoringCase(a:word)
-  return {
-        \   'word'           : a:word,
-        \   'wordForPrimary' : wordL,
-        \   'wordForBoundary': s:toLowerForIgnoringCase(s:getWordBoundaries(a:word)),
-        \   'wordForRefining': wordL,
-        \   'wordForRank'    : wordL,
-        \   'menu'           : a:menu,
-        \ }
-endfunction
-
-"
-function s:interpretPrimaryPatternForPathTail(pattern)
-  let pattern = fuf#expandTailDotSequenceToParentDir(a:pattern)
-  let pairL = fuf#splitPath(s:toLowerForIgnoringCase(pattern))
-  return {
-        \   'primary'       : pattern,
-        \   'primaryForRank': pairL.tail,
-        \   'matchingPairs' : [['v:val.wordForPrimaryTail', pairL.tail],],
-        \ }
-endfunction
-
-"
-function s:interpretPrimaryPatternForPath(pattern)
-  let pattern = fuf#expandTailDotSequenceToParentDir(a:pattern)
-  let patternL = s:toLowerForIgnoringCase(pattern)
-  let pairL = fuf#splitPath(patternL)
-  if g:fuf_splitPathMatching
-    let matches = [
-        \     ['v:val.wordForPrimaryHead', pairL.head],
-        \     ['v:val.wordForPrimaryTail', pairL.tail],
-        \   ]
-  else
-    let matches = [
-          \     ['v:val.wordForPrimaryHead . v:val.wordForPrimaryTail', patternL],
-          \   ]
-  endif
-  return {
-        \   'primary'       : pattern,
-        \   'primaryForRank': pairL.tail,
-        \   'matchingPairs' : matches,
-        \ }
-endfunction
-
-"
-function s:interpretPrimaryPatternForNonPath(pattern)
-  let patternL = s:toLowerForIgnoringCase(a:pattern)
-  return {
-        \   'primary'       : a:pattern,
-        \   'primaryForRank': patternL,
-        \   'matchingPairs' : [['v:val.wordForPrimary', patternL],],
-        \ }
-endfunction
-
-"
-function fuf#makePatternSet(patternBase, interpreter, partialMatching)
-  let MakeMatchingExpr = function(a:partialMatching
-        \                         ? 's:makePartialMatchingExpr'
-        \                         : 's:makeFuzzyMatchingExpr')
-  let [primary; refinings] = split(a:patternBase, g:fuf_patternSeparator, 1)
-  let elements = call(a:interpreter, [primary])
-  let primaryExprs  = map(elements.matchingPairs, 'MakeMatchingExpr(v:val[0], v:val[1])')
-  let refiningExprs = map(refinings, 's:makeRefiningExpr(v:val)')
-  return  {
-        \   'primary'       : elements.primary,
-        \   'primaryForRank': elements.primaryForRank,
-        \   'filteringExpr' : join(primaryExprs + refiningExprs, ' && '),
-        \ }
-endfunction
-
-"
-function fuf#enumExpandedDirsEntries(dir, exclude)
-  " Substitutes "\" because on Windows, "**\" doesn't include ".\",
-  " but "**/" include "./". I don't know why.
-  let dirNormalized = substitute(a:dir, '\', '/', 'g')
-  let entries = split(glob(dirNormalized . "*" ), "\n") +
-        \       split(glob(dirNormalized . ".*"), "\n")
-  " removes "*/." and "*/.."
-  call filter(entries, 'v:val !~ ''\v(^|[/\\])\.\.?$''')
-  call map(entries, 'fuf#makePathItem(v:val, "", 1)')
-  if len(a:exclude)
-    call filter(entries, 'v:val.word !~ a:exclude')
-  endif
-  return entries
-endfunction
-
-"
-function fuf#mapToSetAbbrWithSnippedWordAsPath(items)
-  let maxLenStats = {}
-  call map(a:items, 's:makeFileAbbrInfo(v:val, maxLenStats)')
-  let snippedHeads =
-        \ map(maxLenStats, 's:getSnippedHead(v:key[: -2], v:val)')
-  return map(a:items, 's:setAbbrWithFileAbbrData(v:val, snippedHeads)')
-endfunction
-
-"
-function fuf#setAbbrWithFormattedWord(item, abbrIndex)
-  let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0)
-  let abbrPrefix = (exists('a:item.abbrPrefix') ? a:item.abbrPrefix : '')
-  let a:item.abbr = abbrPrefix . a:item.word
-  if a:abbrIndex
-    let a:item.abbr = printf('%4d: ', a:item.index) . a:item.abbr
-  endif
-  let a:item.abbr = s:snipTail(a:item.abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK)
-  return a:item
-endfunction
-
-"
-function fuf#defineLaunchCommand(CmdName, modeName, prefixInitialPattern)
-  execute printf('command! -bang -narg=? %s call fuf#launch(%s, %s . <q-args>, len(<q-bang>))',
-        \        a:CmdName, string(a:modeName), a:prefixInitialPattern)
-endfunction
-
-"
-function fuf#defineKeyMappingInHandler(key, func)
-    " hacks to be able to use feedkeys().
-    execute printf(
-          \ 'inoremap <buffer> <silent> %s <C-r>=fuf#getRunningHandler().%s ? "" : ""<CR>',
-          \ a:key, a:func)
-endfunction
-
-"
-function fuf#launch(modeName, initialPattern, partialMatching)
-  if exists('s:runningHandler')
-    call fuf#echoWithHl('FuzzyFinder is running.', 'WarningMsg')
-  endif
-  if count(g:fuf_modes, a:modeName) == 0
-    echoerr 'This mode is not available: ' . a:modeName
-    return
-  endif
-  let s:runningHandler = fuf#{a:modeName}#createHandler(copy(s:handlerBase))
-  let s:runningHandler.info = fuf#loadInfoFile(s:runningHandler.getModeName())
-  let s:runningHandler.partialMatching = a:partialMatching
-  let s:runningHandler.bufNrPrev = bufnr('%')
-  let s:runningHandler.lastCol = -1
-  call s:runningHandler.onModeEnterPre()
-  call s:setTemporaryGlobalOption('completeopt', 'menuone')
-  call s:setTemporaryGlobalOption('ignorecase', 0)
-  if s:runningHandler.getPreviewHeight() > 0
-    call s:setTemporaryGlobalOption(
-          \ 'cmdheight', s:runningHandler.getPreviewHeight() + 1)
-  endif
-  call s:activateFufBuffer()
-  augroup FufLocal
-    autocmd!
-    autocmd CursorMovedI <buffer>        call s:runningHandler.onCursorMovedI()
-    autocmd InsertLeave  <buffer> nested call s:runningHandler.onInsertLeave()
-  augroup END
-  for [key, func] in [
-        \   [ g:fuf_keyOpen          , 'onCr(' . s:OPEN_TYPE_CURRENT . ', 0)' ],
-        \   [ g:fuf_keyOpenSplit     , 'onCr(' . s:OPEN_TYPE_SPLIT   . ', 0)' ],
-        \   [ g:fuf_keyOpenVsplit    , 'onCr(' . s:OPEN_TYPE_VSPLIT  . ', 0)' ],
-        \   [ g:fuf_keyOpenTabpage   , 'onCr(' . s:OPEN_TYPE_TAB     . ', 0)' ],
-        \   [ '<BS>'                 , 'onBs()'                               ],
-        \   [ '<C-h>'                , 'onBs()'                               ],
-        \   [ g:fuf_keyPreview       , 'onPreviewBase()'                      ],
-        \   [ g:fuf_keyNextMode      , 'onSwitchMode(+1)'                     ],
-        \   [ g:fuf_keyPrevMode      , 'onSwitchMode(-1)'                     ],
-        \   [ g:fuf_keySwitchMatching, 'onSwitchMatching()'                   ],
-        \   [ g:fuf_keyPrevPattern   , 'onRecallPattern(+1)'                  ],
-        \   [ g:fuf_keyNextPattern   , 'onRecallPattern(-1)'                  ],
-        \ ]
-    call fuf#defineKeyMappingInHandler(key, func)
-  endfor
-  " Starts Insert mode and makes CursorMovedI event now. Command prompt is
-  " needed to forces a completion menu to update every typing.
-  call setline(1, s:runningHandler.getPrompt() . a:initialPattern)
-  call s:runningHandler.onModeEnterPost()
-  call feedkeys("A", 'n') " startinsert! does not work in InsertLeave event handler
-  redraw
-endfunction
-
-"
-function fuf#loadInfoFile(modeName)
-  try
-    let lines = readfile(expand(g:fuf_infoFile))
-    " compatibility check
-    if count(lines, s:INFO_FILE_VERSION_LINE) == 0
-      call s:warnOldInfoFile()
-      let g:fuf_infoFile = ''
-      throw 1
-    endif
-  catch /.*/ 
-    let lines = []
-  endtry
-  let s:lastInfoMap = s:deserializeInfoMap(lines)
-  if !exists('s:lastInfoMap[a:modeName]')
-    let s:lastInfoMap[a:modeName] = {}
-  endif
-  return extend(s:lastInfoMap[a:modeName], { 'data': [], 'stats': [] }, 'keep')
-endfunction
-
-" if a:modeName is empty, a:info is treated as a map of information
-function fuf#saveInfoFile(modeName, info)
-  if empty(a:modeName)
-    let s:lastInfoMap = a:info
-  else
-    let s:lastInfoMap[a:modeName] = a:info
-  endif
-  let lines = [ s:INFO_FILE_VERSION_LINE ] + s:serializeInfoMap(s:lastInfoMap)
-  try
-    call writefile(lines, expand(g:fuf_infoFile))
-  catch /.*/ 
-  endtry
-endfunction
-
-"
-function fuf#editInfoFile()
-  new
-  silent file `='[fuf-info]'`
-  let s:bufNrInfo = bufnr('%')
-  setlocal filetype=vim
-  setlocal bufhidden=delete
-  setlocal buftype=acwrite
-  setlocal noswapfile
-  augroup FufInfo
-    autocmd!
-    autocmd BufWriteCmd <buffer> call s:onBufWriteCmdInfoFile()
-  augroup END
-  execute '0read ' . expand(g:fuf_infoFile)
-  setlocal nomodified
-endfunction
-
-" 
-function fuf#getRunningHandler()
-  return s:runningHandler
-endfunction
-
-" 
-function fuf#onComplete(findstart, base)
-  return s:runningHandler.onComplete(a:findstart, a:base)
-endfunction
-
-" }}}1
-"=============================================================================
-" LOCAL FUNCTIONS/VARIABLES {{{1
-
-let s:INFO_FILE_VERSION_LINE = "VERSION\t300"
-let s:ABBR_SNIP_MASK = '...'
-let s:OPEN_TYPE_CURRENT = 1
-let s:OPEN_TYPE_SPLIT   = 2
-let s:OPEN_TYPE_VSPLIT  = 3
-let s:OPEN_TYPE_TAB     = 4
-
-" wildcard -> regexp
-function s:convertWildcardToRegexp(expr)
-  let re = escape(a:expr, '\')
-  for [pat, sub] in [ [ '*', '\\.\\*' ], [ '?', '\\.' ], [ '[', '\\[' ], ]
-    let re = substitute(re, pat, sub, 'g')
-  endfor
-  return '\V' . re
-endfunction
-
-" a:pattern: 'str' -> '\V\.\*s\.\*t\.\*r\.\*'
-function s:makeFuzzyMatchingExpr(target, pattern)
-  let wi = ''
-  for c in split(a:pattern, '\zs')
-    if wi =~# '[^*?]$' && c !~ '[*?]'
-      let wi .= '*'
-    endif
-    let wi .= c
-  endfor
-  return s:makePartialMatchingExpr(a:target, wi)
-endfunction
-
-" a:pattern: 'str' -> '\Vstr'
-"            'st*r' -> '\Vst\.\*r'
-function s:makePartialMatchingExpr(target, pattern)
-  let patternMigemo = s:makeAdditionalMigemoPattern(a:pattern)
-  if a:pattern !~ '[*?]' && empty(patternMigemo)
-    " NOTE: stridx is faster than regexp matching
-    return 'stridx(' . a:target . ', ' . string(a:pattern) . ') >= 0'
-  endif
-  return a:target . ' =~# ' .
-        \ string(s:convertWildcardToRegexp(a:pattern)) . patternMigemo
-endfunction
-
-" 
-function s:makeRefiningExpr(pattern)
-  let expr = s:makePartialMatchingExpr('v:val.wordForRefining', a:pattern)
-  if a:pattern =~# '\D'
-    return expr
-  else
-    return '(' . expr . ' || v:val.index == ' . string(a:pattern) . ')'
-  endif
-endfunction
-
-" 
-function s:makeAdditionalMigemoPattern(pattern)
-  if !g:fuf_useMigemo || a:pattern =~# '[^\x01-\x7e]'
-    return ''
-  endif
-  return '\|\m' . substitute(migemo(a:pattern), '\\_s\*', '.*', 'g')
-endfunction
-
-" Snips a:str and add a:mask if the length of a:str is more than a:len
-function s:snipHead(str, len, mask)
-  if a:len >= len(a:str)
-    return a:str
-  elseif a:len <= len(a:mask)
-    return a:mask
-  endif
-  return a:mask . a:str[-a:len + len(a:mask):]
-endfunction
-
-" Snips a:str and add a:mask if the length of a:str is more than a:len
-function s:snipTail(str, len, mask)
-  if a:len >= len(a:str)
-    return a:str
-  elseif a:len <= len(a:mask)
-    return a:mask
-  endif
-  return a:str[:a:len - 1 - len(a:mask)] . a:mask
-endfunction
-
-" Snips a:str and add a:mask if the length of a:str is more than a:len
-function s:snipMid(str, len, mask)
-  if a:len >= len(a:str)
-    return a:str
-  elseif a:len <= len(a:mask)
-    return a:mask
-  endif
-  let len_head = (a:len - len(a:mask)) / 2
-  let len_tail = a:len - len(a:mask) - len_head
-  return  (len_head > 0 ? a:str[: len_head - 1] : '') . a:mask .
-        \ (len_tail > 0 ? a:str[-len_tail :] : '')
-endfunction
-
-"
-function s:getWordBoundaries(word)
-  return substitute(a:word, '\a\zs\l\+\|\zs\A', '', 'g')
-endfunction
-
-"
-function s:toLowerForIgnoringCase(str)
-    return (g:fuf_ignoreCase ? tolower(a:str) : a:str)
-endfunction
-
-"
-function s:setRanks(item, pattern, exprBoundary, stats)
-  "let word2 = substitute(a:eval_word, '\a\zs\l\+\|\zs\A', '', 'g')
-  let a:item.ranks = [
-        \   s:evaluateLearningRank(a:item.word, a:stats),
-        \   -s:scoreSequentialMatching(a:item.wordForRank, a:pattern),
-        \   -s:scoreBoundaryMatching(a:item.wordForBoundary, 
-        \                            a:pattern, a:exprBoundary),
-        \   a:item.index,
-        \ ]
-  return a:item
-endfunction
-
-" 
-function s:evaluateLearningRank(word, stats)
-  for i in range(len(a:stats))
-    if a:stats[i].word ==# a:word
-      return i
-    endif
-  endfor
-  return len(a:stats)
-endfunction
-
-let g:s = ""
-" range of return value is [0.0, 1.0]
-function s:scoreSequentialMatching(word, pattern)
-  if empty(a:pattern)
-    return 0.0
-  endif
-  let pos = stridx(a:word, a:pattern)
-  if pos < 0
-    return 0.0
-  endif
-  let lenRest = len(a:word) - len(a:pattern) - pos
-  return (pos == 0 ? 0.5 : 0.0) + 0.5 / (lenRest + 1)
-endfunction
-
-" range of return value is [0.0, 1.0]
-function s:scoreBoundaryMatching(wordForBoundary, pattern, exprBoundary)
-  if empty(a:pattern)
-    return 0.0
-  endif
-  if !eval(a:exprBoundary)
-    return 0
-  endif
-  return 0.5 + 0.5 * s:scoreSequentialMatching(a:wordForBoundary, a:pattern)
-endfunction
-
-"
-function s:highlightPrompt(prompt)
-  syntax clear
-  execute printf('syntax match %s /^\V%s/', g:fuf_promptHighlight, escape(a:prompt, '\'))
-endfunction
-
-"
-function s:highlightError()
-  syntax clear
-  syntax match Error  /^.*$/
-endfunction
-
-" returns 0 if the buffer is not found.
-function s:moveToWindowOfBufferInCurrentTabPage(bufNr)
-  if count(tabpagebuflist(), a:bufNr) == 0
-    return 0
-  endif
-  execute bufwinnr(a:bufNr) . 'wincmd w'
-  return 1
-endfunction
-
-" returns 0 if the buffer is not found.
-function s:moveToOtherTabPageOpeningBuffer(bufNr)
-  for tabNr in range(1, tabpagenr('$'))
-    if tabNr != tabpagenr() && count(tabpagebuflist(tabNr), a:bufNr) > 0
-      execute 'tabnext ' . tabNr
-      return 1
-    endif
-  endfor
-  return 0
-endfunction
-
-" returns 0 if the buffer is not found.
-function s:moveToWindowOfBufferInOtherTabPage(bufNr)
-  if !s:moveToOtherTabPageOpeningBuffer(a:bufNr)
-    return 0
-  endif
-  return s:moveToWindowOfBufferInCurrentTabPage(a:bufNr)
-endfunction
-
-"
-function s:expandAbbrevMap(pattern, abbrevMap)
-  let result = [a:pattern]
-  for [pattern, subs] in items(a:abbrevMap)
-    let exprs = result
-    let result = []
-    for expr in exprs
-      let result += map(copy(subs), 'substitute(expr, pattern, escape(v:val, ''\''), "g")')
-    endfor
-  endfor
-  return fuf#unique(result)
-endfunction
-
-"
-function s:makeFileAbbrInfo(item, maxLenStats)
-  let head = matchstr(a:item.word, '^.*[/\\]\ze.')
-  let a:item.abbr = { 'head' : head,
-        \             'tail' : a:item.word[strlen(head):],
-        \             'key' : head . '.',
-        \             'prefix' : printf('%4d: ', a:item.index), }
-  if exists('a:item.abbrPrefix')
-    let a:item.abbr.prefix .= a:item.abbrPrefix
-  endif
-  let len = len(a:item.abbr.prefix) + len(a:item.word) +
-        \   (exists('a:item.menu') ? len(a:item.menu) + 2 : 0)
-  if !exists('a:maxLenStats[a:item.abbr.key]') || len > a:maxLenStats[a:item.abbr.key]
-    let a:maxLenStats[a:item.abbr.key] = len
-  endif
-  return a:item
-endfunction
-
-"
-function s:getSnippedHead(head, baseLen)
-  return s:snipMid(a:head, len(a:head) + g:fuf_maxMenuWidth - a:baseLen, s:ABBR_SNIP_MASK)
-endfunction
-
-"
-function s:setAbbrWithFileAbbrData(item, snippedHeads)
-  let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0)
-  let abbr = a:item.abbr.prefix . a:snippedHeads[a:item.abbr.key] . a:item.abbr.tail
-  let a:item.abbr = s:snipTail(abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK)
-  return a:item
-endfunction
-
-let s:bufNrFuf = -1
-
-"
-function s:openFufBuffer()
-  if !bufexists(s:bufNrFuf)
-    topleft 1new
-    silent file `='[fuf]'`
-    let s:bufNrFuf = bufnr('%')
-  elseif bufwinnr(s:bufNrFuf) == -1
-    topleft 1split
-    execute 'silent ' . s:bufNrFuf . 'buffer'
-    delete _
-  elseif bufwinnr(s:bufNrFuf) != bufwinnr('%')
-    execute bufwinnr(s:bufNrFuf) . 'wincmd w'
-  endif
-endfunction
-
-function s:setLocalOptionsForFufBuffer()
-  setlocal filetype=fuf
-  setlocal bufhidden=delete
-  setlocal buftype=nofile
-  setlocal noswapfile
-  setlocal nobuflisted
-  setlocal modifiable
-  setlocal nocursorline   " for highlighting
-  setlocal nocursorcolumn " for highlighting
-  setlocal omnifunc=fuf#onComplete
-endfunction
-
-"
-function s:activateFufBuffer()
-  " lcd . : To avoid the strange behavior that unnamed buffer changes its cwd
-  "         if 'autochdir' was set on.
-  lcd .
-  let cwd = getcwd()
-  call s:openFufBuffer()
-  " lcd ... : countermeasure against auto-cd script
-  lcd `=cwd`
-  call s:setLocalOptionsForFufBuffer()
-  redraw " for 'lazyredraw'
-  if exists(':AcpLock')
-    AcpLock
-  elseif exists(':AutoComplPopLock')
-    AutoComplPopLock
-  endif
-endfunction
-
-"
-function s:deactivateFufBuffer()
-  if exists(':AcpUnlock')
-    AcpUnlock
-  elseif exists(':AutoComplPopUnlock')
-    AutoComplPopUnlock
-  endif
-  " must close after returning to previous window
-  wincmd p
-  execute s:bufNrFuf . 'bdelete'
-endfunction
-
-let s:originalGlobalOptions = {}
-
-" 
-function s:setTemporaryGlobalOption(name, value)
-  call extend(s:originalGlobalOptions, { a:name : eval('&' . a:name) }, 'keep')
-  execute printf('let &%s = a:value', a:name)
-endfunction
-
-"
-function s:restoreTemporaryGlobalOptions()
-  for [name, value] in items(s:originalGlobalOptions)
-    execute printf('let &%s = value', name)
-  endfor
-  let s:originalGlobalOptions = {}
-endfunction
-
-"
-function s:warnOldInfoFile()
-  call fuf#echoWithHl(printf("=================================================================\n" .
-        \                    "  Sorry, but your information file for FuzzyFinder is no longer  \n" .
-        \                    "  compatible with this version of FuzzyFinder. Please remove     \n" .
-        \                    "  %-63s\n" .
-        \                    "=================================================================\n" ,
-        \                    '"' . expand(g:fuf_infoFile) . '".'),
-        \           'WarningMsg')
-  echohl Question
-  call input('Press Enter')
-  echohl None
-endfunction
-
-"
-function s:serializeInfoMap(infoMap)
-  let lines = []
-  for [m, info] in items(a:infoMap)
-    for [key, value] in items(info)
-      let lines += map(copy(value), 'm . "\t" . key . "\t" . string(v:val)')
-    endfor
-  endfor
-  return lines
-endfunction
-
-"
-function s:deserializeInfoMap(lines)
-  let infoMap = {}
-  for e in filter(map(a:lines, 'matchlist(v:val, ''^\v(\S+)\s+(\S+)\s+(.+)$'')'), '!empty(v:val)')
-    if !exists('infoMap[e[1]]')
-      let infoMap[e[1]] = {}
-    endif
-    if !exists('infoMap[e[1]][e[2]]')
-      let infoMap[e[1]][e[2]] = []
-    endif
-    call add(infoMap[e[1]][e[2]], eval(e[3]))
-  endfor
-  return infoMap
-endfunction
-
-"
-function s:onBufWriteCmdInfoFile()
-  call fuf#saveInfoFile('', s:deserializeInfoMap(getline(1, '$')))
-  setlocal nomodified
-  execute printf('%dbdelete! ', s:bufNrInfo)
-  echo "Information file updated"
-endfunction
-
-" }}}1
-"=============================================================================
-" s:handlerBase {{{1
-
-let s:handlerBase = {}
-
-"-----------------------------------------------------------------------------
-" PURE VIRTUAL FUNCTIONS {{{2
-"
-" "
-" s:handler.getModeName()
-" 
-" "
-" s:handler.getPrompt()
-" 
-" " returns true if the mode deals with file paths.
-" s:handler.targetsPath()
-"
-" "
-" s:handler.getCompleteItems(patternSet)
-" 
-" "
-" s:handler.onOpen(word, mode)
-" 
-" " Before entering FuzzyFinder buffer. This function should return in a short time.
-" s:handler.onModeEnterPre()
-"
-" " After entering FuzzyFinder buffer.
-" s:handler.onModeEnterPost()
-"
-" " After leaving FuzzyFinder buffer.
-" s:handler.onModeLeavePost(opened)
-"
-" }}}2
-"-----------------------------------------------------------------------------
-
-"
-function s:handlerBase.concretize(deriv)
-  call extend(self, a:deriv, 'error')
-  return self
-endfunction
-
-"
-function s:handlerBase.addStat(pattern, word)
-  let stat = { 'pattern' : a:pattern, 'word' : a:word }
-  call filter(self.info.stats, 'v:val !=# stat')
-  call insert(self.info.stats, stat)
-  let self.info.stats = self.info.stats[0 : g:fuf_learningLimit - 1]
-endfunction
-
-"
-function s:handlerBase.getMatchingCompleteItems(patternBase)
-  let MakeMatchingExpr = function(self.partialMatching
-        \                         ? 's:makePartialMatchingExpr'
-        \                         : 's:makeFuzzyMatchingExpr')
-  let patternSet = self.makePatternSet(a:patternBase)
-  let exprBoundary = s:makeFuzzyMatchingExpr('a:wordForBoundary', patternSet.primaryForRank)
-  let stats = filter(
-        \ copy(self.info.stats), 'v:val.pattern ==# patternSet.primaryForRank')
-  let items = self.getCompleteItems(patternSet.primary)
-  " NOTE: In order to know an excess, plus 1 to limit number
-  let items = fuf#filterWithLimit(
-        \ items, patternSet.filteringExpr, g:fuf_enumeratingLimit + 1)
-  return map(items,
-        \ 's:setRanks(v:val, patternSet.primaryForRank, exprBoundary, stats)')
-endfunction
-
-"
-function s:handlerBase.onComplete(findstart, base)
-  if a:findstart
-    return 0
-  elseif  !self.existsPrompt(a:base)
-    return []
-  endif
-  call s:highlightPrompt(self.getPrompt())
-  let items = []
-  for patternBase in s:expandAbbrevMap(self.removePrompt(a:base), g:fuf_abbrevMap)
-    let items += self.getMatchingCompleteItems(patternBase)
-    if len(items) > g:fuf_enumeratingLimit
-      let items = items[ : g:fuf_enumeratingLimit - 1]
-      call s:highlightError()
-      break
-    endif
-  endfor
-  if empty(items)
-    call s:highlightError()
-  else
-    call sort(items, 'fuf#compareRanks')
-    call feedkeys("\<C-p>\<Down>", 'n')
-    let self.lastFirstWord = items[0].word
-  endif
-  return items
-endfunction
-
-"
-function s:handlerBase.existsPrompt(line)
-  return  strlen(a:line) >= strlen(self.getPrompt()) &&
-        \ a:line[:strlen(self.getPrompt()) -1] ==# self.getPrompt()
-endfunction
-
-"
-function s:handlerBase.removePrompt(line)
-  return a:line[(self.existsPrompt(a:line) ? strlen(self.getPrompt()) : 0):]
-endfunction
-
-"
-function s:handlerBase.restorePrompt(line)
-  let i = 0
-  while i < len(self.getPrompt()) && i < len(a:line) && self.getPrompt()[i] ==# a:line[i]
-    let i += 1
-  endwhile
-  return self.getPrompt() . a:line[i : ]
-endfunction
-
-"
-function s:handlerBase.onCursorMovedI()
-  if !self.existsPrompt(getline('.'))
-    call setline('.', self.restorePrompt(getline('.')))
-    call feedkeys("\<End>", 'n')
-  elseif col('.') <= len(self.getPrompt())
-    " if the cursor is moved before command prompt
-    call feedkeys(repeat("\<Right>", len(self.getPrompt()) - col('.') + 1), 'n')
-  elseif col('.') > strlen(getline('.')) && col('.') != self.lastCol
-    " if the cursor is placed on the end of the line and has been actually moved.
-    let self.lastCol = col('.')
-    let self.lastPattern = self.removePrompt(getline('.'))
-    call feedkeys("\<C-x>\<C-o>", 'n')
-  endif
-endfunction
-
-"
-function s:handlerBase.onInsertLeave()
-  unlet s:runningHandler
-  let lastPattern = self.removePrompt(getline('.'))
-  call s:restoreTemporaryGlobalOptions()
-  call s:deactivateFufBuffer()
-  call fuf#saveInfoFile(self.getModeName(), self.info)
-  let fOpen = exists('s:reservedCommand')
-  if fOpen
-    call self.onOpen(s:reservedCommand[0], s:reservedCommand[1])
-    unlet s:reservedCommand
-  endif
-  call self.onModeLeavePost(fOpen)
-  if exists('s:reservedMode')
-    call fuf#launch(s:reservedMode, lastPattern, self.partialMatching)
-    unlet s:reservedMode
-  endif
-endfunction
-
-"
-function s:handlerBase.onCr(openType, fCheckDir)
-  if pumvisible()
-    call feedkeys(printf("\<C-y>\<C-r>=fuf#getRunningHandler().onCr(%d, %d) ? '' : ''\<CR>",
-          \              a:openType, self.targetsPath()), 'n')
-    return
-  endif
-  if !empty(self.lastPattern)
-    call self.addStat(self.lastPattern, self.removePrompt(getline('.')))
-  endif
-  if a:fCheckDir && getline('.') =~# '[/\\]$'
-    " To clear i_<C-r> expression (fuf#getRunningHandler().onCr...)
-    echo ''
-    return
-  endif
-  let s:reservedCommand = [self.removePrompt(getline('.')), a:openType]
-  call feedkeys("\<Esc>", 'n') " stopinsert behavior is strange...
-endfunction
-
-"
-function s:handlerBase.onBs()
-  let pattern = self.removePrompt(getline('.')[ : col('.') - 2])
-  if empty(pattern)
-    let numBs = 0
-  elseif !g:fuf_smartBs
-    let numBs = 1
-  elseif pattern[-len(g:fuf_patternSeparator) : ] ==# g:fuf_patternSeparator
-    let numBs = len(split(pattern, g:fuf_patternSeparator, 1)[-2])
-          \   + len(g:fuf_patternSeparator)
-  elseif self.targetsPath() && pattern[-1 : ] =~# '[/\\]'
-    let numBs = len(matchstr(pattern, '[^/\\]*.$'))
-  else
-    let numBs = 1
-  endif
-  call feedkeys((pumvisible() ? "\<C-e>" : "") . repeat("\<BS>", numBs), 'n')
-endfunction
-
-"
-function s:handlerBase.onPreviewBase()
-  if self.getPreviewHeight() <= 0
-    return
-  elseif !pumvisible()
-    return
-  elseif !self.existsPrompt(getline('.'))
-    let word = self.removePrompt(getline('.'))
-  elseif !exists('self.lastFirstWord')
-    return
-  else
-    let word = self.lastFirstWord
-  endif
-  redraw
-  if exists('self.lastPreviewInfo') && self.lastPreviewInfo.word ==# word
-    let self.lastPreviewInfo.count += 1
-  else
-    let self.lastPreviewInfo = {'word': word, 'count': 0}
-  endif
-  let lines = self.makePreviewLines(word, self.lastPreviewInfo.count)
-  let lines = lines[: self.getPreviewHeight() - 1]
-  call map(lines, 'substitute(v:val, "\t", repeat(" ", &tabstop), "g")')
-  call map(lines, 's:snipTail(v:val, &columns - 1, s:ABBR_SNIP_MASK)')
-  echo join(lines, "\n")
-endfunction
-
-"
-function s:handlerBase.onSwitchMode(shift)
-  let modes = copy(g:fuf_modes)
-  call map(modes, '{ "ranks": [ fuf#{v:val}#getSwitchOrder(), v:val ] }')
-  call filter(modes, 'v:val.ranks[0] >= 0')
-  call sort(modes, 'fuf#compareRanks')
-  let s:reservedMode = self.getModeName()
-  for i in range(len(modes))
-    if modes[i].ranks[1] ==# self.getModeName()
-      let s:reservedMode = modes[(i + a:shift) % len(modes)].ranks[1]
-      break
-    endif
-  endfor
-  call feedkeys("\<Esc>", 'n') " stopinsert doesn't work.
-endfunction
-
-"
-function s:handlerBase.onSwitchMatching()
-  let self.partialMatching = !self.partialMatching
-  let self.lastCol = -1
-  call setline('.', self.restorePrompt(self.lastPattern))
-  call feedkeys("\<End>", 'n')
-  "call self.onCursorMovedI()
-endfunction
-
-"
-function s:handlerBase.onRecallPattern(shift)
-  let patterns = map(copy(self.info.stats), 'v:val.pattern')
-  if !exists('self.indexRecall')
-    let self.indexRecall = -1
-  endif
-  let self.indexRecall += a:shift
-  if self.indexRecall < 0
-    let self.indexRecall = -1
-  elseif self.indexRecall >= len(patterns)
-    let self.indexRecall = len(patterns) - 1
-  else
-    call setline('.', self.getPrompt() . patterns[self.indexRecall])
-    call feedkeys("\<End>", 'n')
-  endif
-endfunction
-
-" }}}1
-"=============================================================================
-" INITIALIZATION {{{1
-
-augroup FufGlobal
-  autocmd!
-  autocmd BufLeave * let s:bufferCursorPosMap[bufnr('')] = getpos('.')
-augroup END
-
-let s:bufferCursorPosMap = {}
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:
-

File .vim/autoload/fuf/bookmark.vim

-"=============================================================================
-" Copyright (c) 2007-2009 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if exists('g:loaded_autoload_fuf_bookmark') || v:version < 702
-  finish
-endif
-let g:loaded_autoload_fuf_bookmark = 1
-
-" }}}1
-"=============================================================================
-" GLOBAL FUNCTIONS {{{1
-
-"
-function fuf#bookmark#createHandler(base)
-  return a:base.concretize(copy(s:handler))
-endfunction
-
-"
-function fuf#bookmark#getSwitchOrder()
-  return g:fuf_bookmark_switchOrder
-endfunction
-
-"
-function fuf#bookmark#renewCache()
-endfunction
-
-"
-function fuf#bookmark#requiresOnCommandPre()
-  return 0
-endfunction
-
-"
-function fuf#bookmark#onInit()
-  call fuf#defineLaunchCommand('FufBookmark', s:MODE_NAME, '""')
-  command! -bang -narg=?        FufAddBookmark               call s:bookmarkHere(<q-args>)
-  command! -bang -narg=0 -range FufAddBookmarkAsSelectedText call s:bookmarkHere(s:getSelectedText())
-endfunction
-
-" }}}1
-"=============================================================================
-" LOCAL FUNCTIONS/VARIABLES {{{1
-
-let s:MODE_NAME = expand('<sfile>:t:r')
-let s:OPEN_TYPE_DELETE = -1
-
-"
-function s:getSelectedText()
-  let reg_ = [@", getregtype('"')]
-  let regA = [@a, getregtype('a')]
-  if mode() =~# "[vV\<C-v>]"
-    silent normal! "aygv
-  else
-    let pos = getpos('.')
-    silent normal! gv"ay
-    call setpos('.', pos)
-  endif
-  let text = @a
-  call setreg('"', reg_[0], reg_[1])
-  call setreg('a', regA[0], regA[1])
-  return text
-endfunction
-
-" opens a:path and jumps to the line matching to a:pattern from a:lnum within
-" a:range. if not found, jumps to a:lnum.
-function s:jumpToBookmark(path, mode, pattern, lnum)
-  call fuf#openFile(a:path, a:mode, g:fuf_reuseWindow)
-  call cursor(s:getMatchingLineNumber(getline(1, '$'), a:pattern, a:lnum), 0)
-  normal! zvzz
-endfunction
-
-"
-function s:getMatchingLineNumber(lines, pattern, lnumBegin)
-  let l = min([a:lnumBegin, len(a:lines)])
-  for [l0, l1] in map(range(0, g:fuf_bookmark_searchRange),
-        \             '[l + v:val, l - v:val]')
-    if l0 <= len(a:lines) && a:lines[l0 - 1] =~# a:pattern
-      return l0
-    elseif l1 >= 0 && a:lines[l1 - 1] =~# a:pattern
-      return l1
-    endif
-  endfor
-  return l
-endfunction
-
-"
-function s:getLinePattern(lnum)
-  return '\C\V\^' . escape(getline(a:lnum), '\') . '\$'
-endfunction
-
-"
-function s:bookmarkHere(word)
-  if !empty(&buftype) || expand('%') !~ '\S'
-    call fuf#echoWithHl('Can''t bookmark this buffer.', 'WarningMsg')
-    return
-  endif
-  let item = {
-        \   'word' : (a:word =~# '\S' ? substitute(a:word, '\n', ' ', 'g')
-        \                             : pathshorten(expand('%:p:~')) . '|' . line('.') . '| ' . getline('.')),
-        \   'path' : expand('%:p'),
-        \   'lnum' : line('.'),
-        \   'pattern' : s:getLinePattern(line('.')),
-        \   'time' : localtime(),
-        \ }
-  let item.word = fuf#inputHl('Bookmark as:', item.word, 'Question')
-  if item.word !~ '\S'
-    call fuf#echoWithHl('Canceled', 'WarningMsg')
-    return
-  endif
-  let info = fuf#loadInfoFile(s:MODE_NAME)
-  call insert(info.data, item)
-  call fuf#saveInfoFile(s:MODE_NAME, info)
-endfunction
-
-"
-function s:findItem(items, word)
-  for item in a:items
-    if item.word ==# a:word
-      return item
-    endif
-  endfor
-  return {}
-endfunction
-
-" }}}1
-"=============================================================================
-" s:handler {{{1
-
-let s:handler = {}
-
-"
-function s:handler.getModeName()
-  return s:MODE_NAME
-endfunction
-
-"
-function s:handler.getPrompt()
-  return fuf#formatPrompt(g:fuf_bookmark_prompt, self.partialMatching)
-endfunction
-
-"
-function s:handler.getPreviewHeight()
-  return g:fuf_previewHeight
-endfunction
-
-"
-function s:handler.targetsPath()
-  return 0
-endfunction
-
-"
-function s:handler.makePatternSet(patternBase)
-  return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath',
-        \                   self.partialMatching)
-endfunction
-
-"
-function s:handler.makePreviewLines(word, count)
-  let item = s:findItem(self.info.data, a:word)
-  let lines = fuf#getFileLines(item.path)
-  if empty(lines)
-    return []
-  endif
-  let index = s:getMatchingLineNumber(lines, item.pattern, item.lnum) - 1
-  return fuf#makePreviewLinesAround(
-        \ lines, [index], a:count, self.getPreviewHeight())
-endfunction
-
-"
-function s:handler.getCompleteItems(patternPrimary)
-  return self.items
-endfunction
-
-"
-function s:handler.onOpen(word, mode)
-  if a:mode == s:OPEN_TYPE_DELETE
-    call filter(self.info.data, 'v:val.word !=# a:word')
-    call fuf#saveInfoFile(s:MODE_NAME, self.info)
-    call fuf#launch(s:MODE_NAME, self.lastPattern, self.partialMatching)
-    return
-  else
-    let item = s:findItem(self.info.data, a:word)
-    if !empty(item)
-        call s:jumpToBookmark(item.path, a:mode, item.pattern, item.lnum)
-    endif
-  endif
-endfunction
-
-"
-function s:handler.onModeEnterPre()
-endfunction
-
-"
-function s:handler.onModeEnterPost()
-  call fuf#defineKeyMappingInHandler(g:fuf_bookmark_keyDelete,
-        \                            'onCr(' . s:OPEN_TYPE_DELETE . ', 0)')
-  let self.items = copy(self.info.data)
-  call map(self.items, 'fuf#makeNonPathItem(v:val.word, strftime(g:fuf_timeFormat, v:val.time))')
-  call fuf#mapToSetSerialIndex(self.items, 1)
-  call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 1)')
-endfunction
-
-"
-function s:handler.onModeLeavePost(opened)
-endfunction
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:

File .vim/autoload/fuf/buffer.vim

-"=============================================================================
-" Copyright (c) 2007-2009 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if exists('g:loaded_autoload_fuf_buffer') || v:version < 702
-  finish
-endif
-let g:loaded_autoload_fuf_buffer = 1
-
-" }}}1
-"=============================================================================
-" GLOBAL FUNCTIONS {{{1
-
-"
-function fuf#buffer#createHandler(base)
-  return a:base.concretize(copy(s:handler))
-endfunction
-
-"
-function fuf#buffer#getSwitchOrder()
-  return g:fuf_buffer_switchOrder
-endfunction
-
-"
-function fuf#buffer#renewCache()
-endfunction
-
-"
-function fuf#buffer#requiresOnCommandPre()
-  return 0
-endfunction
-
-"
-function fuf#buffer#onInit()
-  call fuf#defineLaunchCommand('FufBuffer', s:MODE_NAME, '""')
-  augroup fuf#buffer
-    autocmd!
-    autocmd BufEnter     * call s:updateBufTimes()
-    autocmd BufWritePost * call s:updateBufTimes()
-  augroup END
-endfunction
-
-" }}}1
-"=============================================================================
-" LOCAL FUNCTIONS/VARIABLES {{{1
-
-let s:MODE_NAME = expand('<sfile>:t:r')
-
-let s:bufTimes = {}
-
-"
-function s:updateBufTimes()
-  let s:bufTimes[bufnr('%')] = localtime()
-endfunction
-
-"
-function s:makeItem(nr)
-  let fname = (empty(bufname(a:nr))
-        \      ? '[No Name]'
-        \      : fnamemodify(bufname(a:nr), ':~:.'))
-  let time = (exists('s:bufTimes[a:nr]') ? s:bufTimes[a:nr] : 0)
-  let item = fuf#makePathItem(fname, strftime(g:fuf_timeFormat, time), 0)
-  let item.index = a:nr
-  let item.bufNr = a:nr
-  let item.time = time
-  let item.abbrPrefix = s:getBufIndicator(a:nr) . ' '
-  return item
-endfunction
-
-"
-function s:getBufIndicator(bufNr)
-  if !getbufvar(a:bufNr, '&modifiable')
-    return '[-]'
-  elseif getbufvar(a:bufNr, '&modified')
-    return '[+]'
-  elseif getbufvar(a:bufNr, '&readonly')
-    return '[R]'
-  else
-    return '   '
-  endif
-endfunction
-
-"
-function s:compareTimeDescending(i1, i2)
-  return a:i1.time == a:i2.time ? 0 : a:i1.time > a:i2.time ? -1 : +1
-endfunction
-
-"
-function s:findItem(items, word)
-  for item in a:items
-    if item.word ==# a:word
-      return item
-    endif
-  endfor
-  return {}
-endfunction
-
-" }}}1
-"=============================================================================
-" s:handler {{{1
-
-let s:handler = {}
-
-"
-function s:handler.getModeName()
-  return s:MODE_NAME
-endfunction
-
-"
-function s:handler.getPrompt()
-  return fuf#formatPrompt(g:fuf_buffer_prompt, self.partialMatching)
-endfunction
-
-"
-function s:handler.getPreviewHeight()
-  return g:fuf_previewHeight
-endfunction
-
-"
-function s:handler.targetsPath()
-  return 1
-endfunction
-
-"
-function s:handler.makePatternSet(patternBase)
-  return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath',
-        \                   self.partialMatching)
-endfunction
-
-"
-function s:handler.makePreviewLines(word, count)
-  let item = s:findItem(self.items, a:word)
-  if empty(item)
-    return []
-  endif
-  return fuf#makePreviewLinesForFile(item.bufNr, a:count, self.getPreviewHeight())
-endfunction
-
-"
-function s:handler.getCompleteItems(patternPrimary)
-  return self.items
-endfunction
-
-"
-function s:handler.onOpen(word, mode)
-  " not use bufnr(a:word) in order to handle unnamed buffer
-  let item = s:findItem(self.items, a:word)
-  if !empty(item)
-    call fuf#openBuffer(item.bufNr, a:mode, g:fuf_reuseWindow)
-  endif
-endfunction
-
-"
-function s:handler.onModeEnterPre()
-endfunction
-
-"
-function s:handler.onModeEnterPost()
-  let self.items = map(filter(range(1, bufnr('$')),
-        \                     'buflisted(v:val) && v:val != self.bufNrPrev'),
-        \              's:makeItem(v:val)')
-  if g:fuf_buffer_mruOrder
-    call fuf#mapToSetSerialIndex(sort(self.items, 's:compareTimeDescending'), 1)
-  endif
-  let self.items = fuf#mapToSetAbbrWithSnippedWordAsPath(self.items)
-endfunction
-
-"
-function s:handler.onModeLeavePost(opened)
-endfunction
-
-" }}}1
-"=============================================================================
-" vim: set fdm=marker:

File .vim/autoload/fuf/callbackfile.vim

-"=============================================================================
-" Copyright (c) 2007-2009 Takeshi NISHIDA
-"
-"=============================================================================
-" LOAD GUARD {{{1
-
-if exists('g:loaded_autoload_fuf_callbackfile') || v:version < 702
-  finish
-endif
-let g:loaded_autoload_fuf_callbackfile = 1
-
-" }}}1
-"=============================================================================
-" GLOBAL FUNCTIONS {{{1
-
-"
-function fuf#callbackfile#createHandler(base)
-  return a:base.concretize(copy(s:handler))
-endfunction
-
-"
-function fuf#callbackfile#getSwitchOrder()
-  return -1
-endfunction
-
-"
-function fuf#callbackfile#renewCache()
-  let s:cache = {}
-endfunction
-
-"
-function fuf#callbackfile#requiresOnCommandPre()
-  return 0
-endfunction
-
-"
-function fuf#callbackfile#onInit()
-endfunction
-
-"
-function fuf#callbackfile#launch(initialPattern, partialMatching, prompt, exclude, listener)
-  let s:prompt = (empty(a:prompt) ? '>' : a:prompt)
-  let s:exclude = a:exclude
-  let s:listener = a:listener
-  call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching)
-endfunction
-
-" }}}1
-"=============================================================================
-" LOCAL FUNCTIONS/VARIABLES {{{1
-
-let s:MODE_NAME = expand('<sfile>:t:r')
-
-"
-function s:enumItems(dir)
-  let key = getcwd() . s:exclude . "\n" . a:dir
-  if !exists('s:cache[key]')
-    let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, s:exclude)
-    if isdirectory(a:dir)
-      call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0))
-    endif
-    call fuf#mapToSetSerialIndex(s:cache[key], 1)
-    call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key])
-  endif
-  return s:cache[key]
-endfunction
-
-" }}}1
-"=============================================================================
-" s:handler {{{1
-
-let s:handler = {}
-
-"
-function s:handler.getModeName()
-  return s:MODE_NAME
-endfunction
-
-"
-function s:handler.getPrompt()
-  return fuf#formatPrompt(s:prompt, self.partialMatching)
-endfunction
-
-"
-function s:handler.getPreviewHeight()
-  return g:fuf_previewHeight
-endfunction
-
-"
-function s:handler.targetsPath()
-  return 1
-endfunction
-
-"
-function s:handler.makePatternSet(patternBase)
-  return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail',
-        \                   self.partialMatching)
-endfunction
-
-"
-function s:handler.makePreviewLines(word, count)
-  return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight())
-endfunction
-
-"
-function s:handler.getCompleteItems(patternPrimary)
-  let items = copy(s:enumItems(fuf#splitPath(a:patternPrimary).head))
-  return filter(items, 'bufnr("^" . v:val.word . "$") != self.bufNrPrev')
-endfunction
-
-"
-function s:handler.onOpen(word, mode)
-  call s:listener.onComplete(a:word, a:mode)
-endfunction
-
-"
-function s:handler.onModeEnterPre()
-endfunction
-