From 442a6ab74ec8c716f57b47ac89b6216f164906c5 Mon Sep 17 00:00:00 2001 From: gryf Date: Mon, 15 Nov 2010 18:45:27 +0100 Subject: [PATCH] - updated FuzzyFinder - moved Pydoc to ftplugin/python - updated pyflakes - added Pygments feature into rst functions --- .vimrc | 2 +- GetLatest/GetLatestVimScripts.dat | 9 +- autoload/fuf.vim | 731 +++++++++++--------------- autoload/fuf/bookmark.vim | 211 -------- autoload/fuf/buffer.vim | 37 +- autoload/fuf/callbackfile.vim | 20 +- autoload/fuf/callbackitem.vim | 18 +- autoload/fuf/changelist.vim | 18 +- autoload/fuf/dir.vim | 26 +- autoload/fuf/file.vim | 34 +- autoload/fuf/givencmd.vim | 16 +- autoload/fuf/givendir.vim | 16 +- autoload/fuf/givenfile.vim | 14 +- autoload/fuf/help.vim | 52 +- autoload/fuf/jumplist.vim | 18 +- autoload/fuf/line.vim | 18 +- autoload/fuf/mrucmd.vim | 28 +- autoload/fuf/mrufile.vim | 118 ++++- autoload/fuf/quickfix.vim | 18 +- autoload/fuf/tag.vim | 48 +- autoload/fuf/taggedfile.vim | 55 +- doc/fuf.txt | 615 ++++++++++++++++------ doc/tags | 453 +++++++++++++++- ftplugin/python/common.vim | 5 +- {plugin => ftplugin/python}/pydoc.vim | 8 +- ftplugin/python/pyflakes.vim | 70 ++- ftplugin/python/pyflakes/README.rst | 2 +- ftplugin/rst/commons.vim | 29 +- plugin/fuf.vim | 237 ++++----- 29 files changed, 1779 insertions(+), 1147 deletions(-) delete mode 100644 autoload/fuf/bookmark.vim rename {plugin => ftplugin/python}/pydoc.vim (93%) diff --git a/.vimrc b/.vimrc index b8220d8..1b3c872 100644 --- a/.vimrc +++ b/.vimrc @@ -15,7 +15,7 @@ set fileformats=unix,dos "Type of in written files set formatoptions=croqw "Automatic formatting settings set hidden "Keep hidden windows set history=1000 "Keep 1000 lines of command line history -set ignorecase "Ignore case in search patterns +"set ignorecase "Ignore case in search patterns set laststatus=2 "Always show statusbar set lazyredraw "Don't update screen while executing macros diff --git a/GetLatest/GetLatestVimScripts.dat b/GetLatest/GetLatestVimScripts.dat index fbde047..c3d1b69 100644 --- a/GetLatest/GetLatestVimScripts.dat +++ b/GetLatest/GetLatestVimScripts.dat @@ -3,12 +3,12 @@ ScriptID SourceID Filename ### plugins 102 13435 DirDiff.vim #2754 13139 :AutoInstall: delimitMate.vim -1984 11852 fuzzyfinder.vim +1984 13961 fuzzyfinder.vim 311 7645 grep.vim 2727 11120 jsbeautify.vim 2666 13424 Mark 2262 8944 occur.vim -910 13092 pydoc.vim +910 14079 pydoc.vim #2421 9423 pysmell.vim 152 3342 showmarks.vim 2540 11006 snipMate.vim @@ -25,7 +25,7 @@ ScriptID SourceID Filename # compiler 891 10365 pylint.vim # ftplugin -2441 13378 pyflakes.vim +2441 14215 pyflakes.vim 30 9196 python_fn.vim ### indent 1936 7708 javascript.vim @@ -33,4 +33,5 @@ ScriptID SourceID Filename # changes doesn't put it on vim.org scripts. it can be (still) found on # http://monkey.org/~caz/python.vim ### syntax -790 12805 python.vim +790 14268 python.vim +1984 13961 :AutoInstall: FuzzyFinder diff --git a/autoload/fuf.vim b/autoload/fuf.vim index 0a91d3a..fe9e6eb 100644 --- a/autoload/fuf.vim +++ b/autoload/fuf.vim @@ -1,72 +1,29 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) 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 +" returns list of paths. +" An argument for glob() is normalized in order to avoid a bug on Windows. +function fuf#glob(expr) + " Substitutes "\", because on Windows, "**\" doesn't include ".\", + " but "**/" include "./". I don't know why. + return split(glob(substitute(a:expr, '\', '/', 'g')), "\n") endfunction " function fuf#countModifiedFiles(files, time) - return len(filter(copy(a:files), 'getftime(v:val) > a:time')) + return len(filter(copy(a:files), 'getftime(expand(v:val)) > a:time')) endfunction " @@ -85,9 +42,11 @@ 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 = filter(result,'v:val.word !=# a:newItem.word') let result = insert(result, a:newItem) - let result = filter(result, 'v:val.word !~ a:exclude') + if len(a:exclude) + let result = filter(result, 'v:val.word !~ a:exclude') + endif return result[0 : a:maxItem - 1] endfunction @@ -109,26 +68,12 @@ endfunction " "foo/.../bar/...hoge" -> "foo/.../bar/../../hoge" function fuf#expandTailDotSequenceToParentDir(pattern) return substitute(a:pattern, '^\(.*[/\\]\)\?\zs\.\(\.\+\)\ze[^/\\]*$', - \ '\=repeat(".." . fuf#getPathSeparator(), len(submatch(2)))', '') + \ '\=repeat(".." . l9#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 ? '!' : '') +function fuf#formatPrompt(prompt, partialMatching, otherString) + let indicator = escape((a:partialMatching ? '!' : '') . a:otherString, '\') return substitute(a:prompt, '[]', indicator, 'g') endfunction @@ -139,11 +84,7 @@ function fuf#getFileLines(file) if !empty(lines) return lines endif - try - return readfile(expand(a:file)) - catch /.*/ - endtry - return [] + return l9#readFile(a:file) endfunction " @@ -181,28 +122,23 @@ function fuf#makePreviewLinesForFile(file, count, maxHeight) endfunction " -function fuf#echoWithHl(msg, hl) - execute "echohl " . a:hl - echo a:msg - echohl None +function fuf#echoWarning(msg) + call l9#echoHl('WarningMsg', a:msg, '[fuf] ', 1) endfunction " -function fuf#inputHl(prompt, text, hl) - execute "echohl " . a:hl - let s = input(a:prompt, a:text) - echohl None - return s +function fuf#echoError(msg) + call l9#echoHl('ErrorMsg', a:msg, '[fuf] ', 1) 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))) + if a:reuse && ((a:mode ==# s:OPEN_TYPE_SPLIT && + \ l9#moveToBufferWindowInCurrentTabpage(a:bufNr)) || + \ (a:mode ==# s:OPEN_TYPE_VSPLIT && + \ l9#moveToBufferWindowInCurrentTabpage(a:bufNr)) || + \ (a:mode ==# s:OPEN_TYPE_TAB && + \ l9#moveToBufferWindowInOtherTabpage(a:bufNr))) return endif execute printf({ @@ -275,8 +211,8 @@ endfunction " function fuf#makePathItem(fname, menu, appendsDirSuffix) let pathPair = fuf#splitPath(a:fname) - let dirSuffix = (a:appendsDirSuffix && isdirectory(a:fname) - \ ? fuf#getPathSeparator() + let dirSuffix = (a:appendsDirSuffix && isdirectory(expand(a:fname)) + \ ? l9#getPathSeparator() \ : '') return { \ 'word' : a:fname . dirSuffix, @@ -302,49 +238,6 @@ function fuf#makeNonPathItem(word, 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 @@ -363,11 +256,7 @@ 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") + let entries = fuf#glob(a:dir . '*') + fuf#glob(a:dir . '.*') " removes "*/." and "*/.." call filter(entries, 'v:val !~ ''\v(^|[/\\])\.\.?$''') call map(entries, 'fuf#makePathItem(v:val, "", 1)') @@ -394,45 +283,101 @@ function fuf#setAbbrWithFormattedWord(item, abbrIndex) 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) + let a:item.abbr = l9#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 . , len())', - \ a:CmdName, string(a:modeName), a:prefixInitialPattern) +function s:onCommandPre() + for m in filter(copy(fuf#getModeNames()), 'fuf#{v:val}#requiresOnCommandPre()') + call fuf#{m}#onCommandPre(getcmdtype() . getcmdline()) + endfor + " lets last entry become the newest in the history + call histadd(getcmdtype(), getcmdline()) + " this is not mapped again (:help recursive_mapping) + return "\" +endfunction + +" +let s:modeNames = [] + +" +function fuf#addMode(modeName) + if count(g:fuf_modesDisable, a:modeName) > 0 + return + endif + call add(s:modeNames, a:modeName) + call fuf#{a:modeName}#renewCache() + call fuf#{a:modeName}#onInit() + if fuf#{a:modeName}#requiresOnCommandPre() + " cnoremap has a problem, which doesn't expand cabbrev. + cmap onCommandPre() + endif +endfunction + +" +function fuf#getModeNames() + return s:modeNames +endfunction + +" +function fuf#defineLaunchCommand(CmdName, modeName, prefixInitialPattern, tempVars) + if empty(a:tempVars) + let preCmd = '' + else + let preCmd = printf('call l9#tempvariables#setList(%s, %s) | ', + \ string(s:TEMP_VARIABLES_GROUP), string(a:tempVars)) + endif + execute printf('command! -range -bang -narg=? %s %s call fuf#launch(%s, %s . , len())', + \ a:CmdName, preCmd, string(a:modeName), a:prefixInitialPattern) endfunction " function fuf#defineKeyMappingInHandler(key, func) - " hacks to be able to use feedkeys(). - execute printf( - \ 'inoremap %s =fuf#getRunningHandler().%s ? "" : ""', - \ a:key, a:func) + " hacks to be able to use feedkeys(). + execute printf( + \ 'inoremap %s =fuf#getRunningHandler().%s ? "" : ""', + \ a:key, a:func) +endfunction + +" +let s:oneTimeVariables = [] + +" +function fuf#setOneTimeVariables(...) + let s:oneTimeVariables += a:000 endfunction " function fuf#launch(modeName, initialPattern, partialMatching) if exists('s:runningHandler') - call fuf#echoWithHl('FuzzyFinder is running.', 'WarningMsg') + call fuf#echoWarning('FuzzyFinder is running.') endif - if count(g:fuf_modes, a:modeName) == 0 + if count(fuf#getModeNames(), 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.stats = fuf#loadDataFile(s:runningHandler.getModeName(), 'stats') let s:runningHandler.partialMatching = a:partialMatching let s:runningHandler.bufNrPrev = bufnr('%') let s:runningHandler.lastCol = -1 + let s:runningHandler.windowRestoringCommand = winrestcmd() call s:runningHandler.onModeEnterPre() - call s:setTemporaryGlobalOption('completeopt', 'menuone') - call s:setTemporaryGlobalOption('ignorecase', 0) + " NOTE: updatetime is set, because in Buffer-Tag mode on Vim 7.3 on Windows, + " Vim keeps from triggering CursorMovedI for updatetime after system() is + " called. I don't know why. + call fuf#setOneTimeVariables( + \ ['&completeopt', 'menuone'], + \ ['&ignorecase', 0], + \ ['&updatetime', 10], + \ ) if s:runningHandler.getPreviewHeight() > 0 - call s:setTemporaryGlobalOption( - \ 'cmdheight', s:runningHandler.getPreviewHeight() + 1) + call fuf#setOneTimeVariables( + \ ['&cmdheight', s:runningHandler.getPreviewHeight() + 1]) endif + call l9#tempvariables#setList(s:TEMP_VARIABLES_GROUP, s:oneTimeVariables) + let s:oneTimeVariables = [] call s:activateFufBuffer() augroup FufLocal autocmd! @@ -440,18 +385,19 @@ function fuf#launch(modeName, initialPattern, partialMatching) autocmd InsertLeave 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)' ], - \ [ '' , 'onBs()' ], - \ [ '' , '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)' ], + \ [ g:fuf_keyOpen , 'onCr(' . s:OPEN_TYPE_CURRENT . ')' ], + \ [ g:fuf_keyOpenSplit , 'onCr(' . s:OPEN_TYPE_SPLIT . ')' ], + \ [ g:fuf_keyOpenVsplit , 'onCr(' . s:OPEN_TYPE_VSPLIT . ')' ], + \ [ g:fuf_keyOpenTabpage , 'onCr(' . s:OPEN_TYPE_TAB . ')' ], + \ [ '' , 'onBs()' ], + \ [ '' , 'onBs()' ], + \ [ '' , 'onDeleteWord()' ], + \ [ g:fuf_keyPreview , 'onPreviewBase(1)' ], + \ [ 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 @@ -464,54 +410,72 @@ function fuf#launch(modeName, initialPattern, partialMatching) 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] = {} +function fuf#loadDataFile(modeName, dataName) + if !s:dataFileAvailable + return [] endif - return extend(s:lastInfoMap[a:modeName], { 'data': [], 'stats': [] }, 'keep') + let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName])) + return map(lines, 'eval(v:val)') 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 +" +function fuf#saveDataFile(modeName, dataName, items) + if !s:dataFileAvailable + return -1 endif - let lines = [ s:INFO_FILE_VERSION_LINE ] + s:serializeInfoMap(s:lastInfoMap) - try - call writefile(lines, expand(g:fuf_infoFile)) - catch /.*/ - endtry + let lines = map(copy(a:items), 'string(v:val)') + return l9#writeFile(lines, l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName])) +endfunction + +" +function fuf#getDataFileTime(modeName, dataName) + if !s:dataFileAvailable + return -1 + endif + return getftime(expand(l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName]))) 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 call s:onBufWriteCmdInfoFile() - augroup END - execute '0read ' . expand(g:fuf_infoFile) - setlocal nomodified +function s:createDataBufferListener(dataFile) + let listener = { 'dataFile': a:dataFile } + + function listener.onWrite(lines) + let [modeName, dataName] = split(self.dataFile, l9#getPathSeparator()) + let items = map(filter(a:lines, '!empty(v:val)'), 'eval(v:val)') + call fuf#saveDataFile(modeName, dataName, items) + echo "Data files updated" + return 1 + endfunction + + return listener +endfunction + +" +function s:createEditDataListener() + let listener = {} + + function listener.onComplete(dataFile, method) + let bufName = '[fuf-info]' + let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:dataFile])) + call l9#tempbuffer#openWritable(bufName, 'vim', lines, 0, 0, 0, + \ s:createDataBufferListener(a:dataFile)) + endfunction + + return listener +endfunction + +" +function s:getEditableDataFiles(modeName) + let dataFiles = fuf#{a:modeName}#getEditableDataNames() + call filter(dataFiles, 'fuf#getDataFileTime(a:modeName, v:val) != -1') + return map(dataFiles, 'l9#concatPaths([a:modeName, v:val])') +endfunction + +" +function fuf#editDataFile() + let dataFiles = map(copy(fuf#getModeNames()), 's:getEditableDataFiles(v:val)') + let dataFiles = l9#concat(dataFiles) + call fuf#callbackitem#launch('', 0, '>Mode>', s:createEditDataListener(), dataFiles, 0) endfunction " @@ -528,22 +492,13 @@ endfunction "============================================================================= " LOCAL FUNCTIONS/VARIABLES {{{1 -let s:INFO_FILE_VERSION_LINE = "VERSION\t300" +let s:TEMP_VARIABLES_GROUP = expand(':p') 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 = '' @@ -565,12 +520,16 @@ function s:makePartialMatchingExpr(target, pattern) return 'stridx(' . a:target . ', ' . string(a:pattern) . ') >= 0' endif return a:target . ' =~# ' . - \ string(s:convertWildcardToRegexp(a:pattern)) . patternMigemo + \ string(l9#convertWildcardToRegexp(a:pattern)) . patternMigemo endfunction " function s:makeRefiningExpr(pattern) - let expr = s:makePartialMatchingExpr('v:val.wordForRefining', a:pattern) + if g:fuf_fuzzyRefining + let expr = s:makeFuzzyMatchingExpr('v:val.wordForRefining', a:pattern) + else + let expr = s:makePartialMatchingExpr('v:val.wordForRefining', a:pattern) + endif if a:pattern =~# '\D' return expr else @@ -586,37 +545,47 @@ function s:makeAdditionalMigemoPattern(pattern) 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):] +" +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 -" 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 +" +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 a:str[:a:len - 1 - len(a:mask)] . a:mask + return { + \ 'primary' : pattern, + \ 'primaryForRank': pairL.tail, + \ 'matchingPairs' : matches, + \ } 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 :] : '') +" +function s:interpretPrimaryPatternForNonPath(pattern) + let patternL = s:toLowerForIgnoringCase(a:pattern) + return { + \ 'primary' : a:pattern, + \ 'primaryForRank': patternL, + \ 'matchingPairs' : [['v:val.wordForPrimary', patternL],], + \ } endfunction " @@ -626,7 +595,7 @@ endfunction " function s:toLowerForIgnoringCase(str) - return (g:fuf_ignoreCase ? tolower(a:str) : a:str) + return (g:fuf_ignoreCase ? tolower(a:str) : a:str) endfunction " @@ -652,35 +621,34 @@ function s:evaluateLearningRank(word, stats) 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 + return str2float('0.0') endif let pos = stridx(a:word, a:pattern) if pos < 0 - return 0.0 + return str2float('0.0') endif let lenRest = len(a:word) - len(a:pattern) - pos - return (pos == 0 ? 0.5 : 0.0) + 0.5 / (lenRest + 1) + return str2float(pos == 0 ? '0.5' : '0.0') + str2float('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 + return str2float('0.0') endif if !eval(a:exprBoundary) return 0 endif - return 0.5 + 0.5 * s:scoreSequentialMatching(a:wordForBoundary, a:pattern) + return (s:scoreSequentialMatching(a:wordForBoundary, a:pattern) + 1) / 2 endfunction " function s:highlightPrompt(prompt) syntax clear - execute printf('syntax match %s /^\V%s/', g:fuf_promptHighlight, escape(a:prompt, '\')) + execute printf('syntax match %s /^\V%s/', g:fuf_promptHighlight, escape(a:prompt, '\/')) endfunction " @@ -689,34 +657,6 @@ function s:highlightError() 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] @@ -727,7 +667,7 @@ function s:expandAbbrevMap(pattern, abbrevMap) let result += map(copy(subs), 'substitute(expr, pattern, escape(v:val, ''\''), "g")') endfor endfor - return fuf#unique(result) + return l9#unique(result) endfunction " @@ -750,45 +690,19 @@ endfunction " function s:getSnippedHead(head, baseLen) - return s:snipMid(a:head, len(a:head) + g:fuf_maxMenuWidth - a:baseLen, s:ABBR_SNIP_MASK) + return l9#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) + let a:item.abbr = l9#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 +let s:FUF_BUF_NAME = '[fuf]' " function s:activateFufBuffer() @@ -796,10 +710,13 @@ function s:activateFufBuffer() " if 'autochdir' was set on. lcd . let cwd = getcwd() - call s:openFufBuffer() + call l9#tempbuffer#openScratch(s:FUF_BUF_NAME, 'fuf', [], 1, 0, 1, {}) + resize 1 " for issue #21 " lcd ... : countermeasure against auto-cd script lcd `=cwd` - call s:setLocalOptionsForFufBuffer() + setlocal nocursorline " for highlighting + setlocal nocursorcolumn " for highlighting + setlocal omnifunc=fuf#onComplete redraw " for 'lazyredraw' if exists(':AcpLock') AcpLock @@ -815,73 +732,7 @@ function s:deactivateFufBuffer() 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" + call l9#tempbuffer#close(s:FUF_BUF_NAME) endfunction " }}}1 @@ -899,9 +750,6 @@ let s:handlerBase = {} " " " s:handler.getPrompt() " -" " returns true if the mode deals with file paths. -" s:handler.targetsPath() -" " " " s:handler.getCompleteItems(patternSet) " @@ -929,9 +777,9 @@ 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] + call filter(self.stats, 'v:val !=# stat') + call insert(self.stats, stat) + let self.stats = self.stats[0 : g:fuf_learningLimit - 1] endfunction " @@ -942,10 +790,10 @@ function s:handlerBase.getMatchingCompleteItems(patternBase) 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') + \ copy(self.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( + let items = l9#filterWithLimit( \ items, patternSet.filteringExpr, g:fuf_enumeratingLimit + 1) return map(items, \ 's:setRanks(v:val, patternSet.primaryForRank, exprBoundary, stats)') @@ -972,7 +820,11 @@ function s:handlerBase.onComplete(findstart, base) call s:highlightError() else call sort(items, 'fuf#compareRanks') - call feedkeys("\\", 'n') + if g:fuf_autoPreview + call feedkeys("\\\=fuf#getRunningHandler().onPreviewBase(0) ? '' : ''\", 'n') + else + call feedkeys("\\", 'n') + endif let self.lastFirstWord = items[0].word endif return items @@ -1017,33 +869,34 @@ endfunction " function s:handlerBase.onInsertLeave() unlet s:runningHandler - let lastPattern = self.removePrompt(getline('.')) - call s:restoreTemporaryGlobalOptions() + let tempVars = l9#tempvariables#getList(s:TEMP_VARIABLES_GROUP) + call l9#tempvariables#end(s:TEMP_VARIABLES_GROUP) call s:deactivateFufBuffer() - call fuf#saveInfoFile(self.getModeName(), self.info) + call fuf#saveDataFile(self.getModeName(), 'stats', self.stats) + execute self.windowRestoringCommand 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 + if exists('self.reservedMode') + call l9#tempvariables#setList(s:TEMP_VARIABLES_GROUP, tempVars) + call fuf#launch(self.reservedMode, self.lastPattern, self.partialMatching) endif endfunction " -function s:handlerBase.onCr(openType, fCheckDir) +function s:handlerBase.onCr(openType) if pumvisible() - call feedkeys(printf("\\=fuf#getRunningHandler().onCr(%d, %d) ? '' : ''\", - \ a:openType, self.targetsPath()), 'n') + call feedkeys(printf("\\=fuf#getRunningHandler().onCr(%d) ? '' : ''\", + \ a:openType), 'n') return endif if !empty(self.lastPattern) call self.addStat(self.lastPattern, self.removePrompt(getline('.'))) endif - if a:fCheckDir && getline('.') =~# '[/\\]$' + if !self.isOpenable(getline('.')) " To clear i_ expression (fuf#getRunningHandler().onCr...) echo '' return @@ -1054,24 +907,30 @@ 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 + call feedkeys((pumvisible() ? "\\" : "\"), 'n') +endfunction + +" +function s:getLastBlockLength(pattern, patternIsPath) + let separatorPos = strridx(a:pattern, g:fuf_patternSeparator) + if separatorPos >= 0 + return len(a:pattern) - separatorPos endif + if a:patternIsPath && a:pattern =~# '[/\\].' + return len(matchstr(a:pattern, '[^/\\]*.$')) + endif + return len(a:pattern) +endfunction + +" +function s:handlerBase.onDeleteWord() + let pattern = self.removePrompt(getline('.')[ : col('.') - 2]) + let numBs = s:getLastBlockLength(pattern, 1) call feedkeys((pumvisible() ? "\" : "") . repeat("\", numBs), 'n') endfunction " -function s:handlerBase.onPreviewBase() +function s:handlerBase.onPreviewBase(repeatable) if self.getPreviewHeight() <= 0 return elseif !pumvisible() @@ -1084,7 +943,7 @@ function s:handlerBase.onPreviewBase() let word = self.lastFirstWord endif redraw - if exists('self.lastPreviewInfo') && self.lastPreviewInfo.word ==# word + if a:repeatable && exists('self.lastPreviewInfo') && self.lastPreviewInfo.word ==# word let self.lastPreviewInfo.count += 1 else let self.lastPreviewInfo = {'word': word, 'count': 0} @@ -1092,20 +951,21 @@ function s:handlerBase.onPreviewBase() 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)') + call map(lines, 'strtrans(v:val)') + call map(lines, 'l9#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) + let modes = copy(fuf#getModeNames()) 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() + let self.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] + let self.reservedMode = modes[(i + a:shift) % len(modes)].ranks[1] break endif endfor @@ -1123,7 +983,7 @@ endfunction " function s:handlerBase.onRecallPattern(shift) - let patterns = map(copy(self.info.stats), 'v:val.pattern') + let patterns = map(copy(self.stats), 'v:val.pattern') if !exists('self.indexRecall') let self.indexRecall = -1 endif @@ -1149,6 +1009,37 @@ augroup END let s:bufferCursorPosMap = {} +" +let s:DATA_FILE_VERSION = 400 + +" +function s:checkDataFileCompatibility() + if empty(g:fuf_dataDir) + let s:dataFileAvailable = 0 + return + endif + let versionPath = l9#concatPaths([g:fuf_dataDir, 'VERSION']) + let lines = l9#readFile(versionPath) + if empty(lines) + call l9#writeFile([s:DATA_FILE_VERSION], versionPath) + let s:dataFileAvailable = 1 + elseif str2nr(lines[0]) == s:DATA_FILE_VERSION + let s:dataFileAvailable = 1 + else + call fuf#echoWarning(printf( + \ "=======================================================\n" . + \ " Existing data files for FuzzyFinder is no longer \n" . + \ " compatible with this version of FuzzyFinder. Remove \n" . + \ " %-53s\n" . + \ "=======================================================\n" , + \ string(g:fuf_dataDir))) + call l9#inputHl('Question', 'Press Enter') + let s:dataFileAvailable = 0 + endif +endfunction + +call s:checkDataFileCompatibility() + " }}}1 "============================================================================= " vim: set fdm=marker: diff --git a/autoload/fuf/bookmark.vim b/autoload/fuf/bookmark.vim deleted file mode 100644 index 59cc13b..0000000 --- a/autoload/fuf/bookmark.vim +++ /dev/null @@ -1,211 +0,0 @@ -"============================================================================= -" 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() - command! -bang -narg=0 -range FufAddBookmarkAsSelectedText call s:bookmarkHere(s:getSelectedText()) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') -let s:OPEN_TYPE_DELETE = -1 - -" -function s:getSelectedText() - let reg_ = [@", getregtype('"')] - let regA = [@a, getregtype('a')] - if mode() =~# "[vV\]" - 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: diff --git a/autoload/fuf/buffer.vim b/autoload/fuf/buffer.vim index b8e5ee1..08b954a 100644 --- a/autoload/fuf/buffer.vim +++ b/autoload/fuf/buffer.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_buffer') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_buffer = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#buffer#getSwitchOrder() return g:fuf_buffer_switchOrder endfunction +" +function fuf#buffer#getEditableDataNames() + return [] +endfunction + " function fuf#buffer#renewCache() endfunction @@ -34,7 +38,7 @@ endfunction " function fuf#buffer#onInit() - call fuf#defineLaunchCommand('FufBuffer', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufBuffer', s:MODE_NAME, '""', []) augroup fuf#buffer autocmd! autocmd BufEnter * call s:updateBufTimes() @@ -47,6 +51,7 @@ endfunction " LOCAL FUNCTIONS/VARIABLES {{{1 let s:MODE_NAME = expand(':t:r') +let s:OPEN_TYPE_DELETE = -1 let s:bufTimes = {} @@ -59,7 +64,7 @@ endfunction function s:makeItem(nr) let fname = (empty(bufname(a:nr)) \ ? '[No Name]' - \ : fnamemodify(bufname(a:nr), ':~:.')) + \ : fnamemodify(bufname(a:nr), ':p:~:.')) 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 @@ -110,7 +115,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_buffer_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_buffer_prompt, self.partialMatching, '') endfunction " @@ -119,7 +124,7 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() +function s:handler.isOpenable(enteredPattern) return 1 endfunction @@ -147,7 +152,12 @@ 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) + if empty(item) + " do nothing + elseif a:mode ==# s:OPEN_TYPE_DELETE + execute item.bufNr . 'bdelete' + let self.reservedMode = self.getModeName() + else call fuf#openBuffer(item.bufNr, a:mode, g:fuf_reuseWindow) endif endfunction @@ -158,11 +168,14 @@ endfunction " function s:handler.onModeEnterPost() - let self.items = map(filter(range(1, bufnr('$')), - \ 'buflisted(v:val) && v:val != self.bufNrPrev'), - \ 's:makeItem(v:val)') + call fuf#defineKeyMappingInHandler(g:fuf_buffer_keyDelete, + \ 'onCr(' . s:OPEN_TYPE_DELETE . ')') + let self.items = range(1, bufnr('$')) + call filter(self.items, 'buflisted(v:val) && v:val != self.bufNrPrev && v:val != bufnr("%")') + call map(self.items, 's:makeItem(v:val)') if g:fuf_buffer_mruOrder - call fuf#mapToSetSerialIndex(sort(self.items, 's:compareTimeDescending'), 1) + call sort(self.items, 's:compareTimeDescending') + call fuf#mapToSetSerialIndex(self.items, 1) endif let self.items = fuf#mapToSetAbbrWithSnippedWordAsPath(self.items) endfunction diff --git a/autoload/fuf/callbackfile.vim b/autoload/fuf/callbackfile.vim index 8c69638..fedf0cf 100644 --- a/autoload/fuf/callbackfile.vim +++ b/autoload/fuf/callbackfile.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_callbackfile') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_callbackfile = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#callbackfile#getSwitchOrder() return -1 endfunction +" +function fuf#callbackfile#getEditableDataNames() + return [] +endfunction + " function fuf#callbackfile#renewCache() let s:cache = {} @@ -53,7 +57,7 @@ let s:MODE_NAME = expand(':t:r') " function s:enumItems(dir) - let key = getcwd() . s:exclude . "\n" . a:dir + let key = getcwd() . g:fuf_ignoreCase . s:exclude . "\n" . a:dir if !exists('s:cache[key]') let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, s:exclude) if isdirectory(a:dir) @@ -78,7 +82,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching) + return fuf#formatPrompt(s:prompt, self.partialMatching, '') endfunction " @@ -87,8 +91,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 1 +function s:handler.isOpenable(enteredPattern) + return a:enteredPattern =~# '[^/\\]$' endfunction " @@ -123,7 +127,7 @@ endfunction " function s:handler.onModeLeavePost(opened) - if !a:opened + if !a:opened && exists('s:listener.onAbort()') call s:listener.onAbort() endif endfunction diff --git a/autoload/fuf/callbackitem.vim b/autoload/fuf/callbackitem.vim index 3ee072c..118ee08 100644 --- a/autoload/fuf/callbackitem.vim +++ b/autoload/fuf/callbackitem.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_callbackitem') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_callbackitem = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#callbackitem#getSwitchOrder() return -1 endfunction +" +function fuf#callbackitem#getEditableDataNames() + return [] +endfunction + " function fuf#callbackitem#renewCache() endfunction @@ -73,7 +77,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching) + return fuf#formatPrompt(s:prompt, self.partialMatching, '') endfunction " @@ -85,8 +89,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return s:forPath +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " @@ -125,7 +129,7 @@ endfunction " function s:handler.onModeLeavePost(opened) - if !a:opened + if !a:opened && exists('s:listener.onAbort()') call s:listener.onAbort() endif endfunction diff --git a/autoload/fuf/changelist.vim b/autoload/fuf/changelist.vim index 40f2d2c..545f6ca 100644 --- a/autoload/fuf/changelist.vim +++ b/autoload/fuf/changelist.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_changelist') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_changelist = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#changelist#getSwitchOrder() return g:fuf_changelist_switchOrder endfunction +" +function fuf#changelist#getEditableDataNames() + return [] +endfunction + " function fuf#changelist#renewCache() endfunction @@ -34,7 +38,7 @@ endfunction " function fuf#changelist#onInit() - call fuf#defineLaunchCommand('FufChangeList', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufChangeList', s:MODE_NAME, '""', []) endfunction " }}}1 @@ -91,7 +95,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_changelist_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_changelist_prompt, self.partialMatching, '') endfunction " @@ -100,8 +104,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/dir.vim b/autoload/fuf/dir.vim index 689ba0f..5316093 100644 --- a/autoload/fuf/dir.vim +++ b/autoload/fuf/dir.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_dir') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_dir = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#dir#getSwitchOrder() return g:fuf_dir_switchOrder endfunction +" +function fuf#dir#getEditableDataNames() + return [] +endfunction + " function fuf#dir#renewCache() let s:cache = {} @@ -35,9 +39,9 @@ endfunction " function fuf#dir#onInit() - call fuf#defineLaunchCommand('FufDir' , s:MODE_NAME, '""') - call fuf#defineLaunchCommand('FufDirWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')') - call fuf#defineLaunchCommand('FufDirWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]') + call fuf#defineLaunchCommand('FufDir' , s:MODE_NAME, '""', []) + call fuf#defineLaunchCommand('FufDirWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')', []) + call fuf#defineLaunchCommand('FufDirWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]', []) endfunction " }}}1 @@ -48,7 +52,7 @@ let s:MODE_NAME = expand(':t:r') " function s:enumItems(dir) - let key = getcwd() . g:fuf_dir_exclude . "\n" . a:dir + let key = getcwd() . g:fuf_ignoreCase . g:fuf_dir_exclude . "\n" . a:dir if !exists('s:cache[key]') let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, g:fuf_dir_exclude) call filter(s:cache[key], 'v:val.word =~# ''[/\\]$''') @@ -74,7 +78,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_dir_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_dir_prompt, self.partialMatching, '') endfunction " @@ -83,8 +87,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 1 +function s:handler.isOpenable(enteredPattern) + return a:enteredPattern =~# '[^/\\]$' endfunction " @@ -96,7 +100,7 @@ endfunction " function s:handler.makePreviewLines(word, count) return fuf#makePreviewLinesAround( - \ split(glob(fnamemodify(a:word, ':p') . '*'), "\n"), + \ fuf#glob(fnamemodify(a:word, ':p') . '*'), \ [], a:count, self.getPreviewHeight()) return endfunction diff --git a/autoload/fuf/file.vim b/autoload/fuf/file.vim index 348b4af..1569192 100644 --- a/autoload/fuf/file.vim +++ b/autoload/fuf/file.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_file') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_file = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#file#getSwitchOrder() return g:fuf_file_switchOrder endfunction +" +function fuf#file#getEditableDataNames() + return [] +endfunction + " function fuf#file#renewCache() let s:cache = {} @@ -35,9 +39,9 @@ endfunction " function fuf#file#onInit() - call fuf#defineLaunchCommand('FufFile' , s:MODE_NAME, '""') - call fuf#defineLaunchCommand('FufFileWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')') - call fuf#defineLaunchCommand('FufFileWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]') + call fuf#defineLaunchCommand('FufFile' , s:MODE_NAME, '""', []) + call fuf#defineLaunchCommand('FufFileWithFullCwd' , s:MODE_NAME, 'fnamemodify(getcwd(), '':p'')', []) + call fuf#defineLaunchCommand('FufFileWithCurrentBufferDir', s:MODE_NAME, 'expand(''%:~:.'')[:-1-len(expand(''%:~:.:t''))]', []) endfunction " }}}1 @@ -48,7 +52,7 @@ let s:MODE_NAME = expand(':t:r') " function s:enumItems(dir) - let key = getcwd() . g:fuf_file_exclude . "\n" . a:dir + let key = join([getcwd(), g:fuf_ignoreCase, g:fuf_file_exclude, a:dir], "\n") if !exists('s:cache[key]') let s:cache[key] = fuf#enumExpandedDirsEntries(a:dir, g:fuf_file_exclude) call fuf#mapToSetSerialIndex(s:cache[key], 1) @@ -58,15 +62,13 @@ function s:enumItems(dir) endfunction " -function s:enumNonCurrentItems(dir, bufNr, cache) +function s:enumNonCurrentItems(dir, bufNrPrev, cache) let key = a:dir . 'AVOIDING EMPTY KEY' if !exists('a:cache[key]') - " NOTE: filtering should be done with - " 'bufnr("^" . v:val.word . "$") != a:bufNr'. - " But it takes a lot of time! - let bufName = bufname(a:bufNr) + " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$') + let bufNamePrev = bufname(a:bufNrPrev) let a:cache[key] = - \ filter(copy(s:enumItems(a:dir)), 'v:val.word != bufName') + \ filter(copy(s:enumItems(a:dir)), 'v:val.word !=# bufNamePrev') endif return a:cache[key] endfunction @@ -84,7 +86,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_file_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_file_prompt, self.partialMatching, '') endfunction " @@ -93,8 +95,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 1 +function s:handler.isOpenable(enteredPattern) + return a:enteredPattern =~# '[^/\\]$' endfunction " diff --git a/autoload/fuf/givencmd.vim b/autoload/fuf/givencmd.vim index 7572829..d59178c 100644 --- a/autoload/fuf/givencmd.vim +++ b/autoload/fuf/givencmd.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_givencmd') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_givencmd = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#givencmd#getSwitchOrder() return -1 endfunction +" +function fuf#givencmd#getEditableDataNames() + return [] +endfunction + " function fuf#givencmd#renewCache() endfunction @@ -65,7 +69,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching) + return fuf#formatPrompt(s:prompt, self.partialMatching, '') endfunction " @@ -74,8 +78,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/givendir.vim b/autoload/fuf/givendir.vim index 10b89ef..e654d85 100644 --- a/autoload/fuf/givendir.vim +++ b/autoload/fuf/givendir.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_givendir') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_givendir = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#givendir#getSwitchOrder() return -1 endfunction +" +function fuf#givendir#getEditableDataNames() + return [] +endfunction + " function fuf#givendir#renewCache() endfunction @@ -65,7 +69,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching) + return fuf#formatPrompt(s:prompt, self.partialMatching, '') endfunction " @@ -74,7 +78,7 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() +function s:handler.isOpenable(enteredPattern) return 1 endfunction @@ -87,7 +91,7 @@ endfunction " function s:handler.makePreviewLines(word, count) return fuf#makePreviewLinesAround( - \ split(glob(fnamemodify(a:word, ':p') . '*'), "\n"), + \ fuf#glob(fnamemodify(a:word, ':p') . '*'), \ [], a:count, self.getPreviewHeight()) return endfunction diff --git a/autoload/fuf/givenfile.vim b/autoload/fuf/givenfile.vim index 3b726bc..5419ff8 100644 --- a/autoload/fuf/givenfile.vim +++ b/autoload/fuf/givenfile.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_givenfile') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_givenfile = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#givenfile#getSwitchOrder() return -1 endfunction +" +function fuf#givenfile#getEditableDataNames() + return [] +endfunction + " function fuf#givenfile#renewCache() endfunction @@ -65,7 +69,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching) + return fuf#formatPrompt(s:prompt, self.partialMatching, '') endfunction " @@ -74,7 +78,7 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() +function s:handler.isOpenable(enteredPattern) return 1 endfunction diff --git a/autoload/fuf/help.vim b/autoload/fuf/help.vim index b0693d0..8f03e36 100644 --- a/autoload/fuf/help.vim +++ b/autoload/fuf/help.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_help') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_help = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#help#getSwitchOrder() return g:fuf_help_switchOrder endfunction +" +function fuf#help#getEditableDataNames() + return [] +endfunction + " function fuf#help#renewCache() let s:cache = {} @@ -35,8 +39,8 @@ endfunction " function fuf#help#onInit() - call fuf#defineLaunchCommand('FufHelp' , s:MODE_NAME, '""') - call fuf#defineLaunchCommand('FufHelpWithCursorWord', s:MODE_NAME, 'expand('''')') + call fuf#defineLaunchCommand('FufHelp' , s:MODE_NAME, '""', []) + call fuf#defineLaunchCommand('FufHelpWithCursorWord', s:MODE_NAME, 'expand('''')', []) endfunction " }}}1 @@ -47,7 +51,7 @@ let s:MODE_NAME = expand(':t:r') " function s:getCurrentHelpTagFiles() - let prefix = 'doc' . fuf#getPathSeparator() + let prefix = 'doc' . l9#getPathSeparator() let tagFiles = split(globpath(&runtimepath, prefix . 'tags' ), "\n") \ + split(globpath(&runtimepath, prefix . 'tags-??'), "\n") return sort(map(tagFiles, 'fnamemodify(v:val, ":p")')) @@ -65,7 +69,7 @@ function s:parseHelpTagEntry(line, tagFile) else let suffix = '@' . suffix endif - let dir = fnamemodify(a:tagFile, ':h') . fuf#getPathSeparator() + let dir = fnamemodify(a:tagFile, ':h') . l9#getPathSeparator() return { \ 'word' : elements[0] . suffix, \ 'path' : dir . elements[1], @@ -75,30 +79,22 @@ endfunction " function s:getHelpTagEntries(tagFile) - let names = map(readfile(a:tagFile), 's:parseHelpTagEntry(v:val, a:tagFile)') + let names = map(l9#readFile(a:tagFile), 's:parseHelpTagEntry(v:val, a:tagFile)') return filter(names, '!empty(v:val)') endfunction " -function s:parseHelpTagFiles(tagFiles) - if !empty(g:fuf_help_cache_dir) - if !isdirectory(expand(g:fuf_help_cache_dir)) - call mkdir(expand(g:fuf_help_cache_dir), 'p') - endif - " NOTE: fnamemodify('a/b', ':p') returns 'a/b/' if the directory exists. - let cacheFile = fnamemodify(g:fuf_help_cache_dir, ':p') - \ . fuf#hash224(join(a:tagFiles, "\n")) - if filereadable(cacheFile) && fuf#countModifiedFiles(a:tagFiles, getftime(cacheFile)) == 0 - return map(readfile(cacheFile), 'eval(v:val)') - endif +function s:parseHelpTagFiles(tagFiles, key) + let cacheName = 'cache-' . l9#hash224(a:key) + let cacheTime = fuf#getDataFileTime(s:MODE_NAME, cacheName) + if cacheTime != -1 && fuf#countModifiedFiles(a:tagFiles, cacheTime) == 0 + return fuf#loadDataFile(s:MODE_NAME, cacheName) endif - let items = fuf#unique(fuf#concat(map(copy(a:tagFiles), 's:getHelpTagEntries(v:val)'))) + let items = l9#unique(l9#concat(map(copy(a:tagFiles), 's:getHelpTagEntries(v:val)'))) let items = map(items, 'extend(v:val, fuf#makeNonPathItem(v:val.word, ""))') call fuf#mapToSetSerialIndex(items, 1) let items = map(items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') - if !empty(g:fuf_help_cache_dir) - call writefile(map(copy(items), 'string(v:val)'), cacheFile) - endif + call fuf#saveDataFile(s:MODE_NAME, cacheName, items) return items endfunction @@ -107,11 +103,11 @@ function s:enumHelpTags(tagFiles) if !len(a:tagFiles) return [] endif - let key = join(a:tagFiles, "\n") + let key = join([g:fuf_ignoreCase] + a:tagFiles, "\n") if !exists('s:cache[key]') || fuf#countModifiedFiles(a:tagFiles, s:cache[key].time) let s:cache[key] = { \ 'time' : localtime(), - \ 'items' : s:parseHelpTagFiles(a:tagFiles) + \ 'items' : s:parseHelpTagFiles(a:tagFiles, key) \ } endif return s:cache[key].items @@ -143,7 +139,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_help_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_help_prompt, self.partialMatching, '') endfunction " @@ -152,8 +148,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/jumplist.vim b/autoload/fuf/jumplist.vim index 72876d9..ddbb1ab 100644 --- a/autoload/fuf/jumplist.vim +++ b/autoload/fuf/jumplist.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_jumplist') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_jumplist = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#jumplist#getSwitchOrder() return g:fuf_jumplist_switchOrder endfunction +" +function fuf#jumplist#getEditableDataNames() + return [] +endfunction + " function fuf#jumplist#renewCache() endfunction @@ -34,7 +38,7 @@ endfunction " function fuf#jumplist#onInit() - call fuf#defineLaunchCommand('FufJumpList', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufJumpList', s:MODE_NAME, '""', []) endfunction " }}}1 @@ -101,7 +105,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_jumplist_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_jumplist_prompt, self.partialMatching, '') endfunction " @@ -110,8 +114,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/line.vim b/autoload/fuf/line.vim index 166c629..60447b5 100644 --- a/autoload/fuf/line.vim +++ b/autoload/fuf/line.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_line') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_line = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#line#getSwitchOrder() return g:fuf_line_switchOrder endfunction +" +function fuf#line#getEditableDataNames() + return [] +endfunction + " function fuf#line#renewCache() endfunction @@ -34,7 +38,7 @@ endfunction " function fuf#line#onInit() - call fuf#defineLaunchCommand('FufLine', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufLine', s:MODE_NAME, '""', []) endfunction " }}}1 @@ -57,7 +61,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_line_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_line_prompt, self.partialMatching, '') endfunction " @@ -66,8 +70,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/mrucmd.vim b/autoload/fuf/mrucmd.vim index cb3ada3..58632ce 100644 --- a/autoload/fuf/mrucmd.vim +++ b/autoload/fuf/mrucmd.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_mrucmd') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_mrucmd = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#mrucmd#getSwitchOrder() return g:fuf_mrucmd_switchOrder endfunction +" +function fuf#mrucmd#getEditableDataNames() + return ['items'] +endfunction + " function fuf#mrucmd#renewCache() endfunction @@ -34,7 +38,7 @@ endfunction " function fuf#mrucmd#onInit() - call fuf#defineLaunchCommand('FufMruCmd', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufMruCmd', s:MODE_NAME, '""', []) endfunction " @@ -53,11 +57,11 @@ let s:MODE_NAME = expand(':t:r') " function s:updateInfo(cmd) - let info = fuf#loadInfoFile(s:MODE_NAME) - let info.data = fuf#updateMruList( - \ info.data, { 'word' : a:cmd, 'time' : localtime() }, + let items = fuf#loadDataFile(s:MODE_NAME, 'items') + let items = fuf#updateMruList( + \ items, { 'word' : a:cmd, 'time' : localtime() }, \ g:fuf_mrucmd_maxItem, g:fuf_mrucmd_exclude) - call fuf#saveInfoFile(s:MODE_NAME, info) + call fuf#saveDataFile(s:MODE_NAME, 'items', items) endfunction " }}}1 @@ -73,7 +77,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_mrucmd_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_mrucmd_prompt, self.partialMatching, '') endfunction " @@ -82,8 +86,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " @@ -115,7 +119,7 @@ endfunction " function s:handler.onModeEnterPost() - let self.items = copy(self.info.data) + let self.items = fuf#loadDataFile(s:MODE_NAME, 'items') 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)') diff --git a/autoload/fuf/mrufile.vim b/autoload/fuf/mrufile.vim index 9235f03..f90b9e3 100644 --- a/autoload/fuf/mrufile.vim +++ b/autoload/fuf/mrufile.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_mrufile') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_mrufile = 1 " }}}1 "============================================================================= @@ -23,9 +22,15 @@ function fuf#mrufile#getSwitchOrder() return g:fuf_mrufile_switchOrder endfunction +" +function fuf#mrufile#getEditableDataNames() + return ['items', 'itemdirs'] +endfunction + " function fuf#mrufile#renewCache() let s:cache = {} + let s:aroundCache = {} endfunction " @@ -35,11 +40,15 @@ endfunction " function fuf#mrufile#onInit() - call fuf#defineLaunchCommand('FufMruFile', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufMruFile', s:MODE_NAME, '""', []) + call fuf#defineLaunchCommand('FufMruFileInCwd', s:MODE_NAME, + \ '""', [['g:fuf_mrufile_underCwd', 1]]) + call l9#defineVariableDefault('g:fuf_mrufile_underCwd', 0) " private option + call l9#defineVariableDefault('g:fuf_mrufile_searchAroundLevel', -1) " private option augroup fuf#mrufile autocmd! - autocmd BufEnter * call s:updateInfo() - autocmd BufWritePost * call s:updateInfo() + autocmd BufEnter * call s:updateData() + autocmd BufWritePost * call s:updateData() augroup END endfunction @@ -48,18 +57,24 @@ endfunction " LOCAL FUNCTIONS/VARIABLES {{{1 let s:MODE_NAME = expand(':t:r') +let s:OPEN_TYPE_EXPAND = -1 " -function s:updateInfo() +function s:updateData() if !empty(&buftype) || !filereadable(expand('%')) return endif - let info = fuf#loadInfoFile(s:MODE_NAME) - let info.data = fuf#updateMruList( - \ info.data, { 'word' : expand('%:p'), 'time' : localtime() }, + let items = fuf#loadDataFile(s:MODE_NAME, 'items') + let items = fuf#updateMruList( + \ items, { 'word' : expand('%:p'), 'time' : localtime() }, \ g:fuf_mrufile_maxItem, g:fuf_mrufile_exclude) - call fuf#saveInfoFile(s:MODE_NAME, info) + call fuf#saveDataFile(s:MODE_NAME, 'items', items) call s:removeItemFromCache(expand('%:p')) + let itemDirs = fuf#loadDataFile(s:MODE_NAME, 'itemdirs') + let itemDirs = fuf#updateMruList( + \ itemDirs, { 'word' : expand('%:p:h') }, + \ g:fuf_mrufile_maxItemDir, g:fuf_mrufile_exclude) + call fuf#saveDataFile(s:MODE_NAME, 'itemdirs', itemDirs) endfunction " @@ -79,7 +94,7 @@ function s:formatItemUsingCache(item) if !exists('s:cache[a:item.word]') if filereadable(a:item.word) let s:cache[a:item.word] = fuf#makePathItem( - \ fnamemodify(a:item.word, ':~'), strftime(g:fuf_timeFormat, a:item.time), 0) + \ fnamemodify(a:item.word, ':p:~'), strftime(g:fuf_timeFormat, a:item.time), 0) else let s:cache[a:item.word] = {} endif @@ -87,6 +102,41 @@ function s:formatItemUsingCache(item) return s:cache[a:item.word] endfunction +" +function s:expandSearchDir(dir, level) + let dirs = [a:dir] + let dirPrev = a:dir + for i in range(a:level) + let dirPrev = l9#concatPaths([dirPrev, '*']) + call add(dirs, dirPrev) + endfor + let dirPrev = a:dir + for i in range(a:level) + let dirPrevPrev = dirPrev + let dirPrev = fnamemodify(dirPrev, ':h') + if dirPrevPrev ==# dirPrev + break + endif + call add(dirs, dirPrev) + endfor + return dirs +endfunction + +" +function s:listAroundFiles(dir) + if !exists('s:aroundCache[a:dir]') + let s:aroundCache[a:dir] = [a:dir] + + \ fuf#glob(l9#concatPaths([a:dir, '*' ])) + + \ fuf#glob(l9#concatPaths([a:dir, '.*'])) + call filter(s:aroundCache[a:dir], 'filereadable(v:val)') + call map(s:aroundCache[a:dir], 'fuf#makePathItem(fnamemodify(v:val, ":~"), "", 0)') + if len(g:fuf_mrufile_exclude) + call filter(s:aroundCache[a:dir], 'v:val.word !~ g:fuf_mrufile_exclude') + endif + endif + return s:aroundCache[a:dir] +endfunction + " }}}1 "============================================================================= " s:handler {{{1 @@ -100,7 +150,10 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_mrufile_prompt, self.partialMatching) + let cwdString = (g:fuf_mrufile_underCwd ? '[CWD]' : '') + let levelString = (g:fuf_mrufile_searchAroundLevel < 0 ? '' + \ : '[Around:' . g:fuf_mrufile_searchAroundLevel . ']') + return fuf#formatPrompt(g:fuf_mrufile_prompt, self.partialMatching, cwdString . levelString) endfunction " @@ -109,7 +162,7 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() +function s:handler.isOpenable(enteredPattern) return 1 endfunction @@ -131,7 +184,14 @@ endfunction " function s:handler.onOpen(word, mode) - call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) + if a:mode ==# s:OPEN_TYPE_EXPAND + let nextLevel = (self.searchAroundLevel < 0 ? 0 : self.searchAroundLevel + 1) + call fuf#setOneTimeVariables(['g:fuf_mrufile_searchAroundLevel', nextLevel]) + let self.reservedMode = self.getModeName() + return + else + call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) + endif endfunction " @@ -140,11 +200,29 @@ endfunction " function s:handler.onModeEnterPost() - let self.items = copy(self.info.data) - let self.items = map(self.items, 's:formatItemUsingCache(v:val)') - let self.items = filter(self.items, '!empty(v:val) && bufnr("^" . v:val.word . "$") != self.bufNrPrev') - let self.items = fuf#mapToSetSerialIndex(self.items, 1) - let self.items = fuf#mapToSetAbbrWithSnippedWordAsPath(self.items) + let self.searchAroundLevel = g:fuf_mrufile_searchAroundLevel + call fuf#defineKeyMappingInHandler(g:fuf_mrufile_keyExpand, + \ 'onCr(' . s:OPEN_TYPE_EXPAND . ')') + if self.searchAroundLevel < 0 + let self.items = fuf#loadDataFile(s:MODE_NAME, 'items') + call map(self.items, 's:formatItemUsingCache(v:val)') + else + let self.items = fuf#loadDataFile(s:MODE_NAME, 'itemdirs') + call map(self.items, 's:expandSearchDir(v:val.word, g:fuf_mrufile_searchAroundLevel)') + let self.items = l9#concat(self.items) + let self.items = l9#unique(self.items) + call map(self.items, 's:listAroundFiles(v:val)') + let self.items = l9#concat(self.items) + endif + " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$') + let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':p:~') + call filter(self.items, '!empty(v:val) && v:val.word !=# bufNamePrev') + if g:fuf_mrufile_underCwd + let cwd = fnamemodify(getcwd(), ':p:~') + call filter(self.items, 'stridx(v:val.word, cwd) == 0') + endif + call fuf#mapToSetSerialIndex(self.items, 1) + call fuf#mapToSetAbbrWithSnippedWordAsPath(self.items) endfunction " diff --git a/autoload/fuf/quickfix.vim b/autoload/fuf/quickfix.vim index 1bb4b64..dd5d67c 100644 --- a/autoload/fuf/quickfix.vim +++ b/autoload/fuf/quickfix.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_quickfix') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_quickfix = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#quickfix#getSwitchOrder() return g:fuf_quickfix_switchOrder endfunction +" +function fuf#quickfix#getEditableDataNames() + return [] +endfunction + " function fuf#quickfix#renewCache() endfunction @@ -34,7 +38,7 @@ endfunction " function fuf#quickfix#onInit() - call fuf#defineLaunchCommand('FufQuickfix', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufQuickfix', s:MODE_NAME, '""', []) endfunction " }}}1 @@ -83,7 +87,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_quickfix_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_quickfix_prompt, self.partialMatching, '') endfunction " @@ -92,8 +96,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/tag.vim b/autoload/fuf/tag.vim index bf566f0..362cabf 100644 --- a/autoload/fuf/tag.vim +++ b/autoload/fuf/tag.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_tag') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_tag = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#tag#getSwitchOrder() return g:fuf_tag_switchOrder endfunction +" +function fuf#tag#getEditableDataNames() + return [] +endfunction + " function fuf#tag#renewCache() let s:cache = {} @@ -35,8 +39,8 @@ endfunction " function fuf#tag#onInit() - call fuf#defineLaunchCommand('FufTag' , s:MODE_NAME, '""') - call fuf#defineLaunchCommand('FufTagWithCursorWord', s:MODE_NAME, 'expand('''')') + call fuf#defineLaunchCommand('FufTag' , s:MODE_NAME, '""', []) + call fuf#defineLaunchCommand('FufTagWithCursorWord', s:MODE_NAME, 'expand('''')', []) endfunction " }}}1 @@ -47,30 +51,22 @@ let s:MODE_NAME = expand(':t:r') " function s:getTagNames(tagFile) - let names = map(readfile(a:tagFile), 'matchstr(v:val, ''^[^!\t][^\t]*'')') + let names = map(l9#readFile(a:tagFile), 'matchstr(v:val, ''^[^!\t][^\t]*'')') return filter(names, 'v:val =~# ''\S''') endfunction " -function s:parseTagFiles(tagFiles) - if !empty(g:fuf_tag_cache_dir) - if !isdirectory(expand(g:fuf_tag_cache_dir)) - call mkdir(expand(g:fuf_tag_cache_dir), 'p') - endif - " NOTE: fnamemodify('a/b', ':p') returns 'a/b/' if the directory exists. - let cacheFile = fnamemodify(g:fuf_tag_cache_dir, ':p') - \ . fuf#hash224(join(a:tagFiles, "\n")) - if filereadable(cacheFile) && fuf#countModifiedFiles(a:tagFiles, getftime(cacheFile)) == 0 - return map(readfile(cacheFile), 'eval(v:val)') - endif +function s:parseTagFiles(tagFiles, key) + let cacheName = 'cache-' . l9#hash224(a:key) + let cacheTime = fuf#getDataFileTime(s:MODE_NAME, cacheName) + if cacheTime != -1 && fuf#countModifiedFiles(a:tagFiles, cacheTime) == 0 + return fuf#loadDataFile(s:MODE_NAME, cacheName) endif - let items = fuf#unique(fuf#concat(map(copy(a:tagFiles), 's:getTagNames(v:val)'))) + let items = l9#unique(l9#concat(map(copy(a:tagFiles), 's:getTagNames(v:val)'))) let items = map(items, 'fuf#makeNonPathItem(v:val, "")') call fuf#mapToSetSerialIndex(items, 1) let items = map(items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') - if !empty(g:fuf_tag_cache_dir) - call writefile(map(copy(items), 'string(v:val)'), cacheFile) - endif + call fuf#saveDataFile(s:MODE_NAME, cacheName, items) return items endfunction @@ -79,11 +75,11 @@ function s:enumTags(tagFiles) if !len(a:tagFiles) return [] endif - let key = join(a:tagFiles, "\n") + let key = join([g:fuf_ignoreCase] + a:tagFiles, "\n") if !exists('s:cache[key]') || fuf#countModifiedFiles(a:tagFiles, s:cache[key].time) let s:cache[key] = { \ 'time' : localtime(), - \ 'items' : s:parseTagFiles(a:tagFiles) + \ 'items' : s:parseTagFiles(a:tagFiles, key) \ } endif return s:cache[key].items @@ -119,7 +115,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_tag_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_tag_prompt, self.partialMatching, '') endfunction " @@ -128,8 +124,8 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() - return 0 +function s:handler.isOpenable(enteredPattern) + return 1 endfunction " diff --git a/autoload/fuf/taggedfile.vim b/autoload/fuf/taggedfile.vim index 30a79b1..74652fc 100644 --- a/autoload/fuf/taggedfile.vim +++ b/autoload/fuf/taggedfile.vim @@ -1,13 +1,12 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_autoload_fuf_taggedfile') || v:version < 702 +if !l9#guardScriptLoading(expand(':p'), 0, 0, []) finish endif -let g:loaded_autoload_fuf_taggedfile = 1 " }}}1 "============================================================================= @@ -23,6 +22,11 @@ function fuf#taggedfile#getSwitchOrder() return g:fuf_taggedfile_switchOrder endfunction +" +function fuf#taggedfile#getEditableDataNames() + return [] +endfunction + " function fuf#taggedfile#renewCache() let s:cache = {} @@ -35,7 +39,7 @@ endfunction " function fuf#taggedfile#onInit() - call fuf#defineLaunchCommand('FufTaggedFile', s:MODE_NAME, '""') + call fuf#defineLaunchCommand('FufTaggedFile', s:MODE_NAME, '""', []) endfunction " }}}1 @@ -47,33 +51,25 @@ let s:MODE_NAME = expand(':t:r') " function s:getTaggedFileList(tagfile) execute 'cd ' . fnamemodify(a:tagfile, ':h') - let result = map(readfile(a:tagfile), 'matchstr(v:val, ''^[^!\t][^\t]*\t\zs[^\t]\+'')') - call map(readfile(a:tagfile), 'fnamemodify(v:val, ":p")') + let result = map(l9#readFile(a:tagfile), 'matchstr(v:val, ''^[^!\t][^\t]*\t\zs[^\t]\+'')') + call map(l9#readFile(a:tagfile), 'fnamemodify(v:val, ":p")') cd - - call map(readfile(a:tagfile), 'fnamemodify(v:val, ":~:.")') + call map(l9#readFile(a:tagfile), 'fnamemodify(v:val, ":~:.")') return filter(result, 'v:val =~# ''[^/\\ ]$''') endfunction " -function s:parseTagFiles(tagFiles) - if !empty(g:fuf_taggedfile_cache_dir) - if !isdirectory(expand(g:fuf_taggedfile_cache_dir)) - call mkdir(expand(g:fuf_taggedfile_cache_dir), 'p') - endif - " NOTE: fnamemodify('a/b', ':p') returns 'a/b/' if the directory exists. - let cacheFile = fnamemodify(g:fuf_taggedfile_cache_dir, ':p') - \ . fuf#hash224(join(a:tagFiles, "\n")) - if filereadable(cacheFile) && fuf#countModifiedFiles(a:tagFiles, getftime(cacheFile)) == 0 - return map(readfile(cacheFile), 'eval(v:val)') - endif +function s:parseTagFiles(tagFiles, key) + let cacheName = 'cache-' . l9#hash224(a:key) + let cacheTime = fuf#getDataFileTime(s:MODE_NAME, cacheName) + if cacheTime != -1 && fuf#countModifiedFiles(a:tagFiles, cacheTime) == 0 + return fuf#loadDataFile(s:MODE_NAME, cacheName) endif - let items = fuf#unique(fuf#concat(map(copy(a:tagFiles), 's:getTaggedFileList(v:val)'))) + let items = l9#unique(l9#concat(map(copy(a:tagFiles), 's:getTaggedFileList(v:val)'))) call map(items, 'fuf#makePathItem(v:val, "", 0)') call fuf#mapToSetSerialIndex(items, 1) call fuf#mapToSetAbbrWithSnippedWordAsPath(items) - if !empty(g:fuf_taggedfile_cache_dir) - call writefile(map(copy(items), 'string(v:val)'), cacheFile) - endif + call fuf#saveDataFile(s:MODE_NAME, cacheName, items) return items endfunction @@ -82,11 +78,11 @@ function s:enumTaggedFiles(tagFiles) if !len(a:tagFiles) return [] endif - let key = join([getcwd()] + a:tagFiles, "\n") + let key = join([getcwd(), g:fuf_ignoreCase] + a:tagFiles, "\n") if !exists('s:cache[key]') || fuf#countModifiedFiles(a:tagFiles, s:cache[key].time) let s:cache[key] = { \ 'time' : localtime(), - \ 'items' : s:parseTagFiles(a:tagFiles) + \ 'items' : s:parseTagFiles(a:tagFiles, key) \ } endif return s:cache[key].items @@ -105,7 +101,7 @@ endfunction " function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_taggedfile_prompt, self.partialMatching) + return fuf#formatPrompt(g:fuf_taggedfile_prompt, self.partialMatching, '') endfunction " @@ -114,7 +110,7 @@ function s:handler.getPreviewHeight() endfunction " -function s:handler.targetsPath() +function s:handler.isOpenable(enteredPattern) return 1 endfunction @@ -146,11 +142,12 @@ endfunction " function s:handler.onModeEnterPost() + " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$') + let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':p:~:.') " NOTE: Don't do this in onModeEnterPre() " because that should return in a short time. - let self.items = - \ filter(copy(s:enumTaggedFiles(self.tagFiles)), - \ 'bufnr("^" . v:val.word . "$") != self.bufNrPrev') + let self.items = copy(s:enumTaggedFiles(self.tagFiles)) + call filter(self.items, 'v:val.word !=# bufNamePrev') endfunction " diff --git a/doc/fuf.txt b/doc/fuf.txt index d6d64c0..2e36831 100644 --- a/doc/fuf.txt +++ b/doc/fuf.txt @@ -1,6 +1,6 @@ *fuf.txt* buffer/file/command/tag/etc explorer with fuzzy matching. - Copyright (c) 2007-2009 Takeshi NISHIDA + Copyright (c) 2007-2010 Takeshi NISHIDA FuzzyFinder *fuzzyfinder* *fuf* @@ -38,7 +38,7 @@ You will be happy when: "./OhLongLongLongLongLongFile.txt" "./OhLongLongLongLongLongName.txt" <- you want :O -Type "ON" and "OhLongLongLongLongLongName.txt" will be select. :D +Type "ON" and "OhLongLongLongLongLongName.txt" will be selected. :D FuzzyFinder can search: @@ -46,8 +46,10 @@ FuzzyFinder can search: - files - directories - most recently used files + - files around most recently used files - most recently used command-lines - - bookmarks + - bookmarked files + - bookmarked directories - tags - files which are included in current tagfiles - jump list @@ -71,36 +73,43 @@ it to your runtime directory. You should place the files as follows: > /plugin/fuf.vim - /autoload/fuf.vim - /autoload/fuf/buffer.vim + /doc/fuf.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. +If you are disgusted to make your runtime directory confused with a lot of +plugins, put each of the plugins into a directory individually and just add +the directory path to 'runtimepath'. It's easy to uninstall plugins. -And then update your help tags files to enable fuzzyfinder help. See +Then update your help tags files to enable help for this plugin. See |add-local-help| for details. +Requirements: ~ + +- L9 library (vimscript #3252) + + ============================================================================== USAGE *fuf-usage* -You can launch FuzzyFinder by following commands: +You can launch FuzzyFinder by the following commands: Command Mode ~ - |:FufBuffer| - Buffer mode (|fuf-buffer-mode|) - |:FufFile| - File mode (|fuf-file-mode|) - |:FufDir| - Directory mode (|fuf-dir-mode|) - |:FufMruFile| - MRU-File mode (|fuf-mrufile-mode|) - |:FufMruCmd| - MRU-Command mode (|fuf-mrucmd-mode|) - |:FufBookmark| - Bookmark mode (|fuf-bookmark-mode|) - |:FufTag| - Tag mode (|fuf-tag-mode|) - |:FufTaggedFile| - Tagged-File mode (|fuf-taggedfile-mode|) - |:FufJumpList| - Jump-List mode (|fuf-jumplist-mode|) - |:FufChangeList| - Change-List mode (|fuf-changelist-mode|) - |:FufQuickfix| - Quickfix mode (|fuf-quickfix-mode|) - |:FufLine| - Line mode (|fuf-line-mode|) - |:FufHelp| - Help mode (|fuf-help-mode|) + |:FufBuffer| - Buffer mode (|fuf-buffer-mode|) + |:FufFile| - File mode (|fuf-file-mode|) + |:FufCoverageFile| - Coverage-File mode (|fuf-coveragefile-mode|) + |:FufDir| - Directory mode (|fuf-dir-mode|) + |:FufMruFile| - MRU-File mode (|fuf-mrufile-mode|) + |:FufMruCmd| - MRU-Command mode (|fuf-mrucmd-mode|) + |:FufBookmarkFile| - Bookmark-File mode (|fuf-bookmarkfile-mode|) + |:FufBookmarkDir| - Bookmark-Dir mode (|fuf-bookmarkdir-mode|) + |:FufTag| - Tag mode (|fuf-tag-mode|) + |:FufBufferTag| - Buffer-Tag mode (|fuf-buffertag-mode|) + |:FufTaggedFile| - Tagged-File mode (|fuf-taggedfile-mode|) + |:FufJumpList| - Jump-List mode (|fuf-jumplist-mode|) + |:FufChangeList| - Change-List mode (|fuf-changelist-mode|) + |:FufQuickfix| - Quickfix mode (|fuf-quickfix-mode|) + |:FufLine| - Line mode (|fuf-line-mode|) + |:FufHelp| - Help mode (|fuf-help-mode|) It is recommended to map these commands. @@ -117,6 +126,9 @@ highlights the pattern with "Error" group. The first item in the completion menu will be selected automatically. +Typing deletes one block of an entered pattern before the cursor, like a +directory name. + with (|g:fuf_keyPrevPattern|) and (|g:fuf_keyNextPattern|), You can recall patterns which have been entered before from history. @@ -136,9 +148,10 @@ With (|g:fuf_keyNextMode|) and (|g:fuf_keyPrevMode|), You can switch current mode without leaving Insert mode . You can preview selected item with (|g:fuf_keyPreview|) in some modes. -Repeating the key on the same item might show another information. The height +Repeating the key on the same item shows another information. The height of command-line area is changed to |g:fuf_previewHeight| when you launch a -mode supporting preview. +mode supporting preview. This feature is available when |g:fuf_previewHeight| +is not 0. ============================================================================== @@ -150,43 +163,79 @@ Buffer mode ~ This mode provides an interface to select a buffer from a list of existing buffers and open it. +Press (|g:fuf_buffer_keyDelete|) in this mode and selected buffer will +be deleted. + *fuf-file-mode* File mode ~ -This mode provides an interface to search a file and open it. +This mode provides an interface to search a file tree for a file and open it. + + *fuf-coveragefile-mode* +Coverage-File mode ~ + +This mode provides an interface to select a file from all files of a preset +coverage and open it. + +By default, This mode lists all files under the current working directory +recursively. (|g:fuf_coveragefile_globPatterns|) + +If you want to search other coverage, execute |FufCoverageFileRegister| +command to register new search coverage and |FufCoverageFileChange| command to +choose a search coverage and launch Coverage-File mode. + +In addition, there is another way to change a search coverage with +|fuf#setOneTimeVariables()| function. + +Example: search only .h and .c files: +> + call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', ['**/*.h', '**/*.c']]) + \ | FufCoverageFile +< +Example: search your home directory in addition to the default coverage: +> + call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', g:fuf_coveragefile_globPatterns + ['~/**/.*', '~/**/*']]) + \ | FufCoverageFile +< *fuf-dir-mode* Directory mode ~ -This mode provides an interface to search a directory and change the current -directory. +This mode provides an interface to search a file tree for a directory and +change the current directory. *fuf-mrufile-mode* MRU-File mode ~ -This mode provides an interface to select a file from most recently used files -and open it. +This mode provides an interface to select a file from the most recently used +files and open it. -This mode is set to disable in |g:fuf_modesDisable| by default because +Press (|g:fuf_mrufile_keyExpand|) in this mode and files around the most +recently used files are listed. Each time the key is pressed, the search range +are expanded one level along the directory tree upwardly/downwardly. + +This mode is set to disable by default (|g:fuf_modesDisable|) because processes for this mode in |BufEnter| and |BufWritePost| could cause Performance issue. +See also: |FufMruFileInCwd| + *fuf-mrucmd-mode* MRU-Command mode ~ -This mode provides an interface to select a command from most recently used -commands and execute it. +This mode provides an interface to select a command from the most recently +used commands and execute it. -This mode is set to disable in |g:fuf_modesDisable| by default because mapping +This mode is set to disable by default (|g:fuf_modesDisable|) because mapping of Command-line mode required by this mode has side effects. - *fuf-bookmark-mode* -Bookmark mode ~ + *fuf-bookmarkfile-mode* +Bookmark-File mode ~ This mode provides an interface to select one of the bookmarks you have added beforehand and jump there. -You can add a cursor line to bookmarks by |:FufAddBookmark| command. +You can add a cursor line to bookmarks by |:FufBookmarkFileAdd| command. Execute that command and you will be prompted to enter a bookmark name. FuzzyFinder adjusts a line number for jump. If a line of bookmarked position @@ -194,22 +243,58 @@ does not match to a pattern when the bookmark was added, FuzzyFinder searches a matching line around bookmarked position. So you can jump to a bookmarked line even if the line is out of bookmarked position. If you want to jump to bookmarked line number without the adjustment, set -|g:fuf_bookmark_searchRange| option to 0. +|g:fuf_bookmarkfile_searchRange| option to 0. -Press (|g:fuf_bookmark_keyDelete|) in Bookmark mode and selected +Press (|g:fuf_bookmarkfile_keyDelete|) in this mode and selected bookmark will be deleted. + *fuf-bookmarkdir-mode* +Bookmark-Dir mode ~ + +This mode provides an interface to select one of the bookmarks you have added +beforehand and change the current directory. + +You can add a directory to bookmarks by |:FufBookmarkDirAdd| command. Execute +that command and you will be prompted to enter a directory path and a +bookmark name. + +Press (|g:fuf_bookmarkdir_keyDelete|) in this mode and selected bookmark +will be deleted. + *fuf-tag-mode* Tag mode ~ This mode provides an interface to select a tag and jump to the definition of it. -Following mapping is the replacement for : +Following mapping is a replacement for : > noremap :FufTagWithCursorWord! < + *fuf-buffertag-mode* +Buffer-Tag mode ~ + +This mode provides an interface to select a tag of current buffer or all +buffers and jump to the definition of it. + +Tag list is instantly created when FuzzyFinder is launched, so there is no +need to make tags file in advance. + +|FufBufferTag| covers current buffer and |FufBufferTagAll| covers all buffers. + +Following mapping is a replacement for : +> + nnoremap :FufBufferTagWithCursorWord! + vnoremap :FufBufferTagAllWithSelectedText! +< +or +> + nnoremap :FufBufferTagAllWithCursorWord! + vnoremap :FufBufferTagAllWithSelectedText! +< +This mode is inspired by taglist.vim (vimscript #273) and refered its codes. + *fuf-taggedfile-mode* Tagged-File mode ~ @@ -421,6 +506,19 @@ Example of use: ============================================================================== DETAILED TOPICS *fuf-detailed-topics* + *fuf-setting-one-time-option* *fuf#setOneTimeVariables()* +Setting One-Time Options ~ + +If you want to set one-time options only for the next FuzzyFinder, +|fuf#setOneTimeVariables()| function will be of help. This function is used as +follows: +> + call fuf#setOneTimeVariables(['g:fuf_ignoreCase', 0], ['&lines', 50]) +< +This function takes 0 or more arguments and each of them is a pair of a +variable name and its value. Specified options will be set practically next +time FuzzyFinder is launched, and restored when FuzzyFinder is closed. + *fuf-search-patterns* Search Patterns ~ @@ -437,8 +535,8 @@ A refining pattern is used to narrow down the list of matching items by another pattern. With a primary pattern, FuzzyFinder does fuzzy matching or partial matching, -which you specified. With a refining pattern, FuzzyFinder always does partial -matching. +which you specified. With a refining pattern, FuzzyFinder does partial +matching by default. (|g:fuf_fuzzyRefining|) When you enter a number as refining pattern, it also can match the index of each item. @@ -520,7 +618,7 @@ For example, set as below: \ ], \ } < -and enter "doc:txt" in File mode, then FuzzyFinder searches by following +and enter "doc:txt" in File mode, then FuzzyFinder searches by the following patterns: "~/project/**/doc/*t*x*t*" @@ -528,15 +626,15 @@ patterns: and show concatenated search results. - *fuf-information-file* -Information File ~ + *fuf-data-file* +Data File ~ -FuzzyFinder writes completion statistics, MRU data, bookmark, etc to -|g:fuf_infoFile|. +FuzzyFinder writes completion statistics, MRU data, bookmark, etc to files +under |g:fuf_dataDir|. -|:FufEditInfo| command is helpful in editing your information file. -This command reads the information file in new unnamed buffer. Write the -buffer and the information file will be updated. +|:FufEditDataFile| command is helpful in editing your data files. This command +reads the data file in new unnamed buffer. Write the buffer and the data file +will be updated. *fuf-cache* Cache ~ @@ -555,6 +653,12 @@ after a path separator is expanded to "../" sequence. /... /../../ /.... /../../../ + *fuf-how-to-add-mode* +How To Add Mode ~ + +To add "mymode" mode, put the source file at autoload/fuf/mymode.vim and call +fuf#addMode("mymode") . + *fuf-migemo* What Is Migemo ~ @@ -594,6 +698,15 @@ See also: |fuf-vimrc-example| Is mostly the same as |:FufFile|, except that initial pattern is a path of directory current buffer is in. + *:FufCoverageFile* +:FufCoverageFile[!] [{pattern}] + Launchs Coverage-File mode. + + If a command was executed with a ! modifier, it does partial matching + instead of fuzzy matching. + + {pattern} will be inserted after launching FuzzyFinder. + *:FufDir* :FufDir[!] [{pattern}] Launchs Directory mode. @@ -622,6 +735,11 @@ See also: |fuf-vimrc-example| {pattern} will be inserted after launching FuzzyFinder. + *:FufMruFileInCwd* +:FufMruFileInCwd[!] [{pattern}] + Is mostly the same as |:FufMruFile|, except that files + only in current working directory are listed. + *:FufMruCmd* :FufMruCmd[!] [{pattern}] Launchs MRU-Command mode. @@ -631,9 +749,18 @@ See also: |fuf-vimrc-example| {pattern} will be inserted after launching FuzzyFinder. - *:FufBookmark* -:FufBookmark[!] [{pattern}] - Launchs Bookmark mode. + *:FufBookmarkFile* +:FufBookmarkFile[!] [{pattern}] + Launchs Bookmark-File mode. + + If a command was executed with a ! modifier, it does partial matching + instead of fuzzy matching. + + {pattern} will be inserted after launching FuzzyFinder. + + *:FufBookmarkDir* +:FufBookmarkDir[!] [{pattern}] + Launchs Bookmark-Dir mode. If a command was executed with a ! modifier, it does partial matching instead of fuzzy matching. @@ -651,7 +778,42 @@ See also: |fuf-vimrc-example| *:FufTagWithCursorWord* :FufTagWithCursorWord[!] [{pattern}] - Is mostly the same as |:FufTag|, except that + Is mostly the same as |:FufTag|, except that initial pattern is the + word under the cursor. + + *:FufBufferTag* +:FufBufferTag[!] [{pattern}] + Launchs Buffer-Tag mode. + + If a command was executed with a ! modifier, it does partial matching + instead of fuzzy matching. + + {pattern} will be inserted after launching FuzzyFinder. + + *:FufBufferTagAll* +:FufBufferTagAll[!] [{pattern}] + Is mostly the same as |:FufBufferTag|, except that tags are gathered + from all other buffers in addition to the current one. + + *:FufBufferTagWithCursorWord* +:FufBufferTagWithCursorWord[!] [{pattern}] + Is mostly the same as |:FufBufferTag|, except that initial pattern is + the word under the cursor. + + *:FufBufferTagAllWithCursorWord* +:FufBufferTagAllWithCursorWord[!] [{pattern}] + Is mostly the same as |:FufBufferTagAll|, except that initial pattern + is the word under the cursor. + + *:FufBufferTagWithSelectedText* +:FufBufferTagWithSelectedText[!] [{pattern}] + Is mostly the same as |:FufBufferTag|, except that initial pattern is + the last selected text. + + *:FufBufferTagAllWithSelectedText* +:FufBufferTagAllWithSelectedText[!] [{pattern}] + Is mostly the same as |:FufBufferTagAll|, except that initial pattern + is the last selected text. *:FufTaggedFile* :FufTaggedFile[!] [{pattern}] @@ -707,20 +869,44 @@ See also: |fuf-vimrc-example| {pattern} will be inserted after launching FuzzyFinder. - *:FufEditInfo* -:FufEditInfo - Opens a buffer for editing your information file. See - |fuf-information-file| for details. - - *:FufAddBookmark* -:FufAddBookmark [{name}] - Adds a cursor line to bookmarks. See |fuf-adding-bookmark| for + *:FufEditDataFile* +:FufEditDataFile + Opens a buffer for editing your data files. See |fuf-data-file| for details. - *:FufAddBookmarkAsSelectedText* -:FufAddBookmarkAsSelectedText - Is mostly the same as |:FufAddBookmark|, except that initial pattern - is last selected one. + *:FufCoverageFileRegister* +:FufCoverageFileRegister + Registers new search coverage to be searched in Coverage-File mode. + First, input glob patterns, like ~/* . You can add patterns unless + typing . Next, input coverage name. + + See also: |glob()|, |fuf-coveragefile-mode| + + *:FufCoverageFileChange* +:FufCoverageFileChange [{name}] + Launchs Coverage-File mode with a chosen coverage, registered with + |FufCoverageFileRegister| command. + + If location name is given, the choise process will be skipped. + + See also: |fuf-coveragefile-mode| + + *:FufBookmarkFileAdd* +:FufBookmarkFileAdd [{name}] + Adds a cursor line to bookmarks. + + See also: |fuf-bookmarkfile-mode| + + *:FufBookmarkFileAddAsSelectedText* +:FufBookmarkFileAddAsSelectedText + Is mostly the same as |:FufBookmarkFileAdd|, except that initial + pattern is the last selected one. + + *:FufBookmarkDirAdd* +:FufBookmarkDirAdd [{name}] + Adds a directory to bookmarks. + + See also: |fuf-bookmarkdir-mode| *:FufRenewCache* :FufRenewCache @@ -799,11 +985,11 @@ For All Modes ~ < Key mapped to switch between fuzzy matching and partial matching. - *g:fuf_infoFile* > - let g:fuf_infoFile = '~/.vim-fuf' + *g:fuf_dataDir* > + let g:fuf_dataDir = '~/.vim-fuf-data' < - Filename to write completion statistics, MRU data, bookmark, etc. If - empty string, FuzzyFinder does not write to a file. + Directory path to which data files is put. If empty string, + FuzzyFinder does not write data files. *g:fuf_abbrevMap* > let g:fuf_abbrevMap = {} @@ -835,12 +1021,13 @@ For All Modes ~ See also: |fuf-search-patterns| - *g:fuf_smartBs* > - let g:fuf_smartBs = 1 + *g:fuf_fuzzyRefining* > + let g:fuf_fuzzyRefining = 0 < - If non-zero, pressing after a path separator deletes one - directory name and pressing after |g:fuf_patternSeparator| - deletes one pattern. + If non-zero, fuzzy matching is done with refining pattern instead of + partial matching. + + See also: |fuf-search-patterns| *g:fuf_reuseWindow* > let g:fuf_reuseWindow = 1 @@ -871,12 +1058,17 @@ For All Modes ~ completion menu. *g:fuf_previewHeight* > - let g:fuf_previewHeight = 5 + let g:fuf_previewHeight = 0 < 'cmdheight' is set to this when a mode supporting preview is launched. Information of selected completion item will be shown on command-line area. If zero, preview feature is disabled. + *g:fuf_autoPreview* > + let g:fuf_autoPreview = 0 +< + If non-zero, previews will be shown automatically. + *g:fuf_useMigemo* > let g:fuf_useMigemo = 0 < @@ -901,6 +1093,11 @@ For Buffer Mode ~ < If non-zero, completion items is sorted in order of recently used. + *g:fuf_buffer_keyDelete* > + let g:fuf_buffer_keyDelete = '' +< + Key mapped to delete selected buffer. + *fuf-options-for-file-mode* For File Mode ~ @@ -916,11 +1113,38 @@ For File Mode ~ number, Fuzzyfinder never switches to this mode. *g:fuf_file_exclude* > - let g:fuf_file_exclude = '\v\~$|\.(o|exe|dll|bak|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])' + let g:fuf_file_exclude = '\v\~$|\.(o|exe|dll|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])' < Regexp pattern for items which you want to exclude from completion list. + *fuf-options-for-coveragefile-mode* +For Coverage-File Mode ~ + + *g:fuf_coveragefile_prompt* > + let g:fuf_coveragefile_prompt = '>CoverageFile[]>' +< + Prompt string. "[]" will be substituted with indicators. + + *g:fuf_coveragefile_switchOrder* > + let g:fuf_coveragefile_switchOrder = 30 +< + Number of order for switching to the next/previous mode. If negative + number, Fuzzyfinder never switches to this mode. + + *g:fuf_coveragefile_exclude* > + let g:fuf_coveragefile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|swp)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])' +< + Regexp pattern for items which you want to exclude from completion + list. + + *g:fuf_coveragefile_globPatterns* > + let g:fuf_coveragefile_globPatterns = ['**/.*', '**/*'] +< + List of glob patterns to get file paths to be searched. + + See also: |glob()| + *fuf-options-for-dir-mode* For Directory Mode ~ @@ -930,7 +1154,7 @@ For Directory Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_dir_switchOrder* > - let g:fuf_dir_switchOrder = 30 + let g:fuf_dir_switchOrder = 40 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. @@ -942,21 +1166,21 @@ For Directory Mode ~ list. *fuf-options-for-mrufile-mode* -For Mru-File Mode ~ +For MRU-File Mode ~ *g:fuf_mrufile_prompt* > - let g:fuf_mrufile_prompt = '>Mru-File[]>' + let g:fuf_mrufile_prompt = '>MRU-File[]>' < Prompt string. "[]" will be substituted with indicators. *g:fuf_mrufile_switchOrder* > - let g:fuf_mrufile_switchOrder = 40 + let g:fuf_mrufile_switchOrder = 50 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. *g:fuf_mrufile_exclude* > - let g:fuf_mrufile_exclude = '\v\~$|\.(bak|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)' + let g:fuf_mrufile_exclude = '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)' < Regexp pattern for items which you want to exclude from completion list. @@ -966,16 +1190,27 @@ For Mru-File Mode ~ < Ceiling for the number of MRU items to be stored. + *g:fuf_mrufile_maxItemDir* > + let g:fuf_mrufile_maxItemDir = 50 +< + Ceiling for the number of parent directories of MRU items to be + stored, which are used for around search. + + *g:fuf_mrufile_keyExpand* > + let g:fuf_mrufile_keyExpand = '' +< + Key mapped to expand search range. + *fuf-options-for-mrucmd-mode* -For Mru-Cmd Mode ~ +For MRU-Cmd Mode ~ *g:fuf_mrucmd_prompt* > - let g:fuf_mrucmd_prompt = '>Mru-Cmd[]>' + let g:fuf_mrucmd_prompt = '>MRU-Cmd[]>' < Prompt string. "[]" will be substituted with indicators. *g:fuf_mrucmd_switchOrder* > - let g:fuf_mrucmd_switchOrder = 50 + let g:fuf_mrucmd_switchOrder = 60 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. @@ -991,28 +1226,47 @@ For Mru-Cmd Mode ~ < This is the ceiling for the number of MRU items to be stored. - *fuf-options-for-Bookmark-mode* -For Bookmark Mode ~ + *fuf-options-for-bookmarkfile-mode* +For Bookmark-File Mode ~ - *g:fuf_bookmark_prompt* > - let g:fuf_bookmark_prompt = '>Bookmark[]>' + *g:fuf_bookmarkfile_prompt* > + let g:fuf_bookmarkfile_prompt = '>BookmarkFile[]>' < Prompt string. "[]" will be substituted with indicators. - *g:fuf_bookmark_switchOrder* > - let g:fuf_bookmark_switchOrder = 60 + *g:fuf_bookmarkfile_switchOrder* > + let g:fuf_bookmarkfile_switchOrder = 70 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. - *g:fuf_bookmark_searchRange* > - let g:fuf_bookmark_searchRange = 400 + *g:fuf_bookmarkfile_searchRange* > + let g:fuf_bookmarkfile_searchRange = 400 < Number of lines which FuzzyFinder searches a matching line from bookmarked position within. - *g:fuf_bookmark_keyDelete* > - let g:fuf_bookmark_keyDelete = '' + *g:fuf_bookmarkfile_keyDelete* > + let g:fuf_bookmarkfile_keyDelete = '' +< + Key mapped to delete selected bookmark. + + *fuf-options-for-bookmarkdir-mode* +For Bookmark-Dir Mode ~ + + *g:fuf_bookmarkdir_prompt* > + let g:fuf_bookmarkdir_prompt = '>BookmarkDir[]>' +< + Prompt string. "[]" will be substituted with indicators. + + *g:fuf_bookmarkdir_switchOrder* > + let g:fuf_bookmarkdir_switchOrder = 80 +< + Number of order for switching to the next/previous mode. If negative + number, Fuzzyfinder never switches to this mode. + + *g:fuf_bookmarkdir_keyDelete* > + let g:fuf_bookmarkdir_keyDelete = '' < Key mapped to delete selected bookmark. @@ -1025,16 +1279,29 @@ For Tag Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_tag_switchOrder* > - let g:fuf_tag_switchOrder = 70 + let g:fuf_tag_switchOrder = 90 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. - *g:fuf_tag_cache_dir* > - let g:fuf_tag_cache_dir = '~/.vim-fuf-cache/tag' + *fuf-options-for-buffertag-mode* +For Buffer-Tag Mode ~ + + *g:fuf_buffertag_prompt* > + let g:fuf_buffertag_prompt = '>Buffer-Tag[]>' < - Cache files are created in this directory. If empty, they are not - created. + Prompt string. "[]" will be substituted with indicators. + + *g:fuf_buffertag_switchOrder* > + let g:fuf_buffertag_switchOrder = 100 +< + Number of order for switching to the next/previous mode. If negative + number, Fuzzyfinder never switches to this mode. + + *g:fuf_buffertag_ctagsPath* > + let g:fuf_buffertag_ctagsPath = 'ctags' +< + Executable file path of Ctags. *fuf-options-for-taggedfile-mode* For Tagged-File Mode ~ @@ -1045,17 +1312,11 @@ For Tagged-File Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_taggedfile_switchOrder* > - let g:fuf_taggedfile_switchOrder = 80 + let g:fuf_taggedfile_switchOrder = 110 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. - *g:fuf_taggedfile_cache_dir* > - let g:fuf_taggedfile_cache_dir = '~/.vim-fuf-cache/taggedfile' -< - Cache files are created in this directory. If empty, they are not - created. - *fuf-options-for-jumplist-mode* For Jump-List Mode ~ @@ -1065,7 +1326,7 @@ For Jump-List Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_jumplist_switchOrder* > - let g:fuf_jumplist_switchOrder = 90 + let g:fuf_jumplist_switchOrder = 120 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. @@ -1079,7 +1340,7 @@ For Change-List Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_changelist_switchOrder* > - let g:fuf_changelist_switchOrder = 100 + let g:fuf_changelist_switchOrder = 130 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. @@ -1093,7 +1354,7 @@ For Quickfix Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_quickfix_switchOrder* > - let g:fuf_quickfix_switchOrder = 110 + let g:fuf_quickfix_switchOrder = 140 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. @@ -1107,7 +1368,7 @@ For Line Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_line_switchOrder* > - let g:fuf_line_switchOrder = 120 + let g:fuf_line_switchOrder = 150 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. @@ -1121,52 +1382,59 @@ For Help Mode ~ Prompt string. "[]" will be substituted with indicators. *g:fuf_help_switchOrder* > - let g:fuf_help_switchOrder = 130 + let g:fuf_help_switchOrder = 160 < Number of order for switching to the next/previous mode. If negative number, Fuzzyfinder never switches to this mode. - *g:fuf_help_cache_dir* > - let g:fuf_help_cache_dir = '~/.vim-fuf-cache/help' -< - Cache files are created in this directory. If empty, they are not - created. - ============================================================================== VIMRC EXAMPLE *fuf-vimrc-example* > let g:fuf_modesDisable = [] - let g:fuf_abbrevMap = { - \ '^vr:' : map(filter(split(&runtimepath, ','), 'v:val !~ "after$"'), 'v:val . ''/**/'''), - \ '^m0:' : [ '/mnt/d/0/', '/mnt/j/0/' ], - \ } - let g:fuf_mrufile_maxItem = 300 + let g:fuf_mrufile_maxItem = 400 let g:fuf_mrucmd_maxItem = 400 - nnoremap :FufBuffer - nnoremap :FufFileWithCurrentBufferDir - nnoremap :FufFileWithFullCwd - nnoremap p :FufFile - nnoremap :FufDirWithCurrentBufferDir - nnoremap d :FufDirWithFullCwd - nnoremap D :FufDir - nnoremap :FufMruFile - nnoremap :FufMruCmd - nnoremap :FufBookmark - nnoremap :FufTag - nnoremap t :FufTag! - noremap g] :FufTagWithCursorWord! - nnoremap :FufTaggedFile - nnoremap :FufJumpList - nnoremap :FufChangeList - nnoremap :FufQuickfix - nnoremap :FufLine - nnoremap :FufHelp - nnoremap :FufAddBookmark - vnoremap :FufAddBookmarkAsSelectedText - nnoremap :FufEditInfo - nnoremap :FufRenewCache + nnoremap sj :FufBuffer + nnoremap sk :FufFileWithCurrentBufferDir + nnoremap sK :FufFileWithFullCwd + nnoremap s :FufFile + nnoremap sl :FufCoverageFileChange + nnoremap sL :FufCoverageFileChange + nnoremap s :FufCoverageFileRegister + nnoremap sd :FufDirWithCurrentBufferDir + nnoremap sD :FufDirWithFullCwd + nnoremap s :FufDir + nnoremap sn :FufMruFile + nnoremap sN :FufMruFileInCwd + nnoremap sm :FufMruCmd + nnoremap su :FufBookmarkFile + nnoremap s :FufBookmarkFileAdd + vnoremap s :FufBookmarkFileAddAsSelectedText + nnoremap si :FufBookmarkDir + nnoremap s :FufBookmarkDirAdd + nnoremap st :FufTag + nnoremap sT :FufTag! + nnoremap s :FufTagWithCursorWord! + nnoremap s, :FufBufferTag + nnoremap s< :FufBufferTag! + vnoremap s, :FufBufferTagWithSelectedText! + vnoremap s< :FufBufferTagWithSelectedText + nnoremap s} :FufBufferTagWithCursorWord! + nnoremap s. :FufBufferTagAll + nnoremap s> :FufBufferTagAll! + vnoremap s. :FufBufferTagAllWithSelectedText! + vnoremap s> :FufBufferTagAllWithSelectedText + nnoremap s] :FufBufferTagAllWithCursorWord! + nnoremap sg :FufTaggedFile + nnoremap sG :FufTaggedFile! + nnoremap so :FufJumpList + nnoremap sp :FufChangeList + nnoremap sq :FufQuickfix + nnoremap sy :FufLine + nnoremap sh :FufHelp + nnoremap se :FufEditDataFile + nnoremap sr :FufRenewCache < ============================================================================== @@ -1183,6 +1451,59 @@ SPECIAL THANKS *fuf-thanks* ============================================================================== CHANGELOG *fuf-changelog* +4.2.2: + - Fixed a bug that unloaded buffers weren't covered by FufBufferTagAll. + +4.2.1: + - Improved response of Buffer-Tag mode. + - Fixed a bug that buffers which had been opened weren't listed in + Coverage-File mode + - Fixed a bug that tag entries including tab characters weren't parsed + correctly in Coverage-File mode + +4.2: + - L9 library (vimscript #3252) version 1.1 is required. + - Added Buffer-Tag mode, inspired by taglist.vim (vimscript #273). + - Added :FufMruFileInCwd command. + +4.1.1: + - Fixed a bug causing a error in MRU-File mode. + +4.1: + - Added Bookmark-Dir mode. + - Added Bookmark-File mode and removed Bookmark mode. + - Changed the filename to store data of Coverage-File mode, from + '~/.vim-fuf-data/coveragefile/items' to + '~/.vim-fuf-data/coveragefile/coverages' . + - Fixed a bug that floating point numbers weren't evaluated correctly and + caused errors on some non-English locales. + - Removed Around-MRU-File mode and integrated its feature to MRU-File mode. + +4.0: + - From this version, L9 library (vimscript #3252) is required. + - Added Coverage-File mode for users wanting something like TextMate's + command-t. (But I've never used it.) + - Added Around-MRU-File mode. (Too slow. There is room for improvement.) + - Added new feature which deletes selected buffer with FuzzyFinder and + g:fuf_buffer_keyDelete option. + - Added new feature which allows to set one-time options/variables with + fuf#setOneTimeVariables() function. + - Added g:fuf_dataDir option and removed g:fuf_infoFile, + g:g:fuf_tag_cache_dir, g:fuf_taggedfile_cache_dir, and + g:fuf_help_cache_dir options. + - Added :FufEditDataFile command and removed :FufEditInfo command. + - Added g:fuf_fuzzyRefining option. + - Added new feature which is auto-preview and g:fuf_autoPreview option. + - Changed the default value of g:fuf_previewHeight to 0 in order to disable + preview feature. There is an unfixable problem which is caused by a Vim's + bug. + - Changed the default value of g:fuf_modesDisable option. + - Changed the default value of g:fuf_*_switchOrder options. + - Improved speed of changing buffers. + - Improved the way to add user-defined mode. + - Fixed a bug that FuzzyFinder caused reseting window layout. + - Removed g:fuf_smartBs option. Use instead. + 3.5: - Added Line mode. - Added Help mode. @@ -1426,7 +1747,7 @@ CHANGELOG *fuf-changelog* 2.3: - Added a key mapping to open items in a new tab page and - g:FuzzyFinderOptions.Base.key_open_tab opton. + g:FuzzyFinderOptions.Base.key_open_tab option. - Changed to show Fuzzyfinder window above last window even if 'splitbelow' was set. - Changed to set nocursorline and nocursorcolumn in Fuzzyfinder. diff --git a/doc/tags b/doc/tags index e88fb63..1cd0a43 100644 --- a/doc/tags +++ b/doc/tags @@ -39,15 +39,26 @@ :DelimitMateReload delimitMate.txt /*:DelimitMateReload* :DelimitMateSwitch delimitMate.txt /*:DelimitMateSwitch* :DelimitMateTest delimitMate.txt /*:DelimitMateTest* -:FufAddBookmark fuf.txt /*:FufAddBookmark* -:FufAddBookmarkAsSelectedText fuf.txt /*:FufAddBookmarkAsSelectedText* -:FufBookmark fuf.txt /*:FufBookmark* +:FufBookmarkDir fuf.txt /*:FufBookmarkDir* +:FufBookmarkDirAdd fuf.txt /*:FufBookmarkDirAdd* +:FufBookmarkFile fuf.txt /*:FufBookmarkFile* +:FufBookmarkFileAdd fuf.txt /*:FufBookmarkFileAdd* +:FufBookmarkFileAddAsSelectedText fuf.txt /*:FufBookmarkFileAddAsSelectedText* :FufBuffer fuf.txt /*:FufBuffer* +:FufBufferTag fuf.txt /*:FufBufferTag* +:FufBufferTagAll fuf.txt /*:FufBufferTagAll* +:FufBufferTagAllWithCursorWord fuf.txt /*:FufBufferTagAllWithCursorWord* +:FufBufferTagAllWithSelectedText fuf.txt /*:FufBufferTagAllWithSelectedText* +:FufBufferTagWithCursorWord fuf.txt /*:FufBufferTagWithCursorWord* +:FufBufferTagWithSelectedText fuf.txt /*:FufBufferTagWithSelectedText* :FufChangeList fuf.txt /*:FufChangeList* +:FufCoverageFile fuf.txt /*:FufCoverageFile* +:FufCoverageFileChange fuf.txt /*:FufCoverageFileChange* +:FufCoverageFileRegister fuf.txt /*:FufCoverageFileRegister* :FufDir fuf.txt /*:FufDir* :FufDirWithCurrentBufferDir fuf.txt /*:FufDirWithCurrentBufferDir* :FufDirWithFullCwd fuf.txt /*:FufDirWithFullCwd* -:FufEditInfo fuf.txt /*:FufEditInfo* +:FufEditDataFile fuf.txt /*:FufEditDataFile* :FufFile fuf.txt /*:FufFile* :FufFileWithCurrentBufferDir fuf.txt /*:FufFileWithCurrentBufferDir* :FufFileWithFullCwd fuf.txt /*:FufFileWithFullCwd* @@ -56,6 +67,7 @@ :FufLine fuf.txt /*:FufLine* :FufMruCmd fuf.txt /*:FufMruCmd* :FufMruFile fuf.txt /*:FufMruFile* +:FufMruFileInCwd fuf.txt /*:FufMruFileInCwd* :FufQuickfix fuf.txt /*:FufQuickfix* :FufRenewCache fuf.txt /*:FufRenewCache* :FufTag fuf.txt /*:FufTag* @@ -175,11 +187,14 @@ delimitMateVisualWrapping delimitMate.txt /*delimitMateVisualWrapping* delimitMate_WithinEmptyPair delimitMate.txt /*delimitMate_WithinEmptyPair* ds surround.txt /*ds* fuf fuf.txt /*fuf* +fuf#setOneTimeVariables() fuf.txt /*fuf#setOneTimeVariables()* fuf-abbreviation fuf.txt /*fuf-abbreviation* fuf-about fuf.txt /*fuf-about* fuf-author fuf.txt /*fuf-author* -fuf-bookmark-mode fuf.txt /*fuf-bookmark-mode* +fuf-bookmarkdir-mode fuf.txt /*fuf-bookmarkdir-mode* +fuf-bookmarkfile-mode fuf.txt /*fuf-bookmarkfile-mode* fuf-buffer-mode fuf.txt /*fuf-buffer-mode* +fuf-buffertag-mode fuf.txt /*fuf-buffertag-mode* fuf-cache fuf.txt /*fuf-cache* fuf-callbackfile-mode fuf.txt /*fuf-callbackfile-mode* fuf-callbackitem-mode fuf.txt /*fuf-callbackitem-mode* @@ -187,6 +202,8 @@ fuf-changelist-mode fuf.txt /*fuf-changelist-mode* fuf-changelog fuf.txt /*fuf-changelog* fuf-commands fuf.txt /*fuf-commands* fuf-contact fuf.txt /*fuf-contact* +fuf-coveragefile-mode fuf.txt /*fuf-coveragefile-mode* +fuf-data-file fuf.txt /*fuf-data-file* fuf-detailed-topics fuf.txt /*fuf-detailed-topics* fuf-dir-mode fuf.txt /*fuf-dir-mode* fuf-dot-sequence fuf.txt /*fuf-dot-sequence* @@ -196,7 +213,7 @@ fuf-givendir-mode fuf.txt /*fuf-givendir-mode* fuf-givenfile-mode fuf.txt /*fuf-givenfile-mode* fuf-help-mode fuf.txt /*fuf-help-mode* fuf-hiding-menu fuf.txt /*fuf-hiding-menu* -fuf-information-file fuf.txt /*fuf-information-file* +fuf-how-to-add-mode fuf.txt /*fuf-how-to-add-mode* fuf-installation fuf.txt /*fuf-installation* fuf-introduction fuf.txt /*fuf-introduction* fuf-jumplist-mode fuf.txt /*fuf-jumplist-mode* @@ -207,10 +224,13 @@ fuf-mrucmd-mode fuf.txt /*fuf-mrucmd-mode* fuf-mrufile-mode fuf.txt /*fuf-mrufile-mode* fuf-multiple-search fuf.txt /*fuf-multiple-search* fuf-options fuf.txt /*fuf-options* -fuf-options-for-Bookmark-mode fuf.txt /*fuf-options-for-Bookmark-mode* fuf-options-for-all-modes fuf.txt /*fuf-options-for-all-modes* +fuf-options-for-bookmarkdir-mode fuf.txt /*fuf-options-for-bookmarkdir-mode* +fuf-options-for-bookmarkfile-mode fuf.txt /*fuf-options-for-bookmarkfile-mode* fuf-options-for-buffer-mode fuf.txt /*fuf-options-for-buffer-mode* +fuf-options-for-buffertag-mode fuf.txt /*fuf-options-for-buffertag-mode* fuf-options-for-changelist-mode fuf.txt /*fuf-options-for-changelist-mode* +fuf-options-for-coveragefile-mode fuf.txt /*fuf-options-for-coveragefile-mode* fuf-options-for-dir-mode fuf.txt /*fuf-options-for-dir-mode* fuf-options-for-file-mode fuf.txt /*fuf-options-for-file-mode* fuf-options-for-help-mode fuf.txt /*fuf-options-for-help-mode* @@ -224,6 +244,7 @@ fuf-options-for-taggedfile-mode fuf.txt /*fuf-options-for-taggedfile-mode* fuf-quickfix-mode fuf.txt /*fuf-quickfix-mode* fuf-reusing-window fuf.txt /*fuf-reusing-window* fuf-search-patterns fuf.txt /*fuf-search-patterns* +fuf-setting-one-time-option fuf.txt /*fuf-setting-one-time-option* fuf-sorting-of-completion-items fuf.txt /*fuf-sorting-of-completion-items* fuf-tag-mode fuf.txt /*fuf-tag-mode* fuf-taggedfile-mode fuf.txt /*fuf-taggedfile-mode* @@ -233,15 +254,28 @@ fuf-vimrc-example fuf.txt /*fuf-vimrc-example* fuf.txt fuf.txt /*fuf.txt* fuzzyfinder fuf.txt /*fuzzyfinder* g:fuf_abbrevMap fuf.txt /*g:fuf_abbrevMap* -g:fuf_bookmark_keyDelete fuf.txt /*g:fuf_bookmark_keyDelete* -g:fuf_bookmark_prompt fuf.txt /*g:fuf_bookmark_prompt* -g:fuf_bookmark_searchRange fuf.txt /*g:fuf_bookmark_searchRange* -g:fuf_bookmark_switchOrder fuf.txt /*g:fuf_bookmark_switchOrder* +g:fuf_autoPreview fuf.txt /*g:fuf_autoPreview* +g:fuf_bookmarkdir_keyDelete fuf.txt /*g:fuf_bookmarkdir_keyDelete* +g:fuf_bookmarkdir_prompt fuf.txt /*g:fuf_bookmarkdir_prompt* +g:fuf_bookmarkdir_switchOrder fuf.txt /*g:fuf_bookmarkdir_switchOrder* +g:fuf_bookmarkfile_keyDelete fuf.txt /*g:fuf_bookmarkfile_keyDelete* +g:fuf_bookmarkfile_prompt fuf.txt /*g:fuf_bookmarkfile_prompt* +g:fuf_bookmarkfile_searchRange fuf.txt /*g:fuf_bookmarkfile_searchRange* +g:fuf_bookmarkfile_switchOrder fuf.txt /*g:fuf_bookmarkfile_switchOrder* +g:fuf_buffer_keyDelete fuf.txt /*g:fuf_buffer_keyDelete* g:fuf_buffer_mruOrder fuf.txt /*g:fuf_buffer_mruOrder* g:fuf_buffer_prompt fuf.txt /*g:fuf_buffer_prompt* g:fuf_buffer_switchOrder fuf.txt /*g:fuf_buffer_switchOrder* +g:fuf_buffertag_ctagsPath fuf.txt /*g:fuf_buffertag_ctagsPath* +g:fuf_buffertag_prompt fuf.txt /*g:fuf_buffertag_prompt* +g:fuf_buffertag_switchOrder fuf.txt /*g:fuf_buffertag_switchOrder* g:fuf_changelist_prompt fuf.txt /*g:fuf_changelist_prompt* g:fuf_changelist_switchOrder fuf.txt /*g:fuf_changelist_switchOrder* +g:fuf_coveragefile_exclude fuf.txt /*g:fuf_coveragefile_exclude* +g:fuf_coveragefile_globPatterns fuf.txt /*g:fuf_coveragefile_globPatterns* +g:fuf_coveragefile_prompt fuf.txt /*g:fuf_coveragefile_prompt* +g:fuf_coveragefile_switchOrder fuf.txt /*g:fuf_coveragefile_switchOrder* +g:fuf_dataDir fuf.txt /*g:fuf_dataDir* g:fuf_dir_exclude fuf.txt /*g:fuf_dir_exclude* g:fuf_dir_prompt fuf.txt /*g:fuf_dir_prompt* g:fuf_dir_switchOrder fuf.txt /*g:fuf_dir_switchOrder* @@ -249,11 +283,10 @@ g:fuf_enumeratingLimit fuf.txt /*g:fuf_enumeratingLimit* g:fuf_file_exclude fuf.txt /*g:fuf_file_exclude* g:fuf_file_prompt fuf.txt /*g:fuf_file_prompt* g:fuf_file_switchOrder fuf.txt /*g:fuf_file_switchOrder* -g:fuf_help_cache_dir fuf.txt /*g:fuf_help_cache_dir* +g:fuf_fuzzyRefining fuf.txt /*g:fuf_fuzzyRefining* g:fuf_help_prompt fuf.txt /*g:fuf_help_prompt* g:fuf_help_switchOrder fuf.txt /*g:fuf_help_switchOrder* g:fuf_ignoreCase fuf.txt /*g:fuf_ignoreCase* -g:fuf_infoFile fuf.txt /*g:fuf_infoFile* g:fuf_jumplist_prompt fuf.txt /*g:fuf_jumplist_prompt* g:fuf_jumplist_switchOrder fuf.txt /*g:fuf_jumplist_switchOrder* g:fuf_keyNextMode fuf.txt /*g:fuf_keyNextMode* @@ -276,7 +309,9 @@ g:fuf_mrucmd_maxItem fuf.txt /*g:fuf_mrucmd_maxItem* g:fuf_mrucmd_prompt fuf.txt /*g:fuf_mrucmd_prompt* g:fuf_mrucmd_switchOrder fuf.txt /*g:fuf_mrucmd_switchOrder* g:fuf_mrufile_exclude fuf.txt /*g:fuf_mrufile_exclude* +g:fuf_mrufile_keyExpand fuf.txt /*g:fuf_mrufile_keyExpand* g:fuf_mrufile_maxItem fuf.txt /*g:fuf_mrufile_maxItem* +g:fuf_mrufile_maxItemDir fuf.txt /*g:fuf_mrufile_maxItemDir* g:fuf_mrufile_prompt fuf.txt /*g:fuf_mrufile_prompt* g:fuf_mrufile_switchOrder fuf.txt /*g:fuf_mrufile_switchOrder* g:fuf_patternSeparator fuf.txt /*g:fuf_patternSeparator* @@ -285,12 +320,9 @@ g:fuf_promptHighlight fuf.txt /*g:fuf_promptHighlight* g:fuf_quickfix_prompt fuf.txt /*g:fuf_quickfix_prompt* g:fuf_quickfix_switchOrder fuf.txt /*g:fuf_quickfix_switchOrder* g:fuf_reuseWindow fuf.txt /*g:fuf_reuseWindow* -g:fuf_smartBs fuf.txt /*g:fuf_smartBs* g:fuf_splitPathMatching fuf.txt /*g:fuf_splitPathMatching* -g:fuf_tag_cache_dir fuf.txt /*g:fuf_tag_cache_dir* g:fuf_tag_prompt fuf.txt /*g:fuf_tag_prompt* g:fuf_tag_switchOrder fuf.txt /*g:fuf_tag_switchOrder* -g:fuf_taggedfile_cache_dir fuf.txt /*g:fuf_taggedfile_cache_dir* g:fuf_taggedfile_prompt fuf.txt /*g:fuf_taggedfile_prompt* g:fuf_taggedfile_switchOrder fuf.txt /*g:fuf_taggedfile_switchOrder* g:fuf_timeFormat fuf.txt /*g:fuf_timeFormat* @@ -366,6 +398,395 @@ project-settings project.txt /*project-settings* project-syntax project.txt /*project-syntax* project-tips project.txt /*project-tips* project.txt project.txt /*project.txt* +py2stdlib py2stdlib.txt /*py2stdlib* +py2stdlib-__future__ py2stdlib.txt /*py2stdlib-__future__* +py2stdlib-__main__ py2stdlib.txt /*py2stdlib-__main__* +py2stdlib-_winreg py2stdlib.txt /*py2stdlib-_winreg* +py2stdlib-abc py2stdlib.txt /*py2stdlib-abc* +py2stdlib-aepack py2stdlib.txt /*py2stdlib-aepack* +py2stdlib-aetools py2stdlib.txt /*py2stdlib-aetools* +py2stdlib-aetypes py2stdlib.txt /*py2stdlib-aetypes* +py2stdlib-aifc py2stdlib.txt /*py2stdlib-aifc* +py2stdlib-al py2stdlib.txt /*py2stdlib-al* +py2stdlib-al^ py2stdlib.txt /*py2stdlib-al^* +py2stdlib-anydbm py2stdlib.txt /*py2stdlib-anydbm* +py2stdlib-applesingle py2stdlib.txt /*py2stdlib-applesingle* +py2stdlib-argparse py2stdlib.txt /*py2stdlib-argparse* +py2stdlib-array py2stdlib.txt /*py2stdlib-array* +py2stdlib-ast py2stdlib.txt /*py2stdlib-ast* +py2stdlib-asynchat py2stdlib.txt /*py2stdlib-asynchat* +py2stdlib-asyncore py2stdlib.txt /*py2stdlib-asyncore* +py2stdlib-atexit py2stdlib.txt /*py2stdlib-atexit* +py2stdlib-audioop py2stdlib.txt /*py2stdlib-audioop* +py2stdlib-autogil py2stdlib.txt /*py2stdlib-autogil* +py2stdlib-base64 py2stdlib.txt /*py2stdlib-base64* +py2stdlib-basehttpserver py2stdlib.txt /*py2stdlib-basehttpserver* +py2stdlib-bastion py2stdlib.txt /*py2stdlib-bastion* +py2stdlib-bdb py2stdlib.txt /*py2stdlib-bdb* +py2stdlib-binascii py2stdlib.txt /*py2stdlib-binascii* +py2stdlib-binhex py2stdlib.txt /*py2stdlib-binhex* +py2stdlib-bisect py2stdlib.txt /*py2stdlib-bisect* +py2stdlib-bsddb py2stdlib.txt /*py2stdlib-bsddb* +py2stdlib-buildtools py2stdlib.txt /*py2stdlib-buildtools* +py2stdlib-builtin py2stdlib.txt /*py2stdlib-builtin* +py2stdlib-builtin:Constants py2stdlib.txt /*py2stdlib-builtin:Constants* +py2stdlib-builtin:Exceptions py2stdlib.txt /*py2stdlib-builtin:Exceptions* +py2stdlib-builtin:Functions py2stdlib.txt /*py2stdlib-builtin:Functions* +py2stdlib-builtin:Types py2stdlib.txt /*py2stdlib-builtin:Types* +py2stdlib-bz2 py2stdlib.txt /*py2stdlib-bz2* +py2stdlib-calendar py2stdlib.txt /*py2stdlib-calendar* +py2stdlib-carbon.ae py2stdlib.txt /*py2stdlib-carbon.ae* +py2stdlib-carbon.ah py2stdlib.txt /*py2stdlib-carbon.ah* +py2stdlib-carbon.app py2stdlib.txt /*py2stdlib-carbon.app* +py2stdlib-carbon.appearance py2stdlib.txt /*py2stdlib-carbon.appearance* +py2stdlib-carbon.carbonevents py2stdlib.txt /*py2stdlib-carbon.carbonevents* +py2stdlib-carbon.carbonevt py2stdlib.txt /*py2stdlib-carbon.carbonevt* +py2stdlib-carbon.cf py2stdlib.txt /*py2stdlib-carbon.cf* +py2stdlib-carbon.cg py2stdlib.txt /*py2stdlib-carbon.cg* +py2stdlib-carbon.cm py2stdlib.txt /*py2stdlib-carbon.cm* +py2stdlib-carbon.components py2stdlib.txt /*py2stdlib-carbon.components* +py2stdlib-carbon.controlaccessor py2stdlib.txt /*py2stdlib-carbon.controlaccessor* +py2stdlib-carbon.controls py2stdlib.txt /*py2stdlib-carbon.controls* +py2stdlib-carbon.corefounation py2stdlib.txt /*py2stdlib-carbon.corefounation* +py2stdlib-carbon.coregraphics py2stdlib.txt /*py2stdlib-carbon.coregraphics* +py2stdlib-carbon.ctl py2stdlib.txt /*py2stdlib-carbon.ctl* +py2stdlib-carbon.dialogs py2stdlib.txt /*py2stdlib-carbon.dialogs* +py2stdlib-carbon.dlg py2stdlib.txt /*py2stdlib-carbon.dlg* +py2stdlib-carbon.drag py2stdlib.txt /*py2stdlib-carbon.drag* +py2stdlib-carbon.dragconst py2stdlib.txt /*py2stdlib-carbon.dragconst* +py2stdlib-carbon.events py2stdlib.txt /*py2stdlib-carbon.events* +py2stdlib-carbon.evt py2stdlib.txt /*py2stdlib-carbon.evt* +py2stdlib-carbon.file py2stdlib.txt /*py2stdlib-carbon.file* +py2stdlib-carbon.files py2stdlib.txt /*py2stdlib-carbon.files* +py2stdlib-carbon.fm py2stdlib.txt /*py2stdlib-carbon.fm* +py2stdlib-carbon.folder py2stdlib.txt /*py2stdlib-carbon.folder* +py2stdlib-carbon.folders py2stdlib.txt /*py2stdlib-carbon.folders* +py2stdlib-carbon.fonts py2stdlib.txt /*py2stdlib-carbon.fonts* +py2stdlib-carbon.help py2stdlib.txt /*py2stdlib-carbon.help* +py2stdlib-carbon.ibcarbon py2stdlib.txt /*py2stdlib-carbon.ibcarbon* +py2stdlib-carbon.ibcarbonruntime py2stdlib.txt /*py2stdlib-carbon.ibcarbonruntime* +py2stdlib-carbon.icns py2stdlib.txt /*py2stdlib-carbon.icns* +py2stdlib-carbon.icons py2stdlib.txt /*py2stdlib-carbon.icons* +py2stdlib-carbon.launch py2stdlib.txt /*py2stdlib-carbon.launch* +py2stdlib-carbon.launchservices py2stdlib.txt /*py2stdlib-carbon.launchservices* +py2stdlib-carbon.list py2stdlib.txt /*py2stdlib-carbon.list* +py2stdlib-carbon.lists py2stdlib.txt /*py2stdlib-carbon.lists* +py2stdlib-carbon.machelp py2stdlib.txt /*py2stdlib-carbon.machelp* +py2stdlib-carbon.mediadescr py2stdlib.txt /*py2stdlib-carbon.mediadescr* +py2stdlib-carbon.menu py2stdlib.txt /*py2stdlib-carbon.menu* +py2stdlib-carbon.menus py2stdlib.txt /*py2stdlib-carbon.menus* +py2stdlib-carbon.mlte py2stdlib.txt /*py2stdlib-carbon.mlte* +py2stdlib-carbon.osa py2stdlib.txt /*py2stdlib-carbon.osa* +py2stdlib-carbon.osaconst py2stdlib.txt /*py2stdlib-carbon.osaconst* +py2stdlib-carbon.qd py2stdlib.txt /*py2stdlib-carbon.qd* +py2stdlib-carbon.qdoffs py2stdlib.txt /*py2stdlib-carbon.qdoffs* +py2stdlib-carbon.qdoffscreen py2stdlib.txt /*py2stdlib-carbon.qdoffscreen* +py2stdlib-carbon.qt py2stdlib.txt /*py2stdlib-carbon.qt* +py2stdlib-carbon.quickdraw py2stdlib.txt /*py2stdlib-carbon.quickdraw* +py2stdlib-carbon.quicktime py2stdlib.txt /*py2stdlib-carbon.quicktime* +py2stdlib-carbon.res py2stdlib.txt /*py2stdlib-carbon.res* +py2stdlib-carbon.resources py2stdlib.txt /*py2stdlib-carbon.resources* +py2stdlib-carbon.scrap py2stdlib.txt /*py2stdlib-carbon.scrap* +py2stdlib-carbon.snd py2stdlib.txt /*py2stdlib-carbon.snd* +py2stdlib-carbon.sound py2stdlib.txt /*py2stdlib-carbon.sound* +py2stdlib-carbon.te py2stdlib.txt /*py2stdlib-carbon.te* +py2stdlib-carbon.textedit py2stdlib.txt /*py2stdlib-carbon.textedit* +py2stdlib-carbon.win py2stdlib.txt /*py2stdlib-carbon.win* +py2stdlib-carbon.windows py2stdlib.txt /*py2stdlib-carbon.windows* +py2stdlib-cd py2stdlib.txt /*py2stdlib-cd* +py2stdlib-cfmfile py2stdlib.txt /*py2stdlib-cfmfile* +py2stdlib-cgi py2stdlib.txt /*py2stdlib-cgi* +py2stdlib-cgihttpserver py2stdlib.txt /*py2stdlib-cgihttpserver* +py2stdlib-cgitb py2stdlib.txt /*py2stdlib-cgitb* +py2stdlib-chunk py2stdlib.txt /*py2stdlib-chunk* +py2stdlib-cmath py2stdlib.txt /*py2stdlib-cmath* +py2stdlib-cmd py2stdlib.txt /*py2stdlib-cmd* +py2stdlib-code py2stdlib.txt /*py2stdlib-code* +py2stdlib-codecs py2stdlib.txt /*py2stdlib-codecs* +py2stdlib-codeop py2stdlib.txt /*py2stdlib-codeop* +py2stdlib-collections py2stdlib.txt /*py2stdlib-collections* +py2stdlib-colorpicker py2stdlib.txt /*py2stdlib-colorpicker* +py2stdlib-colorsys py2stdlib.txt /*py2stdlib-colorsys* +py2stdlib-commands py2stdlib.txt /*py2stdlib-commands* +py2stdlib-compileall py2stdlib.txt /*py2stdlib-compileall* +py2stdlib-compiler py2stdlib.txt /*py2stdlib-compiler* +py2stdlib-compiler.ast py2stdlib.txt /*py2stdlib-compiler.ast* +py2stdlib-compiler.visitor py2stdlib.txt /*py2stdlib-compiler.visitor* +py2stdlib-configparser py2stdlib.txt /*py2stdlib-configparser* +py2stdlib-contextlib py2stdlib.txt /*py2stdlib-contextlib* +py2stdlib-cookie py2stdlib.txt /*py2stdlib-cookie* +py2stdlib-cookielib py2stdlib.txt /*py2stdlib-cookielib* +py2stdlib-copy py2stdlib.txt /*py2stdlib-copy* +py2stdlib-copy_reg py2stdlib.txt /*py2stdlib-copy_reg* +py2stdlib-cpickle py2stdlib.txt /*py2stdlib-cpickle* +py2stdlib-cprofile py2stdlib.txt /*py2stdlib-cprofile* +py2stdlib-crypt py2stdlib.txt /*py2stdlib-crypt* +py2stdlib-cstringio py2stdlib.txt /*py2stdlib-cstringio* +py2stdlib-csv py2stdlib.txt /*py2stdlib-csv* +py2stdlib-ctypes py2stdlib.txt /*py2stdlib-ctypes* +py2stdlib-curses py2stdlib.txt /*py2stdlib-curses* +py2stdlib-curses.ascii py2stdlib.txt /*py2stdlib-curses.ascii* +py2stdlib-curses.panel py2stdlib.txt /*py2stdlib-curses.panel* +py2stdlib-curses.textpad py2stdlib.txt /*py2stdlib-curses.textpad* +py2stdlib-curses.wrapper py2stdlib.txt /*py2stdlib-curses.wrapper* +py2stdlib-datetime py2stdlib.txt /*py2stdlib-datetime* +py2stdlib-dbhash py2stdlib.txt /*py2stdlib-dbhash* +py2stdlib-dbm py2stdlib.txt /*py2stdlib-dbm* +py2stdlib-decimal py2stdlib.txt /*py2stdlib-decimal* +py2stdlib-device py2stdlib.txt /*py2stdlib-device* +py2stdlib-difflib py2stdlib.txt /*py2stdlib-difflib* +py2stdlib-dircache py2stdlib.txt /*py2stdlib-dircache* +py2stdlib-dis py2stdlib.txt /*py2stdlib-dis* +py2stdlib-distutils py2stdlib.txt /*py2stdlib-distutils* +py2stdlib-dl py2stdlib.txt /*py2stdlib-dl* +py2stdlib-doctest py2stdlib.txt /*py2stdlib-doctest* +py2stdlib-docxmlrpcserver py2stdlib.txt /*py2stdlib-docxmlrpcserver* +py2stdlib-dumbdbm py2stdlib.txt /*py2stdlib-dumbdbm* +py2stdlib-dummy_thread py2stdlib.txt /*py2stdlib-dummy_thread* +py2stdlib-dummy_threading py2stdlib.txt /*py2stdlib-dummy_threading* +py2stdlib-easydialogs py2stdlib.txt /*py2stdlib-easydialogs* +py2stdlib-email py2stdlib.txt /*py2stdlib-email* +py2stdlib-email.charset py2stdlib.txt /*py2stdlib-email.charset* +py2stdlib-email.encoders py2stdlib.txt /*py2stdlib-email.encoders* +py2stdlib-email.errors py2stdlib.txt /*py2stdlib-email.errors* +py2stdlib-email.generator py2stdlib.txt /*py2stdlib-email.generator* +py2stdlib-email.header py2stdlib.txt /*py2stdlib-email.header* +py2stdlib-email.iterators py2stdlib.txt /*py2stdlib-email.iterators* +py2stdlib-email.message py2stdlib.txt /*py2stdlib-email.message* +py2stdlib-email.mime py2stdlib.txt /*py2stdlib-email.mime* +py2stdlib-email.parser py2stdlib.txt /*py2stdlib-email.parser* +py2stdlib-email.utils py2stdlib.txt /*py2stdlib-email.utils* +py2stdlib-encodings.idna py2stdlib.txt /*py2stdlib-encodings.idna* +py2stdlib-encodings.utf_8_sig py2stdlib.txt /*py2stdlib-encodings.utf_8_sig* +py2stdlib-errno py2stdlib.txt /*py2stdlib-errno* +py2stdlib-exceptions py2stdlib.txt /*py2stdlib-exceptions* +py2stdlib-fcntl py2stdlib.txt /*py2stdlib-fcntl* +py2stdlib-filecmp py2stdlib.txt /*py2stdlib-filecmp* +py2stdlib-fileinput py2stdlib.txt /*py2stdlib-fileinput* +py2stdlib-findertools py2stdlib.txt /*py2stdlib-findertools* +py2stdlib-fl py2stdlib.txt /*py2stdlib-fl* +py2stdlib-fl^ py2stdlib.txt /*py2stdlib-fl^* +py2stdlib-flp py2stdlib.txt /*py2stdlib-flp* +py2stdlib-fm py2stdlib.txt /*py2stdlib-fm* +py2stdlib-fnmatch py2stdlib.txt /*py2stdlib-fnmatch* +py2stdlib-formatter py2stdlib.txt /*py2stdlib-formatter* +py2stdlib-fpectl py2stdlib.txt /*py2stdlib-fpectl* +py2stdlib-fpformat py2stdlib.txt /*py2stdlib-fpformat* +py2stdlib-fractions py2stdlib.txt /*py2stdlib-fractions* +py2stdlib-framework py2stdlib.txt /*py2stdlib-framework* +py2stdlib-ftplib py2stdlib.txt /*py2stdlib-ftplib* +py2stdlib-functools py2stdlib.txt /*py2stdlib-functools* +py2stdlib-future_builtins py2stdlib.txt /*py2stdlib-future_builtins* +py2stdlib-gc py2stdlib.txt /*py2stdlib-gc* +py2stdlib-gdbm py2stdlib.txt /*py2stdlib-gdbm* +py2stdlib-gensuitemodule py2stdlib.txt /*py2stdlib-gensuitemodule* +py2stdlib-getopt py2stdlib.txt /*py2stdlib-getopt* +py2stdlib-getpass py2stdlib.txt /*py2stdlib-getpass* +py2stdlib-gettext py2stdlib.txt /*py2stdlib-gettext* +py2stdlib-gl py2stdlib.txt /*py2stdlib-gl* +py2stdlib-gl^ py2stdlib.txt /*py2stdlib-gl^* +py2stdlib-glob py2stdlib.txt /*py2stdlib-glob* +py2stdlib-grp py2stdlib.txt /*py2stdlib-grp* +py2stdlib-gzip py2stdlib.txt /*py2stdlib-gzip* +py2stdlib-hashlib py2stdlib.txt /*py2stdlib-hashlib* +py2stdlib-heapq py2stdlib.txt /*py2stdlib-heapq* +py2stdlib-hmac py2stdlib.txt /*py2stdlib-hmac* +py2stdlib-hotshot py2stdlib.txt /*py2stdlib-hotshot* +py2stdlib-hotshot.stats py2stdlib.txt /*py2stdlib-hotshot.stats* +py2stdlib-htmlentitydefs py2stdlib.txt /*py2stdlib-htmlentitydefs* +py2stdlib-htmllib py2stdlib.txt /*py2stdlib-htmllib* +py2stdlib-htmlparser py2stdlib.txt /*py2stdlib-htmlparser* +py2stdlib-httplib py2stdlib.txt /*py2stdlib-httplib* +py2stdlib-ic py2stdlib.txt /*py2stdlib-ic* +py2stdlib-icopen py2stdlib.txt /*py2stdlib-icopen* +py2stdlib-imageop py2stdlib.txt /*py2stdlib-imageop* +py2stdlib-imaplib py2stdlib.txt /*py2stdlib-imaplib* +py2stdlib-imgfile py2stdlib.txt /*py2stdlib-imgfile* +py2stdlib-imghdr py2stdlib.txt /*py2stdlib-imghdr* +py2stdlib-imp py2stdlib.txt /*py2stdlib-imp* +py2stdlib-importlib py2stdlib.txt /*py2stdlib-importlib* +py2stdlib-imputil py2stdlib.txt /*py2stdlib-imputil* +py2stdlib-inspect py2stdlib.txt /*py2stdlib-inspect* +py2stdlib-io py2stdlib.txt /*py2stdlib-io* +py2stdlib-itertools py2stdlib.txt /*py2stdlib-itertools* +py2stdlib-jpeg py2stdlib.txt /*py2stdlib-jpeg* +py2stdlib-json py2stdlib.txt /*py2stdlib-json* +py2stdlib-keyword py2stdlib.txt /*py2stdlib-keyword* +py2stdlib-lib2to3 py2stdlib.txt /*py2stdlib-lib2to3* +py2stdlib-linecache py2stdlib.txt /*py2stdlib-linecache* +py2stdlib-locale py2stdlib.txt /*py2stdlib-locale* +py2stdlib-logging py2stdlib.txt /*py2stdlib-logging* +py2stdlib-macerrors py2stdlib.txt /*py2stdlib-macerrors* +py2stdlib-macos py2stdlib.txt /*py2stdlib-macos* +py2stdlib-macostools py2stdlib.txt /*py2stdlib-macostools* +py2stdlib-macpath py2stdlib.txt /*py2stdlib-macpath* +py2stdlib-macresource py2stdlib.txt /*py2stdlib-macresource* +py2stdlib-mailbox py2stdlib.txt /*py2stdlib-mailbox* +py2stdlib-mailcap py2stdlib.txt /*py2stdlib-mailcap* +py2stdlib-marshal py2stdlib.txt /*py2stdlib-marshal* +py2stdlib-math py2stdlib.txt /*py2stdlib-math* +py2stdlib-md5 py2stdlib.txt /*py2stdlib-md5* +py2stdlib-mhlib py2stdlib.txt /*py2stdlib-mhlib* +py2stdlib-mimetools py2stdlib.txt /*py2stdlib-mimetools* +py2stdlib-mimetypes py2stdlib.txt /*py2stdlib-mimetypes* +py2stdlib-mimewriter py2stdlib.txt /*py2stdlib-mimewriter* +py2stdlib-mimify py2stdlib.txt /*py2stdlib-mimify* +py2stdlib-miniaeframe py2stdlib.txt /*py2stdlib-miniaeframe* +py2stdlib-mmap py2stdlib.txt /*py2stdlib-mmap* +py2stdlib-modulefinder py2stdlib.txt /*py2stdlib-modulefinder* +py2stdlib-msilib py2stdlib.txt /*py2stdlib-msilib* +py2stdlib-msvcrt py2stdlib.txt /*py2stdlib-msvcrt* +py2stdlib-multifile py2stdlib.txt /*py2stdlib-multifile* +py2stdlib-multiprocessing py2stdlib.txt /*py2stdlib-multiprocessing* +py2stdlib-multiprocessing.connection py2stdlib.txt /*py2stdlib-multiprocessing.connection* +py2stdlib-multiprocessing.dummy py2stdlib.txt /*py2stdlib-multiprocessing.dummy* +py2stdlib-multiprocessing.managers py2stdlib.txt /*py2stdlib-multiprocessing.managers* +py2stdlib-multiprocessing.pool py2stdlib.txt /*py2stdlib-multiprocessing.pool* +py2stdlib-multiprocessing.sharedctypes py2stdlib.txt /*py2stdlib-multiprocessing.sharedctypes* +py2stdlib-mutex py2stdlib.txt /*py2stdlib-mutex* +py2stdlib-nav py2stdlib.txt /*py2stdlib-nav* +py2stdlib-netrc py2stdlib.txt /*py2stdlib-netrc* +py2stdlib-new py2stdlib.txt /*py2stdlib-new* +py2stdlib-nis py2stdlib.txt /*py2stdlib-nis* +py2stdlib-nntplib py2stdlib.txt /*py2stdlib-nntplib* +py2stdlib-numbers py2stdlib.txt /*py2stdlib-numbers* +py2stdlib-operator py2stdlib.txt /*py2stdlib-operator* +py2stdlib-optparse py2stdlib.txt /*py2stdlib-optparse* +py2stdlib-os py2stdlib.txt /*py2stdlib-os* +py2stdlib-os.path py2stdlib.txt /*py2stdlib-os.path* +py2stdlib-ossaudiodev py2stdlib.txt /*py2stdlib-ossaudiodev* +py2stdlib-parser py2stdlib.txt /*py2stdlib-parser* +py2stdlib-pdb py2stdlib.txt /*py2stdlib-pdb* +py2stdlib-pickle py2stdlib.txt /*py2stdlib-pickle* +py2stdlib-pickletools py2stdlib.txt /*py2stdlib-pickletools* +py2stdlib-pipes py2stdlib.txt /*py2stdlib-pipes* +py2stdlib-pixmapwrapper py2stdlib.txt /*py2stdlib-pixmapwrapper* +py2stdlib-pkgutil py2stdlib.txt /*py2stdlib-pkgutil* +py2stdlib-platform py2stdlib.txt /*py2stdlib-platform* +py2stdlib-plistlib py2stdlib.txt /*py2stdlib-plistlib* +py2stdlib-popen2 py2stdlib.txt /*py2stdlib-popen2* +py2stdlib-poplib py2stdlib.txt /*py2stdlib-poplib* +py2stdlib-posix py2stdlib.txt /*py2stdlib-posix* +py2stdlib-posixfile py2stdlib.txt /*py2stdlib-posixfile* +py2stdlib-pprint py2stdlib.txt /*py2stdlib-pprint* +py2stdlib-profile py2stdlib.txt /*py2stdlib-profile* +py2stdlib-pstats py2stdlib.txt /*py2stdlib-pstats* +py2stdlib-pty py2stdlib.txt /*py2stdlib-pty* +py2stdlib-pwd py2stdlib.txt /*py2stdlib-pwd* +py2stdlib-py_compile py2stdlib.txt /*py2stdlib-py_compile* +py2stdlib-pyclbr py2stdlib.txt /*py2stdlib-pyclbr* +py2stdlib-pydoc py2stdlib.txt /*py2stdlib-pydoc* +py2stdlib-queue py2stdlib.txt /*py2stdlib-queue* +py2stdlib-quopri py2stdlib.txt /*py2stdlib-quopri* +py2stdlib-random py2stdlib.txt /*py2stdlib-random* +py2stdlib-re py2stdlib.txt /*py2stdlib-re* +py2stdlib-readline py2stdlib.txt /*py2stdlib-readline* +py2stdlib-repr py2stdlib.txt /*py2stdlib-repr* +py2stdlib-resource py2stdlib.txt /*py2stdlib-resource* +py2stdlib-rexec py2stdlib.txt /*py2stdlib-rexec* +py2stdlib-rfc822 py2stdlib.txt /*py2stdlib-rfc822* +py2stdlib-rlcompleter py2stdlib.txt /*py2stdlib-rlcompleter* +py2stdlib-robotparser py2stdlib.txt /*py2stdlib-robotparser* +py2stdlib-runpy py2stdlib.txt /*py2stdlib-runpy* +py2stdlib-sched py2stdlib.txt /*py2stdlib-sched* +py2stdlib-scrolledtext py2stdlib.txt /*py2stdlib-scrolledtext* +py2stdlib-select py2stdlib.txt /*py2stdlib-select* +py2stdlib-sets py2stdlib.txt /*py2stdlib-sets* +py2stdlib-sgmllib py2stdlib.txt /*py2stdlib-sgmllib* +py2stdlib-sha py2stdlib.txt /*py2stdlib-sha* +py2stdlib-shelve py2stdlib.txt /*py2stdlib-shelve* +py2stdlib-shlex py2stdlib.txt /*py2stdlib-shlex* +py2stdlib-shutil py2stdlib.txt /*py2stdlib-shutil* +py2stdlib-signal py2stdlib.txt /*py2stdlib-signal* +py2stdlib-simplehttpserver py2stdlib.txt /*py2stdlib-simplehttpserver* +py2stdlib-simplexmlrpcserver py2stdlib.txt /*py2stdlib-simplexmlrpcserver* +py2stdlib-site py2stdlib.txt /*py2stdlib-site* +py2stdlib-smtpd py2stdlib.txt /*py2stdlib-smtpd* +py2stdlib-smtplib py2stdlib.txt /*py2stdlib-smtplib* +py2stdlib-sndhdr py2stdlib.txt /*py2stdlib-sndhdr* +py2stdlib-socket py2stdlib.txt /*py2stdlib-socket* +py2stdlib-socketserver py2stdlib.txt /*py2stdlib-socketserver* +py2stdlib-spwd py2stdlib.txt /*py2stdlib-spwd* +py2stdlib-sqlite3 py2stdlib.txt /*py2stdlib-sqlite3* +py2stdlib-ssl py2stdlib.txt /*py2stdlib-ssl* +py2stdlib-stat py2stdlib.txt /*py2stdlib-stat* +py2stdlib-statvfs py2stdlib.txt /*py2stdlib-statvfs* +py2stdlib-string py2stdlib.txt /*py2stdlib-string* +py2stdlib-stringio py2stdlib.txt /*py2stdlib-stringio* +py2stdlib-stringprep py2stdlib.txt /*py2stdlib-stringprep* +py2stdlib-struct py2stdlib.txt /*py2stdlib-struct* +py2stdlib-subprocess py2stdlib.txt /*py2stdlib-subprocess* +py2stdlib-sunau py2stdlib.txt /*py2stdlib-sunau* +py2stdlib-sunaudiodev py2stdlib.txt /*py2stdlib-sunaudiodev* +py2stdlib-sunaudiodev^ py2stdlib.txt /*py2stdlib-sunaudiodev^* +py2stdlib-symbol py2stdlib.txt /*py2stdlib-symbol* +py2stdlib-symtable py2stdlib.txt /*py2stdlib-symtable* +py2stdlib-sys py2stdlib.txt /*py2stdlib-sys* +py2stdlib-sysconfig py2stdlib.txt /*py2stdlib-sysconfig* +py2stdlib-syslog py2stdlib.txt /*py2stdlib-syslog* +py2stdlib-tabnanny py2stdlib.txt /*py2stdlib-tabnanny* +py2stdlib-tarfile py2stdlib.txt /*py2stdlib-tarfile* +py2stdlib-telnetlib py2stdlib.txt /*py2stdlib-telnetlib* +py2stdlib-tempfile py2stdlib.txt /*py2stdlib-tempfile* +py2stdlib-termios py2stdlib.txt /*py2stdlib-termios* +py2stdlib-test py2stdlib.txt /*py2stdlib-test* +py2stdlib-test.test_support py2stdlib.txt /*py2stdlib-test.test_support* +py2stdlib-textwrap py2stdlib.txt /*py2stdlib-textwrap* +py2stdlib-thread py2stdlib.txt /*py2stdlib-thread* +py2stdlib-threading py2stdlib.txt /*py2stdlib-threading* +py2stdlib-time py2stdlib.txt /*py2stdlib-time* +py2stdlib-timeit py2stdlib.txt /*py2stdlib-timeit* +py2stdlib-tix py2stdlib.txt /*py2stdlib-tix* +py2stdlib-tkinter py2stdlib.txt /*py2stdlib-tkinter* +py2stdlib-token py2stdlib.txt /*py2stdlib-token* +py2stdlib-tokenize py2stdlib.txt /*py2stdlib-tokenize* +py2stdlib-trace py2stdlib.txt /*py2stdlib-trace* +py2stdlib-traceback py2stdlib.txt /*py2stdlib-traceback* +py2stdlib-ttk py2stdlib.txt /*py2stdlib-ttk* +py2stdlib-tty py2stdlib.txt /*py2stdlib-tty* +py2stdlib-turtle py2stdlib.txt /*py2stdlib-turtle* +py2stdlib-types py2stdlib.txt /*py2stdlib-types* +py2stdlib-unicodedata py2stdlib.txt /*py2stdlib-unicodedata* +py2stdlib-unittest py2stdlib.txt /*py2stdlib-unittest* +py2stdlib-urllib py2stdlib.txt /*py2stdlib-urllib* +py2stdlib-urllib2 py2stdlib.txt /*py2stdlib-urllib2* +py2stdlib-urlparse py2stdlib.txt /*py2stdlib-urlparse* +py2stdlib-user py2stdlib.txt /*py2stdlib-user* +py2stdlib-userdict py2stdlib.txt /*py2stdlib-userdict* +py2stdlib-userlist py2stdlib.txt /*py2stdlib-userlist* +py2stdlib-userstring py2stdlib.txt /*py2stdlib-userstring* +py2stdlib-uu py2stdlib.txt /*py2stdlib-uu* +py2stdlib-uuid py2stdlib.txt /*py2stdlib-uuid* +py2stdlib-videoreader py2stdlib.txt /*py2stdlib-videoreader* +py2stdlib-w py2stdlib.txt /*py2stdlib-w* +py2stdlib-warnings py2stdlib.txt /*py2stdlib-warnings* +py2stdlib-wave py2stdlib.txt /*py2stdlib-wave* +py2stdlib-weakref py2stdlib.txt /*py2stdlib-weakref* +py2stdlib-webbrowser py2stdlib.txt /*py2stdlib-webbrowser* +py2stdlib-whichdb py2stdlib.txt /*py2stdlib-whichdb* +py2stdlib-winsound py2stdlib.txt /*py2stdlib-winsound* +py2stdlib-wsgiref py2stdlib.txt /*py2stdlib-wsgiref* +py2stdlib-wsgiref.handlers py2stdlib.txt /*py2stdlib-wsgiref.handlers* +py2stdlib-wsgiref.headers py2stdlib.txt /*py2stdlib-wsgiref.headers* +py2stdlib-wsgiref.simple_server py2stdlib.txt /*py2stdlib-wsgiref.simple_server* +py2stdlib-wsgiref.util py2stdlib.txt /*py2stdlib-wsgiref.util* +py2stdlib-wsgiref.validate py2stdlib.txt /*py2stdlib-wsgiref.validate* +py2stdlib-xdrlib py2stdlib.txt /*py2stdlib-xdrlib* +py2stdlib-xml.dom py2stdlib.txt /*py2stdlib-xml.dom* +py2stdlib-xml.dom.minidom py2stdlib.txt /*py2stdlib-xml.dom.minidom* +py2stdlib-xml.dom.pulldom py2stdlib.txt /*py2stdlib-xml.dom.pulldom* +py2stdlib-xml.etree.elementtree py2stdlib.txt /*py2stdlib-xml.etree.elementtree* +py2stdlib-xml.parsers.expat py2stdlib.txt /*py2stdlib-xml.parsers.expat* +py2stdlib-xml.sax py2stdlib.txt /*py2stdlib-xml.sax* +py2stdlib-xml.sax.handler py2stdlib.txt /*py2stdlib-xml.sax.handler* +py2stdlib-xml.sax.saxutils py2stdlib.txt /*py2stdlib-xml.sax.saxutils* +py2stdlib-xml.sax.xmlreader py2stdlib.txt /*py2stdlib-xml.sax.xmlreader* +py2stdlib-xmllib py2stdlib.txt /*py2stdlib-xmllib* +py2stdlib-xmlrpclib py2stdlib.txt /*py2stdlib-xmlrpclib* +py2stdlib-zipfile py2stdlib.txt /*py2stdlib-zipfile* +py2stdlib-zipimport py2stdlib.txt /*py2stdlib-zipimport* +py2stdlib-zlib py2stdlib.txt /*py2stdlib-zlib* +py2stdlib.txt py2stdlib.txt /*py2stdlib.txt* showmarks showmarks.txt /*showmarks* showmarks-changelog showmarks.txt /*showmarks-changelog* showmarks-commands showmarks.txt /*showmarks-commands* diff --git a/ftplugin/python/common.vim b/ftplugin/python/common.vim index 56cca97..4f90aaf 100644 --- a/ftplugin/python/common.vim +++ b/ftplugin/python/common.vim @@ -16,13 +16,16 @@ setlocal colorcolumn=+1 set wildignore+=*.pyc -"inoremap # X# +inoremap # X# "set ofu=syntaxcomplete#Complete "autocmd FileType python setlocal omnifunc=pysmell#Complete let python_highlight_all=1 +"I don't want to have pyflakes errors in qfix, it interfering with Pep8/Pylint +let g:pyflakes_use_quickfix = 0 + "Load views for py files autocmd BufWinLeave *.py mkview autocmd BufWinEnter *.py silent loadview diff --git a/plugin/pydoc.vim b/ftplugin/python/pydoc.vim similarity index 93% rename from plugin/pydoc.vim rename to ftplugin/python/pydoc.vim index 559c748..251be39 100644 --- a/plugin/pydoc.vim +++ b/ftplugin/python/pydoc.vim @@ -101,6 +101,10 @@ au FileType python,man map pW :call ShowPyDoc('', 1)< au FileType python,man map pk :call ShowPyDoc('', 0) au FileType python,man map pK :call ShowPyDoc('', 0) +" remap the K (or 'help') key +nnoremap K :call ShowPyDoc(expand(""), 1) + + "commands -command -nargs=1 Pydoc :call ShowPyDoc('', 1) -command -nargs=* PydocSearch :call ShowPyDoc('', 0) +command! -nargs=1 Pydoc :call ShowPyDoc('', 1) +command! -nargs=* PydocSearch :call ShowPyDoc('', 0) diff --git a/ftplugin/python/pyflakes.vim b/ftplugin/python/pyflakes.vim index 8aa508b..18e9eb7 100644 --- a/ftplugin/python/pyflakes.vim +++ b/ftplugin/python/pyflakes.vim @@ -29,6 +29,11 @@ if !exists("b:did_python_init") finish endif +if !exists('g:pyflakes_use_quickfix') + let g:pyflakes_use_quickfix = 1 +endif + + python << EOF import vim import os.path @@ -154,11 +159,47 @@ if !exists("*s:WideMsg") let x=&ruler | let y=&showcmd set noruler noshowcmd redraw - echo a:msg + echo strpart(a:msg, 0, &columns-1) let &ruler=x | let &showcmd=y endfun endif +if !exists("*s:GetQuickFixStackCount") + function s:GetQuickFixStackCount() + let l:stack_count = 0 + try + silent colder 9 + catch /E380:/ + endtry + + try + for i in range(9) + silent cnewer + let l:stack_count = l:stack_count + 1 + endfor + catch /E381:/ + return l:stack_count + endtry + endfunction +endif + +if !exists("*s:ActivatePyflakesQuickFixWindow") + function s:ActivatePyflakesQuickFixWindow() + try + silent colder 9 " go to the bottom of quickfix stack + catch /E380:/ + endtry + + if s:pyflakes_qf > 0 + try + exe "silent cnewer " . s:pyflakes_qf + catch /E381:/ + echoerr "Could not activate Pyflakes Quickfix Window." + endtry + endif + endfunction +endif + if !exists("*s:RunPyflakes") function s:RunPyflakes() highlight link PyFlakes SpellBad @@ -174,12 +215,23 @@ if !exists("*s:RunPyflakes") let b:matched = [] let b:matchedlines = {} + + let b:qf_list = [] + let b:qf_window_count = -1 + python << EOF for w in check(vim.current.buffer): vim.command('let s:matchDict = {}') vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") + + vim.command("let l:qf_item = {}") + vim.command("let l:qf_item.bufnr = bufnr('%')") + vim.command("let l:qf_item.filename = expand('%')") + vim.command("let l:qf_item.lnum = %s" % str(w.lineno)) + vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args)) + vim.command("let l:qf_item.type = 'E'") if w.col is None or isinstance(w, SyntaxError): # without column information, just highlight the whole line @@ -189,8 +241,24 @@ for w in check(vim.current.buffer): # with a column number, highlight the first keyword there vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") + vim.command("let l:qf_item.vcol = 1") + vim.command("let l:qf_item.col = %s" % str(w.col + 1)) + vim.command("call add(b:matched, s:matchDict)") + vim.command("call add(b:qf_list, l:qf_item)") EOF + if g:pyflakes_use_quickfix == 1 + if exists("s:pyflakes_qf") + " if pyflakes quickfix window is already created, reuse it + call s:ActivatePyflakesQuickFixWindow() + call setqflist(b:qf_list, 'r') + else + " one pyflakes quickfix window for all buffer + call setqflist(b:qf_list, '') + let s:pyflakes_qf = s:GetQuickFixStackCount() + endif + endif + let b:cleared = 0 endfunction end diff --git a/ftplugin/python/pyflakes/README.rst b/ftplugin/python/pyflakes/README.rst index 9ac34fc..9f75ef2 100644 --- a/ftplugin/python/pyflakes/README.rst +++ b/ftplugin/python/pyflakes/README.rst @@ -5,7 +5,7 @@ This version of PyFlakes_ has been improved to use Python's newer ``ast`` module, instead of ``compiler``. So code checking happens faster, and will stay up to date with new language changes. -.. _PyFlakes: http://http://www.divmod.org/trac/wiki/DivmodPyflakes +.. _PyFlakes: http://www.divmod.org/trac/wiki/DivmodPyflakes TODO ---- diff --git a/ftplugin/rst/commons.vim b/ftplugin/rst/commons.vim index 702fc6e..749b8e9 100644 --- a/ftplugin/rst/commons.vim +++ b/ftplugin/rst/commons.vim @@ -23,10 +23,37 @@ import re from docutils import core from docutils import nodes +from docutils.parsers.rst import directives, Directive from docutils.writers.html4css1 import Writer, HTMLTranslator +from pygments import highlight +from pygments.lexers import get_lexer_by_name, TextLexer +from pygments.formatters import HtmlFormatter + import vim +class Pygments(Directive): + """ + Source code syntax hightlighting. + """ + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = True + has_content = True + + def run(self): + self.assert_has_content() + try: + lexer = get_lexer_by_name(self.arguments[0]) + except ValueError: + # no lexer found - use the text one instead of an exception + lexer = TextLexer() + # take an arbitrary option if more than one is given + formatter = HtmlFormatter(noclasses=True) + parsed = highlight(u'\n'.join(self.content), lexer, formatter) + return [nodes.raw('', parsed, format='html')] + +directives.register_directive('sourcecode', Pygments) class NoHeaderHTMLTranslator(HTMLTranslator): def __init__(self, document): @@ -104,7 +131,7 @@ if name.lower().endswith(".rst"): vim.command(r'silent! %s//\r\r/g') except: pass - vim.command('w %s' % name) + vim.command('w %s' % name.replace(' ', '\ ')) vim.command('bd') else: print "Ihis is not reSt file. File should have '.rst' extension." diff --git a/plugin/fuf.vim b/plugin/fuf.vim index c215748..9826dab 100644 --- a/plugin/fuf.vim +++ b/plugin/fuf.vim @@ -1,17 +1,18 @@ "============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA +" Copyright (c) 2007-2010 Takeshi NISHIDA " " GetLatestVimScripts: 1984 1 :AutoInstall: FuzzyFinder "============================================================================= " LOAD GUARD {{{1 -if exists('g:loaded_fuf') +try + if !l9#guardScriptLoading(expand(':p'), 702, 101, []) + finish + endif +catch /E117/ + echoerr '***** L9 library must be installed! *****' finish -elseif v:version < 702 - echoerr 'FuzzyFinder does not support this version of vim (' . v:version . ').' - finish -endif -let g:loaded_fuf = 1 +endtry " }}}1 "============================================================================= @@ -20,152 +21,132 @@ let g:loaded_fuf = 1 " function s:initialize() "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_modes' , [ - \ 'buffer', 'file', 'dir', 'mrufile', 'mrucmd', - \ 'bookmark', 'tag', 'taggedfile', - \ 'jumplist', 'changelist', 'quickfix', 'line', 'help', - \ 'givenfile', 'givendir', 'givencmd', - \ 'callbackfile', 'callbackitem', - \ ]) - call s:defineOption('g:fuf_modesDisable' , [ 'mrufile', 'mrucmd', ]) - call s:defineOption('g:fuf_keyOpen' , '') - call s:defineOption('g:fuf_keyOpenSplit' , '') - call s:defineOption('g:fuf_keyOpenVsplit' , '') - call s:defineOption('g:fuf_keyOpenTabpage' , '') - call s:defineOption('g:fuf_keyPreview' , '') - call s:defineOption('g:fuf_keyNextMode' , '') - call s:defineOption('g:fuf_keyPrevMode' , '') - call s:defineOption('g:fuf_keyPrevPattern' , '') - call s:defineOption('g:fuf_keyNextPattern' , '') - call s:defineOption('g:fuf_keySwitchMatching', '') - call s:defineOption('g:fuf_infoFile' , '~/.vim-fuf') - call s:defineOption('g:fuf_abbrevMap' , {}) - call s:defineOption('g:fuf_patternSeparator' , ';') - call s:defineOption('g:fuf_promptHighlight' , 'Question') - call s:defineOption('g:fuf_ignoreCase' , 1) - call s:defineOption('g:fuf_splitPathMatching', 1) - call s:defineOption('g:fuf_smartBs' , 1) - call s:defineOption('g:fuf_reuseWindow' , 1) - call s:defineOption('g:fuf_timeFormat' , '(%Y-%m-%d %H:%M:%S)') - call s:defineOption('g:fuf_learningLimit' , 100) - call s:defineOption('g:fuf_enumeratingLimit' , 50) - call s:defineOption('g:fuf_maxMenuWidth' , 78) - call s:defineOption('g:fuf_previewHeight' , 10) - call s:defineOption('g:fuf_useMigemo' , 0) + call l9#defineVariableDefault('g:fuf_modesDisable' , [ 'mrufile', 'mrucmd', ]) + call l9#defineVariableDefault('g:fuf_keyOpen' , '') + call l9#defineVariableDefault('g:fuf_keyOpenSplit' , '') + call l9#defineVariableDefault('g:fuf_keyOpenVsplit' , '') + call l9#defineVariableDefault('g:fuf_keyOpenTabpage' , '') + call l9#defineVariableDefault('g:fuf_keyPreview' , '') + call l9#defineVariableDefault('g:fuf_keyNextMode' , '') + call l9#defineVariableDefault('g:fuf_keyPrevMode' , '') + call l9#defineVariableDefault('g:fuf_keyPrevPattern' , '') + call l9#defineVariableDefault('g:fuf_keyNextPattern' , '') + call l9#defineVariableDefault('g:fuf_keySwitchMatching', '') + call l9#defineVariableDefault('g:fuf_dataDir' , '~/.vim-fuf-data') + call l9#defineVariableDefault('g:fuf_abbrevMap' , {}) + call l9#defineVariableDefault('g:fuf_patternSeparator' , ';') + call l9#defineVariableDefault('g:fuf_promptHighlight' , 'Question') + call l9#defineVariableDefault('g:fuf_ignoreCase' , 1) + call l9#defineVariableDefault('g:fuf_splitPathMatching', 1) + call l9#defineVariableDefault('g:fuf_fuzzyRefining' , 0) + call l9#defineVariableDefault('g:fuf_smartBs' , 1) + call l9#defineVariableDefault('g:fuf_reuseWindow' , 1) + call l9#defineVariableDefault('g:fuf_timeFormat' , '(%Y-%m-%d %H:%M:%S)') + call l9#defineVariableDefault('g:fuf_learningLimit' , 100) + call l9#defineVariableDefault('g:fuf_enumeratingLimit' , 50) + call l9#defineVariableDefault('g:fuf_maxMenuWidth' , 78) + call l9#defineVariableDefault('g:fuf_previewHeight' , 0) + call l9#defineVariableDefault('g:fuf_autoPreview' , 0) + call l9#defineVariableDefault('g:fuf_useMigemo' , 0) "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_buffer_prompt' , '>Buffer[]>') - call s:defineOption('g:fuf_buffer_switchOrder', 10) - call s:defineOption('g:fuf_buffer_mruOrder' , 1) + call l9#defineVariableDefault('g:fuf_buffer_prompt' , '>Buffer[]>') + call l9#defineVariableDefault('g:fuf_buffer_switchOrder', 10) + call l9#defineVariableDefault('g:fuf_buffer_mruOrder' , 1) + call l9#defineVariableDefault('g:fuf_buffer_keyDelete' , '') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_file_prompt' , '>File[]>') - call s:defineOption('g:fuf_file_switchOrder', 20) - call s:defineOption('g:fuf_file_exclude' , '\v\~$|\.(o|exe|dll|bak|sw[po])$|(^|[/\\])\.(hg|git|bzr)($|[/\\])') + call l9#defineVariableDefault('g:fuf_file_prompt' , '>File[]>') + call l9#defineVariableDefault('g:fuf_file_switchOrder', 20) + call l9#defineVariableDefault('g:fuf_file_exclude' , '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|(^|[/\\])\.(hg|git|bzr)($|[/\\])') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_dir_prompt' , '>Dir[]>') - call s:defineOption('g:fuf_dir_switchOrder', 30) - call s:defineOption('g:fuf_dir_exclude' , '\v(^|[/\\])\.(hg|git|bzr)($|[/\\])') + call l9#defineVariableDefault('g:fuf_coveragefile_prompt' , '>CoverageFile[]>') + call l9#defineVariableDefault('g:fuf_coveragefile_switchOrder', 30) + call l9#defineVariableDefault('g:fuf_coveragefile_exclude' , '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|(^|[/\\])\.(hg|git|bzr)($|[/\\])') + call l9#defineVariableDefault('g:fuf_coveragefile_globPatterns', ['**/.*', '**/*']) "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_mrufile_prompt' , '>Mru-File[]>') - call s:defineOption('g:fuf_mrufile_switchOrder', 40) - call s:defineOption('g:fuf_mrufile_exclude' , '\v\~$|\.(bak|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)') - call s:defineOption('g:fuf_mrufile_maxItem' , 200) + call l9#defineVariableDefault('g:fuf_dir_prompt' , '>Dir[]>') + call l9#defineVariableDefault('g:fuf_dir_switchOrder', 40) + call l9#defineVariableDefault('g:fuf_dir_exclude' , '\v(^|[/\\])\.(hg|git|bzr)($|[/\\])') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_mrucmd_prompt' , '>Mru-Cmd[]>') - call s:defineOption('g:fuf_mrucmd_switchOrder', 50) - call s:defineOption('g:fuf_mrucmd_exclude' , '^$') - call s:defineOption('g:fuf_mrucmd_maxItem' , 200) + call l9#defineVariableDefault('g:fuf_mrufile_prompt' , '>MRU-File[]>') + call l9#defineVariableDefault('g:fuf_mrufile_switchOrder', 50) + call l9#defineVariableDefault('g:fuf_mrufile_exclude' , '\v\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)') + call l9#defineVariableDefault('g:fuf_mrufile_maxItem' , 200) + call l9#defineVariableDefault('g:fuf_mrufile_maxItemDir' , 50) + call l9#defineVariableDefault('g:fuf_mrufile_keyExpand' , '') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_bookmark_prompt' , '>Bookmark[]>') - call s:defineOption('g:fuf_bookmark_switchOrder', 60) - call s:defineOption('g:fuf_bookmark_searchRange', 400) - call s:defineOption('g:fuf_bookmark_keyDelete' , '') + call l9#defineVariableDefault('g:fuf_mrucmd_prompt' , '>MRU-Cmd[]>') + call l9#defineVariableDefault('g:fuf_mrucmd_switchOrder', 60) + call l9#defineVariableDefault('g:fuf_mrucmd_exclude' , '^$') + call l9#defineVariableDefault('g:fuf_mrucmd_maxItem' , 200) "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_tag_prompt' , '>Tag[]>') - call s:defineOption('g:fuf_tag_switchOrder', 70) - call s:defineOption('g:fuf_tag_cache_dir' , '~/.vim-fuf-cache/tag') + call l9#defineVariableDefault('g:fuf_bookmarkfile_prompt' , '>Bookmark-File[]>') + call l9#defineVariableDefault('g:fuf_bookmarkfile_switchOrder', 70) + call l9#defineVariableDefault('g:fuf_bookmarkfile_searchRange', 400) + call l9#defineVariableDefault('g:fuf_bookmarkfile_keyDelete' , '') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_taggedfile_prompt' , '>Tagged-File[]>') - call s:defineOption('g:fuf_taggedfile_switchOrder', 80) - call s:defineOption('g:fuf_taggedfile_cache_dir' , '~/.vim-fuf-cache/taggedfile') + call l9#defineVariableDefault('g:fuf_bookmarkdir_prompt' , '>Bookmark-Dir[]>') + call l9#defineVariableDefault('g:fuf_bookmarkdir_switchOrder', 80) + call l9#defineVariableDefault('g:fuf_bookmarkdir_keyDelete' , '') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_jumplist_prompt' , '>Jump-List[]>') - call s:defineOption('g:fuf_jumplist_switchOrder', 90) + call l9#defineVariableDefault('g:fuf_tag_prompt' , '>Tag[]>') + call l9#defineVariableDefault('g:fuf_tag_switchOrder', 90) "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_changelist_prompt' , '>Change-List[]>') - call s:defineOption('g:fuf_changelist_switchOrder', 100) + call l9#defineVariableDefault('g:fuf_buffertag_prompt' , '>Buffer-Tag[]>') + call l9#defineVariableDefault('g:fuf_buffertag_switchOrder', 100) + call l9#defineVariableDefault('g:fuf_buffertag_ctagsPath' , 'ctags') "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_quickfix_prompt' , '>Quickfix[]>') - call s:defineOption('g:fuf_quickfix_switchOrder', 110) + call l9#defineVariableDefault('g:fuf_taggedfile_prompt' , '>Tagged-File[]>') + call l9#defineVariableDefault('g:fuf_taggedfile_switchOrder', 110) "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_line_prompt' , '>Line[]>') - call s:defineOption('g:fuf_line_switchOrder', 120) + call l9#defineVariableDefault('g:fuf_jumplist_prompt' , '>Jump-List[]>') + call l9#defineVariableDefault('g:fuf_jumplist_switchOrder', 120) "--------------------------------------------------------------------------- - call s:defineOption('g:fuf_help_prompt' , '>Help[]>') - call s:defineOption('g:fuf_help_switchOrder', 130) - call s:defineOption('g:fuf_help_cache_dir' , '~/.vim-fuf-cache/help') + call l9#defineVariableDefault('g:fuf_changelist_prompt' , '>Change-List[]>') + call l9#defineVariableDefault('g:fuf_changelist_switchOrder', 130) "--------------------------------------------------------------------------- - call filter(g:fuf_modes, 'count(g:fuf_modesDisable, v:val) == 0') - for m in g:fuf_modes - call fuf#{m}#renewCache() - call fuf#{m}#onInit() - endfor + call l9#defineVariableDefault('g:fuf_quickfix_prompt' , '>Quickfix[]>') + call l9#defineVariableDefault('g:fuf_quickfix_switchOrder', 140) "--------------------------------------------------------------------------- - command! -bang -narg=0 FufEditInfo call fuf#editInfoFile() - command! -bang -narg=0 FufRenewCache call s:renewCachesOfAllModes() + call l9#defineVariableDefault('g:fuf_line_prompt' , '>Line[]>') + call l9#defineVariableDefault('g:fuf_line_switchOrder', 150) "--------------------------------------------------------------------------- - for m in g:fuf_modes - if fuf#{m}#requiresOnCommandPre() - " cnoremap has a problem, which doesn't expand cabbrev. - cmap onCommandPre() - break - endif - endfor + call l9#defineVariableDefault('g:fuf_help_prompt' , '>Help[]>') + call l9#defineVariableDefault('g:fuf_help_switchOrder', 160) + "--------------------------------------------------------------------------- + command! -bang -narg=0 FufEditDataFile call fuf#editDataFile() + command! -bang -narg=0 FufRenewCache call s:renewCachesOfAllModes() + "--------------------------------------------------------------------------- + call fuf#addMode('buffer') + call fuf#addMode('file') + call fuf#addMode('coveragefile') + call fuf#addMode('dir') + call fuf#addMode('mrufile') + call fuf#addMode('mrucmd') + call fuf#addMode('bookmarkfile') + call fuf#addMode('bookmarkdir') + call fuf#addMode('tag') + call fuf#addMode('buffertag') + call fuf#addMode('taggedfile') + call fuf#addMode('jumplist') + call fuf#addMode('changelist') + call fuf#addMode('quickfix') + call fuf#addMode('line') + call fuf#addMode('help') + call fuf#addMode('givenfile') + call fuf#addMode('givendir') + call fuf#addMode('givencmd') + call fuf#addMode('callbackfile') + call fuf#addMode('callbackitem') "--------------------------------------------------------------------------- -endfunction - -" -function s:initMisc() -endfunction - -" -function s:defineOption(name, default) - if !exists(a:name) - let {a:name} = a:default - endif endfunction " function s:renewCachesOfAllModes() - for m in g:fuf_modes + for m in fuf#getModeNames() call fuf#{m}#renewCache() endfor endfunction -" -function s:onBufEnter() - for m in g:fuf_modes - call fuf#{m}#onBufEnter() - endfor -endfunction - -" -function s:onBufWritePost() - for m in g:fuf_modes - call fuf#{m}#onBufWritePost() - endfor -endfunction - -" -function s:onCommandPre() - for m in filter(copy(g:fuf_modes), 'fuf#{v:val}#requiresOnCommandPre()') - call fuf#{m}#onCommandPre(getcmdtype() . getcmdline()) - endfor - " lets last entry become the newest in the history - call histadd(getcmdtype(), getcmdline()) - " this is not mapped again (:help recursive_mapping) - return "\" -endfunction - " }}}1 "============================================================================= " INITIALIZATION {{{1