diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..b1641d7 --- /dev/null +++ b/.hgignore @@ -0,0 +1,9 @@ +syntax: glob + +*.pyc +*.pyo + +view/* +**/doc/tags + +.netrwhist diff --git a/.vimrc b/.vimrc index 7d3bec6..ee062c6 100644 --- a/.vimrc +++ b/.vimrc @@ -1,4 +1,5 @@ "Basic setup for all files {{{ +call pathogen#infect() "infect path for boundles set nocompatible "VIM over VI filetype plugin indent on "turn plugins/indent on @@ -125,8 +126,8 @@ map wn VimwikiNextWord map wp VimwikiPrevWord " }}} "FuzzyFinder {{{2 -let g:fuf_file_exclude = '\v\~$|\.(o|bak|swp|pyc|pyo|pyd)$|(^|[/\\])\.(hg|git|bzr|cvs)($|[/\\])' -map :FufFile **/ +"let g:fuf_file_exclude = '\v\~$|\.(o|bak|swp|pyc|pyo|pyd)$|(^|[/\\])\.(hg|git|bzr|cvs)($|[/\\])' +"map :FufFile **/ "}}} "ShowMarks {{{2 let g:showmarks_ignore_type = "hqprm" @@ -178,16 +179,27 @@ nmap \dk nmap \dj " }}} " Buffergator {{{2 -let g:buffergator_split_size=10 -let g:buffergator_viewport_split_policy='B' -let g:buffergator_suppress_keymaps=1 -let g:buffergator_sort_regime="filepath" -let g:buffergator_display_regime="filepath" -map b :BuffergatorToggle +"let g:buffergator_split_size=10 +"let g:buffergator_viewport_split_policy='B' +"let g:buffergator_suppress_keymaps=1 +"let g:buffergator_sort_regime="filepath" +"let g:buffergator_display_regime="filepath" +"map b :BuffergatorToggle " }}} "Gundo {{{2 map u :GundoToggle "}}} +"CtrlP {{{2 +let g:ctrlp_custom_ignore = { + \ 'dir': '\.git$\|\.hg$\|\.svn$', + \ 'file': '\.pyo$\|\.pyc$\|\.pyd$', + \ } +let g:ctrlp_map = '' +map b :CtrlPBuffer +"}}} +"NERDCommenter {{{2 +let g:NERDSpaceDelims=1 +"}}} "}}} "KEYS: User defined keyboard shortcuts {{{ @@ -387,13 +399,20 @@ endfunction "}}} " GUI: detect graphics mode, set colorscheme {{{ if has('gui_running') - "set guifont=Consolas\ 12 "I like this font, but it looks like crap on linux - "set guifont=DejaVu\ Sans\ Mono\ 12 "at least, some ttf font that looks good - set guifont=Fixed\ 14 "I like this font better. + " I like this font, but it looks like crap on linux + "set guifont=Consolas\ 12 + " at least, some ttf font that looks good + "set guifont=DejaVu\ Sans\ Mono\ 12 + " Unfortunately there is a problem with TTF fonts in my gvim instance. + " After editing a while there are some leaving trash appearing on the + " buffer. Refreshing the screen helps, but is kinda annoying. It is + " probably my X11 setup, because on other similar workstations and setup I + " didn't noticed such behavior. Fallback to fixed-misc for a while. + set guifont=Fixed\ 14 set mouse=a "Enable mouse support - "No toolbar, menu, scrollbars, draw simple text tabs. This would keep - "window in one place, and also this will conserve space. Tabs are huge - "under GTK. + " No toolbar, menu, scrollbars, draw simple text tabs. This would keep + " window in one place, and also this will conserve space. Tabs are huge + " under GTK. set guioptions=agit "add menuitem OpenInWebBrowser nmenu 666 PopUp.&Open\ in\ browser :call OpenInWebBrowser() @@ -405,5 +424,9 @@ if $TERM == 'linux' && !has('gui_running') " fallback to basic 8-color colorscheme colorscheme pablo endif + +if has('win32') && $_PMX == '1' + source $VIM/vimfiles/pmxrc.vim +endif "}}} " vim:ts=4:sw=4:wrap:fdm=marker: diff --git a/GetLatest/GetLatestVimScripts.dat b/GetLatest/GetLatestVimScripts.dat index 535dc2b..574f5c6 100644 --- a/GetLatest/GetLatestVimScripts.dat +++ b/GetLatest/GetLatestVimScripts.dat @@ -2,39 +2,27 @@ ScriptID SourceID Filename -------------------------- ### plugins 2572 10433 ack.vim -3619 16816 buffergator 102 16171 DirDiff.vim -1984 13961 :AutoInstall: FuzzyFinder 311 7645 grep.vim -3304 16172 gundo.vim +3304 17406 gundo.vim 2727 11120 jsbeautify.vim -3252 13948 :AutoInstall: L9 2289 8922 loremipsum -2666 16840 Mark +2666 17554 Mark 1218 14455 nerdcommenter 2262 8944 occur.vim 2136 8206 repeat.vim 152 3342 showmarks.vim 2540 11006 snipMate.vim -1697 12566 :AutoInstall: surround.vim +1697 12566 surround.vim 3465 17112 Tagbar 90 17031 vcscommand.vim 2226 15854 vimwiki.vim 1334 6377 vst.vim 2321 9055 zoom.vim 52 14880 calendar.vim -### colors -2855 12456 github.vim -1143 11833 inkpot.vim -2555 15432 jellybeans.vim -2536 16615 lucius.vim -3299 16882 sorcerer.vim -1165 3741 tolerable.vim -3309 15759 vydark -2589 15760 vylight -415 15531 zenburn -#3597 1 ColorV -# ftplugin +3736 17319 ctrlp.vim +### ftplugin +3818 16921 MatchTag 910 14691 pydoc.vim 2441 14403 pyflakes.vim 30 9196 python_fn.vim @@ -47,7 +35,7 @@ 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 14268 python.vim +790 17430 python.vim 2651 10658 fitnesse.vim 1858 9244 mako.vim 2539 9949 css.vim diff --git a/autoload/fuf.vim b/autoload/fuf.vim deleted file mode 100644 index fe9e6eb..0000000 --- a/autoload/fuf.vim +++ /dev/null @@ -1,1046 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - - -" 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(expand(v:val)) > a:time')) -endfunction - -" -function fuf#getCurrentTagFiles() - return sort(filter(map(tagfiles(), 'fnamemodify(v:val, '':p'')'), 'filereadable(v:val)')) -endfunction - -" -function fuf#mapToSetSerialIndex(in, offset) - for i in range(len(a:in)) - let a:in[i].index = i + a:offset - endfor - return a:in -endfunction - -" -function fuf#updateMruList(mrulist, newItem, maxItem, exclude) - let result = copy(a:mrulist) - let result = filter(result,'v:val.word !=# a:newItem.word') - let result = insert(result, a:newItem) - if len(a:exclude) - let result = filter(result, 'v:val.word !~ a:exclude') - endif - return result[0 : a:maxItem - 1] -endfunction - -" takes suffix number. if no digits, returns -1 -function fuf#suffixNumber(str) - let s = matchstr(a:str, '\d\+$') - return (len(s) ? str2nr(s) : -1) -endfunction - -" "foo/bar/buz/hoge" -> { head: "foo/bar/buz/", tail: "hoge" } -function fuf#splitPath(path) - let head = matchstr(a:path, '^.*[/\\]') - return { - \ 'head' : head, - \ 'tail' : a:path[strlen(head):] - \ } -endfunction - -" "foo/.../bar/...hoge" -> "foo/.../bar/../../hoge" -function fuf#expandTailDotSequenceToParentDir(pattern) - return substitute(a:pattern, '^\(.*[/\\]\)\?\zs\.\(\.\+\)\ze[^/\\]*$', - \ '\=repeat(".." . l9#getPathSeparator(), len(submatch(2)))', '') -endfunction - -" -function fuf#formatPrompt(prompt, partialMatching, otherString) - let indicator = escape((a:partialMatching ? '!' : '') . a:otherString, '\') - return substitute(a:prompt, '[]', indicator, 'g') -endfunction - -" -function fuf#getFileLines(file) - let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$')) - let lines = getbufline(bufnr, 1, '$') - if !empty(lines) - return lines - endif - return l9#readFile(a:file) -endfunction - -" -function fuf#makePreviewLinesAround(lines, indices, page, maxHeight) - let index = ((empty(a:indices) ? 0 : a:indices[0]) - \ + a:page * a:maxHeight) % len(a:lines) - if empty(a:lines) || a:maxHeight <= 0 - return [] - endif - let beg = max([0, index - a:maxHeight / 2]) - let end = min([beg + a:maxHeight, len(a:lines)]) - let beg = max([0, end - a:maxHeight]) - let lines = [] - for i in range(beg, end - 1) - let mark = (count(a:indices, i) ? '>' : ' ') - call add(lines, printf('%s%4d ', mark, i + 1) . a:lines[i]) - endfor - return lines -endfunction - -" a:file: a path string or a buffer number -function fuf#makePreviewLinesForFile(file, count, maxHeight) - let lines = fuf#getFileLines(a:file) - if empty(lines) - return [] - endif - let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$')) - if exists('s:bufferCursorPosMap[bufnr]') - let indices = [s:bufferCursorPosMap[bufnr][1] - 1] - else - let indices = [] - endif - return fuf#makePreviewLinesAround( - \ lines, indices, a:count, a:maxHeight) -endfunction - -" -function fuf#echoWarning(msg) - call l9#echoHl('WarningMsg', a:msg, '[fuf] ', 1) -endfunction - -" -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 && - \ 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({ - \ s:OPEN_TYPE_CURRENT : '%sbuffer' , - \ s:OPEN_TYPE_SPLIT : '%ssbuffer' , - \ s:OPEN_TYPE_VSPLIT : 'vertical %ssbuffer', - \ s:OPEN_TYPE_TAB : 'tab %ssbuffer' , - \ }[a:mode], a:bufNr) -endfunction - -" -function fuf#openFile(path, mode, reuse) - let bufNr = bufnr('^' . a:path . '$') - if bufNr > -1 - call fuf#openBuffer(bufNr, a:mode, a:reuse) - else - execute { - \ s:OPEN_TYPE_CURRENT : 'edit ' , - \ s:OPEN_TYPE_SPLIT : 'split ' , - \ s:OPEN_TYPE_VSPLIT : 'vsplit ' , - \ s:OPEN_TYPE_TAB : 'tabedit ', - \ }[a:mode] . fnameescape(fnamemodify(a:path, ':~:.')) - endif -endfunction - -" -function fuf#openTag(tag, mode) - execute { - \ s:OPEN_TYPE_CURRENT : 'tjump ' , - \ s:OPEN_TYPE_SPLIT : 'stjump ' , - \ s:OPEN_TYPE_VSPLIT : 'vertical stjump ', - \ s:OPEN_TYPE_TAB : 'tab stjump ' , - \ }[a:mode] . a:tag -endfunction - -" -function fuf#openHelp(tag, mode) - execute { - \ s:OPEN_TYPE_CURRENT : 'help ' , - \ s:OPEN_TYPE_SPLIT : 'help ' , - \ s:OPEN_TYPE_VSPLIT : 'vertical help ', - \ s:OPEN_TYPE_TAB : 'tab help ' , - \ }[a:mode] . a:tag -endfunction - -" -function fuf#prejump(mode) - execute { - \ s:OPEN_TYPE_CURRENT : '' , - \ s:OPEN_TYPE_SPLIT : 'split' , - \ s:OPEN_TYPE_VSPLIT : 'vsplit' , - \ s:OPEN_TYPE_TAB : 'tab split', - \ }[a:mode] -endfunction - -" -function fuf#compareRanks(i1, i2) - if exists('a:i1.ranks') && exists('a:i2.ranks') - for i in range(min([len(a:i1.ranks), len(a:i2.ranks)])) - if a:i1.ranks[i] > a:i2.ranks[i] - return +1 - elseif a:i1.ranks[i] < a:i2.ranks[i] - return -1 - endif - endfor - endif - return 0 -endfunction - -" -function fuf#makePathItem(fname, menu, appendsDirSuffix) - let pathPair = fuf#splitPath(a:fname) - let dirSuffix = (a:appendsDirSuffix && isdirectory(expand(a:fname)) - \ ? l9#getPathSeparator() - \ : '') - return { - \ 'word' : a:fname . dirSuffix, - \ 'wordForPrimaryHead': s:toLowerForIgnoringCase(pathPair.head), - \ 'wordForPrimaryTail': s:toLowerForIgnoringCase(pathPair.tail), - \ 'wordForBoundary' : s:toLowerForIgnoringCase(s:getWordBoundaries(pathPair.tail)), - \ 'wordForRefining' : s:toLowerForIgnoringCase(a:fname . dirSuffix), - \ 'wordForRank' : s:toLowerForIgnoringCase(pathPair.tail), - \ 'menu' : a:menu, - \ } -endfunction - -" -function fuf#makeNonPathItem(word, menu) - let wordL = s:toLowerForIgnoringCase(a:word) - return { - \ 'word' : a:word, - \ 'wordForPrimary' : wordL, - \ 'wordForBoundary': s:toLowerForIgnoringCase(s:getWordBoundaries(a:word)), - \ 'wordForRefining': wordL, - \ 'wordForRank' : wordL, - \ 'menu' : a:menu, - \ } -endfunction - -" -function fuf#makePatternSet(patternBase, interpreter, partialMatching) - let MakeMatchingExpr = function(a:partialMatching - \ ? 's:makePartialMatchingExpr' - \ : 's:makeFuzzyMatchingExpr') - let [primary; refinings] = split(a:patternBase, g:fuf_patternSeparator, 1) - let elements = call(a:interpreter, [primary]) - let primaryExprs = map(elements.matchingPairs, 'MakeMatchingExpr(v:val[0], v:val[1])') - let refiningExprs = map(refinings, 's:makeRefiningExpr(v:val)') - return { - \ 'primary' : elements.primary, - \ 'primaryForRank': elements.primaryForRank, - \ 'filteringExpr' : join(primaryExprs + refiningExprs, ' && '), - \ } -endfunction - -" -function fuf#enumExpandedDirsEntries(dir, exclude) - 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)') - if len(a:exclude) - call filter(entries, 'v:val.word !~ a:exclude') - endif - return entries -endfunction - -" -function fuf#mapToSetAbbrWithSnippedWordAsPath(items) - let maxLenStats = {} - call map(a:items, 's:makeFileAbbrInfo(v:val, maxLenStats)') - let snippedHeads = - \ map(maxLenStats, 's:getSnippedHead(v:key[: -2], v:val)') - return map(a:items, 's:setAbbrWithFileAbbrData(v:val, snippedHeads)') -endfunction - -" -function fuf#setAbbrWithFormattedWord(item, abbrIndex) - let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0) - let abbrPrefix = (exists('a:item.abbrPrefix') ? a:item.abbrPrefix : '') - let a:item.abbr = abbrPrefix . a:item.word - if a:abbrIndex - let a:item.abbr = printf('%4d: ', a:item.index) . a:item.abbr - endif - let a:item.abbr = l9#snipTail(a:item.abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK) - return a:item -endfunction - -" -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) -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#echoWarning('FuzzyFinder is running.') - endif - 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.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() - " 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 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! - autocmd CursorMovedI call s:runningHandler.onCursorMovedI() - autocmd InsertLeave nested call s:runningHandler.onInsertLeave() - augroup END - for [key, func] in [ - \ [ 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 - " Starts Insert mode and makes CursorMovedI event now. Command prompt is - " needed to forces a completion menu to update every typing. - call setline(1, s:runningHandler.getPrompt() . a:initialPattern) - call s:runningHandler.onModeEnterPost() - call feedkeys("A", 'n') " startinsert! does not work in InsertLeave event handler - redraw -endfunction - -" -function fuf#loadDataFile(modeName, dataName) - if !s:dataFileAvailable - return [] - endif - let lines = l9#readFile(l9#concatPaths([g:fuf_dataDir, a:modeName, a:dataName])) - return map(lines, 'eval(v:val)') -endfunction - -" -function fuf#saveDataFile(modeName, dataName, items) - if !s:dataFileAvailable - return -1 - endif - 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 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 - -" -function fuf#getRunningHandler() - return s:runningHandler -endfunction - -" -function fuf#onComplete(findstart, base) - return s:runningHandler.onComplete(a:findstart, a:base) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s: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 - -" a:pattern: 'str' -> '\V\.\*s\.\*t\.\*r\.\*' -function s:makeFuzzyMatchingExpr(target, pattern) - let wi = '' - for c in split(a:pattern, '\zs') - if wi =~# '[^*?]$' && c !~ '[*?]' - let wi .= '*' - endif - let wi .= c - endfor - return s:makePartialMatchingExpr(a:target, wi) -endfunction - -" a:pattern: 'str' -> '\Vstr' -" 'st*r' -> '\Vst\.\*r' -function s:makePartialMatchingExpr(target, pattern) - let patternMigemo = s:makeAdditionalMigemoPattern(a:pattern) - if a:pattern !~ '[*?]' && empty(patternMigemo) - " NOTE: stridx is faster than regexp matching - return 'stridx(' . a:target . ', ' . string(a:pattern) . ') >= 0' - endif - return a:target . ' =~# ' . - \ string(l9#convertWildcardToRegexp(a:pattern)) . patternMigemo -endfunction - -" -function s:makeRefiningExpr(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 - return '(' . expr . ' || v:val.index == ' . string(a:pattern) . ')' - endif -endfunction - -" -function s:makeAdditionalMigemoPattern(pattern) - if !g:fuf_useMigemo || a:pattern =~# '[^\x01-\x7e]' - return '' - endif - return '\|\m' . substitute(migemo(a:pattern), '\\_s\*', '.*', 'g') -endfunction - -" -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 s:getWordBoundaries(word) - return substitute(a:word, '\a\zs\l\+\|\zs\A', '', 'g') -endfunction - -" -function s:toLowerForIgnoringCase(str) - return (g:fuf_ignoreCase ? tolower(a:str) : a:str) -endfunction - -" -function s:setRanks(item, pattern, exprBoundary, stats) - "let word2 = substitute(a:eval_word, '\a\zs\l\+\|\zs\A', '', 'g') - let a:item.ranks = [ - \ s:evaluateLearningRank(a:item.word, a:stats), - \ -s:scoreSequentialMatching(a:item.wordForRank, a:pattern), - \ -s:scoreBoundaryMatching(a:item.wordForBoundary, - \ a:pattern, a:exprBoundary), - \ a:item.index, - \ ] - return a:item -endfunction - -" -function s:evaluateLearningRank(word, stats) - for i in range(len(a:stats)) - if a:stats[i].word ==# a:word - return i - endif - endfor - return len(a:stats) -endfunction - -" range of return value is [0.0, 1.0] -function s:scoreSequentialMatching(word, pattern) - if empty(a:pattern) - return str2float('0.0') - endif - let pos = stridx(a:word, a:pattern) - if pos < 0 - return str2float('0.0') - endif - let lenRest = len(a:word) - len(a:pattern) - pos - 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 str2float('0.0') - endif - if !eval(a:exprBoundary) - return 0 - endif - 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, '\/')) -endfunction - -" -function s:highlightError() - syntax clear - syntax match Error /^.*$/ -endfunction - -" -function s:expandAbbrevMap(pattern, abbrevMap) - let result = [a:pattern] - for [pattern, subs] in items(a:abbrevMap) - let exprs = result - let result = [] - for expr in exprs - let result += map(copy(subs), 'substitute(expr, pattern, escape(v:val, ''\''), "g")') - endfor - endfor - return l9#unique(result) -endfunction - -" -function s:makeFileAbbrInfo(item, maxLenStats) - let head = matchstr(a:item.word, '^.*[/\\]\ze.') - let a:item.abbr = { 'head' : head, - \ 'tail' : a:item.word[strlen(head):], - \ 'key' : head . '.', - \ 'prefix' : printf('%4d: ', a:item.index), } - if exists('a:item.abbrPrefix') - let a:item.abbr.prefix .= a:item.abbrPrefix - endif - let len = len(a:item.abbr.prefix) + len(a:item.word) + - \ (exists('a:item.menu') ? len(a:item.menu) + 2 : 0) - if !exists('a:maxLenStats[a:item.abbr.key]') || len > a:maxLenStats[a:item.abbr.key] - let a:maxLenStats[a:item.abbr.key] = len - endif - return a:item -endfunction - -" -function s:getSnippedHead(head, baseLen) - return 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 = l9#snipTail(abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK) - return a:item -endfunction - -" -let s:FUF_BUF_NAME = '[fuf]' - -" -function s:activateFufBuffer() - " lcd . : To avoid the strange behavior that unnamed buffer changes its cwd - " if 'autochdir' was set on. - lcd . - let cwd = getcwd() - call l9#tempbuffer#openScratch(s:FUF_BUF_NAME, 'fuf', [], 1, 0, 1, {}) - resize 1 " for issue #21 - " lcd ... : countermeasure against auto-cd script - lcd `=cwd` - setlocal nocursorline " for highlighting - setlocal nocursorcolumn " for highlighting - setlocal omnifunc=fuf#onComplete - redraw " for 'lazyredraw' - if exists(':AcpLock') - AcpLock - elseif exists(':AutoComplPopLock') - AutoComplPopLock - endif -endfunction - -" -function s:deactivateFufBuffer() - if exists(':AcpUnlock') - AcpUnlock - elseif exists(':AutoComplPopUnlock') - AutoComplPopUnlock - endif - call l9#tempbuffer#close(s:FUF_BUF_NAME) -endfunction - -" }}}1 -"============================================================================= -" s:handlerBase {{{1 - -let s:handlerBase = {} - -"----------------------------------------------------------------------------- -" PURE VIRTUAL FUNCTIONS {{{2 -" -" " -" s:handler.getModeName() -" -" " -" s:handler.getPrompt() -" -" " -" s:handler.getCompleteItems(patternSet) -" -" " -" s:handler.onOpen(word, mode) -" -" " Before entering FuzzyFinder buffer. This function should return in a short time. -" s:handler.onModeEnterPre() -" -" " After entering FuzzyFinder buffer. -" s:handler.onModeEnterPost() -" -" " After leaving FuzzyFinder buffer. -" s:handler.onModeLeavePost(opened) -" -" }}}2 -"----------------------------------------------------------------------------- - -" -function s:handlerBase.concretize(deriv) - call extend(self, a:deriv, 'error') - return self -endfunction - -" -function s:handlerBase.addStat(pattern, word) - let stat = { 'pattern' : a:pattern, 'word' : a:word } - call filter(self.stats, 'v:val !=# stat') - call insert(self.stats, stat) - let self.stats = self.stats[0 : g:fuf_learningLimit - 1] -endfunction - -" -function s:handlerBase.getMatchingCompleteItems(patternBase) - let MakeMatchingExpr = function(self.partialMatching - \ ? 's:makePartialMatchingExpr' - \ : 's:makeFuzzyMatchingExpr') - let patternSet = self.makePatternSet(a:patternBase) - let exprBoundary = s:makeFuzzyMatchingExpr('a:wordForBoundary', patternSet.primaryForRank) - let stats = filter( - \ copy(self.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 = l9#filterWithLimit( - \ items, patternSet.filteringExpr, g:fuf_enumeratingLimit + 1) - return map(items, - \ 's:setRanks(v:val, patternSet.primaryForRank, exprBoundary, stats)') -endfunction - -" -function s:handlerBase.onComplete(findstart, base) - if a:findstart - return 0 - elseif !self.existsPrompt(a:base) - return [] - endif - call s:highlightPrompt(self.getPrompt()) - let items = [] - for patternBase in s:expandAbbrevMap(self.removePrompt(a:base), g:fuf_abbrevMap) - let items += self.getMatchingCompleteItems(patternBase) - if len(items) > g:fuf_enumeratingLimit - let items = items[ : g:fuf_enumeratingLimit - 1] - call s:highlightError() - break - endif - endfor - if empty(items) - call s:highlightError() - else - call sort(items, 'fuf#compareRanks') - 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 -endfunction - -" -function s:handlerBase.existsPrompt(line) - return strlen(a:line) >= strlen(self.getPrompt()) && - \ a:line[:strlen(self.getPrompt()) -1] ==# self.getPrompt() -endfunction - -" -function s:handlerBase.removePrompt(line) - return a:line[(self.existsPrompt(a:line) ? strlen(self.getPrompt()) : 0):] -endfunction - -" -function s:handlerBase.restorePrompt(line) - let i = 0 - while i < len(self.getPrompt()) && i < len(a:line) && self.getPrompt()[i] ==# a:line[i] - let i += 1 - endwhile - return self.getPrompt() . a:line[i : ] -endfunction - -" -function s:handlerBase.onCursorMovedI() - if !self.existsPrompt(getline('.')) - call setline('.', self.restorePrompt(getline('.'))) - call feedkeys("\", 'n') - elseif col('.') <= len(self.getPrompt()) - " if the cursor is moved before command prompt - call feedkeys(repeat("\", len(self.getPrompt()) - col('.') + 1), 'n') - elseif col('.') > strlen(getline('.')) && col('.') != self.lastCol - " if the cursor is placed on the end of the line and has been actually moved. - let self.lastCol = col('.') - let self.lastPattern = self.removePrompt(getline('.')) - call feedkeys("\\", 'n') - endif -endfunction - -" -function s:handlerBase.onInsertLeave() - unlet s:runningHandler - let tempVars = l9#tempvariables#getList(s:TEMP_VARIABLES_GROUP) - call l9#tempvariables#end(s:TEMP_VARIABLES_GROUP) - call s:deactivateFufBuffer() - 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('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) - if pumvisible() - 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 !self.isOpenable(getline('.')) - " To clear i_ expression (fuf#getRunningHandler().onCr...) - echo '' - return - endif - let s:reservedCommand = [self.removePrompt(getline('.')), a:openType] - call feedkeys("\", 'n') " stopinsert behavior is strange... -endfunction - -" -function s:handlerBase.onBs() - 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(repeatable) - if self.getPreviewHeight() <= 0 - return - elseif !pumvisible() - return - elseif !self.existsPrompt(getline('.')) - let word = self.removePrompt(getline('.')) - elseif !exists('self.lastFirstWord') - return - else - let word = self.lastFirstWord - endif - redraw - if a:repeatable && exists('self.lastPreviewInfo') && self.lastPreviewInfo.word ==# word - let self.lastPreviewInfo.count += 1 - else - let self.lastPreviewInfo = {'word': word, 'count': 0} - endif - let lines = self.makePreviewLines(word, self.lastPreviewInfo.count) - let lines = lines[: self.getPreviewHeight() - 1] - call map(lines, 'substitute(v:val, "\t", repeat(" ", &tabstop), "g")') - call map(lines, '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(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 self.reservedMode = self.getModeName() - for i in range(len(modes)) - if modes[i].ranks[1] ==# self.getModeName() - let self.reservedMode = modes[(i + a:shift) % len(modes)].ranks[1] - break - endif - endfor - call feedkeys("\", 'n') " stopinsert doesn't work. -endfunction - -" -function s:handlerBase.onSwitchMatching() - let self.partialMatching = !self.partialMatching - let self.lastCol = -1 - call setline('.', self.restorePrompt(self.lastPattern)) - call feedkeys("\", 'n') - "call self.onCursorMovedI() -endfunction - -" -function s:handlerBase.onRecallPattern(shift) - let patterns = map(copy(self.stats), 'v:val.pattern') - if !exists('self.indexRecall') - let self.indexRecall = -1 - endif - let self.indexRecall += a:shift - if self.indexRecall < 0 - let self.indexRecall = -1 - elseif self.indexRecall >= len(patterns) - let self.indexRecall = len(patterns) - 1 - else - call setline('.', self.getPrompt() . patterns[self.indexRecall]) - call feedkeys("\", 'n') - endif -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -augroup FufGlobal - autocmd! - autocmd BufLeave * let s:bufferCursorPosMap[bufnr('')] = getpos('.') -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/bookmarkdir.vim b/autoload/fuf/bookmarkdir.vim deleted file mode 100644 index 01585ff..0000000 --- a/autoload/fuf/bookmarkdir.vim +++ /dev/null @@ -1,163 +0,0 @@ -"============================================================================= -" Copyright (c) 2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#bookmarkdir#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#bookmarkdir#getSwitchOrder() - return g:fuf_bookmarkdir_switchOrder -endfunction - -" -function fuf#bookmarkdir#getEditableDataNames() - return ['items'] -endfunction - -" -function fuf#bookmarkdir#renewCache() -endfunction - -" -function fuf#bookmarkdir#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#bookmarkdir#onInit() - call fuf#defineLaunchCommand('FufBookmarkDir', s:MODE_NAME, '""', []) - command! -bang -narg=? FufBookmarkDirAdd call s:bookmark() -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') -let s:OPEN_TYPE_DELETE = -1 - -" -function s:bookmark(word) - let item = { - \ 'time' : localtime(), - \ } - - let item.path = l9#inputHl('Question', '[fuf] Directory to bookmark:', - \ fnamemodify(getcwd(), ':p:~'), 'dir') - if item.path !~ '\S' - call fuf#echoWarning('Canceled') - return - endif - let item.word = l9#inputHl('Question', '[fuf] Bookmark as:', - \ fnamemodify(getcwd(), ':p:~')) - if item.word !~ '\S' - call fuf#echoWarning('Canceled') - return - endif - let items = fuf#loadDataFile(s:MODE_NAME, 'items') - call insert(items, item) - call fuf#saveDataFile(s:MODE_NAME, 'items', items) -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_bookmarkdir_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return 0 -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return [] -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - if a:mode ==# s:OPEN_TYPE_DELETE - let items = fuf#loadDataFile(s:MODE_NAME, 'items') - call filter(items, 'v:val.word !=# a:word') - call fuf#saveDataFile(s:MODE_NAME, 'items', items) - let self.reservedMode = self.getModeName() - return - else - let item = s:findItem(fuf#loadDataFile(s:MODE_NAME, 'items'), a:word) - if !empty(item) - execute ':cd ' . fnameescape(item.path) - endif - endif -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - call fuf#defineKeyMappingInHandler(g:fuf_bookmarkdir_keyDelete, - \ 'onCr(' . s:OPEN_TYPE_DELETE . ')') - 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)') -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/bookmarkfile.vim b/autoload/fuf/bookmarkfile.vim deleted file mode 100644 index 12ac80f..0000000 --- a/autoload/fuf/bookmarkfile.vim +++ /dev/null @@ -1,199 +0,0 @@ -"============================================================================= -" Copyright (c) 2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#bookmarkfile#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#bookmarkfile#getSwitchOrder() - return g:fuf_bookmarkfile_switchOrder -endfunction - -" -function fuf#bookmarkfile#getEditableDataNames() - return ['items'] -endfunction - -" -function fuf#bookmarkfile#renewCache() -endfunction - -" -function fuf#bookmarkfile#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#bookmarkfile#onInit() - call fuf#defineLaunchCommand('FufBookmarkFile', s:MODE_NAME, '""', []) - command! -bang -narg=? FufBookmarkFileAdd call s:bookmarkHere() - command! -bang -narg=0 -range FufBookmarkFileAddAsSelectedText call s:bookmarkHere(l9#getSelectedText()) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') -let s:OPEN_TYPE_DELETE = -1 - -" 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_bookmarkfile_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#echoWarning('Can''t bookmark this buffer.') - 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 = l9#inputHl('Question', '[fuf] Bookmark as:', item.word) - if item.word !~ '\S' - call fuf#echoWarning('Canceled') - return - endif - let items = fuf#loadDataFile(s:MODE_NAME, 'items') - call insert(items, item) - call fuf#saveDataFile(s:MODE_NAME, 'items', items) -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_bookmarkfile_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -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(fuf#loadDataFile(s:MODE_NAME, 'items'), 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 - let items = fuf#loadDataFile(s:MODE_NAME, 'items') - call filter(items, 'v:val.word !=# a:word') - call fuf#saveDataFile(s:MODE_NAME, 'items', items) - let self.reservedMode = self.getModeName() - return - else - let item = s:findItem(fuf#loadDataFile(s:MODE_NAME, 'items'), 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_bookmarkfile_keyDelete, - \ 'onCr(' . s:OPEN_TYPE_DELETE . ')') - 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)') -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/buffer.vim b/autoload/fuf/buffer.vim deleted file mode 100644 index 08b954a..0000000 --- a/autoload/fuf/buffer.vim +++ /dev/null @@ -1,189 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#buffer#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#buffer#getSwitchOrder() - return g:fuf_buffer_switchOrder -endfunction - -" -function fuf#buffer#getEditableDataNames() - return [] -endfunction - -" -function fuf#buffer#renewCache() -endfunction - -" -function fuf#buffer#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#buffer#onInit() - call fuf#defineLaunchCommand('FufBuffer', s:MODE_NAME, '""', []) - augroup fuf#buffer - autocmd! - autocmd BufEnter * call s:updateBufTimes() - autocmd BufWritePost * call s:updateBufTimes() - augroup END -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') -let s:OPEN_TYPE_DELETE = -1 - -let s:bufTimes = {} - -" -function s:updateBufTimes() - let s:bufTimes[bufnr('%')] = localtime() -endfunction - -" -function s:makeItem(nr) - let fname = (empty(bufname(a:nr)) - \ ? '[No Name]' - \ : fnamemodify(bufname(a:nr), ':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 - let item.bufNr = a:nr - let item.time = time - let item.abbrPrefix = s:getBufIndicator(a:nr) . ' ' - return item -endfunction - -" -function s:getBufIndicator(bufNr) - if !getbufvar(a:bufNr, '&modifiable') - return '[-]' - elseif getbufvar(a:bufNr, '&modified') - return '[+]' - elseif getbufvar(a:bufNr, '&readonly') - return '[R]' - else - return ' ' - endif -endfunction - -" -function s:compareTimeDescending(i1, i2) - return a:i1.time == a:i2.time ? 0 : a:i1.time > a:i2.time ? -1 : +1 -endfunction - -" -function s:findItem(items, word) - for item in a:items - if item.word ==# a:word - return item - endif - endfor - return {} -endfunction - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_buffer_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - let item = s:findItem(self.items, a:word) - if empty(item) - return [] - endif - return fuf#makePreviewLinesForFile(item.bufNr, a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - " not use bufnr(a:word) in order to handle unnamed buffer - let item = s:findItem(self.items, a:word) - if empty(item) - " 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 - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - 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 sort(self.items, 's:compareTimeDescending') - call fuf#mapToSetSerialIndex(self.items, 1) - endif - let self.items = fuf#mapToSetAbbrWithSnippedWordAsPath(self.items) -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/buffertag.vim b/autoload/fuf/buffertag.vim deleted file mode 100644 index 392b996..0000000 --- a/autoload/fuf/buffertag.vim +++ /dev/null @@ -1,300 +0,0 @@ -"============================================================================= -" Copyright (c) 2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#buffertag#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#buffertag#getSwitchOrder() - return g:fuf_buffertag_switchOrder -endfunction - -" -function fuf#buffertag#getEditableDataNames() - return [] -endfunction - -" -function fuf#buffertag#renewCache() - let s:tagItemsCache = {} - let s:tagDataCache = {} -endfunction - -" -function fuf#buffertag#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#buffertag#onInit() - call fuf#defineLaunchCommand('FufBufferTag', s:MODE_NAME, '""', - \ [['g:fuf_buffertag_forAll', 0]]) - call fuf#defineLaunchCommand('FufBufferTagAll', s:MODE_NAME, '""', - \ [['g:fuf_buffertag_forAll', 1]]) - call fuf#defineLaunchCommand('FufBufferTagWithCursorWord', s:MODE_NAME, - \ 'expand('''')', [['g:fuf_buffertag_forAll', 0]]) - call fuf#defineLaunchCommand('FufBufferTagAllWithCursorWord', s:MODE_NAME, - \ 'expand('''')', [['g:fuf_buffertag_forAll', 1]]) - call fuf#defineLaunchCommand('FufBufferTagWithSelectedText', s:MODE_NAME, - \ 'l9#getSelectedText()', [['g:fuf_buffertag_forAll', 0]]) - call fuf#defineLaunchCommand('FufBufferTagAllWithSelectedText', s:MODE_NAME, - \ 'l9#getSelectedText()', [['g:fuf_buffertag_forAll', 1]]) - call l9#defineVariableDefault('g:fuf_buffertag_forAll', 0) " private option - " the following settings originate from taglist.vim - call l9#defineVariableDefault('g:fuf_buffertag__asm' , '--language-force=asm --asm-types=dlmt') - call l9#defineVariableDefault('g:fuf_buffertag__aspperl' , '--language-force=asp --asp-types=fsv') - call l9#defineVariableDefault('g:fuf_buffertag__aspvbs' , '--language-force=asp --asp-types=fsv') - call l9#defineVariableDefault('g:fuf_buffertag__awk' , '--language-force=awk --awk-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__beta' , '--language-force=beta --beta-types=fsv') - call l9#defineVariableDefault('g:fuf_buffertag__c' , '--language-force=c --c-types=dgsutvf') - call l9#defineVariableDefault('g:fuf_buffertag__cpp' , '--language-force=c++ --c++-types=nvdtcgsuf') - call l9#defineVariableDefault('g:fuf_buffertag__cs' , '--language-force=c# --c#-types=dtncEgsipm') - call l9#defineVariableDefault('g:fuf_buffertag__cobol' , '--language-force=cobol --cobol-types=dfgpPs') - call l9#defineVariableDefault('g:fuf_buffertag__eiffel' , '--language-force=eiffel --eiffel-types=cf') - call l9#defineVariableDefault('g:fuf_buffertag__erlang' , '--language-force=erlang --erlang-types=drmf') - call l9#defineVariableDefault('g:fuf_buffertag__expect' , '--language-force=tcl --tcl-types=cfp') - call l9#defineVariableDefault('g:fuf_buffertag__fortran' , '--language-force=fortran --fortran-types=pbceiklmntvfs') - call l9#defineVariableDefault('g:fuf_buffertag__html' , '--language-force=html --html-types=af') - call l9#defineVariableDefault('g:fuf_buffertag__java' , '--language-force=java --java-types=pcifm') - call l9#defineVariableDefault('g:fuf_buffertag__javascript', '--language-force=javascript --javascript-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__lisp' , '--language-force=lisp --lisp-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__lua' , '--language-force=lua --lua-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__make' , '--language-force=make --make-types=m') - call l9#defineVariableDefault('g:fuf_buffertag__pascal' , '--language-force=pascal --pascal-types=fp') - call l9#defineVariableDefault('g:fuf_buffertag__perl' , '--language-force=perl --perl-types=clps') - call l9#defineVariableDefault('g:fuf_buffertag__php' , '--language-force=php --php-types=cdvf') - call l9#defineVariableDefault('g:fuf_buffertag__python' , '--language-force=python --python-types=cmf') - call l9#defineVariableDefault('g:fuf_buffertag__rexx' , '--language-force=rexx --rexx-types=s') - call l9#defineVariableDefault('g:fuf_buffertag__ruby' , '--language-force=ruby --ruby-types=cfFm') - call l9#defineVariableDefault('g:fuf_buffertag__scheme' , '--language-force=scheme --scheme-types=sf') - call l9#defineVariableDefault('g:fuf_buffertag__sh' , '--language-force=sh --sh-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__csh' , '--language-force=sh --sh-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__zsh' , '--language-force=sh --sh-types=f') - call l9#defineVariableDefault('g:fuf_buffertag__slang' , '--language-force=slang --slang-types=nf') - call l9#defineVariableDefault('g:fuf_buffertag__sml' , '--language-force=sml --sml-types=ecsrtvf') - call l9#defineVariableDefault('g:fuf_buffertag__sql' , '--language-force=sql --sql-types=cFPrstTvfp') - call l9#defineVariableDefault('g:fuf_buffertag__tcl' , '--language-force=tcl --tcl-types=cfmp') - call l9#defineVariableDefault('g:fuf_buffertag__vera' , '--language-force=vera --vera-types=cdefgmpPtTvx') - call l9#defineVariableDefault('g:fuf_buffertag__verilog' , '--language-force=verilog --verilog-types=mcPertwpvf') - call l9#defineVariableDefault('g:fuf_buffertag__vim' , '--language-force=vim --vim-types=avf') - call l9#defineVariableDefault('g:fuf_buffertag__yacc' , '--language-force=yacc --yacc-types=l') -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:parseTagLine(line) - " tag W:\Win32\SRC7\NCSIM\NCVW32\CUBEFACE.H /^#define CUBEFACE_H$/;" macro line:4 - let fields = matchlist(a:line, '\v^([^\t]+)\t(.+)\t\/\^(.+)\$\/\;\"\t(.+)\tline\:(\d+)') - if empty(fields) - return {} - endif - return { - \ 'tag' : fields[1], - \ 'fname' : fields[2], - \ 'pattern': fields[3], - \ 'kind' : fields[4], - \ 'lnum' : str2nr(fields[5]), - \ } -endfunction - -" -let s:TEMP_VARIABLES_GROUP = expand(':p') - -" -function s:getFileType(bufNr) - let ft = getbufvar(a:bufNr, '&filetype') - if !empty(ft) || bufloaded(a:bufNr) - return ft - endif - let ft = getbufvar(a:bufNr, 'fuf_buffertag_filetype') - if !empty(ft) - return ft - endif - call l9#tempvariables#set(s:TEMP_VARIABLES_GROUP, '&eventignore', 'FileType') - call l9#tempvariables#set(s:TEMP_VARIABLES_GROUP, '&filetype', &filetype) - " from taglist.vim - execute 'doautocmd filetypedetect BufRead ' . bufname(a:bufNr) - let ft = &filetype - call l9#tempvariables#end(s:TEMP_VARIABLES_GROUP) - call setbufvar(a:bufNr, 'fuf_buffertag_filetype', ft) - return ft -endfunction - -" -function s:makeCtagsCmd(bufNr) - let ft = s:getFileType(a:bufNr) - if !exists('g:fuf_buffertag__{ft}') - return '' - endif - " - let cmd = join([g:fuf_buffertag_ctagsPath, - \ '-f - --sort=no --excmd=pattern --fields=nKs', - \ g:fuf_buffertag__{ft}, - \ shellescape(fnamemodify(bufname(a:bufNr), ':p'))]) - return cmd -endfunction - -" -function s:getTagItems(bufNr) - let cmd = s:makeCtagsCmd(a:bufNr) - if empty(cmd) - return [] - elseif !exists('s:tagItemsCache[cmd]') || - \ s:tagItemsCache[cmd].time < getftime(expand(bufname(a:bufNr))) - let items = split(system(cmd), "\n") - if v:shell_error - call fuf#echoError([cmd] + items) - throw "Command error" - endif - call map(items, 's:parseTagLine(v:val)') - call filter(items, '!empty(v:val)') - let s:tagItemsCache[cmd] = { - \ 'time' : localtime(), - \ 'items' : items, - \ } - endif - return s:tagItemsCache[cmd].items -endfunction - -" -function s:makeItem(tag, itemMap) - let menu = fnamemodify(a:itemMap[a:tag][0].fname, ':t') - \ . ' [' . a:itemMap[a:tag][0].kind . ']' - if len(a:itemMap[a:tag]) > 1 - let menu .= ' (' . len(a:itemMap[a:tag]) . ')' - endif - let item = fuf#makeNonPathItem(a:tag, menu) - return item -endfunction - -" -function s:getTagData(bufNrs) - let key = join([0] + sort(copy(a:bufNrs)), "\n") - let bufNames = map(copy(a:bufNrs), 'bufname(v:val)') - if !exists('s:tagDataCache[key]') || - \ fuf#countModifiedFiles(bufNames, s:tagDataCache[key].time) > 0 - let itemMap = {} - for item in l9#concat(map(copy(a:bufNrs), 's:getTagItems(v:val)')) - if !exists('itemMap[item.tag]') - let itemMap[item.tag] = [] - endif - call add(itemMap[item.tag], item) - endfor - let items = sort(keys(itemMap)) - call map(items, 's:makeItem(v:val, itemMap)') - call fuf#mapToSetSerialIndex(items, 1) - call map(items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') - let s:tagDataCache[key] = { - \ 'time' : localtime(), - \ 'itemMap': itemMap, - \ 'items' : items, - \ } - endif - return [s:tagDataCache[key].items, s:tagDataCache[key].itemMap] -endfunction - -" -function s:jumpToTag(item, mode) - call fuf#openFile(a:item.fname, a:mode, g:fuf_reuseWindow) - call cursor(a:item.lnum, 1) - normal! zvzz -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_buffertag_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return 0 -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return [] -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - if !exists('self.itemMap[a:word][0]') - call fuf#echoError('Definition not found:' . a:word) - return - elseif len(self.itemMap[a:word]) == 1 - let i = 0 - else - let list = map(fuf#mapToSetSerialIndex(copy(self.itemMap[a:word]), 1), - \ 'printf(" %2d: %s|%d| [%s] %s",v:val.index, fnamemodify(v:val.fname, ":~:."), v:val.lnum, v:val.kind, v:val.pattern)') - let i = inputlist(['Select a definition of "' . a:word . '":'] + list) - 1 - endif - if 0 <= i && i < len(self.itemMap[a:word]) - call s:jumpToTag(self.itemMap[a:word][i], a:mode) - endif -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - if g:fuf_buffertag_forAll - let bufNrs = filter(range(1, bufnr('$')), 'buflisted(v:val)') - else - let bufNrs = [self.bufNrPrev] - endif - let [self.items, self.itemMap] = s:getTagData(bufNrs) -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/callbackfile.vim b/autoload/fuf/callbackfile.vim deleted file mode 100644 index fedf0cf..0000000 --- a/autoload/fuf/callbackfile.vim +++ /dev/null @@ -1,137 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#callbackfile#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#callbackfile#getSwitchOrder() - return -1 -endfunction - -" -function fuf#callbackfile#getEditableDataNames() - return [] -endfunction - -" -function fuf#callbackfile#renewCache() - let s:cache = {} -endfunction - -" -function fuf#callbackfile#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#callbackfile#onInit() -endfunction - -" -function fuf#callbackfile#launch(initialPattern, partialMatching, prompt, exclude, listener) - let s:prompt = (empty(a:prompt) ? '>' : a:prompt) - let s:exclude = a:exclude - let s:listener = a:listener - call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:enumItems(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) - call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0)) - endif - call fuf#mapToSetSerialIndex(s:cache[key], 1) - call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key]) - endif - return s:cache[key] -endfunction - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return a:enteredPattern =~# '[^/\\]$' -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - let items = copy(s:enumItems(fuf#splitPath(a:patternPrimary).head)) - return filter(items, 'bufnr("^" . v:val.word . "$") != self.bufNrPrev') -endfunction - -" -function s:handler.onOpen(word, mode) - call s:listener.onComplete(a:word, a:mode) -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) - if !a:opened && exists('s:listener.onAbort()') - call s:listener.onAbort() - endif -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/callbackitem.vim b/autoload/fuf/callbackitem.vim deleted file mode 100644 index 118ee08..0000000 --- a/autoload/fuf/callbackitem.vim +++ /dev/null @@ -1,139 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#callbackitem#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#callbackitem#getSwitchOrder() - return -1 -endfunction - -" -function fuf#callbackitem#getEditableDataNames() - return [] -endfunction - -" -function fuf#callbackitem#renewCache() -endfunction - -" -function fuf#callbackitem#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#callbackitem#onInit() -endfunction - -" -function fuf#callbackitem#launch(initialPattern, partialMatching, prompt, listener, items, forPath) - let s:prompt = (empty(a:prompt) ? '>' : a:prompt) - let s:listener = a:listener - let s:forPath = a:forPath - let s:items = copy(a:items) - if s:forPath - call map(s:items, 'fuf#makePathItem(v:val, "", 1)') - call fuf#mapToSetSerialIndex(s:items, 1) - call fuf#mapToSetAbbrWithSnippedWordAsPath(s:items) - else - call map(s:items, 'fuf#makeNonPathItem(v:val, "")') - call fuf#mapToSetSerialIndex(s:items, 1) - call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') - endif - call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - if s:forPath - return g:fuf_previewHeight - endif - return 0 -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - let parser = (s:forPath - \ ? 's:interpretPrimaryPatternForPath' - \ : 's:interpretPrimaryPatternForNonPath') - return fuf#makePatternSet(a:patternBase, parser, self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - if s:forPath - return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) - endif - return [] -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:items -endfunction - -" -function s:handler.onOpen(word, mode) - call s:listener.onComplete(a:word, a:mode) -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) - if !a:opened && exists('s:listener.onAbort()') - call s:listener.onAbort() - endif -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/changelist.vim b/autoload/fuf/changelist.vim deleted file mode 100644 index 545f6ca..0000000 --- a/autoload/fuf/changelist.vim +++ /dev/null @@ -1,172 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#changelist#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#changelist#getSwitchOrder() - return g:fuf_changelist_switchOrder -endfunction - -" -function fuf#changelist#getEditableDataNames() - return [] -endfunction - -" -function fuf#changelist#renewCache() -endfunction - -" -function fuf#changelist#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#changelist#onInit() - call fuf#defineLaunchCommand('FufChangeList', s:MODE_NAME, '""', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:getChangesLines() - redir => result - :silent changes - redir END - return split(result, "\n") -endfunction - -" -function s:parseChangesLine(line) - " return matchlist(a:line, '^\(.\)\s\+\(\d\+\)\s\(.*\)$') - let elements = matchlist(a:line, '\v^(.)\s*(\d+)\s+(\d+)\s+(\d+)\s*(.*)$') - if empty(elements) - return {} - endif - return { - \ 'prefix': elements[1], - \ 'count' : elements[2], - \ 'lnum' : elements[3], - \ 'text' : printf('|%d:%d|%s', elements[3], elements[4], elements[5]), - \ } -endfunction - -" -function s:makeItem(line) - let parsed = s:parseChangesLine(a:line) - if empty(parsed) - return {} - endif - let item = fuf#makeNonPathItem(parsed.text, '') - let item.abbrPrefix = parsed.prefix - let item.lnum = parsed.lnum - return item -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_changelist_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - let items = filter(copy(self.items), 'v:val.word ==# a:word') - if empty(items) - return [] - endif - let lines = fuf#getFileLines(self.bufNrPrev) - return fuf#makePreviewLinesAround( - \ lines, [items[0].lnum - 1], a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#prejump(a:mode) - let older = 0 - for line in reverse(s:getChangesLines()) - if stridx(line, '>') == 0 - let older = 1 - endif - let parsed = s:parseChangesLine(line) - if !empty(parsed) && parsed.text ==# a:word - if parsed.count != 0 - execute 'normal! ' . parsed.count . (older ? 'g;' : 'g,') . 'zvzz' - endif - break - endif - endfor -endfunction - -" -function s:handler.onModeEnterPre() - let self.items = s:getChangesLines() -endfunction - -" -function s:handler.onModeEnterPost() - call map(self.items, 's:makeItem(v:val)') - call filter(self.items, '!empty(v:val)') - call reverse(self.items) - 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/coveragefile.vim b/autoload/fuf/coveragefile.vim deleted file mode 100644 index 1471ef8..0000000 --- a/autoload/fuf/coveragefile.vim +++ /dev/null @@ -1,199 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#coveragefile#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#coveragefile#getSwitchOrder() - return g:fuf_coveragefile_switchOrder -endfunction - -" -function fuf#coveragefile#getEditableDataNames() - return ['coverages'] -endfunction - -" -function fuf#coveragefile#renewCache() - let s:cache = {} -endfunction - -" -function fuf#coveragefile#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#coveragefile#onInit() - call fuf#defineLaunchCommand('FufCoverageFile', s:MODE_NAME, '""', []) - call l9#defineVariableDefault('g:fuf_coveragefile_name', '') " private option - command! -bang -narg=0 FufCoverageFileRegister call s:registerCoverage() - command! -bang -narg=? FufCoverageFileChange call s:changeCoverage() -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:enumItems() - let key = join([getcwd(), g:fuf_ignoreCase, g:fuf_coveragefile_exclude, - \ g:fuf_coveragefile_globPatterns], "\n") - if !exists('s:cache[key]') - let s:cache[key] = l9#concat(map(copy(g:fuf_coveragefile_globPatterns), - \ 'fuf#glob(v:val)')) - call filter(s:cache[key], 'filereadable(v:val)') " filter out directories - call map(s:cache[key], 'fuf#makePathItem(fnamemodify(v:val, ":~:."), "", 0)') - if len(g:fuf_coveragefile_exclude) - call filter(s:cache[key], 'v:val.word !~ g:fuf_coveragefile_exclude') - endif - call fuf#mapToSetSerialIndex(s:cache[key], 1) - call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key]) - endif - return s:cache[key] -endfunction - -" -function s:registerCoverage() - let patterns = [] - while 1 - let pattern = l9#inputHl('Question', '[fuf] Glob pattern for coverage ( and end):', - \ '', 'file') - if pattern !~ '\S' - break - endif - call add(patterns, pattern) - endwhile - if empty(patterns) - call fuf#echoWarning('Canceled') - return - endif - echo '[fuf] patterns: ' . string(patterns) - let name = l9#inputHl('Question', '[fuf] Coverage name:') - if name !~ '\S' - call fuf#echoWarning('Canceled') - return - endif - let coverages = fuf#loadDataFile(s:MODE_NAME, 'coverages') - call insert(coverages, {'name': name, 'patterns': patterns}) - call fuf#saveDataFile(s:MODE_NAME, 'coverages', coverages) -endfunction - -" -function s:createChangeCoverageListener() - let listener = {} - - function listener.onComplete(name, method) - call s:changeCoverage(a:name) - endfunction - - return listener -endfunction - -" -function s:changeCoverage(name) - let coverages = fuf#loadDataFile(s:MODE_NAME, 'coverages') - if a:name !~ '\S' - let names = map(copy(coverages), 'v:val.name') - call fuf#callbackitem#launch('', 0, '>Coverage>', s:createChangeCoverageListener(), names, 0) - return - else - let name = a:name - endif - call filter(coverages, 'v:val.name ==# name') - if empty(coverages) - call fuf#echoError('Coverage not found: ' . name) - return - endif - call fuf#setOneTimeVariables( - \ ['g:fuf_coveragefile_globPatterns', coverages[0].patterns], - \ ['g:fuf_coveragefile_name' , a:name] - \ ) - FufCoverageFile -endfunction - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - let nameString = (empty(g:fuf_coveragefile_name) ? '' - \ : '[' . g:fuf_coveragefile_name . ']') - return fuf#formatPrompt(g:fuf_coveragefile_prompt, self.partialMatching, - \ nameString) -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - " NOTE: Comparing filenames is faster than bufnr('^' . fname . '$') - let bufNamePrev = fnamemodify(bufname(self.bufNrPrev), ':~:.') - let self.items = copy(s:enumItems()) - call filter(self.items, 'v:val.word !=# bufNamePrev') -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/dir.vim b/autoload/fuf/dir.vim deleted file mode 100644 index 5316093..0000000 --- a/autoload/fuf/dir.vim +++ /dev/null @@ -1,132 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#dir#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#dir#getSwitchOrder() - return g:fuf_dir_switchOrder -endfunction - -" -function fuf#dir#getEditableDataNames() - return [] -endfunction - -" -function fuf#dir#renewCache() - let s:cache = {} -endfunction - -" -function fuf#dir#requiresOnCommandPre() - return 0 -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''))]', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:enumItems(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 =~# ''[/\\]$''') - if isdirectory(a:dir) - call insert(s:cache[key], fuf#makePathItem(a:dir . '.', '', 0)) - endif - call fuf#mapToSetSerialIndex(s:cache[key], 1) - call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key]) - endif - return s:cache[key] -endfunction - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_dir_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return a:enteredPattern =~# '[^/\\]$' -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesAround( - \ fuf#glob(fnamemodify(a:word, ':p') . '*'), - \ [], a:count, self.getPreviewHeight()) - return -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:enumItems(fuf#splitPath(a:patternPrimary).head) -endfunction - -" -function s:handler.onOpen(word, mode) - execute ':cd ' . fnameescape(a:word) -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/file.vim b/autoload/fuf/file.vim deleted file mode 100644 index 1569192..0000000 --- a/autoload/fuf/file.vim +++ /dev/null @@ -1,139 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#file#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#file#getSwitchOrder() - return g:fuf_file_switchOrder -endfunction - -" -function fuf#file#getEditableDataNames() - return [] -endfunction - -" -function fuf#file#renewCache() - let s:cache = {} -endfunction - -" -function fuf#file#requiresOnCommandPre() - return 0 -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''))]', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:enumItems(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) - call fuf#mapToSetAbbrWithSnippedWordAsPath(s:cache[key]) - endif - return s:cache[key] -endfunction - -" -function s:enumNonCurrentItems(dir, bufNrPrev, cache) - let key = a:dir . 'AVOIDING EMPTY KEY' - if !exists('a:cache[key]') - " 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 !=# bufNamePrev') - endif - return a:cache[key] -endfunction - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(g:fuf_file_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return a:enteredPattern =~# '[^/\\]$' -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPathTail', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:enumNonCurrentItems( - \ fuf#splitPath(a:patternPrimary).head, self.bufNrPrev, self.cache) -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - let self.cache = {} -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/givencmd.vim b/autoload/fuf/givencmd.vim deleted file mode 100644 index d59178c..0000000 --- a/autoload/fuf/givencmd.vim +++ /dev/null @@ -1,123 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#givencmd#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#givencmd#getSwitchOrder() - return -1 -endfunction - -" -function fuf#givencmd#getEditableDataNames() - return [] -endfunction - -" -function fuf#givencmd#renewCache() -endfunction - -" -function fuf#givencmd#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#givencmd#onInit() -endfunction - -" -function fuf#givencmd#launch(initialPattern, partialMatching, prompt, items) - let s:prompt = (empty(a:prompt) ? '>' : a:prompt) - let s:items = copy(a:items) - call map(s:items, 'fuf#makeNonPathItem(v:val, "")') - call fuf#mapToSetSerialIndex(s:items, 1) - call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') - call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return 0 -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return [] -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:items -endfunction - -" -function s:handler.onOpen(word, mode) - if a:word[0] =~# '[:/?]' - call histadd(a:word[0], a:word[1:]) - endif - call feedkeys(a:word . "\", 'n') -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/givendir.vim b/autoload/fuf/givendir.vim deleted file mode 100644 index e654d85..0000000 --- a/autoload/fuf/givendir.vim +++ /dev/null @@ -1,123 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#givendir#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#givendir#getSwitchOrder() - return -1 -endfunction - -" -function fuf#givendir#getEditableDataNames() - return [] -endfunction - -" -function fuf#givendir#renewCache() -endfunction - -" -function fuf#givendir#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#givendir#onInit() -endfunction - -" -function fuf#givendir#launch(initialPattern, partialMatching, prompt, items) - let s:prompt = (empty(a:prompt) ? '>' : a:prompt) - let s:items = map(copy(a:items), 'substitute(v:val, ''[/\\]\?$'', "", "")') - let s:items = map(s:items, 'fuf#makePathItem(v:val, "", 0)') - call fuf#mapToSetSerialIndex(s:items, 1) - call fuf#mapToSetAbbrWithSnippedWordAsPath(s:items) - call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesAround( - \ fuf#glob(fnamemodify(a:word, ':p') . '*'), - \ [], a:count, self.getPreviewHeight()) - return -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:items -endfunction - -" -function s:handler.onOpen(word, mode) - execute ':cd ' . fnameescape(a:word) -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/givenfile.vim b/autoload/fuf/givenfile.vim deleted file mode 100644 index 5419ff8..0000000 --- a/autoload/fuf/givenfile.vim +++ /dev/null @@ -1,121 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#givenfile#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#givenfile#getSwitchOrder() - return -1 -endfunction - -" -function fuf#givenfile#getEditableDataNames() - return [] -endfunction - -" -function fuf#givenfile#renewCache() -endfunction - -" -function fuf#givenfile#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#givenfile#onInit() -endfunction - -" -function fuf#givenfile#launch(initialPattern, partialMatching, prompt, items) - let s:prompt = (empty(a:prompt) ? '>' : a:prompt) - let s:items = map(copy(a:items), 'fuf#makePathItem(v:val, "", 0)') - call fuf#mapToSetSerialIndex(s:items, 1) - call map(s:items, 'fuf#setAbbrWithFormattedWord(v:val, 1)') - call fuf#launch(s:MODE_NAME, a:initialPattern, a:partialMatching) -endfunction - - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" }}}1 -"============================================================================= -" s:handler {{{1 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - return fuf#formatPrompt(s:prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) -endfunction - - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/help.vim b/autoload/fuf/help.vim deleted file mode 100644 index 8f03e36..0000000 --- a/autoload/fuf/help.vim +++ /dev/null @@ -1,198 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#help#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#help#getSwitchOrder() - return g:fuf_help_switchOrder -endfunction - -" -function fuf#help#getEditableDataNames() - return [] -endfunction - -" -function fuf#help#renewCache() - let s:cache = {} -endfunction - -" -function fuf#help#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#help#onInit() - call fuf#defineLaunchCommand('FufHelp' , s:MODE_NAME, '""', []) - call fuf#defineLaunchCommand('FufHelpWithCursorWord', s:MODE_NAME, 'expand('''')', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:getCurrentHelpTagFiles() - 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")')) -endfunction - -" -function s:parseHelpTagEntry(line, tagFile) - let elements = split(a:line, "\t") - if len(elements) != 3 || elements[0][0] ==# '!' - return {} - endif - let suffix = matchstr(a:tagFile, '-\zs..$') - if empty(suffix) - let suffix = '@en' - else - let suffix = '@' . suffix - endif - let dir = fnamemodify(a:tagFile, ':h') . l9#getPathSeparator() - return { - \ 'word' : elements[0] . suffix, - \ 'path' : dir . elements[1], - \ 'pattern': elements[2][1:], - \ } -endfunction - -" -function s:getHelpTagEntries(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, 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 = 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)') - call fuf#saveDataFile(s:MODE_NAME, cacheName, items) - return items -endfunction - -" -function s:enumHelpTags(tagFiles) - if !len(a:tagFiles) - return [] - endif - 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, key) - \ } - endif - return s:cache[key].items -endfunction - -" -function s:getMatchingIndex(lines, pattern) - if empty(a:pattern) - return -1 - endif - for i in range(len(a:lines)) - if stridx(a:lines[i], a:pattern) >= 0 - return i - endif - endfor - return -1 -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_help_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - let items = filter(copy(s:enumHelpTags(self.tagFiles)), 'v:val.word ==# a:word') - if empty(items) - return [] - endif - let lines = fuf#getFileLines(items[0].path) - let index = s:getMatchingIndex(lines, items[0].pattern) - return [items[0].path . ':'] + fuf#makePreviewLinesAround( - \ lines, (index < 0 ? [] : [index]), a:count, self.getPreviewHeight() - 1) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:enumHelpTags(self.tagFiles) -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#openHelp(a:word, a:mode) -endfunction - -" -function s:handler.onModeEnterPre() - let self.tagFiles = s:getCurrentHelpTagFiles() -endfunction - -" -function s:handler.onModeEnterPost() -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/jumplist.vim b/autoload/fuf/jumplist.vim deleted file mode 100644 index ddbb1ab..0000000 --- a/autoload/fuf/jumplist.vim +++ /dev/null @@ -1,182 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#jumplist#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#jumplist#getSwitchOrder() - return g:fuf_jumplist_switchOrder -endfunction - -" -function fuf#jumplist#getEditableDataNames() - return [] -endfunction - -" -function fuf#jumplist#renewCache() -endfunction - -" -function fuf#jumplist#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#jumplist#onInit() - call fuf#defineLaunchCommand('FufJumpList', s:MODE_NAME, '""', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:getJumpsLines() - redir => result - :silent jumps - redir END - return split(result, "\n") -endfunction - -" -function s:parseJumpsLine(line, bufnrPrev) - "return matchlist(a:line, '^\(.\)\s\+\(\d\+\)\s\(.*\)$') - let elements = matchlist(a:line, '\v^(.)\s*(\d+)\s+(\d+)\s+(\d+)\s*(.*)$') - if empty(elements) - return {} - endif - let linePrevBuffer = join(getbufline(a:bufnrPrev, elements[3])) - if stridx(linePrevBuffer, elements[5]) >= 0 - let fname = bufname(a:bufnrPrev) - let text = elements[5] - else - let fname = elements[5] - let text = join(getbufline('^' . elements[5] . '$', elements[3])) - endif - return { - \ 'prefix': elements[1], - \ 'count' : elements[2], - \ 'lnum' : elements[3], - \ 'fname' : fname, - \ 'text' : printf('%s|%d:%d|%s', fname, elements[3], elements[4], text), - \ } -endfunction - -" -function s:makeItem(line, bufnrPrev) - let parsed = s:parseJumpsLine(a:line, a:bufnrPrev) - if empty(parsed) - return {} - endif - let item = fuf#makeNonPathItem(parsed.text, '') - let item.abbrPrefix = parsed.prefix - let item.lnum = parsed.lnum - let item.fname = parsed.fname - return item -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_jumplist_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - let items = filter(copy(self.items), 'v:val.word ==# a:word') - if empty(items) - return [] - endif - let lines = fuf#getFileLines(items[0].fname) - return fuf#makePreviewLinesAround( - \ lines, [items[0].lnum - 1], a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#prejump(a:mode) - let older = 0 - for line in reverse(s:getJumpsLines()) - if stridx(line, '>') == 0 - let older = 1 - endif - let parsed = s:parseJumpsLine(line, self.bufNrPrev) - if !empty(parsed) && parsed.text ==# a:word - if parsed.count != 0 - execute 'normal! ' . parsed.count . (older ? "\" : "\") . 'zvzz' - endif - break - endif - endfor -endfunction - -" -function s:handler.onModeEnterPre() - let self.items = s:getJumpsLines() -endfunction - -" -function s:handler.onModeEnterPost() - call map(self.items, 's:makeItem(v:val, self.bufNrPrev)') - call filter(self.items, '!empty(v:val)') - call reverse(self.items) - 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/line.vim b/autoload/fuf/line.vim deleted file mode 100644 index 60447b5..0000000 --- a/autoload/fuf/line.vim +++ /dev/null @@ -1,135 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#line#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#line#getSwitchOrder() - return g:fuf_line_switchOrder -endfunction - -" -function fuf#line#getEditableDataNames() - return [] -endfunction - -" -function fuf#line#renewCache() -endfunction - -" -function fuf#line#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#line#onInit() - call fuf#defineLaunchCommand('FufLine', s:MODE_NAME, '""', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') -let s:OPEN_TYPE_DELETE = -1 - -" }}}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_line_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - let items = filter(copy(self.items), 'v:val.word ==# a:word') - if empty(items) - return [] - endif - let lines = fuf#getFileLines(self.bufNrPrev) - return fuf#makePreviewLinesAround( - \ lines, [items[0].index - 1], a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#prejump(a:mode) - call filter(self.items, 'v:val.word ==# a:word') - if empty(self.items) - return - execute 'cc ' . self.items[0].index - endif - call cursor(self.items[0].index, 0) - normal! zvzz -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - let tab = repeat(' ', getbufvar(self.bufNrPrev, '&tabstop')) - let self.items = getbufline(self.bufNrPrev, 1, '$') - let lnumFormat = '%' . len(string(len(self.items) + 1)) . 'd|' - for i in range(len(self.items)) - let self.items[i] = printf(lnumFormat, i + 1) - \ . substitute(self.items[i], "\t", tab, 'g') - endfor - call map(self.items, 'fuf#makeNonPathItem(v:val, "")') - call fuf#mapToSetSerialIndex(self.items, 1) - call map(self.items, 'fuf#setAbbrWithFormattedWord(v:val, 0)') -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/mrucmd.vim b/autoload/fuf/mrucmd.vim deleted file mode 100644 index 58632ce..0000000 --- a/autoload/fuf/mrucmd.vim +++ /dev/null @@ -1,134 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#mrucmd#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#mrucmd#getSwitchOrder() - return g:fuf_mrucmd_switchOrder -endfunction - -" -function fuf#mrucmd#getEditableDataNames() - return ['items'] -endfunction - -" -function fuf#mrucmd#renewCache() -endfunction - -" -function fuf#mrucmd#requiresOnCommandPre() - return 1 -endfunction - -" -function fuf#mrucmd#onInit() - call fuf#defineLaunchCommand('FufMruCmd', s:MODE_NAME, '""', []) -endfunction - -" -function fuf#mrucmd#onCommandPre(cmd) - if getcmdtype() =~# '^[:/?]' - call s:updateInfo(a:cmd) - endif -endfunction - - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:updateInfo(cmd) - 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#saveDataFile(s:MODE_NAME, 'items', items) -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_mrucmd_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return 0 -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return [] -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call s:updateInfo(a:word) - call histadd(a:word[0], a:word[1:]) - call feedkeys(a:word . "\", 'n') -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - 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)') -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/mrufile.vim b/autoload/fuf/mrufile.vim deleted file mode 100644 index f90b9e3..0000000 --- a/autoload/fuf/mrufile.vim +++ /dev/null @@ -1,234 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#mrufile#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -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 - -" -function fuf#mrufile#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#mrufile#onInit() - 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:updateData() - autocmd BufWritePost * call s:updateData() - augroup END -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') -let s:OPEN_TYPE_EXPAND = -1 - -" -function s:updateData() - if !empty(&buftype) || !filereadable(expand('%')) - return - endif - 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#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 - -" -function s:removeItemFromCache(word) - for items in values(s:cache) - if exists('items[a:word]') - unlet items[a:word] - endif - endfor -endfunction - -" returns empty value if invalid item -function s:formatItemUsingCache(item) - if a:item.word !~ '\S' - return {} - endif - if !exists('s:cache[a:item.word]') - if filereadable(a:item.word) - let s:cache[a:item.word] = fuf#makePathItem( - \ fnamemodify(a:item.word, ':p:~'), strftime(g:fuf_timeFormat, a:item.time), 0) - else - let s:cache[a:item.word] = {} - endif - endif - 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 - -let s:handler = {} - -" -function s:handler.getModeName() - return s:MODE_NAME -endfunction - -" -function s:handler.getPrompt() - 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 - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesForFile(a:word, 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_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 - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - 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 - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/quickfix.vim b/autoload/fuf/quickfix.vim deleted file mode 100644 index dd5d67c..0000000 --- a/autoload/fuf/quickfix.vim +++ /dev/null @@ -1,154 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#quickfix#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#quickfix#getSwitchOrder() - return g:fuf_quickfix_switchOrder -endfunction - -" -function fuf#quickfix#getEditableDataNames() - return [] -endfunction - -" -function fuf#quickfix#renewCache() -endfunction - -" -function fuf#quickfix#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#quickfix#onInit() - call fuf#defineLaunchCommand('FufQuickfix', s:MODE_NAME, '""', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:getJumpsLines() - redir => result - :silent jumps - redir END - return split(result, "\n") -endfunction - -" -function s:parseJumpsLine(line) - return matchlist(a:line, '^\(.\)\s\+\(\d\+\)\s\(.*\)$') -endfunction - -" -function s:makeItem(qfItem) - if !a:qfItem.valid - return {} - endif - let item = fuf#makeNonPathItem( - \ printf('%s|%d:%d|%s', bufname(a:qfItem.bufnr), a:qfItem.lnum, - \ a:qfItem.col, matchstr(a:qfItem.text, '\s*\zs.*\S')) - \ , '') - let item.bufnr = a:qfItem.bufnr - let item.lnum = a:qfItem.lnum - return item -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_quickfix_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - let items = filter(copy(self.items), 'v:val.word ==# a:word') - if empty(items) - return [] - endif - let lines = fuf#getFileLines(items[0].bufnr) - return fuf#makePreviewLinesAround( - \ lines, [items[0].lnum - 1], a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#prejump(a:mode) - call filter(self.items, 'v:val.word ==# a:word') - if !empty(self.items) - execute 'cc ' . self.items[0].index - endif -endfunction - -" -function s:handler.onModeEnterPre() -endfunction - -" -function s:handler.onModeEnterPost() - let self.items = getqflist() - call map(self.items, 's:makeItem(v:val)') - call fuf#mapToSetSerialIndex(self.items, 1) - call filter(self.items, 'exists("v:val.word")') - 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/tag.vim b/autoload/fuf/tag.vim deleted file mode 100644 index 362cabf..0000000 --- a/autoload/fuf/tag.vim +++ /dev/null @@ -1,178 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#tag#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#tag#getSwitchOrder() - return g:fuf_tag_switchOrder -endfunction - -" -function fuf#tag#getEditableDataNames() - return [] -endfunction - -" -function fuf#tag#renewCache() - let s:cache = {} -endfunction - -" -function fuf#tag#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#tag#onInit() - call fuf#defineLaunchCommand('FufTag' , s:MODE_NAME, '""', []) - call fuf#defineLaunchCommand('FufTagWithCursorWord', s:MODE_NAME, 'expand('''')', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:getTagNames(tagFile) - let names = map(l9#readFile(a:tagFile), 'matchstr(v:val, ''^[^!\t][^\t]*'')') - return filter(names, 'v:val =~# ''\S''') -endfunction - -" -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 = 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)') - call fuf#saveDataFile(s:MODE_NAME, cacheName, items) - return items -endfunction - -" -function s:enumTags(tagFiles) - if !len(a:tagFiles) - return [] - endif - 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, key) - \ } - endif - return s:cache[key].items -endfunction - -" -function s:getMatchingIndex(lines, cmd) - if a:cmd !~# '\D' - return str2nr(a:cmd) - endif - let pattern = matchstr(a:cmd, '^\/\^\zs.*\ze\$\/$') - if empty(pattern) - return -1 - endif - for i in range(len(a:lines)) - if a:lines[i] ==# pattern - return i - endif - endfor - return -1 -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_tag_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForNonPath', - \ self.partialMatching) -endfunction - -" 'cmd' is '/^hoge hoge$/' or line number -function s:handler.makePreviewLines(word, count) - let tags = taglist('^' . a:word . '$') - if empty(tags) - return [] - endif - let i = a:count % len(tags) - let title = printf('(%d/%d) %s', i + 1, len(tags), tags[i].filename) - let lines = fuf#getFileLines(tags[i].filename) - let index = s:getMatchingIndex(lines, tags[i].cmd) - return [title] + fuf#makePreviewLinesAround( - \ lines, (index < 0 ? [] : [index]), 0, self.getPreviewHeight() - 1) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return s:enumTags(self.tagFiles) -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#openTag(a:word, a:mode) -endfunction - -" -function s:handler.onModeEnterPre() - let self.tagFiles = fuf#getCurrentTagFiles() -endfunction - -" -function s:handler.onModeEnterPost() - let &l:tags = join(self.tagFiles, ',') -endfunction - -" -function s:handler.onModeLeavePost(opened) - let &l:tags = '' -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/fuf/taggedfile.vim b/autoload/fuf/taggedfile.vim deleted file mode 100644 index 74652fc..0000000 --- a/autoload/fuf/taggedfile.vim +++ /dev/null @@ -1,159 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - -" -function fuf#taggedfile#createHandler(base) - return a:base.concretize(copy(s:handler)) -endfunction - -" -function fuf#taggedfile#getSwitchOrder() - return g:fuf_taggedfile_switchOrder -endfunction - -" -function fuf#taggedfile#getEditableDataNames() - return [] -endfunction - -" -function fuf#taggedfile#renewCache() - let s:cache = {} -endfunction - -" -function fuf#taggedfile#requiresOnCommandPre() - return 0 -endfunction - -" -function fuf#taggedfile#onInit() - call fuf#defineLaunchCommand('FufTaggedFile', s:MODE_NAME, '""', []) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:MODE_NAME = expand(':t:r') - -" -function s:getTaggedFileList(tagfile) - execute 'cd ' . fnamemodify(a:tagfile, ':h') - 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(l9#readFile(a:tagfile), 'fnamemodify(v:val, ":~:.")') - return filter(result, 'v:val =~# ''[^/\\ ]$''') -endfunction - -" -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 = 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) - call fuf#saveDataFile(s:MODE_NAME, cacheName, items) - return items -endfunction - -" -function s:enumTaggedFiles(tagFiles) - if !len(a:tagFiles) - return [] - endif - 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, key) - \ } - endif - return s:cache[key].items -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_taggedfile_prompt, self.partialMatching, '') -endfunction - -" -function s:handler.getPreviewHeight() - return g:fuf_previewHeight -endfunction - -" -function s:handler.isOpenable(enteredPattern) - return 1 -endfunction - -" -function s:handler.makePatternSet(patternBase) - return fuf#makePatternSet(a:patternBase, 's:interpretPrimaryPatternForPath', - \ self.partialMatching) -endfunction - -" -function s:handler.makePreviewLines(word, count) - return fuf#makePreviewLinesForFile(a:word, a:count, self.getPreviewHeight()) -endfunction - -" -function s:handler.getCompleteItems(patternPrimary) - return self.items -endfunction - -" -function s:handler.onOpen(word, mode) - call fuf#openFile(a:word, a:mode, g:fuf_reuseWindow) -endfunction - -" -function s:handler.onModeEnterPre() - let self.tagFiles = fuf#getCurrentTagFiles() -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 = copy(s:enumTaggedFiles(self.tagFiles)) - call filter(self.items, 'v:val.word !=# bufNamePrev') -endfunction - -" -function s:handler.onModeLeavePost(opened) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/l9.vim b/autoload/l9.vim deleted file mode 100644 index b6a0ae7..0000000 --- a/autoload/l9.vim +++ /dev/null @@ -1,570 +0,0 @@ -"============================================================================= -" Copyright (c) 2009-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if exists('g:loaded_autoload_l9') - finish -endif -let g:loaded_autoload_l9 = 1 - -" }}}1 -"============================================================================= -" COMPATIBILITY TEST {{{1 - -" -let s:L9_VERSION_CURRENT = 101 -let s:L9_VERSION_PASSABLE = 101 - -" returns true if given version is compatible. -function l9#isCompatible(ver) - return -endfunction - -let s:VERSION_FACTOR = str2float('0.01') - -" returns false if the caller script should finish. -" a:vimVersion: if 0, don't check vim version -" a:l9Version: same rule as v:version -function l9#guardScriptLoading(path, vimVersion, l9Version, exprs) - let loadedVarName = 'g:loaded_' . substitute(a:path, '\W', '_', 'g') - if exists(loadedVarName) - return 0 - elseif a:vimVersion > 0 && a:vimVersion > v:version - echoerr a:path . ' requires Vim version ' . string(a:vimVersion * s:VERSION_FACTOR) - return 0 - elseif a:l9Version > 0 && (a:l9Version > s:L9_VERSION_CURRENT || - \ a:l9Version < s:L9_VERSION_PASSABLE) - echoerr a:path . ' requires L9 library version ' . string(a:l9Version * s:VERSION_FACTOR) - return 0 - endif - for expr in a:exprs - if !eval(expr) - echoerr a:path . ' requires: ' . expr - return 0 - endif - endfor - let {loadedVarName} = 1 - return 1 -endfunction - -" -function l9#getVersion() - return s:L9_VERSION_CURRENT -endfunction - -" }}}1 -"============================================================================= -" LIST {{{1 - -" Removes duplicates (unstable) -" This function doesn't change the list of argument. -function l9#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 - -" Removes duplicates (stable) -" This function doesn't change the list of argument. -function l9#uniqueStably(items) - let result = [] - for item in a:items - if count(result, item, &ignorecase) == 0 - call add(result, item) - endif - endfor - return result -endfunction - -" [ [0], [1,2], [3] ] -> [ 0, 1, 2, 3 ] -" This function doesn't change the list of argument. -function l9#concat(items) - let result = [] - for l in a:items - let result += l - endfor - return result -endfunction - -" [ [0,1,2], [3,4], [5,6,7,8] ] -> [ [0,3,5],[1,4,6] ] -" This function doesn't change the list of argument. -function l9#zip(items) - let result = [] - for i in range(min(map(copy(a:items), 'len(v:val)'))) - call add(result, map(copy(a:items), 'v:val[i]')) - endfor - return result -endfunction - -" filter() with the maximum number of items -" This function doesn't change the list of argument. -function l9#filterWithLimit(items, expr, limit) - if a:limit <= 0 - return filter(copy(a:items), a:expr) - endif - let result = [] - let stride = a:limit * 3 / 2 " x1.5 - for i in range(0, len(a:items) - 1, stride) - let result += filter(a:items[i : i + stride - 1], a:expr) - if len(result) >= a:limit - return remove(result, 0, a:limit - 1) - endif - endfor - return result -endfunction - -" Removes if a:expr is evaluated as non-zero and returns removed items. -" This function change the list of argument. -function l9#removeIf(items, expr) - let removed = filter(copy(a:items), a:expr) - call filter(a:items, '!( ' . a:expr . ')') - return removed -endfunction - -" }}}1 -"============================================================================= -" NUMERIC {{{1 - -" }}}1 -"============================================================================= -" STRING {{{1 - -" Snips a:str and add a:mask if the length of a:str is more than a:len -function l9#snipHead(str, len, mask) - if a:len >= len(a:str) - return a:str - elseif a:len <= len(a:mask) - return a:mask - endif - return a:mask . a:str[-a:len + len(a:mask):] -endfunction - -" Snips a:str and add a:mask if the length of a:str is more than a:len -function l9#snipTail(str, len, mask) - if a:len >= len(a:str) - return a:str - elseif a:len <= len(a:mask) - return a:mask - endif - return a:str[:a:len - 1 - len(a:mask)] . a:mask -endfunction - -" Snips a:str and add a:mask if the length of a:str is more than a:len -function l9#snipMid(str, len, mask) - if a:len >= len(a:str) - return a:str - elseif a:len <= len(a:mask) - return a:mask - endif - let len_head = (a:len - len(a:mask)) / 2 - let len_tail = a:len - len(a:mask) - len_head - return (len_head > 0 ? a:str[: len_head - 1] : '') . a:mask . - \ (len_tail > 0 ? a:str[-len_tail :] : '') -endfunction - -" -function l9#hash224(str) - let a = 0x00000800 " shift 11 bit (if unsigned) - let b = 0x001fffff " extract 11 bit (if unsigned) - 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 - -" wildcard -> regexp -function l9#convertWildcardToRegexp(expr) - let re = escape(a:expr, '\') - for [pat, sub] in [ [ '*', '\\.\\*' ], [ '?', '\\.' ], [ '[', '\\[' ], ] - let re = substitute(re, pat, sub, 'g') - endfor - return '\V' . re -endfunction - -" }}}1 -"============================================================================= -" LINES {{{1 - -" Removes from the line matching with a:begin first to the line matching with -" a:end next and returns removed lines. -" If matching range is not found, returns [] -function l9#removeLinesBetween(lines, begin, end) - for i in range(len(a:lines) - 1) - if a:lines[i] =~ a:begin - break - endif - endfor - for j in range(i + 1, len(a:lines) - 1) - if a:lines[j] =~ a:end - let g:l0 += [a:lines[i : j]] - return remove(a:lines, i, j) - endif - endfor - return [] -endfunction - -" }}}1 -"============================================================================= -" PATH {{{1 - -" returns the path separator charactor. -function l9#getPathSeparator() - return (!&shellslash && (has('win32') || has('win64')) ? '\' : '/') -endfunction - -" [ 'a', 'b/', '/c' ] -> 'a/b/c' -function l9#concatPaths(paths) - let result = '' - for p in a:paths - if empty(p) - continue - elseif empty(result) - let result = p - else - let result = substitute(result, '[/\\]$', '', '') . l9#getPathSeparator() - \ . substitute(p, '^[/\\]', '', '') - endif - endfor - return result -endfunction - -" path: '/a/b/c/d', dir: '/a/b' => 'c/d' -function l9#modifyPathRelativeToDir(path, dir) - let pathFull = fnamemodify(a:path, ':p') - let dirFull = fnamemodify(a:dir, ':p') - if len(pathFull) < len(dirFull) || pathFull[:len(dirFull) - 1] !=# dirFull - return pathFull - endif - return pathFull[len(dirFull):] -endfunction - -" }}}1 -"============================================================================= -" FILE {{{1 - -" Almost same as readfile(). -function l9#readFile(...) - let args = copy(a:000) - let args[0] = expand(args[0]) - try - return call('readfile', args) - catch - endtry - return [] -endfunction - -" Almost same as writefile(). -function l9#writeFile(...) - let args = copy(a:000) - let args[1] = expand(args[1]) - let dir = fnamemodify(args[1], ':h') - try - if !isdirectory(dir) - call mkdir(dir, 'p') - endif - return call('writefile', args) - catch - endtry - return -1 " -1 is error code. -endfunction - -" }}}1 -"============================================================================= -" BUFFER {{{1 - -" :wall/:wall! wrapper. Useful for writing readonly buffers. -function l9#writeAll() - try - silent update " NOTE: avoiding a problem with a buftype=acwrite buffer. - silent wall - catch /^Vim/ " E45, E505 - if l9#inputHl('Question', v:exception . "\nWrite readonly files? (Y/N) : ", 'Y') ==? 'y' - redraw - :wall! - endif - endtry -endfunction - -" Loads given files with :edit command -function l9#loadFilesToBuffers(files) - for file in filter(copy(a:files), '!bufloaded(v:val)') - execute 'edit ' . fnameescape(file) - if !exists('bufNrFirst') - let bufNrFirst = bufnr('%') - endif - endfor - if exists('bufNrFirst') - execute bufNrFirst . 'buffer' - endif -endfunction - -" Deletes all buffers except given files with :bdelete command -function l9#deleteAllBuffersExcept(files) - let bufNrExcepts = map(copy(a:files), 'bufnr("^" . v:val . "$")') - for bufNr in filter(range(1, bufnr('$')), 'bufloaded(v:val)') - if count(bufNrExcepts, bufNr) == 0 - execute bufNr . 'bdelete' - endif - endfor -endfunction - -" }}}1 -"============================================================================= -" WINDOW {{{1 - -" move current window to next tabpage. -function l9#shiftWinNextTabpage() - if tabpagenr('$') < 2 - return - endif - let bufnr = bufnr('%') - tabnext - execute bufnr . 'sbuffer' - tabprevious - if winnr('$') > 1 - close - tabnext - else - close " if tabpage is closed, next tabpage will become current - endif -endfunction - -" move current window to previous tabpage. -function l9#shiftWinPrevTabpage() - if tabpagenr('$') < 2 - return - endif - let bufnr = bufnr('%') - tabprevious - execute bufnr . 'sbuffer' - tabnext - close - tabprevious -endfunction - -" move to a window containing specified buffer. -" returns 0 if the buffer is not found. -function l9#moveToBufferWindowInCurrentTabpage(bufNr) - if bufnr('%') == a:bufNr - return 1 - elseif 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 - -" move to a window containing specified buffer. -" returns 0 if the buffer is not found. -function l9#moveToBufferWindowInOtherTabpage(bufNr) - if !s:moveToOtherTabpageOpeningBuffer(a:bufNr) - return 0 - endif - return l9#moveToBufferWindowInCurrentTabpage(a:bufNr) -endfunction - -" }}}1 -"============================================================================= -" COMMAND LINE {{{1 - -" echo/echomsg with highlighting. -function l9#echoHl(hl, msg, prefix, addingHistory) - let echoCmd = (a:addingHistory ? 'echomsg' : 'echo') - execute "echohl " . a:hl - try - for l in (type(a:msg) == type([]) ? a:msg : split(a:msg, "\n")) - execute echoCmd . ' a:prefix . l' - endfor - finally - echohl None - endtry -endfunction - -" input() with highlighting. -" This function can take list as {completion} argument. -function l9#inputHl(hl, ...) - execute "echohl " . a:hl - try - let args = copy(a:000) - if len(args) > 2 && type(args[2]) == type([]) - let s:candidatesForInputHl = args[2] - let args[2] = 'custom,l9#completeForInputHl' - endif - let s = call('input', args) - unlet! s:candidatesForInputHl - finally - echohl None - endtry - redraw " needed to show following echo to next line. - return s -endfunction - -" only called by l9#inputHl() for completion. -function l9#completeForInputHl(lead, line, pos) - return join(s:candidatesForInputHl, "\n") -endfunction - -" }}}1 -"============================================================================= -" VISUAL MODE {{{1 - -" returns last selected text in Visual mode. -function l9#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 - - -" }}}1 -"============================================================================= -" EVAL {{{1 - -" loads given text as Vim script with :source command -function l9#loadScript(text) - let lines = (type(a:text) == type([]) ? a:text : split(a:text, "\n")) - let fname = tempname() - call writefile(lines, fname) - source `=fname` - call delete(fname) -endfunction - - -" }}}1 -"============================================================================= -" VARIABLES {{{1 - -" -function l9#defineVariableDefault(name, default) - if !exists(a:name) - let {a:name} = a:default - endif -endfunction - -" }}}1 -"============================================================================= -" GREP {{{1 - -" Execute :vimgrep and opens the quickfix window if matches are found. -" -" a:pattern: search pattern. If ommitted, last search pattern (@/) is used. -" a:files: List of files -function l9#grepFiles(pattern, files) - let target = join(map(a:files, 'escape(v:val, " ")'), ' ') - let pattern = (a:pattern[0] ==# '/' ? a:pattern[1:] : a:pattern) - let pattern = (empty(pattern) ? @/ : pattern) - try - execute printf('vimgrep/%s/j %s', pattern, target) - catch /^Vim/ - call setqflist([]) - endtry - call l9#quickfix#sort() - call l9#quickfix#openIfNotEmpty(1, 0) -endfunction - -" Execute :vimgrep for buffers using l9#grepFiles() -" See also: :L9GrepBuffer :L9GrepBufferAll -function l9#grepBuffers(pattern, bufNrs) - let files = map(filter(a:bufNrs, 'bufloaded(v:val)'), 'bufname(v:val)') - call l9#grepFiles(a:pattern, files) -endfunction - -" }}}1 -"============================================================================= -" SIGN {{{1 - -" Highlights lines using :sign define and :sign place. -" -" a:linehl, a:text, a:texthl: See |signs|. Ignored if empty string. -" a:locations: List of [{buffer number}, {line number}] for highlighting -function l9#placeSign(linehl, text, texthl, locations) - let argLinehl = (empty(a:linehl) ? '' : 'linehl=' . a:linehl) - let argText = (empty(a:text) ? '' : 'text=' . a:text) - let argTexthl = (empty(a:texthl) ? '' : 'texthl=' . a:texthl) - let name = 'l9--' . a:linehl . '--' . a:text . '--' . a:texthl - execute printf('sign define %s linehl=%s text=%s texthl=%s', - \ name, a:linehl, a:text, a:texthl) - for [bufNr, lnum] in a:locations - execute printf('sign place 1 line=%d name=%s buffer=%d', lnum, name, bufNr) - endfor -endfunction - -" }}}1 -"============================================================================= -" NOTIFY EXTERNALLY {{{1 - -" Notify a message using an external program. -" Currently supports Balloonly, Screen, and Tmux. -function l9#notifyExternally(msg) - return l9#notifyBalloonly(a:msg) - \ || l9#notifyScreen(a:msg) - \ || l9#notifyTmux(a:msg) -endfunction - -" -function l9#notifyBalloonly(msg) - if !(has('win32') || has('win64')) || !executable(g:l9_balloonly) - return 0 - endif - execute 'silent !start ' . shellescape(g:l9_balloonly) . ' 4000 "l9" ' . shellescape(a:msg) - return 1 -endfunction - -" -function l9#notifyScreen(msg) - if !has('unix') || has('gui_running') || $WINDOW !~ '\d' || !executable('screen') - return 0 - endif - call system('screen -X wall ' . shellescape('l9: ' . a:msg)) - return 1 -endfunction - -" -function l9#notifyTmux(msg) - if !has('unix') || has('gui_running') || empty($TMUX) || !executable('tmux') - return 0 - endif - call system('tmux display-message ' . shellescape('l9: ' . a:msg)) - return 1 -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/autoload/l9/async.py b/autoload/l9/async.py deleted file mode 100644 index eeb0cc3..0000000 --- a/autoload/l9/async.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python - -from __future__ import with_statement -import vim -import os -import subprocess -import threading -import Queue - - -class Asyncer: - - def __init__(self): - self._workers = {} - - def execute(self, var_key, var_command, var_cwd, var_input, var_appends): - key = vim.eval(var_key) - command = vim.eval(var_command) - cwd = vim.eval(var_cwd) - input = vim.eval(var_input) - appends = vim.eval(var_appends) - if key not in self._workers: - self._workers[key] = Worker() - self._workers[key].start() - self._workers[key].put(Executor(command, cwd, input, appends)) - - def print_output(self, var_key): - key = vim.eval(var_key) - if key not in self._workers: - return - for l in self._workers[key].copy_outputs(): - print l, - - def print_worker_keys(self): - for k in self._workers.keys(): - print k - - def print_active_worker_keys(self): - for k in self._workers.keys(): - print k - - -class Worker(threading.Thread): - - def __init__(self): - threading.Thread.__init__(self) - self._queue = Queue.Queue() - self._lines = [] - self._lock = threading.Lock() - - def run(self): - while True: - self._queue.get().execute(self) - self._queue.task_done() - - def put(self, executor): - self._queue.put(executor) - - def clear_outputs(self): - with self._lock: - self._lines = [] - - def record_output(self, line): - with self._lock: - self._lines.append(line) - - def copy_outputs(self): - with self._lock: - return self._lines[:] - - -class Executor: - - def __init__(self, command, cwd, input, appends): - self._command = command - self._cwd = cwd - self._input = input - self._appends = appends - - def execute(self, worker): - if not self._appends: - worker.clear_outputs() - os.chdir(self._cwd) - p = subprocess.Popen(self._command, shell=True, stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - p.stdin.write(self._input) - line = p.stdout.readline() - while line: - worker.record_output(line) - line = p.stdout.readline() - - diff --git a/autoload/l9/async.vim b/autoload/l9/async.vim deleted file mode 100644 index fa66e9f..0000000 --- a/autoload/l9/async.vim +++ /dev/null @@ -1,67 +0,0 @@ -"============================================================================= -" Copyright (C) 2009-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, ['has("python")']) - finish -endif - -" }}}1 -"============================================================================= -" ASYNC EXECUTE {{{1 - -" -function s:checkKey(key) - if a:key =~ '\n' || a:key !~ '\S' - throw "Asyncer: Invalid key: " . a:key - endif -endfunction - -" -function l9#async#execute(key, cmd, cwd, input, appends) - call s:checkKey(a:key) - python asyncer.execute('a:key', 'a:cmd', 'a:cwd', 'a:input', 'a:appends') -endfunction - -" -function l9#async#read(key) - call s:checkKey(a:key) - redir => result - silent python asyncer.print_output('a:key') - redir END - " NOTE: "\n" is somehow inserted by redir. - return (result[0] ==# "\n" ? result[1:] : result) -endfunction - -" -function l9#async#listWorkers() - redir => result - silent python asyncer.print_worker_keys() - redir END - return split(result, "\n") -endfunction - -" -function l9#async#listActiveWorkers() - redir => result - silent python asyncer.print_active_worker_keys() - redir END - return split(result, "\n") -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -let s:ASYNC_PY_PATH = fnamemodify(expand(':p:h'), ':p') . 'async.py' - -pyfile `=s:ASYNC_PY_PATH` -python asyncer = Asyncer() - -" }}}1 -"============================================================================= -" vim: set fdm=marker: - - diff --git a/autoload/l9/quickfix.vim b/autoload/l9/quickfix.vim deleted file mode 100644 index 1758b39..0000000 --- a/autoload/l9/quickfix.vim +++ /dev/null @@ -1,107 +0,0 @@ -"============================================================================= -" Copyright (C) 2009-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" QUICKFIX {{{1 - -" Returns non-zero if quickfix window is opened. -function l9#quickfix#isWindowOpened() - return count(map(range(1, winnr('$')), 'getwinvar(v:val, "&buftype")'), 'quickfix') > 0 -endfunction - -" Opens quickfix window if quickfix is not empty, and echo the number of errors. -" -" a:onlyRecognized: if non-zero, opens only if quickfix has recognized errors. -" a:holdCursor: if non-zero, the cursor won't move to quickfix window. -function l9#quickfix#openIfNotEmpty(onlyRecognized, holdCursor) - let numErrors = len(filter(getqflist(), 'v:val.valid')) - let numOthers = len(getqflist()) - numErrors - if numErrors > 0 || (!a:onlyRecognized && numOthers > 0) - copen - if a:holdCursor - wincmd p - endif - else - cclose - endif - redraw - if numOthers > 0 - echo printf('Quickfix: %d(+%d)', numErrors, numOthers) - else - echo printf('Quickfix: %d', numErrors) - endif -endfunction - -" Toggles Quickfix window -function l9#quickfix#toggleWindow() - if l9#quickfix#isWindowOpened() - cclose - else - call l9#quickfix#openIfNotEmpty(0, 0) - endif -endfunction - -" Creates quickfix list form given lines and opens the quickfix window if -" errors exists. -" -" a:lines: -" a:jump: if non-zero, jump to the first error. -function l9#quickfix#setMakeResult(lines) - cexpr a:lines - call l9#quickfix#openIfNotEmpty(0, 1) -endfunction - -" Compares quickfix entries for sorting. -function l9#quickfix#compareEntries(e0, e1) - if a:e0.bufnr != a:e1.bufnr - let i0 = bufname(a:e0.bufnr) - let i1 = bufname(a:e1.bufnr) - elseif a:e0.lnum != a:e1.lnum - let i0 = a:e0.lnum - let i1 = a:e1.lnum - elseif a:e0.col != a:e1.col - let i0 = a:e0.col - let i1 = a:e1.col - else - return 0 - endif - return (i0 > i1 ? +1 : -1) -endfunction - -" Sorts quickfix -function l9#quickfix#sort() - call setqflist(sort(getqflist(), 'l9#quickfix#compareEntries'), 'r') -endfunction - -" Highlights Quickfix lines by :sign. -" Inspired by errormarker plugin. -" -" You can customize the highlighting via L9ErrorLine and L9WarningLine -" highlight groups. -function l9#quickfix#placeSign() - let warnings = [] - let errors = [] - for e in filter(getqflist(), 'v:val.valid') - let warning = (e.type ==? 'w' || e.text =~? '^\s*warning:') - call add((warning ? warnings : errors), [e.bufnr, e.lnum]) - endfor - sign unplace * - call l9#placeSign('L9WarningLine', '>>', '', warnings) - call l9#placeSign('L9ErrorLine', '>>', '', errors) -endfunction - -highlight default L9ErrorLine ctermfg=white ctermbg=52 guibg=#5F0000 -highlight default L9WarningLine ctermfg=white ctermbg=17 guibg=#00005F - -" }}}1 -"============================================================================= -" vim: set fdm=marker: - diff --git a/autoload/l9/tempbuffer.vim b/autoload/l9/tempbuffer.vim deleted file mode 100644 index 6f11a78..0000000 --- a/autoload/l9/tempbuffer.vim +++ /dev/null @@ -1,112 +0,0 @@ -"============================================================================= -" Copyright (C) 2009-2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" TEMPORARY BUFFER {{{1 - -" each key is a buffer name. -let s:dataMap = {} - -" -function s:onBufDelete(bufname) - if exists('s:dataMap[a:bufname].listener.onClose') - call s:dataMap[a:bufname].listener.onClose(s:dataMap[a:bufname].written) - endif - if bufnr('%') == s:dataMap[a:bufname].bufNr && winnr('#') != 0 - " if winnr('#') returns 0, "wincmd p" causes ringing the bell. - wincmd p - endif -endfunction - -" -function s:onBufWriteCmd(bufname) - if !exists('s:dataMap[a:bufname].listener.onWrite') || - \ s:dataMap[a:bufname].listener.onWrite(getline(1, '$')) - setlocal nomodified - let s:dataMap[a:bufname].written = 1 - call l9#tempbuffer#close(a:bufname) - else - endif -endfunction - -" a:bufname: -" a:height: Window height. If 0, default height is used. -" If less than 0, the window becomes full-screen. -" a:listener: -" a:listener.onClose(written) -function l9#tempbuffer#openScratch(bufname, filetype, lines, topleft, vertical, height, listener) - let openCmdPrefix = (a:topleft ? 'topleft ' : '') - \ . (a:vertical ? 'vertical ' : '') - \ . (a:height > 0 ? a:height : '') - if !exists('s:dataMap[a:bufname]') || !bufexists(s:dataMap[a:bufname].bufNr) - execute openCmdPrefix . 'new' - else - call l9#tempbuffer#close(a:bufname) - execute openCmdPrefix . 'split' - execute 'silent ' . s:dataMap[a:bufname].bufNr . 'buffer' - endif - if a:height < 0 - only - endif - setlocal buflisted noswapfile bufhidden=delete modifiable noreadonly buftype=nofile - let &l:filetype = a:filetype - silent file `=a:bufname` - call setline(1, a:lines) - setlocal nomodified - augroup L9TempBuffer - autocmd! * - execute printf('autocmd BufDelete call s:onBufDelete (%s)', string(a:bufname)) - execute printf('autocmd BufWriteCmd nested call s:onBufWriteCmd(%s)', string(a:bufname)) - augroup END - let s:dataMap[a:bufname] = { - \ 'bufNr': bufnr('%'), - \ 'written': 0, - \ 'listener': a:listener, - \ } -endfunction - -" -function l9#tempbuffer#openReadOnly(bufname, filetype, lines, topleft, vertical, height, listener) - call l9#tempbuffer#openScratch(a:bufname, a:filetype, a:lines, a:topleft, a:vertical, a:height, a:listener) - setlocal nomodifiable readonly -endfunction - -" a:listener: -" a:listener.onClose(written) -" a:listener.onWrite(lines) -function l9#tempbuffer#openWritable(bufname, filetype, lines, topleft, vertical, height, listener) - call l9#tempbuffer#openScratch(a:bufname, a:filetype, a:lines, a:topleft, a:vertical, a:height, a:listener) - setlocal buftype=acwrite -endfunction - -" makes specified temp buffer current. -function l9#tempbuffer#moveTo(bufname) - return l9#moveToBufferWindowInCurrentTabpage(s:dataMap[a:bufname].bufNr) || - \ l9#moveToBufferWindowInOtherTabpage(s:dataMap[a:bufname].bufNr) -endfunction - -" -function l9#tempbuffer#close(bufname) - if !l9#tempbuffer#isOpen(a:bufname) - return - endif - execute printf('%dbdelete!', s:dataMap[a:bufname].bufNr) -endfunction - -" -function l9#tempbuffer#isOpen(bufname) - return exists('s:dataMap[a:bufname]') && bufloaded(s:dataMap[a:bufname].bufNr) -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: - diff --git a/autoload/l9/tempvariables.vim b/autoload/l9/tempvariables.vim deleted file mode 100644 index ee847ee..0000000 --- a/autoload/l9/tempvariables.vim +++ /dev/null @@ -1,60 +0,0 @@ -"============================================================================= -" Copyright (C) 2010 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if !l9#guardScriptLoading(expand(':p'), 0, 0, []) - finish -endif - -" }}}1 -"============================================================================= -" TEMPORARY VARIABLES {{{1 - -" -let s:origMap = {} - -" set temporary variables -function l9#tempvariables#set(group, name, value) - if !exists('s:origMap[a:group]') - let s:origMap[a:group] = {} - endif - if !exists('s:origMap[a:group][a:name]') - let s:origMap[a:group][a:name] = eval(a:name) - endif - execute 'let ' . a:name . ' = a:value' -endfunction - -" set temporary variables -function l9#tempvariables#setList(group, variables) - for [name, value] in a:variables - call l9#tempvariables#set(a:group, name, value) - unlet value " to avoid E706 - endfor -endfunction - -" get temporary variables -function l9#tempvariables#getList(group) - if !exists('s:origMap[a:group]') - return [] - endif - return map(keys(s:origMap[a:group]), '[v:val, eval(v:val)]') -endfunction - -" restore original variables and clean up. -function l9#tempvariables#end(group) - if !exists('s:origMap[a:group]') - return - endif - for [name, value] in items(s:origMap[a:group]) - execute 'let ' . name . ' = value' - unlet value " to avoid E706 - endfor - unlet s:origMap[a:group] -endfunction - -" }}}1 -"============================================================================= -" vim: set fdm=marker: - diff --git a/autoload/pathogen.vim b/autoload/pathogen.vim new file mode 100644 index 0000000..be68389 --- /dev/null +++ b/autoload/pathogen.vim @@ -0,0 +1,230 @@ +" pathogen.vim - path option manipulation +" Maintainer: Tim Pope +" Version: 2.0 + +" Install in ~/.vim/autoload (or ~\vimfiles\autoload). +" +" For management of individually installed plugins in ~/.vim/bundle (or +" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc +" prior to `fileype plugin indent on` is the only other setup necessary. +" +" The API is documented inline below. For maximum ease of reading, +" :set foldmethod=marker + +if exists("g:loaded_pathogen") || &cp + finish +endif +let g:loaded_pathogen = 1 + +" Point of entry for basic default usage. Give a directory name to invoke +" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path +" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards, +" pathogen#cycle_filetype() is invoked. +function! pathogen#infect(...) abort " {{{1 + let source_path = a:0 ? a:1 : 'bundle' + if source_path =~# '[\\/]' + call pathogen#runtime_prepend_subdirectories(source_path) + else + call pathogen#runtime_append_all_bundles(source_path) + endif + call pathogen#cycle_filetype() +endfunction " }}}1 + +" Split a path into a list. +function! pathogen#split(path) abort " {{{1 + if type(a:path) == type([]) | return a:path | endif + let split = split(a:path,'\\\@,'edit',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',) +command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,'lcd') + +" vim:set ft=vim ts=8 sw=2 sts=2: diff --git a/autoload/taglisttoo/lang/java.vim b/autoload/taglisttoo/lang/java.vim deleted file mode 100644 index ced1fe1..0000000 --- a/autoload/taglisttoo/lang/java.vim +++ /dev/null @@ -1,90 +0,0 @@ -" Author: Eric Van Dewoestine -" -" License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine -" All rights reserved. -" -" Redistribution and use of this software in source and binary forms, with -" or without modification, are permitted provided that the following -" conditions are met: -" -" * Redistributions of source code must retain the above -" copyright notice, this list of conditions and the -" following disclaimer. -" -" * Redistributions in binary form must reproduce the above -" copyright notice, this list of conditions and the -" following disclaimer in the documentation and/or other -" materials provided with the distribution. -" -" * Neither the name of Eric Van Dewoestine nor the names of its -" contributors may be used to endorse or promote products derived from -" this software without specific prior written permission of -" Eric Van Dewoestine. -" -" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -" }}} - -" Format(types, tags) {{{ -function! taglisttoo#lang#java#Format(types, tags) - let formatter = taglisttoo#util#Formatter(a:tags) - call formatter.filename() - - let package = filter(copy(a:tags), 'v:val.type == "p"') - call formatter.format(a:types['p'], package, '') - - let classes = filter(copy(a:tags), 'v:val.type == "c"') - - " sort classes alphabetically except for the primary containing class. - if len(classes) > 1 && g:Tlist_Sort_Type == 'name' - let classes = [classes[0]] + sort(classes[1:], 'taglisttoo#util#SortTags') - endif - - for class in classes - call formatter.blank() - - let visibility = taglisttoo#util#GetVisibility(class) - call formatter.heading(a:types['c'], class, '') - - let fields = filter(copy(a:tags), - \ 'v:val.type == "f" && v:val.parent =~ "class:.*\\<" . class.name . "$"') - call formatter.format(a:types['f'], fields, "\t") - - let methods = filter(copy(a:tags), - \ 'v:val.type == "m" && v:val.parent =~ "class:.*\\<" . class.name . "$"') - call formatter.format(a:types['m'], methods, "\t") - endfor - - let interfaces = filter(copy(a:tags), 'v:val.type == "i"') - if g:Tlist_Sort_Type == 'name' - call sort(interfaces, 'taglisttoo#util#SortTags') - endif - for interface in interfaces - call formatter.blank() - - let visibility = taglisttoo#util#GetVisibility(interface) - call formatter.heading(a:types['i'], interface, '') - - let fields = filter(copy(a:tags), - \ 'v:val.type == "f" && v:val.parent =~ "interface:.*\\<" . interface.name . "$"') - call formatter.format(a:types['f'], fields, "\t") - - let methods = filter(copy(a:tags), - \ 'v:val.type == "m" && v:val.parent =~ "interface:.*\\<" . interface.name . "$"') - call formatter.format(a:types['m'], methods, "\t") - endfor - - return formatter -endfunction " }}} - -" vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/php.vim b/autoload/taglisttoo/lang/php.vim deleted file mode 100644 index 8e8f6c2..0000000 --- a/autoload/taglisttoo/lang/php.vim +++ /dev/null @@ -1,142 +0,0 @@ -" Author: Eric Van Dewoestine -" -" License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine -" All rights reserved. -" -" Redistribution and use of this software in source and binary forms, with -" or without modification, are permitted provided that the following -" conditions are met: -" -" * Redistributions of source code must retain the above -" copyright notice, this list of conditions and the -" following disclaimer. -" -" * Redistributions in binary form must reproduce the above -" copyright notice, this list of conditions and the -" following disclaimer in the documentation and/or other -" materials provided with the distribution. -" -" * Neither the name of Eric Van Dewoestine nor the names of its -" contributors may be used to endorse or promote products derived from -" this software without specific prior written permission of -" Eric Van Dewoestine. -" -" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -" }}} - -" Format(types, tags) {{{ -function! taglisttoo#lang#php#Format(types, tags) - let pos = getpos('.') - - let formatter = taglisttoo#util#Formatter(a:tags) - call formatter.filename() - - let top_functions = filter(copy(a:tags), 'v:val.type == "f"') - - let class_contents = [] - let classes = filter(copy(a:tags), 'v:val.type == "c"') - if g:Tlist_Sort_Type == 'name' - call sort(classes, 'taglisttoo#util#SortTags') - endif - for class in classes - let object_start = class.line - call cursor(object_start, 1) - call search('{', 'W') - let object_end = searchpair('{', '', '}', 'W') - - let functions = [] - let indexes = [] - let index = 0 - for fct in top_functions - if len(fct) > 3 - let fct_line = fct.line - if fct_line > object_start && fct_line < object_end - call add(functions, fct) - call add(indexes, index) - endif - endif - let index += 1 - endfor - call reverse(indexes) - for i in indexes - call remove(top_functions, i) - endfor - - call add(class_contents, {'class': class, 'functions': functions}) - endfor - - let interface_contents = [] - let interfaces = filter(copy(a:tags), 'v:val.type == "i"') - if g:Tlist_Sort_Type == 'name' - call sort(interfaces, 'taglisttoo#util#SortTags') - endif - for interface in interfaces - let object_start = interface.line - call cursor(object_start, 1) - call search('{', 'W') - let object_end = searchpair('{', '', '}', 'W') - - let functions = [] - let indexes = [] - let index = 0 - for fct in top_functions - if len(fct) > 3 - let fct_line = fct.line - if fct_line > object_start && fct_line < object_end - call add(functions, fct) - call add(indexes, index) - endif - endif - let index += 1 - endfor - call reverse(indexes) - for i in indexes - call remove(top_functions, i) - endfor - - call add(interface_contents, {'interface': interface, 'functions': functions}) - endfor - - if len(top_functions) > 0 - call formatter.blank() - call formatter.format(a:types['f'], top_functions, '') - endif - - for class_content in class_contents - call formatter.blank() - call formatter.heading(a:types['c'], class_content.class, '') - call formatter.format(a:types['f'], class_content.functions, "\t") - endfor - - for interface_content in interface_contents - call formatter.blank() - call formatter.heading(a:types['i'], interface_content.interface, '') - call formatter.format(a:types['f'], interface_content.functions, "\t") - endfor - - call setpos('.', pos) - - return formatter -endfunction " }}} - -" Parse(file, settings) {{{ -function! taglisttoo#lang#php#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ - \ ['f', '\bfunction\s+([a-zA-Z0-9_]+)\s*\(', 1], - \ ['c', '\bclass\s+([a-zA-Z0-9_]+)', 1], - \ ['i', '\binterface\s+([a-zA-Z0-9_]+)', 1], - \ ]) -endfunction " }}} - -" vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/util.vim b/autoload/taglisttoo/util.vim deleted file mode 100644 index 3f4f5bc..0000000 --- a/autoload/taglisttoo/util.vim +++ /dev/null @@ -1,131 +0,0 @@ -" Author: Eric Van Dewoestine -" -" License: {{{ -" Copyright (c) 2005 - 2011, Eric Van Dewoestine -" All rights reserved. -" -" Redistribution and use of this software in source and binary forms, with -" or without modification, are permitted provided that the following -" conditions are met: -" -" * Redistributions of source code must retain the above -" copyright notice, this list of conditions and the -" following disclaimer. -" -" * Redistributions in binary form must reproduce the above -" copyright notice, this list of conditions and the -" following disclaimer in the documentation and/or other -" materials provided with the distribution. -" -" * Neither the name of Eric Van Dewoestine nor the names of its -" contributors may be used to endorse or promote products derived from -" this software without specific prior written permission of -" Eric Van Dewoestine. -" -" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -" }}} - -function! taglisttoo#util#Formatter(tags) " {{{ - let formatter = {'lines': [], 'content': [], 'syntax': [], 'tags': a:tags} - - function! formatter.filename() dict " {{{ - call add(self.content, expand('%:t')) - call add(self.lines, -1) - endfunction " }}} - - function! formatter.format(type, values, indent) dict " {{{ - if len(a:values) > 0 - if g:Tlist_Sort_Type == 'name' - call sort(a:values, 'taglisttoo#util#SortTags') - endif - - call self.heading(a:type, {}, a:indent) - - for value in a:values - let visibility = taglisttoo#util#GetVisibility(value) - call add(self.content, "\t" . a:indent . visibility . value.name) - call add(self.lines, index(self.tags, value)) - endfor - endif - endfunction " }}} - - function! formatter.heading(type, tag, indent) dict " {{{ - if len(a:tag) - call add(self.lines, index(self.tags, a:tag)) - call add(self.content, a:indent . a:type . ' ' . a:tag.name) - call add(self.syntax, - \ 'syn match TagListKeyword "^\s*' . a:type . '\%' . len(self.lines) . 'l"') - else - call add(self.lines, 'label') - call add(self.content, a:indent . a:type) - call add(self.syntax, 'syn match TagListKeyword "^.*\%' . len(self.lines) . 'l.*"') - endif - endfunction " }}} - - function! formatter.blank() dict " {{{ - call add(self.content, '') - call add(self.lines, -1) - endfunction " }}} - - return formatter -endfunction " }}} - -function! taglisttoo#util#GetVisibility(tag) " {{{ - let pattern = a:tag.pattern - if pattern =~ '\' - if pattern =~ '\' - return '*' - endif - return '+' - elseif pattern =~ '\' - return '#' - elseif pattern =~ '\' - return '-' - endif - return '' -endfunction " }}} - -function! taglisttoo#util#Parse(file, patterns) " {{{ -python << PYTHONEOF -filename = vim.eval('a:file') -patterns = vim.eval('a:patterns') -result = taglisttoo.parse(filename, patterns) -vim.command('let results = %s' % ('%r' % result).replace("\\'", "''")) -PYTHONEOF - - let tags = [] - if len(results) - for result in results - " filter false positives found in comments or strings - let lnum = result.line - let line = getline(lnum) - let col = len(line) - len(substitute(line, '^\s*', '', '')) + 1 - if synIDattr(synID(lnum, col, 1), 'name') =~? '\(comment\|string\)' || - \ synIDattr(synIDtrans(synID(lnum, col, 1)), 'name') =~? '\(comment\|string\)' - continue - endif - - call add(tags, result) - endfor - endif - - return tags -endfunction " }}} - -function! taglisttoo#util#SortTags(tag1, tag2) " {{{ - let name1 = tolower(a:tag1.name) - let name2 = tolower(a:tag2.name) - return name1 == name2 ? 0 : name1 > name2 ? 1 : -1 -endfunction " }}} - -" vim:ft=vim:fdm=marker diff --git a/doc/ack.txt b/bundle/ack/doc/ack.txt similarity index 100% rename from doc/ack.txt rename to bundle/ack/doc/ack.txt diff --git a/plugin/ack.vim b/bundle/ack/plugin/ack.vim similarity index 100% rename from plugin/ack.vim rename to bundle/ack/plugin/ack.vim diff --git a/plugin/calendar.vim b/bundle/calendar/plugin/calendar.vim similarity index 100% rename from plugin/calendar.vim rename to bundle/calendar/plugin/calendar.vim diff --git a/compiler/jsl.vim b/bundle/compiler_javascript/compiler/jsl.vim similarity index 85% rename from compiler/jsl.vim rename to bundle/compiler_javascript/compiler/jsl.vim index 2d1097c..5f94fa2 100644 --- a/compiler/jsl.vim +++ b/bundle/compiler_javascript/compiler/jsl.vim @@ -1,5 +1,5 @@ " Vim compiler file -" Compiler: pdf creator out of LaTeX files using rubber +" Compiler: Javascript Lint if exists("current_compiler") finish endif diff --git a/bin/pylint_parseable.py b/bundle/compiler_pylint/bin/pylint_parseable.py similarity index 100% rename from bin/pylint_parseable.py rename to bundle/compiler_pylint/bin/pylint_parseable.py diff --git a/compiler/pylint.vim b/bundle/compiler_pylint/compiler/pylint.vim similarity index 84% rename from compiler/pylint.vim rename to bundle/compiler_pylint/compiler/pylint.vim index f7d4c5d..b71754f 100644 --- a/compiler/pylint.vim +++ b/bundle/compiler_pylint/compiler/pylint.vim @@ -8,5 +8,5 @@ if exists("current_compiler") endif let current_compiler = "pylint" -CompilerSet makeprg=$HOME/.vim/bin/pylint_parseable.py\ % +CompilerSet makeprg=pylint_parseable.py\ % CompilerSet efm=%f:\ %t:\ %l:\ %c:\ %m,%f:\ %t:\ %l:\ %m diff --git a/bundle/compiler_pylint/readme.txt b/bundle/compiler_pylint/readme.txt new file mode 100644 index 0000000..0ce4757 --- /dev/null +++ b/bundle/compiler_pylint/readme.txt @@ -0,0 +1,5 @@ +Simple pylint compiler for Vim. + +Installation: +Place bin/pylint_parseable.py into your path (/usr/local/bin or whenever) and +compiler/pylint.vim under ~/.vim/compiler. diff --git a/compiler/rubber.vim b/bundle/compiler_rubber/compiler/rubber.vim similarity index 100% rename from compiler/rubber.vim rename to bundle/compiler_rubber/compiler/rubber.vim diff --git a/plugin/DirDiff.vim b/bundle/dirdiff/plugin/DirDiff.vim similarity index 100% rename from plugin/DirDiff.vim rename to bundle/dirdiff/plugin/DirDiff.vim diff --git a/doc/py2stdlib.txt b/bundle/doc_py2stdlib/doc/py2stdlib.txt similarity index 100% rename from doc/py2stdlib.txt rename to bundle/doc_py2stdlib/doc/py2stdlib.txt diff --git a/ftplugin/python/jpythonfold.vim b/bundle/ft_jpythonfold/ftplugin/python/jpythonfold.vim similarity index 100% rename from ftplugin/python/jpythonfold.vim rename to bundle/ft_jpythonfold/ftplugin/python/jpythonfold.vim diff --git a/bundle/ft_matchtag/ftplugin/html.vim b/bundle/ft_matchtag/ftplugin/html.vim new file mode 100644 index 0000000..320c7e8 --- /dev/null +++ b/bundle/ft_matchtag/ftplugin/html.vim @@ -0,0 +1,82 @@ +" Vim plugin for showing matching html tags. +" Maintainer: Greg Sexton +" Credits: Bram Moolenar and the 'matchparen' plugin from which this draws heavily. + +if exists("b:did_ftplugin") + finish +endif + +augroup matchhtmlparen + autocmd! CursorMoved,CursorMovedI,WinEnter call s:Highlight_Matching_Pair() +augroup END + +fu! s:Highlight_Matching_Pair() + " Remove any previous match. + if exists('w:tag_hl_on') && w:tag_hl_on + 2match none + let w:tag_hl_on = 0 + endif + + " Avoid that we remove the popup menu. + " Return when there are no colors (looks like the cursor jumps). + if pumvisible() || (&t_Co < 8 && !has("gui_running")) + return + endif + + "get html tag under cursor + let tagname = s:GetCurrentCursorTag() + if tagname == ""|return|endif + + if tagname[0] == '/' + let position = s:SearchForMatchingTag(tagname[1:], 0) + else + let position = s:SearchForMatchingTag(tagname, 1) + endif + call s:HighlightTagAtPosition(position) +endfu + +fu! s:GetCurrentCursorTag() + "returns the tag under the cursor, includes the '/' if on a closing tag. + + let c_col = col('.') + let matched = matchstr(getline('.'), '\(<[^<>]*\%'.c_col.'c.\{-}>\)\|\(\%'.c_col.'c<.\{-}>\)') + if matched == "" + return matched + endif + + let tagname = matchstr(matched, '<\zs.\{-}\ze[ >]') + return tagname +endfu + +fu! s:SearchForMatchingTag(tagname, forwards) + "returns the position of a matching tag or [0 0] + + let starttag = '<'.a:tagname.'.\{-}>' + let midtag = '' + let endtag = ''.(a:forwards?'':'\zs') + let flags = 'nW'.(a:forwards?'':'b') + + " When not in a string or comment ignore matches inside them. + let skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . + \ '=~? "htmlString\\|htmlCommentPart"' + execute 'if' skip '| let skip = 0 | endif' + + " Limit the search to lines visible in the window. + let stopline = a:forwards ? line('w$') : line('w0') + let timeout = 300 + + return searchpairpos(starttag, midtag, endtag, flags, skip, stopline, timeout) +endfu + +fu! s:HighlightTagAtPosition(position) + if a:position == [0, 0] + return + endif + + let [m_lnum, m_col] = a:position + exe '2match MatchParen /\(\%' . m_lnum . 'l\%' . m_col . 'c<\zs.\{-}\ze[ >]\)\|' + \ .'\(\%' . line('.') . 'l\%' . col('.') . 'c<\zs.\{-}\ze[ >]\)\|' + \ .'\(\%' . line('.') . 'l<\zs[^<> ]*\%' . col('.') . 'c.\{-}\ze[ >]\)\|' + \ .'\(\%' . line('.') . 'l<\zs[^<>]\{-}\ze\s[^<>]*\%' . col('.') . 'c.\{-}>\)/' + let w:tag_hl_on = 1 +endfu diff --git a/ftplugin/python/pydoc.vim b/bundle/ft_pydoc/ftplugin/python/pydoc.vim similarity index 100% rename from ftplugin/python/pydoc.vim rename to bundle/ft_pydoc/ftplugin/python/pydoc.vim diff --git a/ftplugin/python/pyflakes/README.rst b/bundle/ft_pyflakes-vim/README.rst similarity index 100% rename from ftplugin/python/pyflakes/README.rst rename to bundle/ft_pyflakes-vim/README.rst diff --git a/ftplugin/python/pyflakes.vim b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes.vim similarity index 100% rename from ftplugin/python/pyflakes.vim rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes.vim diff --git a/ftplugin/python/pyflakes/LICENSE b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/LICENSE similarity index 100% rename from ftplugin/python/pyflakes/LICENSE rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/LICENSE diff --git a/ftplugin/python/pyflakes/NEWS.txt b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/NEWS.txt similarity index 100% rename from ftplugin/python/pyflakes/NEWS.txt rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/NEWS.txt diff --git a/ftplugin/python/pyflakes/bin/pyflakes b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/bin/pyflakes similarity index 100% rename from ftplugin/python/pyflakes/bin/pyflakes rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/bin/pyflakes diff --git a/ftplugin/python/pyflakes/pyflakes/__init__.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/__init__.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/__init__.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/__init__.py diff --git a/ftplugin/python/pyflakes/pyflakes/checker.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/checker.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/checker.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/checker.py diff --git a/ftplugin/python/pyflakes/pyflakes/messages.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/messages.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/messages.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/messages.py diff --git a/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/scripts/__init__.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py diff --git a/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py diff --git a/ftplugin/python/pyflakes/pyflakes/test/__init__.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/__init__.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/test/__init__.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/__init__.py diff --git a/ftplugin/python/pyflakes/pyflakes/test/harness.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/harness.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/test/harness.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/harness.py diff --git a/ftplugin/python/pyflakes/pyflakes/test/test_imports.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_imports.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/test/test_imports.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_imports.py diff --git a/ftplugin/python/pyflakes/pyflakes/test/test_other.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_other.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/test/test_other.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_other.py diff --git a/ftplugin/python/pyflakes/pyflakes/test/test_script.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_script.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/test/test_script.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_script.py diff --git a/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py similarity index 100% rename from ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py diff --git a/ftplugin/python/pyflakes/setup.py b/bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/setup.py similarity index 100% rename from ftplugin/python/pyflakes/setup.py rename to bundle/ft_pyflakes-vim/ftplugin/python/pyflakes/setup.py diff --git a/ftplugin/python/common.vim b/bundle/ft_python/ftplugin/python/common.vim similarity index 100% rename from ftplugin/python/common.vim rename to bundle/ft_python/ftplugin/python/common.vim diff --git a/ftplugin/python/pep8_fn.vim b/bundle/ft_python/ftplugin/python/pep8_fn.vim similarity index 100% rename from ftplugin/python/pep8_fn.vim rename to bundle/ft_python/ftplugin/python/pep8_fn.vim diff --git a/ftplugin/python/pylint_fn.vim b/bundle/ft_python/ftplugin/python/pylint_fn.vim similarity index 95% rename from ftplugin/python/pylint_fn.vim rename to bundle/ft_python/ftplugin/python/pylint_fn.vim index 6e045eb..7ebefd1 100644 --- a/ftplugin/python/pylint_fn.vim +++ b/bundle/ft_python/ftplugin/python/pylint_fn.vim @@ -50,6 +50,24 @@ else let b:did_pylint_plugin = 1 endif +if !exists('*s:CheckPylint') + function s:CheckPylint() + python << EOF +try: + import vim + from pylint import lint + from pylint.reporters.text import TextReporter +except ImportError: + vim.command("return 0") +vim.command("return 1") +EOF + endfunction +endif + +if s:CheckPylint() == 0 + finish +endif + if !exists("b:did_pylint_init") let b:did_pylint_init = 0 @@ -59,16 +77,9 @@ if !exists("b:did_pylint_init") endif python << EOF -import vim import sys from StringIO import StringIO -try: - from pylint import lint - from pylint.reporters.text import TextReporter -except ImportError: - raise AssertionError('Pylint is required for this plugin') - class VImPylint(object): sys_stderr = sys.stderr diff --git a/ftplugin/python/python_fn.vim b/bundle/ft_python_fn/ftplugin/python/python_fn.vim similarity index 100% rename from ftplugin/python/python_fn.vim rename to bundle/ft_python_fn/ftplugin/python/python_fn.vim diff --git a/ftplugin/python/pythonhelper.vim b/bundle/ft_pythonhelper/ftplugin/python/pythonhelper.vim similarity index 100% rename from ftplugin/python/pythonhelper.vim rename to bundle/ft_pythonhelper/ftplugin/python/pythonhelper.vim diff --git a/ftplugin/rst/commons.vim b/bundle/ft_rst/ftplugin/rst/commons.vim similarity index 100% rename from ftplugin/rst/commons.vim rename to bundle/ft_rst/ftplugin/rst/commons.vim diff --git a/ftplugin/rst/word_utils.vim b/bundle/ft_rst/ftplugin/rst/word_utils.vim similarity index 100% rename from ftplugin/rst/word_utils.vim rename to bundle/ft_rst/ftplugin/rst/word_utils.vim diff --git a/ftplugin/snippet/common.vim b/bundle/ft_snippets/ftplugin/snippet/common.vim similarity index 100% rename from ftplugin/snippet/common.vim rename to bundle/ft_snippets/ftplugin/snippet/common.vim diff --git a/ftplugin/sql/common.vim b/bundle/ft_sql/ftplugin/sql/common.vim similarity index 100% rename from ftplugin/sql/common.vim rename to bundle/ft_sql/ftplugin/sql/common.vim diff --git a/ftplugin/tex/common.vim b/bundle/ft_tex/ftplugin/tex/common.vim similarity index 100% rename from ftplugin/tex/common.vim rename to bundle/ft_tex/ftplugin/tex/common.vim diff --git a/ftplugin/vim/common.vim b/bundle/ft_vim/ftplugin/vim/common.vim similarity index 100% rename from ftplugin/vim/common.vim rename to bundle/ft_vim/ftplugin/vim/common.vim diff --git a/bundle/ft_vimblogger/README.rst b/bundle/ft_vimblogger/README.rst new file mode 100644 index 0000000..20d3614 --- /dev/null +++ b/bundle/ft_vimblogger/README.rst @@ -0,0 +1,220 @@ +:Author: Roman Dobosz, gryf73 at gmail com + +============= +vimblogger_ft +============= + +vimblogger_ft is a simple reStructuredText_ to Blogger interface through VIm_. + +As the name suggest it is a filetype plugin, which helps to create blog +articles in rsST format and send them to blog site. It also provides commands +for preview in browser and delete articles. + +Requirements +------------ + +Module for communication was written in Python. So, VIm has to be +compiled with ``+python``. + +Other requirements: + +- Python (tested with version 2.6, should work also in others) + + - gdata_ + - docutils_ + - Pygments_ (optional) + +- Blogger account + +Install +------- + +Download_, edit the vba with VIm and type:: + + :so % + +Or, clone this repository and put files in your ``~/.vim`` directory. + +Usage +----- + +This plugin is targeting for people, who has blogger account, want to +use VIm for creating blog articles and don't really likes to manually do +this in html. + +Before starting writing a post, at least ``g:blogger_name`` and +``g:blogger_login`` has to be set up in ``.vimrc``. Next, an article has to +be written using standard reST markup, ``:Title:`` added (not required, +but it's nice to have some title for a blog entry). Now, +``:PreviewBlogArticle`` can be used for saving generated HTML page into +the file of the same name as reST file. Please note, that it'll silently +overwrite existing file, because it is treated as a temporary file. + +When article is done, ``:SendBlogArticle`` will send it to the server. + +Output provided by ``:PreviewBlogArticle`` without any +css stylesheet will look pretty raw, so it is generally good idea to +grab stylesheets from blog itself, and tweak it a little, and add to +list in ``g:blogger_stylesheets``. They will be automatically linked to +generated preview file. + +Unfortunately, this script has several limitations, like it is +impossible to use multiple blogs or edit existing articles without reST +source files. It has to be somehow converted to reStructuredText, id of +an article added to ``:Id:`` docinfo item and then updated. Id of an +article is available through blogger account - every action for each +post listed on Posting->Edit Posts has URL with query string item +postID, for example:: + + http://www.blogger.com/post-edit.g?blogID=9876&postID=12345 + +See plugin documentation for configuration. + +Commands +-------- + +#. ``:PreviewBlogArticle`` - Generate article in HTML format, save it to the + file with te same name as a reST source with .html extension in the same + directory, and optionally opens it in browser. No connection to the blogger + is performed. +#. ``:SendBlogArticle`` - + Generate partial HTML document, which holds article, from current + reST buffer and send it to the blog. + + See reST document structure below for further description. +#. ``:DeleteBlogArticle`` - + Display list of articles, and lets user choose one (or none) of them + to perform deletions. + +reST document structure +----------------------- + +It is assumed, that following template will be used:: + + :Id: + :Title: Title for the blog article + :Date: + :Modified: + :Tags: some, tags + + Penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla + facilisis massa ut massa. Sed nisi purus, malesuada eu, porta vulputate, + suscipit auctor, nunc. Vestibulum convallis, augue eu luctus malesuada, + mi ante mattis odio, ac venenatis neque sem vitae nisi. + + .. more + + heading + ------- + + **Congue** mi, quis posuere augue nulla a augue. Pellentesque sed est. + Mauris cursus urna id lectus. Integer dignissim feugiat eros. Sed tempor + volutpat dolor. Vestibulum vel lectus nec mauris semper adipiscing. + + Aliquam tincidunt enim sit amet tellus. Sed mauris nulla, semper + tincidunt, luctus a, sodales eget, leo. Sed ligula augue, cursus et. + +reST document (optionally) starts with *docinfo* section (first several +lines, that are starting from ":" character) separaded from other +content with one empty line. + +Docinfo items holds article attributes, and are updated automatically +every each of upload to blogger, which is triggered by +":SendBlogArticle" command. + +- **:Id:** - Holds article id on blogger side. If not defined, new article + will be created (even if there is already existing one with the very same + content). If wrong Id is entered (or an Id of deleted article), + exception will be raised, and no action on blogger side will be + performed. +- **:Title:** - Holds article title. Can be changed when ``:Id:`` is obtained. +- **:Date:** - This is published date in RFC 3339 + http://www.ietf.org/rfc/rfc3339.txt format. If empty on first + upload, it will be set to current date. Can be set/changed to + desired date. +- **:Modified:** - This is read-only item, which store modification date + which happens on blogger side. +- **:Tags:** - Comma separated list of tags (Labels). Can be empty. + +All other items are ignored. + +After docinfo block, article body should be placed using markup for +reStructuredText. + +Note, that ``.. more`` will became HTML comment ```` which will +prevent from displaying entire post on the bloggers front page, but will +not have any visible effect during preview in browser. + +Pygments code highlighting +-------------------------- + +Additionally, if Pygments is installed, there is ``sourcecode`` directive, +simple syntax highlighter using Pygments module. Very simple usage for Python +code could be as follows:: + + .. sourcecode:: python + + import vim + print vim.current.buffer.name + +Note, that ``sourcecode`` directive requires argument with the name of the +lexer to use. If wrong/non existent lexer is provided, it will fall back to +*text* lexer. For more information about available lexers, please refer to +Pygments documentation. + +Directive ``sourcecode`` supports two options: ``:linenos:`` and +``:cssclass:``. + +``:linenos:`` takes zero or one argument - if no arguments is provided, line +numbers will be visible starting form 1. Provided integer will be the number +of the first line. + +``:cssclass:`` can be use for changing default class name for block of code. +Default class can be changed by appropriate option for plugin (see +documentation), and defaults to "highlight". + +It is possible to use VIm colorschemes like desert (which is distributed with +VIm), Zenburn_, Lucius_, Wombat_, inkpot_ or any other with Pygments. +Assuming, that colorscheme *desert* should be used, there are two steps to +achive it. + +First, python module containing Pygments *Style* class has to be generated. +There is apropriate convertion tool in Pygments distribution - +``scripts/vim2pygments.py``. Uage is simple as:: + + python Pygments/scripts/vim2pygments.py [path/to/vim/colors]/desert.vim > desert.py + +Which will create new python module ``desert.py`` containing class +``DessertStyle``. + +To generate CSS stylesheet, it's enough to:: + + python rst2blogger/scripts/style2css.py desert.py -c VimDesert > desert.css + +VimDesert is the name of the class, which passed as an argument to +``:cssclass:`` option of directive ``sourceocode``. It will be used as a main +CSS class for code top ``
`` element. So, above example will looks like +this:: + + .. sourcecode:: python + :cssclass: VimDesert + + import vim + print vim.current.buffer.name + +Note: All headings for generated HTML by ``:SendBlogArticle`` will be +shifted by 3, so the first heading will become

, second

and so +on, to fit into blogger template (well, most of them). Remember, that +HTML allow up to 6 level of headings, while reST doesn't have this +limitation. + +.. _VIm: http://www.vim.org +.. _gdata: http://code.google.com/p/gdata-python-client +.. _docutils: http://docutils.sourceforge.net +.. _Pygments: http://pygments.org +.. _reStructuredText: http://docutils.sourceforge.net/rst.html +.. _Download: http://www.vim.org/scripts/script.php?script_id=3367 +.. _Zenburn: http://www.vim.org/scripts/script.php?script_id=415 +.. _inkpot: http://www.vim.org/scripts/script.php?script_id=1143 +.. _Lucius: http://www.vim.org/scripts/script.php?script_id=2536 +.. _Wombat: http://www.vim.org/scripts/script.php?script_id=1778 diff --git a/doc/vimblogger_ft.txt b/bundle/ft_vimblogger/doc/vimblogger_ft.txt similarity index 100% rename from doc/vimblogger_ft.txt rename to bundle/ft_vimblogger/doc/vimblogger_ft.txt diff --git a/ftplugin/rst/rst2blogger/__init__.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/__init__.py similarity index 100% rename from ftplugin/rst/rst2blogger/__init__.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/__init__.py diff --git a/ftplugin/rst/rst2blogger/blogger.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/blogger.py similarity index 100% rename from ftplugin/rst/rst2blogger/blogger.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/blogger.py diff --git a/ftplugin/rst/rst2blogger/main.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/main.py similarity index 100% rename from ftplugin/rst/rst2blogger/main.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/main.py diff --git a/ftplugin/rst/rst2blogger/rest.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/rest.py similarity index 100% rename from ftplugin/rst/rst2blogger/rest.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/rest.py diff --git a/ftplugin/rst/rst2blogger/scripts/style2css.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/scripts/style2css.py similarity index 100% rename from ftplugin/rst/rst2blogger/scripts/style2css.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/scripts/style2css.py diff --git a/ftplugin/rst/rst2blogger/tests/__init__.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/__init__.py similarity index 100% rename from ftplugin/rst/rst2blogger/tests/__init__.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/__init__.py diff --git a/ftplugin/rst/rst2blogger/tests/shared.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/shared.py similarity index 100% rename from ftplugin/rst/rst2blogger/tests/shared.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/shared.py diff --git a/ftplugin/rst/rst2blogger/tests/test_blogger.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/test_blogger.py similarity index 100% rename from ftplugin/rst/rst2blogger/tests/test_blogger.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/test_blogger.py diff --git a/ftplugin/rst/rst2blogger/tests/test_main.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/test_main.py similarity index 100% rename from ftplugin/rst/rst2blogger/tests/test_main.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/test_main.py diff --git a/ftplugin/rst/rst2blogger/tests/test_rest.py b/bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/test_rest.py similarity index 100% rename from ftplugin/rst/rst2blogger/tests/test_rest.py rename to bundle/ft_vimblogger/ftplugin/rst/rst2blogger/tests/test_rest.py diff --git a/ftplugin/rst/vimblogger_ft.vim b/bundle/ft_vimblogger/ftplugin/rst/vimblogger_ft.vim similarity index 100% rename from ftplugin/rst/vimblogger_ft.vim rename to bundle/ft_vimblogger/ftplugin/rst/vimblogger_ft.vim diff --git a/bundle/git_ctrlp/.gitignore b/bundle/git_ctrlp/.gitignore new file mode 100644 index 0000000..299a816 --- /dev/null +++ b/bundle/git_ctrlp/.gitignore @@ -0,0 +1,8 @@ +.hgignore +*.markdown +*.zip +wiki.md +note.txt +tags +.hg/* +tmp/* diff --git a/bundle/git_ctrlp/autoload/ctrlp.vim b/bundle/git_ctrlp/autoload/ctrlp.vim new file mode 100644 index 0000000..a186072 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp.vim @@ -0,0 +1,1542 @@ +" ============================================================================= +" File: autoload/ctrlp.vim +" Description: Fuzzy file, buffer, mru and tag finder. +" Author: Kien Nguyen +" Version: 1.7.2 +" ============================================================================= + +" Static variables {{{1 +fu! s:opts() + " Options + let hst = exists('+hi') ? &hi : 20 + let opts = { + \ 'g:ctrlp_arg_map': ['s:argmap', 0], + \ 'g:ctrlp_by_filename': ['s:byfname', 0], + \ 'g:ctrlp_clear_cache_on_exit': ['s:clrex', 1], + \ 'g:ctrlp_custom_ignore': ['s:usrign', ''], + \ 'g:ctrlp_dont_split': ['s:nosplit', 'netrw'], + \ 'g:ctrlp_dotfiles': ['s:dotfiles', 1], + \ 'g:ctrlp_extensions': ['s:extensions', []], + \ 'g:ctrlp_follow_symlinks': ['s:folsym', 0], + \ 'g:ctrlp_highlight_match': ['s:mathi', [1, 'CtrlPMatch']], + \ 'g:ctrlp_jump_to_buffer': ['s:jmptobuf', 2], + \ 'g:ctrlp_lazy_update': ['s:lazy', 0], + \ 'g:ctrlp_match_window_bottom': ['s:mwbottom', 1], + \ 'g:ctrlp_match_window_reversed': ['s:mwreverse', 1], + \ 'g:ctrlp_max_depth': ['s:maxdepth', 40], + \ 'g:ctrlp_max_files': ['s:maxfiles', 10000], + \ 'g:ctrlp_max_height': ['s:mxheight', 10], + \ 'g:ctrlp_max_history': ['s:maxhst', hst], + \ 'g:ctrlp_open_multi': ['s:opmul', '1v'], + \ 'g:ctrlp_open_new_file': ['s:newfop', 'v'], + \ 'g:ctrlp_prompt_mappings': ['s:urprtmaps', 0], + \ 'g:ctrlp_regexp_search': ['s:regexp', 0], + \ 'g:ctrlp_root_markers': ['s:rmarkers', []], + \ 'g:ctrlp_split_window': ['s:splitwin', 0], + \ 'g:ctrlp_status_func': ['s:status', {}], + \ 'g:ctrlp_use_caching': ['s:caching', 1], + \ 'g:ctrlp_use_migemo': ['s:migemo', 0], + \ 'g:ctrlp_user_command': ['s:usrcmd', ''], + \ 'g:ctrlp_working_path_mode': ['s:pathmode', 2], + \ } + for [ke, va] in items(opts) + exe 'let' va[0] '=' string(exists(ke) ? eval(ke) : va[1]) + endfo + let new_opts = { + \ 'g:ctrlp_open_multiple_files': 's:opmul', + \ 'g:ctrlp_regexp': 's:regexp', + \ 'g:ctrlp_reuse_window': 's:nosplit', + \ 'g:ctrlp_switch_buffer': 's:jmptobuf', + \ } + for [key, val] in items(new_opts) + exe 'let' val '=' string(eval(exists(key) ? key : val)) + endfo + if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en + let s:maxdepth = min([s:maxdepth, 100]) + let s:mxheight = max([s:mxheight, 1]) + let s:glob = s:dotfiles ? '.*\|*' : '*' + let s:igntype = empty(s:usrign) ? -1 : type(s:usrign) + " Extensions + let g:ctrlp_builtins = 2 + for each in s:extensions + exe 'ru autoload/ctrlp/'.each.'.vim' + endfo + " Keymaps + let [s:lcmap, s:prtmaps] = ['nn ', { + \ 'PrtBS()': ['', ''], + \ 'PrtDelete()': [''], + \ 'PrtDeleteWord()': [''], + \ 'PrtClear()': [''], + \ 'PrtSelectMove("j")': ['', ''], + \ 'PrtSelectMove("k")': ['', ''], + \ 'PrtSelectMove("t")': ['', ''], + \ 'PrtSelectMove("b")': ['', ''], + \ 'PrtSelectMove("u")': ['', ''], + \ 'PrtSelectMove("d")': ['', ''], + \ 'PrtHistory(-1)': [''], + \ 'PrtHistory(1)': [''], + \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], + \ 'AcceptSelection("h")': ['', '', ''], + \ 'AcceptSelection("t")': ['', ''], + \ 'AcceptSelection("v")': ['', ''], + \ 'ToggleFocus()': [''], + \ 'ToggleRegex()': [''], + \ 'ToggleByFname()': [''], + \ 'ToggleType(1)': ['', ''], + \ 'ToggleType(-1)': ['', ''], + \ 'PrtExpandDir()': [''], + \ 'PrtInsert("w")': ['', ''], + \ 'PrtInsert("s")': [''], + \ 'PrtInsert("v")': [''], + \ 'PrtInsert("+")': [''], + \ 'PrtCurStart()': [''], + \ 'PrtCurEnd()': [''], + \ 'PrtCurLeft()': ['', '', ''], + \ 'PrtCurRight()': ['', ''], + \ 'PrtClearCache()': [''], + \ 'PrtDeleteMRU()': [''], + \ 'CreateNewFile()': [''], + \ 'MarkToOpen()': [''], + \ 'OpenMulti()': [''], + \ 'PrtExit()': ['', '', ''], + \ }] + if !has('gui_running') && ( has('win32') || has('win64') ) + cal add(s:prtmaps['PrtBS()'], remove(s:prtmaps['PrtCurLeft()'], 0)) + en + if type(s:urprtmaps) == 4 + cal extend(s:prtmaps, s:urprtmaps) + en + " Global options + let s:glbs = { 'magic': 1, 'to': 1, 'tm': 0, 'sb': 1, 'hls': 0, 'im': 0, + \ 'report': 9999, 'sc': 0, 'ss': 0, 'siso': 0, 'mfd': 200, 'mouse': 'n', + \ 'gcr': 'a:blinkon0', 'ic': 1, 'scs': 1, 'lmap': '', 'mousef': 0, + \ 'imd': 1 } + if s:lazy + cal extend(s:glbs, { 'ut': ( s:lazy > 1 ? s:lazy : 250 ) }) + en +endf +cal s:opts() + +let s:lash = ctrlp#utils#lash() + +" Limiters +let [s:compare_lim, s:nocache_lim] = [3000, 4000] + +" Regexp +let s:fpats = { + \ '^\(\\|\)\|\(\\|\)$': '\\|', + \ '^\\\(zs\|ze\|<\|>\)': '^\\\(zs\|ze\|<\|>\)', + \ '^\S\*$': '\*', + \ '^\S\\?$': '\\?', + \ } + +" Mappings +let s:prtunmaps = [ + \ 'PrtBS()', + \ 'PrtDelete()', + \ 'PrtDeleteWord()', + \ 'PrtClear()', + \ 'PrtCurStart()', + \ 'PrtCurEnd()', + \ 'PrtCurLeft()', + \ 'PrtCurRight()', + \ 'PrtHistory(-1)', + \ 'PrtHistory(1)', + \ 'PrtInsert("w")', + \ 'PrtInsert("s")', + \ 'PrtInsert("v")', + \ 'PrtInsert("+")', + \ ] + +" Keypad +let s:kprange = { + \ 'Plus': '+', + \ 'Minus': '-', + \ 'Divide': '/', + \ 'Multiply': '*', + \ 'Point': '.', + \ } + +" Highlight groups +let s:hlgrps = { + \ 'NoEntries': 'Error', + \ 'Mode1': 'Character', + \ 'Mode2': 'LineNr', + \ 'Stats': 'Function', + \ 'Match': 'Identifier', + \ 'PrtBase': 'Comment', + \ 'PrtText': 'Normal', + \ 'PrtCursor': 'Constant', + \ } +" * Open & Close {{{1 +fu! s:Open() + cal s:log(1) + cal s:getenv() + sil! exe 'noa keepa' ( s:mwbottom ? 'bo' : 'to' ) '1new ControlP' + let [s:bufnr, s:prompt, s:winw] = [bufnr('%'), ['', '', ''], winwidth(0)] + abc + if !exists('s:hstry') + let hst = filereadable(s:gethistloc()[1]) ? s:gethistdata() : [''] + let s:hstry = empty(hst) || !s:maxhst ? [''] : hst + en + for [ke, va] in items(s:glbs) | if exists('+'.ke) + sil! exe 'let s:glb_'.ke.' = &'.ke.' | let &'.ke.' = '.string(va) + en | endfo + if s:opmul != '0' && has('signs') + sign define ctrlpmark text=+> texthl=Search + en + cal s:setupblank() +endf + +fu! s:Close() + try | noa bun! + cat | noa clo! | endt + cal s:unmarksigns() + for key in keys(s:glbs) | if exists('+'.key) + sil! exe 'let &'.key.' = s:glb_'.key + en | endfo + if exists('s:glb_acd') | let &acd = s:glb_acd | en + let [g:ctrlp_lines, g:ctrlp_allfiles] = [[], []] + if s:winres[1] >= &lines && s:winres[2] == winnr('$') + exe s:winres[0] + en + unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:cline s:init s:savestr + \ g:ctrlp_nolimit + cal ctrlp#recordhist() + cal s:onexit() + cal s:log(0) + ec +endf +" * Clear caches {{{1 +fu! ctrlp#clr(...) + exe 'let g:ctrlp_new'.( a:0 ? a:1 : 'cache' ).' = 1' +endf + +fu! ctrlp#clra() + let cache_dir = ctrlp#utils#cachedir() + if isdirectory(cache_dir) + let cache_files = split(s:glbpath(cache_dir, '**', 1), "\n") + let eval = '!isdirectory(v:val) && v:val !~ ''\= 2 && cmd[:1] != ['', ''] + " Find a repo root + cal s:findroot(getcwd(), cmd[0], 0, 1) + if !exists('s:vcsroot') + " Try the secondary_command + retu len(cmd) == 3 ? cmd[2] : '' + en + unl s:vcsroot + let s:vcscmd = s:lash == '\' ? 1 : 0 + retu cmd[1] + elsei type(cmd) == 4 && has_key(cmd, 'types') + for key in sort(keys(cmd['types']), 's:compval') + cal s:findroot(getcwd(), cmd['types'][key][0], 0, 1) + if exists('s:vcsroot') | brea | en + endfo + if !exists('s:vcsroot') + retu has_key(cmd, 'fallback') ? cmd['fallback'] : '' + en + unl s:vcsroot + let s:vcscmd = s:lash == '\' ? 1 : 0 + retu cmd['types'][key][1] + en +endf +" Buffers {{{1 +fu! ctrlp#buffers() + retu map(filter(range(1, bufnr('$')), 'empty(getbufvar(v:val, "&bt"))' + \ .' && getbufvar(v:val, "&bl") && strlen(bufname(v:val))'), + \ 'fnamemodify(bufname(v:val), ":.")') +endf +" * MatchedItems() {{{1 +fu! s:MatchIt(items, pat, limit, mfunc, ipt) + let [newitems, crfile] = [[], exists('s:crfilerel') ? s:crfilerel : ''] + for item in a:items + try | if !( a:ipt && item == crfile ) && call(a:mfunc, [item, a:pat]) >= 0 + cal add(newitems, item) + en | cat | brea | endt + if a:limit > 0 && len(newitems) >= a:limit | brea | en + endfo + retu newitems +endf + +fu! s:MatchedItems(items, pat, limit, ipt) + let [type, mfunc] = [s:type(1), 'match'] + if s:byfname && a:ipt + let mfunc = 's:matchfname' + elsei s:itemtype > 2 + let types = { 'tabs': 's:matchtabs', 'tabe': 's:matchtabe' } + if has_key(types, type) | let mfunc = types[type] | en + en + let newitems = s:MatchIt(a:items, a:pat, a:limit, mfunc, a:ipt) + let s:matches = len(newitems) + retu newitems +endf +fu! s:SplitPattern(str) "{{{1 + let str = a:str + if s:migemo && s:regexp && len(str) > 0 && executable('cmigemo') + let str = s:migemo(str) + en + let s:savestr = str + if s:regexp || match(str, '\\\(<\|>\)\|[*|]') >= 0 + let pat = s:regexfilter(str) + el + let lst = split(str, '\zs') + if exists('+ssl') && !&ssl + cal map(lst, 'escape(v:val, ''\'')') + en + for each in ['^', '$', '.'] + cal map(lst, 'escape(v:val, each)') + endfo + en + if exists('lst') + let pat = '' + if !empty(lst) + let pat = lst[0] + for item in range(1, len(lst) - 1) + let pat .= '[^'.lst[item - 1].']\{-}'.lst[item] + endfo + en + en + retu escape(pat, '~') +endf +" * BuildPrompt() {{{1 +fu! s:Render(lines, pat, ipt) + let [&ma, lines, s:height] = [1, a:lines, min([len(a:lines), s:winh])] + " Setup the match window + sil! exe '%d _ | res' s:height + " Print the new items + if empty(lines) + let s:matched = [] + cal setline(1, ' == NO ENTRIES ==') + setl noma nocul + cal s:unmarksigns() + if s:dohighlight() | cal clearmatches() | en + retu + en + " Sort if not MRU + if ( s:itemtype != 2 && !exists('g:ctrlp_nolimit') ) + \ || s:prompt != ['', '', ''] + let s:compat = a:pat + cal sort(lines, 's:mixedsort') + unl s:compat + en + if s:mwreverse | cal reverse(lines) | en + let s:matched = copy(lines) + cal map(lines, 's:formatline(v:val, a:ipt)') + cal setline(1, lines) + setl noma cul + exe 'keepj norm!' ( s:mwreverse ? 'G' : 'gg' ).'1|' + cal s:unmarksigns() + cal s:remarksigns() + if exists('s:cline') && !exists('g:ctrlp_nolimit') + cal cursor(s:cline, 1) + en + " Highlighting + if s:dohighlight() + cal s:highlight(a:pat, s:mathi[1], a:ipt) + en +endf + +fu! s:Update(str) + " Get the previous string if existed + let oldstr = exists('s:savestr') ? s:savestr : '' + " Get the new string sans tail + let str = s:sanstail(a:str) + " Stop if the string's unchanged + if str == oldstr && !empty(str) && !exists('s:force') | retu | en + let [pat, ipt] = [s:SplitPattern(str), s:ispathitem()] + let lines = exists('g:ctrlp_nolimit') && empty(str) ? copy(g:ctrlp_lines) + \ : s:MatchedItems(g:ctrlp_lines, pat, s:winh, ipt) + cal s:Render(lines, pat, ipt) +endf + +fu! s:ForceUpdate() + let [estr, prt] = ['"\', copy(s:prompt)] + cal map(prt, 'escape(v:val, estr)') + sil! cal s:Update(join(prt, '')) +endf + +fu! s:BuildPrompt(upd, ...) + let base = ( s:regexp ? 'r' : '>' ).( s:byfname ? 'd' : '>' ).'> ' + let [estr, prt] = ['"\', copy(s:prompt)] + cal map(prt, 'escape(v:val, estr)') + let str = join(prt, '') + let lazy = empty(str) || exists('s:force') || !has('autocmd') ? 0 : s:lazy + if a:upd && !lazy && ( s:matches || s:regexp + \ || match(str, '\(\\\(<\|>\)\|[*|]\)\|\(\\\:\([^:]\|\\:\)*$\)') >= 0 ) + sil! cal s:Update(str) + en + sil! cal ctrlp#statusline() + " Toggling + let [hiactive, hicursor, base] = a:0 && !a:1 + \ ? ['CtrlPPrtBase', 'CtrlPPrtBase', tr(base, '>', '-')] + \ : ['CtrlPPrtText', 'CtrlPPrtCursor', base] + let hibase = 'CtrlPPrtBase' + " Build it + redr + exe 'echoh' hibase '| echon "'.base.'" + \ | echoh' hiactive '| echon "'.prt[0].'" + \ | echoh' hicursor '| echon "'.prt[1].'" + \ | echoh' hiactive '| echon "'.prt[2].'" | echoh None' + " Append the cursor at the end + if empty(prt[1]) && !( a:0 && !a:1 ) + exe 'echoh' hibase '| echon "_" | echoh None' + en +endf +" ** Prt Actions {{{1 +" Editing {{{2 +fu! s:PrtClear() + unl! s:hstgot + let [s:prompt, s:matches] = [['', '', ''], 1] + cal s:BuildPrompt(1) +endf + +fu! s:PrtAdd(char) + unl! s:hstgot + let s:prompt[0] .= a:char + cal s:BuildPrompt(1) +endf + +fu! s:PrtBS() + unl! s:hstgot + let [s:prompt[0], s:matches] = [substitute(s:prompt[0], '.$', '', ''), 1] + cal s:BuildPrompt(1) +endf + +fu! s:PrtDelete() + unl! s:hstgot + let [prt, s:matches] = [s:prompt, 1] + let prt[1] = matchstr(prt[2], '^.') + let prt[2] = substitute(prt[2], '^.', '', '') + cal s:BuildPrompt(1) +endf + +fu! s:PrtDeleteWord() + unl! s:hstgot + let [str, s:matches] = [s:prompt[0], 1] + let str = match(str, '\W\w\+$') >= 0 ? matchstr(str, '^.\+\W\ze\w\+$') + \ : match(str, '\w\W\+$') >= 0 ? matchstr(str, '^.\+\w\ze\W\+$') + \ : match(str, '\s\+$') >= 0 ? matchstr(str, '^.*[^ \t]\+\ze\s\+$') + \ : match(str, ' ') <= 0 ? '' : str + let s:prompt[0] = str + cal s:BuildPrompt(1) +endf + +fu! s:PrtInsert(type) + unl! s:hstgot + let s:prompt[0] .= a:type == 'w' ? s:crword + \ : a:type == 's' ? getreg('/') + \ : a:type == 'v' ? s:crvisual + \ : a:type == '+' ? substitute(getreg('+'), '\n', '\\n', 'g') : s:prompt[0] + cal s:BuildPrompt(1) +endf + +fu! s:PrtExpandDir() + let prt = s:prompt + if prt[0] == '' | retu | en + let [base, seed] = s:headntail(prt[0]) + let dirs = s:dircompl(base, seed) + if len(dirs) == 1 + let prt[0] = dirs[0] + elsei len(dirs) > 1 + let prt[0] .= s:findcommon(dirs, prt[0]) + en + cal s:BuildPrompt(1) +endf +" Movement {{{2 +fu! s:PrtCurLeft() + let prt = s:prompt + if !empty(prt[0]) + let s:prompt = [substitute(prt[0], '.$', '', ''), matchstr(prt[0], '.$'), + \ prt[1] . prt[2]] + en + cal s:BuildPrompt(0) +endf + +fu! s:PrtCurRight() + let prt = s:prompt + let s:prompt = [prt[0] . prt[1], matchstr(prt[2], '^.'), + \ substitute(prt[2], '^.', '', '')] + cal s:BuildPrompt(0) +endf + +fu! s:PrtCurStart() + let str = join(s:prompt, '') + let s:prompt = ['', matchstr(str, '^.'), substitute(str, '^.', '', '')] + cal s:BuildPrompt(0) +endf + +fu! s:PrtCurEnd() + let s:prompt = [join(s:prompt, ''), '', ''] + cal s:BuildPrompt(0) +endf + +fu! s:PrtSelectMove(dir) + let wht = winheight(0) + let dirs = {'t': 'gg','b': 'G','j': 'j','k': 'k','u': wht.'k','d': wht.'j'} + exe 'keepj norm!' dirs[a:dir] + if !exists('g:ctrlp_nolimit') | let s:cline = line('.') | en + if line('$') > winheight(0) | cal s:BuildPrompt(0, s:Focus()) | en +endf + +fu! s:PrtSelectJump(char, ...) + let lines = copy(s:matched) + if a:0 + cal map(lines, 'split(v:val, ''[\/]\ze[^\/]\+$'')[-1]') + en + " Cycle through matches, use s:jmpchr to store last jump + let chr = escape(a:char, '.~') + if match(lines, '\c^'.chr) >= 0 + " If not exists or does but not for the same char + let pos = match(lines, '\c^'.chr) + if !exists('s:jmpchr') || ( exists('s:jmpchr') && s:jmpchr[0] != chr ) + let [jmpln, s:jmpchr] = [pos, [chr, pos]] + elsei exists('s:jmpchr') && s:jmpchr[0] == chr + " Start of lines + if s:jmpchr[1] == -1 | let s:jmpchr[1] = pos | en + let npos = match(lines, '\c^'.chr, s:jmpchr[1] + 1) + let [jmpln, s:jmpchr] = [npos == -1 ? pos : npos, [chr, npos]] + en + keepj exe jmpln + 1 + if !exists('g:ctrlp_nolimit') | let s:cline = line('.') | en + if line('$') > winheight(0) | cal s:BuildPrompt(0, s:Focus()) | en + en +endf +" Misc {{{2 +fu! s:PrtClearCache() + if s:itemtype == 1 | retu | en + if s:itemtype == 0 + cal ctrlp#clr() + elsei s:itemtype > 2 + cal ctrlp#clr(s:statypes[s:itemtype][1]) + en + if s:itemtype == 2 + let g:ctrlp_lines = ctrlp#mrufiles#list(-1, 1) + el + cal ctrlp#setlines(s:itemtype) + en + let s:force = 1 + cal s:BuildPrompt(1) + unl s:force +endf + +fu! s:PrtDeleteMRU() + if s:itemtype != 2 | retu | en + let [s:force, ags] = [1, [-1, 2]] + if exists('s:marked') + let ags = [-1, 2, values(s:marked)] + cal s:unmarksigns() + unl s:marked + en + let g:ctrlp_lines = call('ctrlp#mrufiles#list', ags) + cal s:BuildPrompt(1) + unl s:force +endf + +fu! s:PrtExit() + if !has('autocmd') | cal s:Close() | en + exe s:currwin.'winc w' +endf + +fu! s:PrtHistory(...) + if !s:maxhst | retu | en + let [str, hst, s:matches] = [join(s:prompt, ''), s:hstry, 1] + " Save to history if not saved before + let [hst[0], hslen] = [exists('s:hstgot') ? hst[0] : str, len(hst)] + let idx = exists('s:hisidx') ? s:hisidx + a:1 : a:1 + " Limit idx within 0 and hslen + let idx = idx < 0 ? 0 : idx >= hslen ? hslen > 1 ? hslen - 1 : 0 : idx + let s:prompt = [hst[idx], '', ''] + let [s:hisidx, s:hstgot, s:force] = [idx, 1, 1] + cal s:BuildPrompt(1) + unl s:force +endf +"}}}1 +" * MapKeys() {{{1 +fu! s:MapKeys(...) + " Normal keys + let pfunc = a:0 && !a:1 ? 'PrtSelectJump' : 'PrtAdd' + let dojmp = s:byfname && a:0 && !a:1 ? ', 1' : '' + let pcmd = "nn \ \ \ :\cal \%s(\"%s\"%s)\" + let cmd = substitute(pcmd, 'k%s', 'char-%d', '') + for each in range(32, 126) + exe printf(cmd, each, pfunc, escape(nr2char(each), '"|\'), dojmp) + endfo + for each in range(0, 9) + exe printf(pcmd, each, pfunc, each, dojmp) + endfo + for [ke, va] in items(s:kprange) + exe printf(pcmd, ke, pfunc, va, dojmp) + endfo + " Special keys + if a:0 < 2 + cal call('s:MapSpecs', a:0 && !a:1 ? [1] : []) + en +endf + +fu! s:MapSpecs(...) + " Correct arrow keys in terminal + if ( has('termresponse') && match(v:termresponse, "\") >= 0 ) + \ || &term =~? 'xterm\|\','\B ','\C ','\D '] + exe s:lcmap.' ['.each + endfo + en + if a:0 + for ke in s:prtunmaps | for kp in s:prtmaps[ke] + exe s:lcmap kp '' + endfo | endfo + el + for [ke, va] in items(s:prtmaps) | for kp in va + exe s:lcmap kp ':cal '.ke.'' + endfo | endfo + en +endf +" * Toggling {{{1 +fu! s:Focus() + retu !exists('s:focus') ? 1 : s:focus +endf + +fu! s:ToggleFocus() + let s:focus = !exists('s:focus') || s:focus ? 0 : 1 + cal s:MapKeys(s:focus) + cal s:BuildPrompt(0, s:focus) +endf + +fu! s:ToggleRegex() + let s:regexp = s:regexp ? 0 : 1 + cal s:PrtSwitcher() +endf + +fu! s:ToggleByFname() + if s:ispathitem() + let s:byfname = s:byfname ? 0 : 1 + cal s:MapKeys(s:Focus(), 1) + cal s:PrtSwitcher() + en +endf + +fu! s:ToggleType(dir) + let ext = exists('g:ctrlp_ext_vars') ? len(g:ctrlp_ext_vars) : 0 + let s:itemtype = s:walker(g:ctrlp_builtins + ext, s:itemtype, a:dir) + if s:byfname && !s:ispathitem() | let s:byfname = 0 | en + unl! g:ctrlp_nolimit + if has('syntax') && exists('g:syntax_on') + cal ctrlp#syntax() + en + cal ctrlp#setlines(s:itemtype) + cal s:PrtSwitcher() +endf + +fu! s:PrtSwitcher() + let [s:force, s:matches] = [1, 1] + cal s:BuildPrompt(1, s:Focus()) + unl s:force +endf +fu! s:SetWD(...) "{{{1 + let [pathmode, s:crfilerel] = [s:wpmode, fnamemodify(s:crfile, ':.')] + if a:0 && strlen(a:1) | if type(a:1) + cal ctrlp#setdir(a:1) | retu + el + let pathmode = a:1 + en | en + if a:0 < 2 + if match(s:crfile, '^\<.\+\>://.*') >= 0 || !pathmode | retu | en + if exists('+acd') | let [s:glb_acd, &acd] = [&acd, 0] | en + cal ctrlp#setdir(s:crfpath) + en + if pathmode == 1 | retu | en + let markers = ['root.dir', '.git/', '.hg/', '.svn/', '.bzr/', '_darcs/'] + if type(s:rmarkers) == 3 && !empty(s:rmarkers) + cal extend(markers, s:rmarkers, 0) + en + for marker in markers + cal s:findroot(getcwd(), marker, 0, 0) + if exists('s:foundroot') | brea | en + endfo + unl! s:foundroot +endf +" * AcceptSelection() {{{1 +fu! ctrlp#acceptfile(mode, line, ...) + let [md, filpath] = [a:mode, fnamemodify(a:line, ':p')] + cal s:PrtExit() + let [bufnr, tail] = [bufnr('^'.filpath.'$'), s:tail()] + let j2l = a:0 ? a:1 : str2nr(matchstr(tail, '^ +\D*\zs\d\+\ze\D*')) + if s:jmptobuf && bufnr > 0 && md =~ 'e\|t' + let [jmpb, bufwinnr] = [1, bufwinnr(bufnr)] + let buftab = s:jmptobuf > 1 ? s:buftab(bufnr, md) : [0, 0] + en + " Switch to existing buffer or open new one + if exists('jmpb') && bufwinnr > 0 && md != 't' + exe bufwinnr.'winc w' + if j2l | cal ctrlp#j2l(j2l) | en + elsei exists('jmpb') && buftab[0] + exe 'tabn' buftab[0] + exe buftab[1].'winc w' + if j2l | cal ctrlp#j2l(j2l) | en + el + " Determine the command to use + let useb = bufnr > 0 && empty(tail) + let cmd = + \ md == 't' || s:splitwin == 1 ? ( useb ? 'tab sb' : 'tabe' ) : + \ md == 'h' || s:splitwin == 2 ? ( useb ? 'sb' : 'new' ) : + \ md == 'v' || s:splitwin == 3 ? ( useb ? 'vert sb' : 'vne' ) : + \ call('ctrlp#normcmd', useb ? ['b', 'bo vert sb'] : ['e']) + " Reset &switchbuf option + if useb + let [swb, &swb] = [&swb, ''] + en + " Open new window/buffer + let args = [cmd, useb ? bufnr : filpath, a:0 ? ' +'.a:1 : tail, useb, j2l] + cal call('s:openfile', args) + if useb + let &swb = swb + en + en +endf + +fu! s:SpecInputs(str) + let [str, type] = [a:str, s:type()] + if str == '..' && type =~ '\v^(0|dir)$' + cal s:parentdir(getcwd()) + cal ctrlp#setlines(s:itemtype) + cal s:PrtClear() + retu 1 + elsei str =~ '^[\/]$' && type =~ '\v^(0|dir)$' + cal s:SetWD(2, 0) + cal ctrlp#setlines(s:itemtype) + cal s:PrtClear() + retu 1 + elsei str == '?' + cal s:PrtExit() + let hlpwin = &columns > 159 ? '| vert res 80' : '' + sil! exe 'bo vert h ctrlp-mappings' hlpwin '| norm! 0' + retu 1 + en + retu 0 +endf + +fu! s:AcceptSelection(mode) + let str = join(s:prompt, '') + if a:mode == 'e' | if s:SpecInputs(str) | retu | en | en + " Get the selected line + let line = !empty(s:matched) ? s:matched[line('.') - 1] : '' + if a:mode != 'e' && s:itemtype < 3 && line == '' + \ && str !~ '\v^(\.\.|/|\\|\?)$' + cal s:CreateNewFile(a:mode) | retu + en + if empty(line) | retu | en + " Do something with it + let actfunc = s:itemtype < 3 ? 'ctrlp#acceptfile' + \ : g:ctrlp_ext_vars[s:itemtype - ( g:ctrlp_builtins + 1 )]['accept'] + cal call(actfunc, [a:mode, line]) +endf +fu! s:CreateNewFile(...) "{{{1 + let [md, str] = ['', join(s:prompt, '')] + if empty(str) | retu | en + if s:argmap && !a:0 + " Get the extra argument + let md = s:argmaps(md, 1) + if md == 'cancel' | retu | en + en + let str = s:sanstail(str) + let [base, fname] = s:headntail(str) + if fname =~ '^[\/]$' | retu | en + if exists('s:marked') && len(s:marked) + " Use the first marked file's path + let path = fnamemodify(values(s:marked)[0], ':p:h') + let base = path.s:lash(path).base + let str = fnamemodify(base.s:lash.fname, ':.') + en + if base != '' | if isdirectory(ctrlp#utils#mkdir(base)) + let optyp = str | en | el | let optyp = fname + en + if !exists('optyp') | retu | en + let [filpath, tail] = [fnamemodify(optyp, ':p'), s:tail()] + if !stridx(filpath, getcwd()) | cal s:insertcache(str) | en + cal s:PrtExit() + let cmd = md == 'r' ? ctrlp#normcmd('e') : + \ s:newfop =~ '1\|t' || ( a:0 && a:1 == 't' ) || md == 't' ? 'tabe' : + \ s:newfop =~ '2\|h' || ( a:0 && a:1 == 'h' ) || md == 'h' ? 'new' : + \ s:newfop =~ '3\|v' || ( a:0 && a:1 == 'v' ) || md == 'v' ? 'vne' : + \ ctrlp#normcmd('e') + cal s:openfile(cmd, filpath, tail) +endf +" * OpenMulti() {{{1 +fu! s:MarkToOpen() + if s:bufnr <= 0 || s:opmul == '0' + \ || ( s:itemtype > g:ctrlp_builtins && s:type() !~ 'rts' ) + retu + en + let line = !empty(s:matched) ? s:matched[line('.') - 1] : '' + if empty(line) | retu | en + let filpath = fnamemodify(line, ':p') + if exists('s:marked') && s:dictindex(s:marked, filpath) > 0 + " Unmark and remove the file from s:marked + let key = s:dictindex(s:marked, filpath) + cal remove(s:marked, key) + if empty(s:marked) | unl! s:marked | en + if has('signs') + exe 'sign unplace' key 'buffer='.s:bufnr + en + el + " Add to s:marked and place a new sign + if exists('s:marked') + let vac = s:vacantdict(s:marked) + let key = empty(vac) ? len(s:marked) + 1 : vac[0] + let s:marked = extend(s:marked, { key : filpath }) + el + let [key, s:marked] = [1, { 1 : filpath }] + en + if has('signs') + exe 'sign place' key 'line='.line('.').' name=ctrlpmark buffer='.s:bufnr + en + en + sil! cal ctrlp#statusline() +endf + +fu! s:OpenMulti() + if !exists('s:marked') || s:opmul == '0' | retu | en + " Get the options + let [nr, md, ucr] = matchlist(s:opmul, '\v^(\d+)=(\w)=(\w)=$')[1:3] + if s:argmap + let md = s:argmaps(md) + if md == 'cancel' | retu | en + en + let mkd = values(s:marked) + cal s:sanstail(join(s:prompt, '')) + cal s:PrtExit() + " Move the cursor to a reusable window + let [tail, fnesc] = [s:tail(), exists('*fnameescape') && v:version > 701] + let [emptytail, nwpt] = [empty(tail), exists('g:ctrlp_open_multiple_files')] + let useb = bufnr('^'.mkd[0].'$') > 0 && emptytail + let fst = call('ctrlp#normcmd', useb ? ['b', 'bo vert sb'] : ['e']) + " Check if it's a replaceable buffer + let repabl = ( empty(bufname('%')) && empty(&l:ft) ) || s:nosplit() + " Commands for the rest of the files + let [ic, cmds] = [1, { 'v': ['vert sb', 'vne'], 'h': ['sb', 'new'], + \ 't': ['tab sb', 'tabe'] }] + let [swb, &swb] = [&swb, ''] + " Open the files + for va in mkd + let bufnr = bufnr('^'.va.'$') + let useb = bufnr > 0 && emptytail + let snd = md != '' && has_key(cmds, md) ? + \ ( useb ? cmds[md][0] : cmds[md][1] ) : ( useb ? 'vert sb' : 'vne' ) + let cmd = ic == 1 && ( ucr == 'r' || repabl ) ? fst : snd + let conds = [( nr != '' && nr > 1 && nr < ic ) || ( nr == '' && ic > 1 ), + \ nr != '' && nr < ic] + if conds[nwpt] + if bufnr <= 0 | if fnesc + cal s:openfile('bad', fnamemodify(va, ':.'), '') + el + cal s:openfile(cmd, va, tail) | sil! hid clo! + en | en + el + cal s:openfile(cmd, useb ? bufnr : va, tail) | let ic += 1 + en + endfo + let &swb = swb +endf +" ** Helper functions {{{1 +" Sorting {{{2 +fu! ctrlp#complen(s1, s2) + " By length + let [len1, len2] = [strlen(a:s1), strlen(a:s2)] + retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 +endf + +fu! s:compmatlen(s1, s2) + " By match length + let mln1 = s:shortest(s:matchlens(a:s1, s:compat)) + let mln2 = s:shortest(s:matchlens(a:s2, s:compat)) + retu mln1 == mln2 ? 0 : mln1 > mln2 ? 1 : -1 +endf + +fu! s:comptime(s1, s2) + " By last modified time + let [time1, time2] = [getftime(a:s1), getftime(a:s2)] + retu time1 == time2 ? 0 : time1 < time2 ? 1 : -1 +endf + +fu! s:comparent(s1, s2) + " By same parent dir + let cwd = getcwd() + if match(s:crfpath, escape(cwd, '.^$*\')) >= 0 + let [as1, as2] = [cwd.s:lash().a:s1, cwd.s:lash().a:s2] + let [loc1, loc2] = [s:getparent(as1), s:getparent(as2)] + if loc1 == s:crfpath && loc2 != s:crfpath | retu -1 | en + if loc2 == s:crfpath && loc1 != s:crfpath | retu 1 | en + retu 0 + en + retu 0 +endf + +fu! s:compfnlen(s1, s2) + " By filename length + let len1 = strlen(split(a:s1, s:lash)[-1]) + let len2 = strlen(split(a:s2, s:lash)[-1]) + retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 +endf + +fu! s:matchlens(str, pat, ...) + if empty(a:pat) || index(['^', '$'], a:pat) >= 0 | retu {} | en + let st = a:0 ? a:1 : 0 + let lens = a:0 >= 2 ? a:2 : {} + let nr = a:0 >= 3 ? a:3 : 0 + if nr > 20 | retu {} | en + if match(a:str, a:pat, st) >= 0 + let [mst, mnd] = [matchstr(a:str, a:pat, st), matchend(a:str, a:pat, st)] + let lens = extend(lens, { nr : [strlen(mst), mst] }) + let lens = s:matchlens(a:str, a:pat, mnd, lens, nr + 1) + en + retu lens +endf + +fu! s:shortest(lens) + retu min(map(values(a:lens), 'v:val[0]')) +endf + +fu! s:mixedsort(s1, s2) + let [cml, cln] = [s:compmatlen(a:s1, a:s2), ctrlp#complen(a:s1, a:s2)] + if s:itemtype < 3 && s:height < 51 + let [par, cfn] = [s:comparent(a:s1, a:s2), s:compfnlen(a:s1, a:s2)] + if s:height < 21 + let ctm = s:comptime(a:s1, a:s2) + retu 12 * cml + 6 * par + 3 * cfn + 2 * ctm + cln + en + retu 6 * cml + 3 * par + 2 * cfn + cln + en + retu 2 * cml + cln +endf + +fu! s:compval(...) + retu a:1 - a:2 +endf +" Statusline {{{2 +fu! ctrlp#statusline() + if !exists('s:statypes') + let s:statypes = [ + \ ['files', 'fil'], + \ ['buffers', 'buf'], + \ ['mru files', 'mru'], + \ ] + if exists('g:ctrlp_ext_vars') + cal map(copy(g:ctrlp_ext_vars), + \ 'add(s:statypes, [ v:val["lname"], v:val["sname"] ])') + en + en + let tps = s:statypes + let max = len(tps) - 1 + let nxt = tps[s:walker(max, s:itemtype, 1)][1] + let prv = tps[s:walker(max, s:itemtype, -1)][1] + let item = tps[s:itemtype][0] + let focus = s:Focus() ? 'prt' : 'win' + let byfname = s:byfname ? 'file' : 'path' + let marked = s:opmul != '0' ? + \ exists('s:marked') ? ' <'.s:dismrk().'>' : ' <->' : '' + if has_key(s:status, 'main') + let args = [focus, byfname, s:regexp, prv, item, nxt, marked] + let &l:stl = call(s:status['main'], args) + el + let item = '%#CtrlPMode1# '.item.' %*' + let focus = '%#CtrlPMode2# '.focus.' %*' + let byfname = '%#CtrlPMode1# '.byfname.' %*' + let regex = s:regexp ? '%#CtrlPMode2# regex %*' : '' + let slider = ' <'.prv.'>={'.item.'}=<'.nxt.'>' + let dir = ' %=%<%#CtrlPMode2# '.getcwd().' %*' + let &l:stl = focus.byfname.regex.slider.marked.dir + en +endf + +fu! s:dismrk() + retu has('signs') ? len(s:marked) : + \ '%<'.join(values(map(copy(s:marked), 'split(v:val, "[\\/]")[-1]')), ', ') +endf + +fu! ctrlp#progress(enum) + if has('macunix') || has('mac') | sl 1m | en + let &l:stl = has_key(s:status, 'prog') ? call(s:status['prog'], [a:enum]) + \ : '%#CtrlPStats# '.a:enum.' %* %=%<%#CtrlPMode2# '.getcwd().' %*' + redraws +endf +" Paths {{{2 +fu! s:formatline(str, ipt) + let cond = a:ipt && ( s:winw - 4 ) < s:strwidth(a:str) + retu '> '.( cond ? pathshorten(a:str) : a:str ) +endf + +fu! s:dircompl(be, sd) + if a:sd == '' | retu [] | en + let [be, sd] = a:be == '' ? [getcwd(), a:sd] : [a:be, a:be.s:lash(a:be).a:sd] + let dirs = ctrlp#rmbasedir(split(globpath(be, a:sd.'*/'), "\n")) + cal filter(dirs, '!match(v:val, escape(sd, ''~$.\''))' + \ . ' && match(v:val, ''\v(^|[\/])\.{1,2}[\/]$'') < 0') + retu dirs +endf + +fu! s:findcommon(items, seed) + let [items, id, cmn, ic] = [copy(a:items), strlen(a:seed), '', 0] + cal map(items, 'strpart(v:val, id)') + for char in split(items[0], '\zs') + for item in items[1:] + if item[ic] != char | let brk = 1 | brea | en + endfo + if exists('brk') | brea | en + let cmn .= char + let ic += 1 + endfo + retu cmn +endf + +fu! s:headntail(str) + let parts = split(a:str, '[\/]\ze[^\/]\+[\/:]\?$') + retu len(parts) == 1 ? ['', parts[0]] : len(parts) == 2 ? parts : [] +endf + +fu! s:lash(...) + retu match(a:0 ? a:1 : getcwd(), '[\/]$') < 0 ? s:lash : '' +endf + +fu! s:ispathitem() + let ext = s:itemtype - ( g:ctrlp_builtins + 1 ) + retu s:itemtype < 3 + \ || ( s:itemtype > 2 && g:ctrlp_ext_vars[ext]['type'] == 'path' ) +endf + +fu! ctrlp#dirnfile(entries) + let [items, cwd] = [[[], []], getcwd().s:lash()] + for each in a:entries + let etype = getftype(each) + if s:igntype >= 0 && s:usrign(each, etype) | con | en + if etype == 'dir' + if s:dotfiles | if match(each, '[\/]\.\{1,2}$') < 0 + cal add(items[0], each) + en | el + cal add(items[0], each) + en + elsei etype == 'link' + if s:folsym + let isfile = !isdirectory(each) + if !s:samerootsyml(each, isfile, cwd) + cal add(items[isfile], each) + en + en + elsei etype == 'file' + cal add(items[1], each) + en + endfo + retu items +endf + +fu! s:usrign(item, type) + retu s:igntype == 1 ? a:item =~ s:usrign + \ : s:igntype == 4 && has_key(s:usrign, a:type) && s:usrign[a:type] != '' + \ ? a:item =~ s:usrign[a:type] : 0 +endf + +fu! s:samerootsyml(each, isfile, cwd) + let resolve = fnamemodify(resolve(a:each), ':p:h') + let resolve .= s:lash(resolve) + retu !( stridx(resolve, a:cwd) && ( stridx(a:cwd, resolve) || a:isfile ) ) +endf + +fu! ctrlp#rmbasedir(items) + let cwd = getcwd() + if a:items != [] && !stridx(a:items[0], cwd) + let idx = strlen(cwd) + ( match(cwd, '[\/]$') < 0 ) + retu map(a:items, 'strpart(v:val, idx)') + en + retu a:items +endf + +fu! s:parentdir(curr) + let parent = s:getparent(a:curr) + if parent != a:curr | cal ctrlp#setdir(parent) | en +endf + +fu! s:getparent(item) + let parent = substitute(a:item, '[\/][^\/]\+[\/:]\?$', '', '') + if parent == '' || match(parent, '[\/]') < 0 + let parent .= s:lash + en + retu parent +endf + +fu! s:findroot(curr, mark, depth, type) + let [depth, notfound] = [a:depth + 1, empty(s:glbpath(a:curr, a:mark, 1))] + if !notfound || depth > s:maxdepth + if notfound | cal ctrlp#setdir(s:cwd) | en + if a:type && depth <= s:maxdepth + let s:vcsroot = a:curr + elsei !a:type && !notfound + cal ctrlp#setdir(a:curr) | let s:foundroot = 1 + en + el + let parent = s:getparent(a:curr) + if parent != a:curr | cal s:findroot(parent, a:mark, depth, a:type) | en + en +endf + +fu! s:glbpath(...) + let cond = v:version > 702 || ( v:version == 702 && has('patch051') ) + retu call('globpath', cond ? a:000 : a:000[:1]) +endf + +fu! ctrlp#fnesc(path) + retu exists('*fnameescape') ? fnameescape(a:path) : escape(a:path, " %#*?|<\"\n") +endf + +fu! ctrlp#setdir(path, ...) + let cmd = a:0 ? a:1 : 'lc!' + sil! exe cmd ctrlp#fnesc(a:path) + let s:crfilerel = fnamemodify(s:crfile, ':.') +endf + +fu! ctrlp#setlcdir() + if exists('*haslocaldir') + cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!') + en +endf +" Highlighting {{{2 +fu! ctrlp#syntax() + for [ke, va] in items(s:hlgrps) | if !hlexists('CtrlP'.ke) + exe 'hi link CtrlP'.ke va + en | endfo + if !hlexists('CtrlPLinePre') + \ && synIDattr(synIDtrans(hlID('Normal')), 'bg') !~ '^-1$\|^$' + sil! exe 'hi CtrlPLinePre '.( has("gui_running") ? 'gui' : 'cterm' ).'fg=bg' + en + sy match CtrlPNoEntries '^ == NO ENTRIES ==$' + if hlexists('CtrlPLinePre') + sy match CtrlPLinePre '^>' + en +endf + +fu! s:highlight(pat, grp, ipt) + cal clearmatches() + if !empty(a:pat) && a:ipt + let pat = s:regexp ? substitute(a:pat, '\\\@ \\zs', 'g') : a:pat + if s:byfname + " Match only filename + let pat = substitute(pat, '\[\^\(.\{-}\)\]\\{-}', '[^\\/\1]\\{-}', 'g') + let pat = substitute(pat, '\$\@') + en + en +endf + +fu! s:dohighlight() + retu s:mathi[0] && exists('*clearmatches') +endf +" Prompt history {{{2 +fu! s:gethistloc() + let utilcadir = ctrlp#utils#cachedir() + let cache_dir = utilcadir.s:lash(utilcadir).'hist' + retu [cache_dir, cache_dir.s:lash(cache_dir).'cache.txt'] +endf + +fu! s:gethistdata() + retu ctrlp#utils#readfile(s:gethistloc()[1]) +endf + +fu! ctrlp#recordhist() + let str = join(s:prompt, '') + if empty(str) || !s:maxhst | retu | en + let hst = s:hstry + if len(hst) > 1 && hst[1] == str | retu | en + cal extend(hst, [str], 1) + if len(hst) > s:maxhst | cal remove(hst, s:maxhst, -1) | en + cal ctrlp#utils#writecache(hst, s:gethistloc()[0], s:gethistloc()[1]) +endf +" Signs {{{2 +fu! s:unmarksigns() + if !s:dosigns() | retu | en + for key in keys(s:marked) + exe 'sign unplace' key 'buffer='.s:bufnr + endfo +endf + +fu! s:remarksigns() + if !s:dosigns() | retu | en + for ic in range(1, len(s:matched)) + let key = s:dictindex(s:marked, fnamemodify(s:matched[ic - 1], ':p')) + if key > 0 + exe 'sign place' key 'line='.ic.' name=ctrlpmark buffer='.s:bufnr + en + endfo +endf + +fu! s:dosigns() + retu exists('s:marked') && s:bufnr > 0 && s:opmul != '0' && has('signs') +endf +" Dictionaries {{{2 +fu! s:dictindex(dict, expr) + for key in keys(a:dict) + if a:dict[key] == a:expr | retu key | en + endfo + retu -1 +endf + +fu! s:vacantdict(dict) + retu filter(range(1, max(keys(a:dict))), '!has_key(a:dict, v:val)') +endf +" Buffers {{{2 +fu! s:buftab(bufnr, md) + for tabnr in range(1, tabpagenr('$')) + if tabpagenr() == tabnr && a:md == 't' | con | en + let buflist = tabpagebuflist(tabnr) + if index(buflist, a:bufnr) >= 0 + for winnr in range(1, tabpagewinnr(tabnr, '$')) + if buflist[winnr - 1] == a:bufnr | retu [tabnr, winnr] | en + endfo + en + endfo + retu [0, 0] +endf + +fu! ctrlp#normcmd(cmd, ...) + if s:nosplit() | retu a:cmd | en + let norwins = filter(range(1, winnr('$')), + \ 'empty(getbufvar(winbufnr(v:val), "&bt"))') + for each in norwins + let bufnr = winbufnr(each) + if empty(bufname(bufnr)) && empty(getbufvar(bufnr, '&ft')) + let fstemp = each | brea + en + endfo + let norwin = empty(norwins) ? 0 : norwins[0] + if norwin + if index(norwins, winnr()) < 0 + exe ( exists('fstemp') ? fstemp : norwin ).'winc w' + en + retu a:cmd + en + retu a:0 ? a:1 : 'bo vne' +endf + +fu! s:nosplit() + retu !empty(s:nosplit) && match([bufname('%'), &l:ft, &l:bt], s:nosplit) >= 0 +endf + +fu! s:setupblank() + setl noswf nobl nonu nowrap nolist nospell nocuc wfh + setl fdc=0 fdl=99 tw=0 bt=nofile bh=unload + if v:version > 702 + setl nornu noudf cc=0 + en +endf + +fu! s:leavepre() + if s:clrex && !( has('clientserver') && len(split(serverlist(), "\n")) > 1 ) + cal ctrlp#clra() + en +endf + +fu! s:checkbuf() + if exists('s:init') | retu | en + if exists('s:bufnr') && s:bufnr > 0 + exe s:bufnr.'bw!' + en +endf +" Arguments {{{2 +fu! s:tail() + if exists('s:optail') && !empty('s:optail') + let tailpref = match(s:optail, '^\s*+') < 0 ? ' +' : ' ' + retu tailpref.s:optail + en + retu '' +endf + +fu! s:sanstail(str) + let [str, pat] = [substitute(a:str, '\\\\', '\', 'g'), '\([^:]\|\\:\)*$'] + unl! s:optail + if match(str, '\\\@= 0 + let s:optail = matchstr(str, '\\\@= 0 + retu char + elsei char =~# "\\v\|\|\" + cal s:BuildPrompt(0) + retu 'cancel' + en + retu a:md +endf +" Misc {{{2 +fu! s:log(m) + if exists('g:ctrlp_log') && g:ctrlp_log | if a:m + let cadir = ctrlp#utils#cachedir() + sil! exe 'redi! >' cadir.s:lash(cadir).'ctrlp.log' + el + sil! redi END + en | en +endf + +fu! s:strwidth(str) + retu exists('*strdisplaywidth') ? strdisplaywidth(a:str) : strlen(a:str) +endf + +fu! s:getenv() + let [s:cwd, s:winres] = [getcwd(), [winrestcmd(), &lines, winnr('$')]] + let [s:crfile, s:crfpath] = [expand('%:p', 1), expand('%:p:h', 1)] + let [s:crword, s:crline] = [expand(''), getline('.')] + let [s:winh, s:crcursor] = [min([s:mxheight, &lines]), getpos('.')] + let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()] + let s:currwin = s:mwbottom ? winnr() : winnr() + has('autocmd') + let s:wpmode = exists('b:ctrlp_working_path_mode') + \ ? b:ctrlp_working_path_mode : s:pathmode + if exists('g:ctrlp_extensions') + if index(g:ctrlp_extensions, 'undo') >= 0 && exists('*undotree') + \ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) ) + let s:undotree = undotree() + en + if index(g:ctrlp_extensions, 'tag') >= 0 + let s:tagfiles = s:tagfiles() + en + en +endf + +fu! s:lastvisual() + let cview = winsaveview() + let [ovreg, ovtype] = [getreg('v'), getregtype('v')] + let [oureg, outype] = [getreg('"'), getregtype('"')] + sil! norm! gv"vy + let selected = substitute(getreg('v'), '\n', '\\n', 'g') + cal setreg('v', ovreg, ovtype) + cal setreg('"', oureg, outype) + cal winrestview(cview) + retu selected +endf + +fu! s:migemo(str) + let str = a:str + let dict = s:glbpath(&rtp, printf("dict/%s/migemo-dict", &enc), 1) + if !len(dict) + let dict = s:glbpath(&rtp, "dict/migemo-dict", 1) + en + if len(dict) + let [tokens, str, cmd] = [split(str, '\s'), '', 'cmigemo -v -w %s -d %s'] + for token in tokens + let rtn = system(printf(cmd, shellescape(token), shellescape(dict))) + let str .= !v:shell_error && strlen(rtn) > 0 ? '.*'.rtn : token + endfo + en + retu str +endf + +fu! s:openfile(cmd, fid, tail, ...) + let cmd = a:cmd =~ '^[eb]$' && &modified ? 'hid '.a:cmd : a:cmd + let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd + let j2l = a:0 && a:1 ? a:2 : 0 + exe cmd.( a:0 && a:1 ? '' : a:tail ) ctrlp#fnesc(a:fid) + if j2l + exe j2l + en + if !empty(a:tail) || j2l + sil! norm! zvzz + en + if cmd != 'bad' + cal ctrlp#setlcdir() + en +endf + +fu! s:writecache(read_cache, cache_file) + if !a:read_cache && ( ( g:ctrlp_newcache || !filereadable(a:cache_file) ) + \ && s:caching || len(g:ctrlp_allfiles) > s:nocache_lim ) + if len(g:ctrlp_allfiles) > s:nocache_lim | let s:caching = 1 | en + cal ctrlp#utils#writecache(g:ctrlp_allfiles) + en +endf + +fu! ctrlp#j2l(nr) + exe a:nr + sil! norm! zvzz +endf + +fu! s:regexfilter(str) + let str = a:str + for key in keys(s:fpats) | if match(str, key) >= 0 + let str = substitute(str, s:fpats[key], '', 'g') + en | endfo + retu str +endf + +fu! s:walker(max, pos, dir) + retu a:dir > 0 ? a:pos < a:max ? a:pos + 1 : 0 : a:pos > 0 ? a:pos - 1 : a:max +endf + +fu! s:matchfname(item, pat) + retu match(split(a:item, s:lash)[-1], a:pat) +endf + +fu! s:matchtabs(item, pat) + retu match(split(a:item, '\t\+')[0], a:pat) +endf + +fu! s:matchtabe(item, pat) + retu match(split(a:item, '\t\+[^\t]\+$')[0], a:pat) +endf + +fu! s:maxf(len) + retu s:maxfiles && a:len > s:maxfiles ? 1 : 0 +endf + +fu! s:insertcache(str) + let [data, g:ctrlp_newcache, str] = [g:ctrlp_allfiles, 1, a:str] + if strlen(str) <= strlen(data[0]) + let pos = 0 + elsei strlen(str) >= strlen(data[-1]) + let pos = len(data) - 1 + el + let pos = 0 + for each in data + if strlen(each) > strlen(str) | brea | en + let pos += 1 + endfo + en + cal insert(data, str, pos) + cal s:writecache(0, ctrlp#utils#cachefile()) +endf +" Extensions {{{2 +fu! s:type(...) + let ext = s:itemtype - ( g:ctrlp_builtins + 1 ) + retu s:itemtype > 2 ? g:ctrlp_ext_vars[ext][a:0 ? 'type' : 'sname'] : s:itemtype +endf + +fu! s:tagfiles() + retu filter(map(tagfiles(), 'fnamemodify(v:val, ":p")'), 'filereadable(v:val)') +endf + +fu! s:onexit() + if exists('g:ctrlp_ext_vars') + cal map(filter(copy(g:ctrlp_ext_vars), + \ 'has_key(v:val, "exit")'), 'eval(v:val["exit"])') + en +endf + +fu! ctrlp#exit() + cal s:PrtExit() +endf + +fu! ctrlp#prtclear() + cal s:PrtClear() +endf +"}}}1 +" * Initialization {{{1 +fu! ctrlp#setlines(type) + let s:itemtype = a:type + let types = [ + \ 'ctrlp#files()', + \ 'ctrlp#buffers()', + \ 'ctrlp#mrufiles#list(-1)', + \ ] + if exists('g:ctrlp_ext_vars') + cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val["init"])') + en + let g:ctrlp_lines = eval(types[a:type]) +endf + +fu! ctrlp#init(type, ...) + if exists('s:init') | retu | en + let [s:matches, s:init] = [1, 1] + cal s:Open() + cal s:SetWD(a:0 ? a:1 : '') + cal s:MapKeys() + if has('syntax') && exists('g:syntax_on') + cal ctrlp#syntax() + en + cal ctrlp#setlines(a:type) + cal s:BuildPrompt(1) +endf +if has('autocmd') "{{{1 + aug CtrlPAug + au! + au BufEnter ControlP cal s:checkbuf() + au BufLeave ControlP cal s:Close() + au VimLeavePre * cal s:leavepre() + if s:lazy + au CursorHold ControlP cal s:ForceUpdate() + en + aug END +en "}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/buffertag.vim b/bundle/git_ctrlp/autoload/ctrlp/buffertag.vim new file mode 100644 index 0000000..345f876 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/buffertag.vim @@ -0,0 +1,237 @@ +" ============================================================================= +" File: autoload/ctrlp/buffertag.vim +" Description: Buffer Tag extension +" Maintainer: Kien Nguyen +" Credits: Much of the code was taken from tagbar.vim by Jan Larres, plus +" a few lines from taglist.vim by Yegappan Lakshmanan and from +" buffertag.vim by Takeshi Nishida. +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_buftag') && g:loaded_ctrlp_buftag + fini +en +let g:loaded_ctrlp_buftag = 1 + +let s:buftag_var = { + \ 'init': 'ctrlp#buffertag#init(s:crfile)', + \ 'accept': 'ctrlp#buffertag#accept', + \ 'lname': 'buffer tags', + \ 'sname': 'bft', + \ 'exit': 'ctrlp#buffertag#exit()', + \ 'type': 'tabs', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:buftag_var) : [s:buftag_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) + +fu! s:opts() + let opts = { + \ 'g:ctrlp_buftag_systemenc': ['s:enc', &enc], + \ 'g:ctrlp_buftag_ctags_bin': ['s:bin', ''], + \ 'g:ctrlp_buftag_types': ['s:usr_types', ''], + \ } + for [ke, va] in items(opts) + exe 'let' va[0] '=' string(exists(ke) ? eval(ke) : va[1]) + endfo +endf +cal s:opts() + +fu! s:bins() + let bins = [ + \ 'ctags-exuberant', + \ 'exuberant-ctags', + \ 'exctags', + \ '/usr/local/bin/ctags', + \ '/opt/local/bin/ctags', + \ 'ctags', + \ 'ctags.exe', + \ 'tags', + \ ] + if empty(s:bin) + for bin in bins | if executable(bin) + let s:bin = bin + brea + en | endfo + el + let s:bin = expand(s:bin, 1) + en +endf +cal s:bins() + +" s:types {{{2 +let s:types = { + \ 'asm' : '%sasm%sasm%sdlmt', + \ 'aspperl': '%sasp%sasp%sfsv', + \ 'aspvbs' : '%sasp%sasp%sfsv', + \ 'awk' : '%sawk%sawk%sf', + \ 'beta' : '%sbeta%sbeta%sfsv', + \ 'c' : '%sc%sc%sdgsutvf', + \ 'cpp' : '%sc++%sc++%snvdtcgsuf', + \ 'cs' : '%sc#%sc#%sdtncEgsipm', + \ 'cobol' : '%scobol%scobol%sdfgpPs', + \ 'eiffel' : '%seiffel%seiffel%scf', + \ 'erlang' : '%serlang%serlang%sdrmf', + \ 'expect' : '%stcl%stcl%scfp', + \ 'fortran': '%sfortran%sfortran%spbceiklmntvfs', + \ 'html' : '%shtml%shtml%saf', + \ 'java' : '%sjava%sjava%spcifm', + \ 'javascript': '%sjavascript%sjavascript%sf', + \ 'lisp' : '%slisp%slisp%sf', + \ 'lua' : '%slua%slua%sf', + \ 'make' : '%smake%smake%sm', + \ 'pascal' : '%spascal%spascal%sfp', + \ 'perl' : '%sperl%sperl%sclps', + \ 'php' : '%sphp%sphp%scdvf', + \ 'python' : '%spython%spython%scmf', + \ 'rexx' : '%srexx%srexx%ss', + \ 'ruby' : '%sruby%sruby%scfFm', + \ 'scheme' : '%sscheme%sscheme%ssf', + \ 'sh' : '%ssh%ssh%sf', + \ 'csh' : '%ssh%ssh%sf', + \ 'zsh' : '%ssh%ssh%sf', + \ 'slang' : '%sslang%sslang%snf', + \ 'sml' : '%ssml%ssml%secsrtvf', + \ 'sql' : '%ssql%ssql%scFPrstTvfp', + \ 'tcl' : '%stcl%stcl%scfmp', + \ 'vera' : '%svera%svera%scdefgmpPtTvx', + \ 'verilog': '%sverilog%sverilog%smcPertwpvf', + \ 'vim' : '%svim%svim%savf', + \ 'yacc' : '%syacc%syacc%sl', + \ } + +cal map(s:types, 'printf(v:val, "--language-force=", " --", "-types=")') + +if executable('jsctags') + cal extend(s:types, { 'javascript': { 'args': '-f -', 'bin': 'jsctags' } }) +en + +if type(s:usr_types) == 4 + cal extend(s:types, s:usr_types) +en +" Utilities {{{1 +fu! s:validfile(fname, ftype) + if ( !empty(a:fname) || !empty(a:ftype) ) && filereadable(a:fname) + \ && index(keys(s:types), a:ftype) >= 0 | retu 1 | en + retu 0 +endf + +fu! s:exectags(cmd) + if exists('+ssl') + let [ssl, &ssl] = [&ssl, 0] + en + if &sh =~ 'cmd\.exe' + let [sxq, &sxq, shcf, &shcf] = [&sxq, '"', &shcf, '/s /c'] + en + let output = system(a:cmd) + if &sh =~ 'cmd\.exe' + let [&sxq, &shcf] = [sxq, shcf] + en + if exists('+ssl') + let &ssl = ssl + en + retu output +endf + +fu! s:exectagsonfile(fname, ftype) + let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs ', a:ftype] + if type(s:types[ft]) == 1 + let ags .= s:types[ft] + let bin = s:bin + elsei type(s:types[ft]) == 4 + let ags = s:types[ft]['args'] + let bin = expand(s:types[ft]['bin'], 1) + en + if empty(bin) | retu '' | en + let cmd = s:esctagscmd(bin, ags, a:fname) + if empty(cmd) | retu '' | en + let output = s:exectags(cmd) + if v:shell_error || output =~ 'Warning: cannot open' | retu '' | en + retu output +endf + +fu! s:esctagscmd(bin, args, ...) + if exists('+ssl') + let [ssl, &ssl] = [&ssl, 0] + en + let fname = a:0 == 1 ? shellescape(a:1) : '' + let cmd = shellescape(a:bin).' '.a:args.' '.fname + if exists('+ssl') + let &ssl = ssl + en + if has('iconv') + let last = s:enc != &enc ? s:enc : !empty($LANG) ? $LANG : &enc + let cmd = iconv(cmd, &enc, last) + en + retu cmd +endf + +fu! s:process(fname, ftype) + if !s:validfile(a:fname, a:ftype) | retu [] | endif + let ftime = getftime(a:fname) + if has_key(g:ctrlp_buftags, a:fname) + \ && g:ctrlp_buftags[a:fname]['time'] >= ftime + let lines = g:ctrlp_buftags[a:fname]['lines'] + el + let data = s:exectagsonfile(a:fname, a:ftype) + let [raw, lines] = [split(data, '\n\+'), []] + for line in raw | if len(split(line, ';"')) == 2 + let parsed_line = s:parseline(line) + if parsed_line != '' + cal add(lines, parsed_line) + en + en | endfo + let cache = { a:fname : { 'time': ftime, 'lines': lines } } + cal extend(g:ctrlp_buftags, cache) + en + retu lines +endf + +fu! s:parseline(line) + let eval = '\v^([^\t]+)\t(.+)\t\/\^(.+)\$\/\;\"\t(.+)\tline(no)?\:(\d+)' + let vals = matchlist(a:line, eval) + if empty(vals) | retu '' | en + let [bufnr, bufname] = [bufnr('^'.vals[2].'$'), fnamemodify(vals[2], ':p:t')] + retu vals[1].' '.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'| '.vals[3] +endf +" Public {{{1 +fu! ctrlp#buffertag#init(fname) + let bufs = exists('s:btmode') && s:btmode + \ ? filter(ctrlp#buffers(), 'filereadable(v:val)') + \ : [exists('s:bufname') ? s:bufname : a:fname] + let lines = [] + for each in bufs + let tftype = get(split(getbufvar(each, '&ft'), '\.'), 0, '') + cal extend(lines, s:process(each, tftype)) + endfo + if has('syntax') && exists('g:syntax_on') + if !hlexists('CtrlPTabExtra') + hi link CtrlPTabExtra Comment + en + sy match CtrlPTabExtra '\zs\t.*\ze$' + en + retu lines +endf + +fu! ctrlp#buffertag#accept(mode, str) + let vals = matchlist(a:str, '\v^[^\t]+\t+[^\t|]+\|(\d+)\:[^\t|]+\|(\d+)\|') + let [bufnm, linenr] = [fnamemodify(bufname(str2nr(vals[1])), ':p'), vals[2]] + cal ctrlp#acceptfile(a:mode, bufnm, linenr) +endf + +fu! ctrlp#buffertag#cmd(mode, ...) + let s:btmode = a:mode + if a:0 && !empty(a:1) + let s:bufname = fnamemodify(a:1, ':p') + en + retu s:id +endf + +fu! ctrlp#buffertag#exit() + unl! s:btmode s:bufname +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/changes.vim b/bundle/git_ctrlp/autoload/ctrlp/changes.vim new file mode 100644 index 0000000..4fe5f68 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/changes.vim @@ -0,0 +1,106 @@ +" ============================================================================= +" File: autoload/ctrlp/changes.vim +" Description: Change list extension - Jump to a recent change in any buffer +" Author: Kien Nguyen +" ============================================================================= + +" User Configuration {{{1 +" Enable: +" let g:ctrlp_extensions += ['changes'] +" Create Some Commands: +" " Single buffer +" com! -n=? -com=buffer CtrlPChange +" \ cal ctrlp#init(ctrlp#changes#cmd(0, )) +" " All listed buffers +" com! CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1)) +"}}} + +" Init {{{1 +if exists('g:loaded_ctrlp_changes') && g:loaded_ctrlp_changes + fini +en +let g:loaded_ctrlp_changes = 1 + +let s:changes_var = { + \ 'init': 'ctrlp#changes#init(s:bufnr, s:crfile)', + \ 'accept': 'ctrlp#changes#accept', + \ 'lname': 'changes', + \ 'sname': 'chs', + \ 'exit': 'ctrlp#changes#exit()', + \ 'type': 'tabe', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:changes_var) : [s:changes_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Utilities {{{1 +fu! s:changelist(bufnr) + sil! exe 'noa hid b' a:bufnr + redi => result + sil! changes + redi END + retu map(split(result, "\n")[1:], 'tr(v:val, " ", " ")') +endf + +fu! s:process(clines, ...) + let [clines, evas] = [[], []] + for each in a:clines + let parts = matchlist(each, '\v^.\s*\d+\s+(\d+)\s+(\d+)\s(.*)$') + if !empty(parts) + if parts[3] == '' | let parts[3] = ' ' | en + cal add(clines, parts[3].' |'.a:1.':'.a:2.'|'.parts[1].':'.parts[2].'|') + en + endfo + retu reverse(filter(clines, 'count(clines, v:val) == 1')) +endf +" Public {{{1 +fu! ctrlp#changes#init(original_bufnr, fname) + let fname = exists('s:bufname') ? s:bufname : a:fname + let bufs = exists('s:clmode') && s:clmode + \ ? filter(ctrlp#buffers(), 'filereadable(v:val)') : [fname] + let [swb, &swb] = [&swb, ''] + let lines = [] + for each in bufs + let [bufnr, fnamet] = [bufnr('^'.each.'$'), fnamemodify(each, ':t')] + if bufnr > 0 + cal extend(lines, s:process(s:changelist(bufnr), bufnr, fnamet)) + en + endfo + sil! exe 'noa hid b' a:original_bufnr + let &swb = swb + let g:ctrlp_nolimit = 1 + if has('syntax') && exists('g:syntax_on') + cal ctrlp#syntax() + if !hlexists('CtrlPTabExtra') + hi link CtrlPTabExtra Comment + en + sy match CtrlPTabExtra '\zs\t.*\ze$' + en + retu lines +endf + +fu! ctrlp#changes#accept(mode, str) + let info = matchlist(a:str, '\t|\(\d\+\):[^|]\+|\(\d\+\):\(\d\+\)|$') + let bufnr = str2nr(get(info, 1)) + if bufnr + cal ctrlp#acceptfile(a:mode, fnamemodify(bufname(bufnr), ':p')) + cal cursor(get(info, 2), get(info, 3)) + sil! norm! zvzz + en +endf + +fu! ctrlp#changes#cmd(mode, ...) + let s:clmode = a:mode + if a:0 && !empty(a:1) + let s:bufname = fnamemodify(a:1, ':p') + en + retu s:id +endf + +fu! ctrlp#changes#exit() + unl! s:clmode s:bufname +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/dir.vim b/bundle/git_ctrlp/autoload/ctrlp/dir.vim new file mode 100644 index 0000000..982f298 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/dir.vim @@ -0,0 +1,93 @@ +" ============================================================================= +" File: autoload/ctrlp/dir.vim +" Description: Directory extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_dir') && g:loaded_ctrlp_dir + fini +en +let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0] + +let s:ars = [ + \ 's:maxdepth', + \ 's:maxfiles', + \ 's:compare_lim', + \ 's:glob', + \ ] + +let s:dir_var = { + \ 'init': 'ctrlp#dir#init('.join(s:ars, ', ').')', + \ 'accept': 'ctrlp#dir#accept', + \ 'lname': 'dirs', + \ 'sname': 'dir', + \ 'type': 'path', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:dir_var) : [s:dir_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Utilities {{{1 +fu! s:globdirs(dirs, depth) + let entries = split(globpath(a:dirs, s:glob), "\n") + let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1] + cal extend(g:ctrlp_alldirs, dirs) + if !empty(dirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles) + \ && depth <= s:maxdepth + sil! cal ctrlp#progress(len(g:ctrlp_alldirs)) + cal s:globdirs(join(dirs, ','), depth) + en +endf + +fu! s:max(len, max) + retu a:max && a:len > a:max ? 1 : 0 +endf +" Public {{{1 +fu! ctrlp#dir#init(...) + let s:cwd = getcwd() + for each in range(len(s:ars)) + exe 'let' s:ars[each] '=' string(eval('a:'.(each + 1))) + endfo + let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().s:dir_var['sname'] + let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile(s:dir_var['sname']) + if g:ctrlp_newdir || !filereadable(cafile) + let g:ctrlp_alldirs = [] + cal s:globdirs(s:cwd, 0) + cal ctrlp#rmbasedir(g:ctrlp_alldirs) + let read_cache = 0 + if len(g:ctrlp_alldirs) <= s:compare_lim + cal sort(g:ctrlp_alldirs, 'ctrlp#complen') + en + el + let g:ctrlp_alldirs = ctrlp#utils#readfile(cafile) + let read_cache = 1 + en + if !read_cache + cal ctrlp#utils#writecache(g:ctrlp_alldirs, cadir, cafile) + let g:ctrlp_newdir = 0 + en + retu g:ctrlp_alldirs +endf + +fu! ctrlp#dir#accept(mode, str) + let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#utils#lash().a:str + if a:mode =~ 't\|v\|h' + cal ctrlp#exit() + en + cal ctrlp#setdir(path, a:mode =~ 't\|h' ? 'chd!' : 'lc!') + if a:mode == 'e' + sil! cal ctrlp#statusline() + cal ctrlp#setlines(s:id) + cal ctrlp#recordhist() + cal ctrlp#prtclear() + en +endf + +fu! ctrlp#dir#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/line.vim b/bundle/git_ctrlp/autoload/ctrlp/line.vim new file mode 100644 index 0000000..961ede4 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/line.vim @@ -0,0 +1,68 @@ +" ============================================================================= +" File: autoload/ctrlp/line.vim +" Description: Line extension - Find a line in any buffer +" Author: Kien Nguyen +" ============================================================================= + +" User Configuration {{{1 +" Enable: +" let g:ctrlp_extensions += ['line'] +" Create A Command: +" com! CtrlPLine cal ctrlp#init(ctrlp#line#id()) +"}}} + +" Init {{{1 +if exists('g:loaded_ctrlp_line') && g:loaded_ctrlp_line + fini +en +let g:loaded_ctrlp_line = 1 + +let s:line_var = { + \ 'init': 'ctrlp#line#init()', + \ 'accept': 'ctrlp#line#accept', + \ 'lname': 'lines', + \ 'sname': 'lns', + \ 'type': 'tabe', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:line_var) : [s:line_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Public {{{1 +fu! ctrlp#line#init() + let [bufs, lines] = [filter(ctrlp#buffers(), 'filereadable(v:val)'), []] + for each in bufs + let [fnamet, from_file] = [fnamemodify(each, ':t'), readfile(each)] + cal map(from_file, 'tr(v:val, '' '', '' '')') + let [id, len_ff, bufnr] = [1, len(from_file), bufnr('^'.each.'$')] + wh id <= len_ff + let from_file[id-1] .= ' |'.fnamet.'|'.bufnr.':'.id.'|' + let id += 1 + endw + cal filter(from_file, 'v:val !~ ''^\s*\t|[^|]\+|\d\+:\d\+|$''') + cal extend(lines, from_file) + endfo + if has('syntax') && exists('g:syntax_on') + if !hlexists('CtrlPTabExtra') + hi link CtrlPTabExtra Comment + en + sy match CtrlPTabExtra '\zs\t.*\ze$' + en + retu lines +endf + +fu! ctrlp#line#accept(mode, str) + let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$') + let [bufnr, linenr] = [str2nr(get(info, 1)), get(info, 2)] + if bufnr > 0 + cal ctrlp#acceptfile(a:mode, fnamemodify(bufname(bufnr), ':p'), linenr) + en +endf + +fu! ctrlp#line#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/mrufiles.vim b/bundle/git_ctrlp/autoload/ctrlp/mrufiles.vim new file mode 100644 index 0000000..ff485e7 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/mrufiles.vim @@ -0,0 +1,93 @@ +" ============================================================================= +" File: autoload/ctrlp/mrufiles.vim +" Description: Most Recently Used Files extension +" Author: Kien Nguyen +" ============================================================================= + +" Static variables {{{1 +fu! ctrlp#mrufiles#opts() + let opts = { + \ 'g:ctrlp_mruf_max': ['s:max', 250], + \ 'g:ctrlp_mruf_include': ['s:in', ''], + \ 'g:ctrlp_mruf_exclude': ['s:ex', ''], + \ 'g:ctrlp_mruf_case_sensitive': ['s:csen', 1], + \ 'g:ctrlp_mruf_relative': ['s:re', 0], + \ 'g:ctrlp_mruf_last_entered': ['s:mre', 0], + \ } + for [ke, va] in items(opts) + exe 'let' va[0] '=' string(exists(ke) ? eval(ke) : va[1]) + endfo + let s:csen = s:csen ? '#' : '?' +endf +cal ctrlp#mrufiles#opts() +fu! ctrlp#mrufiles#list(bufnr, ...) "{{{1 + if s:locked | retu | en + let bufnr = a:bufnr + 0 + if bufnr > 0 + let fn = fnamemodify(bufname(bufnr), ':p') + let fn = exists('+ssl') ? tr(fn, '/', '\') : fn + if empty(fn) || !empty(&bt) || ( !empty(s:in) && fn !~# s:in ) + \ || ( !empty(s:ex) && fn =~# s:ex ) || !filereadable(fn) + retu + en + en + if !exists('s:cadir') || !exists('s:cafile') + let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru' + let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt' + en + if a:0 && a:1 == 2 + let mrufs = [] + if a:0 == 2 + let mrufs = ctrlp#utils#readfile(s:cafile) + cal filter(mrufs, 'index(a:2, v:val) < 0') + en + cal ctrlp#utils#writecache(mrufs, s:cadir, s:cafile) + retu map(mrufs, 'fnamemodify(v:val, '':.'')') + en + " Get the list + let mrufs = ctrlp#utils#readfile(s:cafile) + " Remove non-existent files + if a:0 && a:1 == 1 + cal filter(mrufs, '!empty(ctrlp#utils#glob(v:val, 1)) && !s:excl(v:val)') + if exists('+ssl') + cal map(mrufs, 'tr(v:val, ''/'', ''\'')') + cal filter(mrufs, 'count(mrufs, v:val) == 1') + en + cal ctrlp#utils#writecache(mrufs, s:cadir, s:cafile) + en + " Return the list with the active buffer removed + if bufnr == -1 + if s:re + let cwd = exists('+ssl') ? tr(getcwd(), '/', '\') : getcwd() + cal filter(mrufs, '!stridx(v:val, cwd)') + en + retu map(mrufs, 'fnamemodify(v:val, '':.'')') + en + " Remove old entry + cal filter(mrufs, 'v:val !='.s:csen.' fn') + " Insert new one + cal insert(mrufs, fn) + " Remove oldest entry or entries + if len(mrufs) > s:max | cal remove(mrufs, s:max, -1) | en + cal ctrlp#utils#writecache(mrufs, s:cadir, s:cafile) +endf "}}} +fu! s:excl(fn) "{{{ + retu !empty(s:ex) && a:fn =~# s:ex +endf "}}} +fu! ctrlp#mrufiles#init() "{{{1 + let s:locked = 0 + aug CtrlPMRUF + au! + au BufReadPost,BufNewFile,BufWritePost * + \ cal ctrlp#mrufiles#list(expand('', 1)) + if s:mre + au BufEnter,BufUnload * + \ cal ctrlp#mrufiles#list(expand('', 1)) + en + au QuickFixCmdPre *vimgrep* let s:locked = 1 + au QuickFixCmdPost *vimgrep* let s:locked = 0 + aug END +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/quickfix.vim b/bundle/git_ctrlp/autoload/ctrlp/quickfix.vim new file mode 100644 index 0000000..cb1d6a5 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/quickfix.vim @@ -0,0 +1,61 @@ +" ============================================================================= +" File: autoload/ctrlp/quickfix.vim +" Description: Quickfix extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_quickfix') && g:loaded_ctrlp_quickfix + fini +en +let g:loaded_ctrlp_quickfix = 1 + +let s:var_qf = { + \ 'init': 'ctrlp#quickfix#init()', + \ 'accept': 'ctrlp#quickfix#accept', + \ 'lname': 'quickfix', + \ 'sname': 'qfx', + \ 'type': 'line', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:var_qf) : [s:var_qf] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) + +fu! s:lineout(dict) + retu printf('%s|%d:%d| %s', bufname(a:dict['bufnr']), a:dict['lnum'], + \ a:dict['col'], matchstr(a:dict['text'], '\s*\zs.*\S')) +endf +" Public {{{1 +fu! ctrlp#quickfix#init() + let g:ctrlp_nolimit = 1 + if has('syntax') && exists('g:syntax_on') + if !hlexists('CtrlPqfLineCol') + hi link CtrlPqfLineCol Search + en + sy match CtrlPqfLineCol '|\zs\d\+:\d\+\ze|' + en + retu map(getqflist(), 's:lineout(v:val)') +endf + +fu! ctrlp#quickfix#accept(mode, str) + let items = matchlist(a:str, '^\([^|]\+\ze\)|\(\d\+\):\(\d\+\)|') + let [md, filpath] = [a:mode, fnamemodify(items[1], ':p')] + if empty(filpath) | retu | en + cal ctrlp#exit() + let cmd = md == 't' ? 'tabe' : md == 'h' ? 'new' : md == 'v' ? 'vne' + \ : ctrlp#normcmd('e') + let cmd = cmd == 'e' && &modified ? 'hid e' : cmd + exe cmd ctrlp#fnesc(filpath) + cal cursor(items[2], items[3]) + sil! norm! zvzz + cal ctrlp#setlcdir() +endf + +fu! ctrlp#quickfix#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/rtscript.vim b/bundle/git_ctrlp/autoload/ctrlp/rtscript.vim new file mode 100644 index 0000000..dda9dd0 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/rtscript.vim @@ -0,0 +1,51 @@ +" ============================================================================= +" File: autoload/ctrlp/rtscript.vim +" Description: Runtime scripts extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_rtscript') && g:loaded_ctrlp_rtscript + fini +en +let [g:loaded_ctrlp_rtscript, g:ctrlp_newrts] = [1, 0] + +let s:rtscript_var = { + \ 'init': 'ctrlp#rtscript#init()', + \ 'accept': 'ctrlp#acceptfile', + \ 'lname': 'runtime scripts', + \ 'sname': 'rts', + \ 'type': 'path', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:rtscript_var) : [s:rtscript_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Public {{{1 +fu! ctrlp#rtscript#init() + if g:ctrlp_newrts + \ || !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[0] == &rtp ) + sil! cal ctrlp#progress('Indexing...') + let entries = split(globpath(&rtp, '**/*.*'), "\n") + cal filter(entries, 'count(entries, v:val) == 1') + let [entries, echoed] = [ctrlp#dirnfile(entries)[1], 1] + el + let [entries, results] = g:ctrlp_rtscache[2:3] + en + let cwd = getcwd() + if g:ctrlp_newrts + \ || !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[:1] == [&rtp, cwd] ) + if !exists('echoed') | sil! cal ctrlp#progress('Processing...') | en + let results = map(copy(entries), 'fnamemodify(v:val, '':.'')') + en + let [g:ctrlp_rtscache, g:ctrlp_newrts] = [[&rtp, cwd, entries, results], 0] + retu results +endf + +fu! ctrlp#rtscript#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/tag.vim b/bundle/git_ctrlp/autoload/ctrlp/tag.vim new file mode 100644 index 0000000..2b9a86c --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/tag.vim @@ -0,0 +1,106 @@ +" ============================================================================= +" File: autoload/ctrlp/tag.vim +" Description: Tag file extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_tag') && g:loaded_ctrlp_tag + fini +en +let g:loaded_ctrlp_tag = 1 + +let s:tag_var = { + \ 'init': 'ctrlp#tag#init(s:tagfiles)', + \ 'accept': 'ctrlp#tag#accept', + \ 'lname': 'tags', + \ 'sname': 'tag', + \ 'type': 'tabs', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:tag_var) : [s:tag_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Utilities {{{1 +fu! s:findcount(str) + let [tg, fname] = split(a:str, '\t\+\ze[^\t]\+$') + let [fname, tgs] = [expand(fname, 1), taglist('^'.tg.'$')] + if empty(tgs) | retu [1, 1] | en + let [fnd, ct, pos] = [0, 0, 0] + for each in tgs + let ct += 1 + let fulname = fnamemodify(each["filename"], ':p') + if stridx(fulname, fname) >= 0 + \ && strlen(fname) + stridx(fulname, fname) == strlen(fulname) + let fnd += 1 + let pos = ct + en + if fnd > 1 | brea | en + endfo + retu [fnd, pos] +endf + +fu! s:filter(tags) + let [nr, alltags] = [0, a:tags] + wh 0 < 1 + if alltags[nr] =~ '^!' && alltags[nr] !~ '^!_TAG_' + let nr += 1 + con + en + if alltags[nr] =~ '^!_TAG_' && len(alltags) > nr + cal remove(alltags, nr) + el + brea + en + endw + retu alltags +endf +" Public {{{1 +fu! ctrlp#tag#init(tagfiles) + if empty(a:tagfiles) | retu [] | en + let g:ctrlp_alltags = [] + let tagfiles = sort(filter(a:tagfiles, 'count(a:tagfiles, v:val) == 1')) + for each in tagfiles + let alltags = s:filter(ctrlp#utils#readfile(each)) + cal extend(g:ctrlp_alltags, alltags) + endfo + if has('syntax') && exists('g:syntax_on') + if !hlexists('CtrlPTabExtra') + hi link CtrlPTabExtra Comment + en + sy match CtrlPTabExtra '\zs\t.*\ze$' + en + retu g:ctrlp_alltags +endf + +fu! ctrlp#tag#accept(mode, str) + cal ctrlp#exit() + let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t') + let [tg, fnd] = [split(str, '^[^\t]\+\zs\t')[0], s:findcount(str)] + let cmds = { + \ 't': ['tab sp', 'tab stj'], + \ 'h': ['sp', 'stj'], + \ 'v': ['vs', 'vert stj'], + \ 'e': ['', 'tj'], + \ } + let cmd = fnd[0] == 1 ? cmds[a:mode][0] : cmds[a:mode][1] + let cmd = cmd == 'tj' && &modified ? 'hid '.cmd : cmd + let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd + if fnd[0] == 1 + if cmd != '' + exe cmd + en + exe fnd[1].'ta' tg + el + exe cmd tg + en + cal ctrlp#setlcdir() +endf + +fu! ctrlp#tag#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/undo.vim b/bundle/git_ctrlp/autoload/ctrlp/undo.vim new file mode 100644 index 0000000..9b371d8 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/undo.vim @@ -0,0 +1,125 @@ +" ============================================================================= +" File: autoload/ctrlp/undo.vim +" Description: Undo extension - Browse undo history (requires Vim 7.3.005+) +" Author: Kien Nguyen +" ============================================================================= + +" User Configuration {{{1 +" Enable: +" let g:ctrlp_extensions += ['undo'] +" Create A Command: +" com! CtrlPUndo cal ctrlp#init(ctrlp#undo#id()) +"}}} + +" Init {{{1 +if ( exists('g:loaded_ctrlp_undo') && g:loaded_ctrlp_undo ) + \ || !( v:version > 703 || ( v:version == 703 && has('patch005') ) ) + fini +en +let g:loaded_ctrlp_undo = 1 + +let s:undo_var = { + \ 'init': 'ctrlp#undo#init(s:undotree)', + \ 'accept': 'ctrlp#undo#accept', + \ 'lname': 'undo', + \ 'sname': 'udo', + \ 'type': 'line', + \ } + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:undo_var) : [s:undo_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Utilities {{{1 +fu! s:flatten(tree) + let flatdict = {} + for each in a:tree + cal extend(flatdict, { each['seq'] : each['time'] }) + if has_key(each, 'alt') + cal extend(flatdict, s:flatten(each['alt'])) + en + endfo + retu flatdict +endf + +fu! s:humantime(nr) + let elapsed = localtime() - a:nr + let mins = elapsed / 60 + let hrs = elapsed / 3600 + let days = elapsed / 86400 + let wks = elapsed / 604800 + let mons = elapsed / 2592000 + let yrs = elapsed / 31536000 + let text = [ + \ ' second ago', + \ ' seconds ago', + \ ' minutes ago', + \ ' hours ago', + \ ' days ago', + \ ' weeks ago', + \ ' months ago', + \ ' years ago', + \ ] + if yrs > 1 + retu yrs.text[7] + elsei mons > 1 + retu mons.text[6] + elsei wks > 1 + retu wks.text[5] + elsei days > 1 + retu days.text[4] + elsei hrs > 1 + retu hrs.text[3] + elsei mins > 1 + retu mins.text[2] + elsei elapsed == 1 + retu elapsed.text[0] + elsei elapsed < 120 + retu elapsed.text[1] + en +endf + +fu! s:syntax() + for [ke, va] in items({'T': 'Directory', 'Br': 'Comment', 'Nr': 'String'}) + if !hlexists('CtrlPUndo'.ke) + exe 'hi link CtrlPUndo'.ke va + en + endfo + sy match CtrlPUndoT '\d\+ \zs[^ ]\+\ze' + sy match CtrlPUndoBr '\[\|\]' + sy match CtrlPUndoNr '\[\d\+\]$' contains=CtrlPUndoBr +endf + +fu! s:dict2list(dict) + let dict = map(a:dict, 's:humantime(v:val)') + retu map(keys(dict), 'eval(''[v:val, dict[v:val]]'')') +endf + +fu! s:compval(...) + retu a:2[0] - a:1[0] +endf +" Public {{{1 +fu! ctrlp#undo#init(undo) + let entries = a:undo['entries'] + if empty(entries) | retu [] | en + if has('syntax') && exists('g:syntax_on') + cal s:syntax() + en + let g:ctrlp_nolimit = 1 + let entries = sort(s:dict2list(s:flatten(entries)), 's:compval') + retu map(entries, 'v:val[1]." [".v:val[0]."]"') +endf + +fu! ctrlp#undo#accept(mode, str) + let undon = matchstr(a:str, '\[\zs\d\+\ze\]') + if empty(undon) | retu | en + cal ctrlp#exit() + exe 'u' undon +endf + +fu! ctrlp#undo#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/autoload/ctrlp/utils.vim b/bundle/git_ctrlp/autoload/ctrlp/utils.vim new file mode 100644 index 0000000..b4af577 --- /dev/null +++ b/bundle/git_ctrlp/autoload/ctrlp/utils.vim @@ -0,0 +1,75 @@ +" ============================================================================= +" File: autoload/ctrlp/utils.vim +" Description: Utilities +" Author: Kien Nguyen +" ============================================================================= + +" Static variables {{{1 +fu! ctrlp#utils#lash() + retu &ssl || !exists('+ssl') ? '/' : '\' +endf +let s:lash = ctrlp#utils#lash() + +fu! s:lash(...) + retu match(a:0 ? a:1 : getcwd(), '[\/]$') < 0 ? s:lash : '' +endf + +fu! ctrlp#utils#opts() + let usrhome = $HOME.s:lash($HOME) + let cahome = exists('$XDG_CACHE_HOME') ? $XDG_CACHE_HOME : usrhome.'.cache' + let s:cache_dir = isdirectory(usrhome.'.ctrlp_cache') + \ ? usrhome.'.ctrlp_cache' : cahome.s:lash(cahome).'ctrlp' + if exists('g:ctrlp_cache_dir') + let s:cache_dir = expand(g:ctrlp_cache_dir, 1) + if isdirectory(s:cache_dir.s:lash(s:cache_dir).'.ctrlp_cache') + let s:cache_dir = s:cache_dir.s:lash(s:cache_dir).'.ctrlp_cache' + en + en +endf +cal ctrlp#utils#opts() +" Files and Directories {{{1 +fu! ctrlp#utils#cachedir() + retu s:cache_dir +endf + +fu! ctrlp#utils#cachefile(...) + let tail = a:0 ? '.'.a:1 : '' + let cache_file = substitute(getcwd(), '\([\/]\|^\a\zs:\)', '%', 'g').tail.'.txt' + retu a:0 ? cache_file : s:cache_dir.s:lash(s:cache_dir).cache_file +endf + +fu! ctrlp#utils#readfile(file) + if filereadable(a:file) + let data = readfile(a:file) + if empty(data) || type(data) != 3 + unl data + let data = [] + en + retu data + en + retu [] +endf + +fu! ctrlp#utils#mkdir(dir) + if exists('*mkdir') && !isdirectory(a:dir) + sil! cal mkdir(a:dir, 'p') + en + retu a:dir +endf + +fu! ctrlp#utils#writecache(lines, ...) + if isdirectory(ctrlp#utils#mkdir(a:0 ? a:1 : s:cache_dir)) + sil! cal writefile(a:lines, a:0 >= 2 ? a:2 : ctrlp#utils#cachefile()) + if !a:0 + let g:ctrlp_newcache = 0 + en + en +endf + +fu! ctrlp#utils#glob(...) + let cond = v:version > 702 || ( v:version == 702 && has('patch051') ) + retu call('glob', cond ? a:000 : [a:1]) +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/bundle/git_ctrlp/doc/ctrlp.txt b/bundle/git_ctrlp/doc/ctrlp.txt new file mode 100644 index 0000000..a63f461 --- /dev/null +++ b/bundle/git_ctrlp/doc/ctrlp.txt @@ -0,0 +1,903 @@ +*ctrlp.txt* Fuzzy file, buffer, mru and tag finder. v1.7.2 +*CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* +=============================================================================== +# # +# :::::::: ::::::::::: ::::::::: ::: ::::::::: # +# :+: :+: :+: :+: :+: :+: :+: :+: # +# +:+ +:+ +:+ +:+ +:+ +:+ +:+ # +# +#+ +#+ +#++:++#: +#+ +#++:++#+ # +# +#+ +#+ +#+ +#+ +#+ +#+ # +# #+# #+# #+# #+# #+# #+# #+# # +# ######## ### ### ### ########## ### # +# # +=============================================================================== +CONTENTS *ctrlp-contents* + + 1. Intro........................................|ctrlp-intro| + 2. Options......................................|ctrlp-options| + 3. Commands.....................................|ctrlp-commands| + 4. Mappings.....................................|ctrlp-mappings| + 5. Input Formats................................|ctrlp-input-formats| + 6. Extensions...................................|ctrlp-extensions| + +=============================================================================== +INTRO *ctrlp-intro* + +Full path fuzzy file, buffer, mru and tag finder with an intuitive interface. +Written in pure Vimscript for MacVim and Vim version 7.0+. Has full support for +Vim’s |regexp| as search pattern, built-in MRU files monitoring, project’s root +finder, and more. + +To enable optional extensions (tag, dir, rtscript...), see |ctrlp-extensions|. + +=============================================================================== +OPTIONS *ctrlp-options* + +Below are the available options and their default values:~ + + *'g:ctrlp_map'* +Use this option to change the mapping to invoke |CtrlP| in |Normal| mode: > + let g:ctrlp_map = '' +< + + *'g:ctrlp_cmd'* +Set the default opening command to use when pressing the above mapping: > + let g:ctrlp_cmd = 'CtrlP' +< + + *'g:loaded_ctrlp'* +Use this to disable the plugin completely: > + let g:loaded_ctrlp = 1 +< + + *'g:ctrlp_by_filename'* +Set this to 1 to set searching by filename (not full path) as the default: > + let g:ctrlp_by_filename = 0 +< +Can be toggled on/off by pressing inside the prompt. + + *'g:ctrlp_regexp'* +Set this to 1 to set |regexp| search as the default: > + let g:ctrlp_regexp = 0 +< +Can be toggled on/off by pressing inside the prompt. + + *'g:ctrlp_match_window_bottom'* +Set this to 0 to show the match window at the top of the screen: > + let g:ctrlp_match_window_bottom = 1 +< + + *'g:ctrlp_match_window_reversed'* +Change the listing order of the files in the match window. The default setting +(1) is from bottom to top: > + let g:ctrlp_match_window_reversed = 1 +< + + *'g:ctrlp_max_height'* +Set the maximum height of the match window: > + let g:ctrlp_max_height = 10 +< + + *'g:ctrlp_switch_buffer'* +When opening a file with or , if the file’s already opened somewhere +|CtrlP| will try to jump to it instead of opening a new instance: > + let g:ctrlp_switch_buffer = 2 +< + 1 - only jump to the buffer if it’s opened in the current tab. + 2 - jump tab as well if the buffer’s opened in another tab. + 0 - disable this feature. + + *'g:ctrlp_reuse_window'* +When opening a file with , |CtrlP| avoids opening it in windows created by +plugins, help and quickfix. Use this to setup some exceptions: > + let g:ctrlp_reuse_window = 'netrw' +< +Acceptable values are partial name, filetype or buftype of the special buffers. +Use |regexp| to specify the pattern. +Example: > + let g:ctrlp_reuse_window = 'netrw\|help\|quickfix' +< + + *'g:ctrlp_working_path_mode'* +When starting up, |CtrlP| sets its local working directory according to this +variable: > + let g:ctrlp_working_path_mode = 2 +< + 1 - the parent directory of the current file. + 2 - the nearest ancestor that contains one of these directories or files: + .git/ .hg/ .svn/ .bzr/ _darcs/ + 0 - don’t manage working directory. +Note: you can use b:ctrlp_working_path_mode (a |b:var|) to set this option on a +per buffer basis. + + *'g:ctrlp_root_markers'* +Use this to set your own root markers in addition to the default ones. Your +markers will take precedence: > + let g:ctrlp_root_markers = [''] +< +These markers (builtins and yours) will serve as identifiers for the '/' and +'\' special inputs (|ctrlp-input-formats| (e)). + + *'g:ctrlp_use_caching'* +Set this to 0 to disable per-session caching. When disabled, caching will still +be enabled for directories that have more than 4000 files: > + let g:ctrlp_use_caching = 1 +< +Note: you can quickly purge the cache by pressing while inside |CtrlP|. + + *'g:ctrlp_clear_cache_on_exit'* +Set this to 0 to enable cross-session caching by not deleting the cache files +upon exiting Vim: > + let g:ctrlp_clear_cache_on_exit = 1 +< + + *'g:ctrlp_cache_dir'* +Set the directory to store the cache files: > + let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' +< + + *'g:ctrlp_prompt_mappings'* +Use this to customize the mappings inside |CtrlP|’s prompt to your liking. You +only need to keep the lines that you’ve changed the values (inside []): > + let g:ctrlp_prompt_mappings = { + \ 'PrtBS()': ['', ''], + \ 'PrtDelete()': [''], + \ 'PrtDeleteWord()': [''], + \ 'PrtClear()': [''], + \ 'PrtSelectMove("j")': ['', ''], + \ 'PrtSelectMove("k")': ['', ''], + \ 'PrtHistory(-1)': [''], + \ 'PrtHistory(1)': [''], + \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], + \ 'AcceptSelection("h")': ['', '', ''], + \ 'AcceptSelection("t")': ['', ''], + \ 'AcceptSelection("v")': ['', ''], + \ 'ToggleFocus()': [''], + \ 'ToggleRegex()': [''], + \ 'ToggleByFname()': [''], + \ 'ToggleType(1)': ['', ''], + \ 'ToggleType(-1)': ['', ''], + \ 'PrtExpandDir()': [''], + \ 'PrtInsert("w")': ['', ''], + \ 'PrtInsert("s")': [''], + \ 'PrtInsert("v")': [''], + \ 'PrtInsert("+")': [''], + \ 'PrtCurStart()': [''], + \ 'PrtCurEnd()': [''], + \ 'PrtCurLeft()': ['', '', ''], + \ 'PrtCurRight()': ['', ''], + \ 'PrtClearCache()': [''], + \ 'PrtDeleteMRU()': [''], + \ 'CreateNewFile()': [''], + \ 'MarkToOpen()': [''], + \ 'OpenMulti()': [''], + \ 'PrtExit()': ['', '', ''], + \ } +< +Note: In some terminals, it’s not possible to remap without also changing + (|key-codes|). So if pressing moves the cursor to the left instead of +deleting a char for you, add this to your |vimrc| to disable the default +mapping: > + let g:ctrlp_prompt_mappings = { + \ 'PrtCurLeft()': ['', ''] + \ } +< + + *'g:ctrlp_mruf_max'* +Specify the number of recently opened files you want |CtrlP| to remember: > + let g:ctrlp_mruf_max = 250 +< + + *'g:ctrlp_mruf_exclude'* +Files you don’t want |CtrlP| to remember. Use |regexp| to specify the patterns: +> + let g:ctrlp_mruf_exclude = '' +< +Examples: > + let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux + let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows +< + + *'g:ctrlp_mruf_include'* +And if you want |CtrlP| to only remember some files, specify them here: > + let g:ctrlp_mruf_include = '' +< +Example: > + let g:ctrlp_mruf_include = '\.py$\|\.rb$' +< + + *'g:ctrlp_mruf_relative'* +Set this to 1 to show only MRU files in the current working directory: > + let g:ctrlp_mruf_relative = 0 +< + + *'g:ctrlp_mruf_case_sensitive'* +Match this with your file system case-sensitivity setting to avoid duplicate +MRU entries: > + let g:ctrlp_mruf_case_sensitive = 1 +< + + *'g:ctrlp_mruf_last_entered'* +Set to 1 to sort the MRU file list to most-recently-entered-buffer order: > + let g:ctrlp_mruf_last_entered = 0 +< + + *'g:ctrlp_dotfiles'* +Set this to 0 if you don’t want |CtrlP| to scan for dotfiles and dotdirs: > + let g:ctrlp_dotfiles = 1 +< +You can use |'wildignore'| to exclude anything from the search. +Examples: > + " Excluding version control directories + set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX + set wildignore+=.git\*,.hg\*,.svn\* " Windows +< +Note #1: the `*/` in front of each directory glob is required. + +Note #2: |wildignore| influences the result of |expand()|, |globpath()| and +|glob()| which many plugins use to find stuff on the system (e.g. VCS related +plugins look for .git/, .hg/,... some other plugins look for external *.exe +tools on Windows). So be a little mindful of what you put in your |wildignore|. + + *'g:ctrlp_custom_ignore'* +In addition to |'wildignore'|, use this for files and directories you want only +|CtrlP| to not show. Use |regexp| to specify the patterns: > + let g:ctrlp_custom_ignore = '' +< +Examples: > + let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' + let g:ctrlp_custom_ignore = { + \ 'dir': '\.git$\|\.hg$\|\.svn$', + \ 'file': '\.exe$\|\.so$\|\.dll$', + \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', + \ } +< + + *'g:ctrlp_max_files'* +The maximum number of files to scan, set to 0 for no limit: > + let g:ctrlp_max_files = 10000 +< + + *'g:ctrlp_max_depth'* +The maximum depth of a directory tree to recurse into: > + let g:ctrlp_max_depth = 40 +< +Note: the larger these values, the more memory Vim uses. + + *'g:ctrlp_user_command'* +Specify an external tool to use for listing files instead of using Vim’s +|globpath()|. Use %s in place of the target directory: > + let g:ctrlp_user_command = '' +< +Examples: > + let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux + let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows +< +You can also use 'grep', 'findstr' or something else to filter the results. +Examples: > + let g:ctrlp_user_command = 'find %s -type f | grep (?!tmp/.*)' + let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d | findstr .*\.py$' +< +Use a version control listing command when inside a repository, this is faster +when scanning large projects: > + let g:ctrlp_user_command = [root_marker, listing_command, fallback_command] + let g:ctrlp_user_command = { + \ 'types': { + \ 1: [root_marker_1, listing_command_1], + \ n: [root_marker_n, listing_command_n], + \ }, + \ 'fallback': fallback_command + \ } +< +Examples: > + let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files'] + let g:ctrlp_user_command = ['.hg/', 'hg --cwd %s locate -I .'] + let g:ctrlp_user_command = { + \ 'types': { + \ 1: ['.git/', 'cd %s && git ls-files'], + \ 2: ['.hg/', 'hg --cwd %s locate -I .'], + \ }, + \ 'fallback': 'find %s -type f' + \ } +< +If the fallback_command is empty or not defined, |globpath()| will then be used +when searching outside a repo. + + *'g:ctrlp_max_history'* +The maximum number of input strings you want |CtrlP| to remember. The default +value mirrors Vim’s global |'history'| option: > + let g:ctrlp_max_history = &history +< +Set to 0 to disable prompt’s history. Browse the history with and . + + *'g:ctrlp_open_new_file'* +Use this option to specify how the newly created file is to be opened when +pressing : + t - in a new tab + h - in a new horizontal split + v - in a new vertical split + r - in the current window +> + let g:ctrlp_open_new_file = 'v' +< + + *'g:ctrlp_open_multiple_files'* +If non-zero, this will enable opening multiple files with and : > + let g:ctrlp_open_multiple_files = 'v' +< +Example: > + let g:ctrlp_open_multiple_files = '2vr' +< +For the number: + - If given, it’ll be used as the maximum number of windows or tabs to create + when opening the files (the rest will be opened as hidden buffers). + - If not given, will open all files, each in a new window or new tab. +For the letters: + t - each file in a new tab. + h - each file in a new horizontal split. + v - each file in a new vertical split. + Reuse the current window: + tr, + hr, + vr - open the first file in the current window, then the remaining files in + new splits or new tabs just like with t, h, v. + + *'g:ctrlp_arg_map'* +When this is set to 1, the and mappings will accept one extra key +as an argument to override their default behavior: > + let g:ctrlp_arg_map = 0 +< +Pressing or will then prompt for a keypress. The key can be: + t - open in tab(s) + h - open in horizontal split(s) + v - open in vertical split(s) + r - open in current window (for only) + , - cancel and go back to the prompt. + Any other key - use the behavior specified with |g:ctrlp_open_new_file| and + |g:ctrlp_open_multiple_files|. + + *'g:ctrlp_follow_symlinks'* +Set this to 1 to follow symbolic links when listing files: > + let g:ctrlp_follow_symlinks = 0 +< +When enabled, looped internal symlinks will be ignored to avoid duplicates. + + *'g:ctrlp_lazy_update'* +Set this to 1 to enable the lazy-update feature: only update the match window +after typing’s been stopped for a certain amount of time: > + let g:ctrlp_lazy_update = 0 +< +If is 1, update after 250ms. If bigger than 1, the number will be used as the +delay time in milliseconds. + + *'g:ctrlp_use_migemo'* +Set this to 1 to use Migemo Pattern for Japanese filenames. Migemo Search only +works in |regexp| mode. To split the pattern, separate words with space: > + let g:ctrlp_use_migemo = 0 +< + + *'g:ctrlp_status_func'* +Use this to customize the statuslines for the |CtrlP| window: > + let g:ctrlp_status_func = {} +< +Example: > + let g:ctrlp_status_func = { + \ 'main': 'Function_Name_1', + \ 'prog': 'Function_Name_2', + \ } +< +See https://gist.github.com/1610859 for a working example. + +=============================================================================== +COMMANDS *ctrlp-commands* + + *:CtrlP* +:CtrlP [starting-directory] + Open |CtrlP| in find file mode. + + If no argument is given, the value of |g:ctrlp_working_path_mode| will be + used to determine the starting directory. + You can use to auto-complete the [starting-directory] when typing it. + + *:CtrlPBuffer* +:CtrlPBuffer + Open |CtrlP| in find buffer mode. + + *:CtrlPMRU* +:CtrlPMRU + Open |CtrlP| in find Most-Recently-Used file mode. + + *:CtrlPClearCache* +:CtrlPClearCache + Flush the cache for the current working directory. The same as pressing + inside |CtrlP|. + You can also enable/disable caching with the option |g:ctrlp_use_caching|. + + *:CtrlPClearAllCaches* +:CtrlPClearAllCaches + Delete all the cache files saved in |g:ctrlp_cache_dir|. + + *:CtrlPReload* +:CtrlPReload + Load new values for the option variables. + +------------------------------------------------------------------------------- +The following commands ignore the current value of |g:ctrlp_working_path_mode|: + +:CtrlPCurWD *:CtrlPCurWD* + This acts like |:CtrlP| with |path_mode| = 0 + +:CtrlPCurFile *:CtrlPCurFile* + This acts like |:CtrlP| with |path_mode| = 1 + +:CtrlPRoot *:CtrlPRoot* + This acts like |:CtrlP| with |path_mode| = 2 + +=============================================================================== +MAPPINGS *ctrlp-mappings* + + *'ctrlp-'* + + Default |Normal| mode mapping to open the |CtrlP| prompt in find file mode. + +Once inside the prompt:~ + + *'ctrlp-fullregexp'* + Toggle between the string mode and full |regexp| mode. + Note: in full |regexp| mode, the prompt’s base is 'r>>' instead of '>>>' + + See also |input-formats| (guide) and |g:ctrlp_regexp_search| (option). + + + Toggle between full-path search and filename only search. + Note: in filename mode, the prompt’s base is '>d>' instead of '>>>' + + , 'forward' + + Scroll to the 'next' search mode in the sequence. + + , 'backward' + + Scroll to the 'previous' search mode in the sequence. + + + Auto-complete directory names under the current working directory inside + the prompt. + + + Toggle the focus between the match window and the prompt. + + , + + Move selection down. + + , + + Move selection up. + + + Move the cursor to the 'start' of the prompt. + + + Move the cursor to the 'end' of the prompt. + + , + , + + Move the cursor one character to the 'left'. + + , + + Move the cursor one character to the 'right'. + + , + + Delete the preceding character. + + + Delete the current character. + + + Delete a preceding inner word. + + + Clear the input field. + + + Open selected file in the active window if possible. + + + Open selected file in a new 'tab' after the last tabpage. + + + Open selected file in a 'vertical' split. + + , + , + + Open selected file in a 'horizontal' split. + + + Create a new file and its parent directories. + + + Next string in the prompt’s history. + + + Previous string in the prompt’s history. + + + - Mark/unmark a file to be opened with . + - Mark/unmark a file to create a new file in its directory using . + + + Open files marked by . + + + - Refresh the match window and purge the cache for the current directory. + - Remove deleted files from MRU list. + + + - Wipe MRU list. + - Delete MRU entries marked by . + + + Insert the word under the cursor (in the active buffer) into the prompt. + + , + , + + Exit |CtrlP|. + Note: can also be used to stop the scan if it’s taking too long. + +Choose your own mappings with |g:ctrlp_prompt_mappings|. + +When inside the match window (press to switch):~ + + a-z + 0-9 + ~^-=;`',.+!@#$%&_(){}[] + Cycle through the lines with the first letter (of paths or filenames) that + matches that key. + +=============================================================================== +INPUT FORMATS *ctrlp-input-formats* + +Formats for inputting in the prompt:~ + +a) Simple string. + e.g. 'abc' is understood internally as 'a[^a]\{-}b[^b]\{-}c' + +b) Vim |regexp|. If the input string contains '*' or '|', it’ll be treated as + a Vim’s |regexp| |pattern| without any modification. + e.g. 'abc\d*efg' will be read as 'abc\d*efg'. + + See also |ctrlp-fullregexp| (keymap) and |g:ctrlp_regexp_search| (option). + +c) End the string with a colon ':' followed by a Vim command to execute that + command after opening the file. If you need to use ':' literally, escape it + with a backslash: '\:'. When opening multiple files, the command will be + executed on each opening file. + e.g. 'abc:45' will open the selected file and jump to line 45. + 'abc:/my\:string' will open the selected file and jump to the first + instance of 'my:function'. + 'abc:+setf\ myfiletype|50' will open the selected file and set its + filetype to 'myfiletype', then jump to line 50. + 'abc:diffthis' will open the selected file and run |:diffthis| on the + first 4 files. + + See also Vim’s |++opt| and |+cmd|. + +d) Type exactly two dots '..' at the start of the prompt and press enter to go + backward in the directory tree by 1 level. If the parent directory is + large, this might be slow. + +e) Similarly, submit '/' or '\' to find and go to the project’s root. If the + project is large, using a VCS listing command to look for files might help + speeding up the intial scan (see |g:ctrlp_user_command| for more details). + +f) Type the name of a non-existent file and press to create it. Mark a + file with to create the new file in the same directory as the marked + file. + e.g. 'parentdir/newfile.txt' will create a directory named 'parentdir' as + well as 'newfile.txt'. + If 'some/old/dirs/oldfile.txt' is marked with , then 'parentdir' + and 'newfile.txt' will be created in 'some/old/dirs'. The final path + will then be 'some/old/dirs/parentdir/newfile.txt'. + Use '\' in place of '/' on Windows (if |'ssl'| is not set). + +g) Submit ? to open this help file. + +=============================================================================== +EXTENSIONS *g:ctrlp-extensions* + +Extensions are optional. To enable an extension, add its name to the variable +g:ctrlp_extensions: > + let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript'] +< +The order of the items will be the order they appear on the statusline and when +using , . + +Available extensions:~ + + *:CtrlPTag* + * Tag mode:~ + - Name: 'tag' + - Command: ':CtrlPTag' + - Search for a tag within a generated central tags file, and jump to the + definition. Use the Vim’s option |'tags'| to specify the names and the + locations of the tags file(s). Example: `set tags+=tags/help,doc/tags` + + *:CtrlPBufTag* + *:CtrlPBufTagAll* + * Buffer Tag mode:~ + - Name: 'buffertag' + - Commands: ':CtrlPBufTag [buffer-name]', + ':CtrlPBufTagAll'. + - Search for a tag within the current buffer or all buffers and jump to the + definition. Requires |exuberant_ctags| or compatible programs. + + *:CtrlPQuickfix* + * Quickfix mode:~ + - Name: 'quickfix' + - Command: ':CtrlPQuickfix' + - Search for an entry in the current quickfix errors and jump to it. + + *:CtrlPDir* + * Directory mode:~ + - Name: 'dir' + - Command: ':CtrlPDir [starting-directory]' + - Search for a directory and change the working directory to it. + - Mappings: + + change the local working directory for |CtrlP| and keep it open. + + change the global working directory (exit). + + change the local working directory for the current window (exit). + + change the global working directory to |CtrlP|’s current local + working directory (exit). + + *:CtrlPRTS* + * Runtime script mode:~ + - Name: 'rtscript' + - Command: ':CtrlPRTS' + - Search for files (vimscripts, docs, snippets...) in runtimepath. + +------------------------------------------------------------------------------- +Buffer Tag mode options:~ + + *'g:ctrlp_buftag_ctags_bin'* +If ctags isn’t in your $PATH, use this to set its location: > + let g:ctrlp_buftag_ctags_bin = '' +< + + *'g:ctrlp_buftag_systemenc'* +Match this with your OS’s encoding (not Vim’s). The default value mirrors Vim’s +global |'encoding'| option: > + let g:ctrlp_buftag_systemenc = &encoding +< + + *'g:ctrlp_buftag_types'* +Use this to set the arguments for ctags, jsctags... for a given filetype: > + let g:ctrlp_buftag_types = '' +< +Examples: > + let g:ctrlp_buftag_types = { + \ 'erlang' : '--language-force=erlang --erlang-types=drmf', + \ 'javascript' : { + \ 'bin': 'jsctags', + \ 'args': '-f -', + \ }, + \ } +< + +=============================================================================== +CUSTOMIZATION *ctrlp-customization* + +Highlighting:~ + * For the |CtrlP| buffer: + CtrlPNoEntries : the message when no match is found (Error) + CtrlPMatch : the matched pattern (Identifier) + CtrlPLinePre : the line prefix '>' in the match window + CtrlPPrtBase : the prompt’s base (Comment) + CtrlPPrtText : the prompt’s text (|hl-Normal|) + CtrlPPrtCursor : the prompt’s cursor when moving over the text (Constant) + + * In extensions: + CtrlPTabExtra : the part of each line that’s not matched against (Comment) + CtrlPqfLineCol : the line and column numbers in quickfix mode (|hl-Search|) + CtrlPUndoT : the elapsed time in undo mode (|hl-Directory|) + CtrlPUndoBr : the square brackets [] in undo mode (Comment) + CtrlPUndoNr : the undo number inside [] in undo mode (String) + +Statuslines:~ + * Highlight groups: + CtrlPMode1 : 'prt' or 'win', also for 'regex' (Character) + CtrlPMode2 : 'file' or 'path', also for the local working dir (|hl-LineNr|) + CtrlPStats : the scanning status (Function) + + For rebuilding the statuslines, see |g:ctrlp_status_func|. + +=============================================================================== +MISCELLANEOUS CONFIGS *ctrlp-miscellaneous-configs* + +* Use |wildignore| for |g:ctrlp_user_command|: +> + function! s:wig2cmd() + " Change wildignore into space or | separated groups + " e.g. .aux .out .toc .jpg .bmp .gif + " or .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$ + let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@) + +* A standalone function to set the working directory to the project’s root, or + to the parent directory of the current file if a root can’t be found: +> + function! s:setcwd() + let cph = expand('%:p:h', 1) + if match(cph, '\v^<.+>://') >= 0 | retu | en + for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects'] + let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';']) + if wd != '' | let &acd = 0 | brea | en + endfo + exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', '')) + endfunction + + autocmd BufEnter * call s:setcwd() +< +(requires Vim 7.1.299+) + +=============================================================================== +CREDITS *ctrlp-credits* + +Developed by Kien Nguyen . + +Project’s homepage: http://kien.github.com/ctrlp.vim +Git repository: https://github.com/kien/ctrlp.vim +Mercurial repository: https://bitbucket.org/kien/ctrlp.vim + +------------------------------------------------------------------------------- +Thanks to everyone that has submitted ideas, bug reports or helped debugging on +gibhub, bitbucket, and through email. + +Special thanks:~ + + * Woojong Koh + * Simon Ruderich + * Yasuhiro Matsumoto + * Ken Earley + * Kyo Nagashima + * Zak Johnson + * Diego Viola + * Piet Delport + * Thibault Duplessis + * Kent Sibilev + * Tacahiroy + * Luca Pette + +=============================================================================== +CHANGELOG *ctrlp-changelog* + + + Rename: + *ClearCtrlPCache* -> |CtrlPClearCache| + *ClearAllCtrlPCaches* -> |CtrlPClearAllCaches| + *ResetCtrlP* -> |CtrlPReload| + +Before 2012/03/02~ + + + Rename: + *g:ctrlp_regexp_search* -> |g:ctrlp_regexp|, + *g:ctrlp_dont_split* -> |g:ctrlp_reuse_window|, + *g:ctrlp_jump_to_buffer* -> |g:ctrlp_switch_buffer|. + + Rename and tweak: + *g:ctrlp_open_multi* -> |g:ctrlp_open_multiple_files|. + + Deprecate *g:ctrlp_highlight_match* + + Extend |g:ctrlp_user_command| to support multiple commands. + + New option: |g:ctrlp_mruf_last_entered| change MRU to Recently-Entered. + +Before 2012/01/15~ + + + New mapping: Switch and . is now used for completion + of directory names under the current working directory. + + New options: |g:ctrlp_arg_map| for , to accept an argument. + |g:ctrlp_status_func| custom statusline. + |g:ctrlp_mruf_relative| show only MRU files inside cwd. + + Extend g:ctrlp_open_multi with new optional values: tr, hr, vr. + + Extend |g:ctrlp_custom_ignore| to specifically filter dir, file and link. + +Before 2012/01/05~ + + + New feature: Buffer Tag extension. + + New commands: |:CtrlPBufTag|, |:CtrlPBufTagAll|. + + New options: |g:ctrlp_cmd|, + |g:ctrlp_custom_ignore| + +Before 2011/11/30~ + + + New features: Tag, Quickfix and Directory extensions. + + New commands: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|. + + New options: |g:ctrlp_use_migemo|, + |g:ctrlp_lazy_update|, + |g:ctrlp_follow_symlinks| + +Before 2011/11/13~ + + + New special input: '/' and '\' find root (|ctrlp-input-formats| (e)) + + Remove ctrlp#SetWorkingPath(). + + Remove *g:ctrlp_mru_files* and make MRU mode permanent. + + Extend g:ctrlp_open_multi, add new ways to open files. + + New option: g:ctrlp_dont_split, + |g:ctrlp_mruf_case_sensitive| + +Before 2011/10/30~ + + + New feature: Support for custom extensions. + also removes non-existent files from MRU list. + + New option: g:ctrlp_jump_to_buffer + +Before 2011/10/12~ + + + New features: Open multiple files. + Pass Vim’s |++opt| and |+cmd| to the opening file + (|ctrlp-input-formats| (c)) + Auto-complete each dir for |:CtrlP| [starting-directory] + + New mappings: mark/unmark a file to be opened with . + open all marked files. + + New option: g:ctrlp_open_multi + + Remove *g:ctrlp_persistent_input* *g:ctrlp_live_update* and . + +Before 2011/09/29~ + + + New mappings: , next/prev string in the input history. + create a new file and its parent dirs. + + New options: |g:ctrlp_open_new_file|, + |g:ctrlp_max_history| + + Added a new open-in-horizontal-split mapping: + +Before 2011/09/19~ + + + New command: ResetCtrlP + + New options: |g:ctrlp_max_files|, + |g:ctrlp_max_depth|, + g:ctrlp_live_update + + New mapping: + +Before 2011/09/12~ + + + Ability to cycle through matched lines in the match window. + + Extend the behavior of g:ctrlp_persistent_input + + Extend the behavior of |:CtrlP| + + New options: |g:ctrlp_dotfiles|, + |g:ctrlp_clear_cache_on_exit|, + g:ctrlp_highlight_match, + |g:ctrlp_user_command| + + New special input: '..' (|ctrlp-input-formats| (d)) + + New mapping: . + + New commands: |:CtrlPCurWD|, + |:CtrlPCurFile|, + |:CtrlPRoot| + + + New feature: Search in most recently used (MRU) files + + New mapping: . + + Extended the behavior of . + + New options: g:ctrlp_mru_files, + |g:ctrlp_mruf_max|, + |g:ctrlp_mruf_exclude|, + |g:ctrlp_mruf_include| + + New command: |:CtrlPMRU| + +First public release: 2011/09/06~ + +=============================================================================== +vim:ft=help:et:ts=2:sw=2:sts=2:norl diff --git a/bundle/git_ctrlp/plugin/ctrlp.vim b/bundle/git_ctrlp/plugin/ctrlp.vim new file mode 100644 index 0000000..162a055 --- /dev/null +++ b/bundle/git_ctrlp/plugin/ctrlp.vim @@ -0,0 +1,68 @@ +" ============================================================================= +" File: plugin/ctrlp.vim +" Description: Fuzzy file, buffer, mru and tag finder. +" Author: Kien Nguyen +" ============================================================================= +" GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip + +if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp + fini +en +let [g:loaded_ctrlp, g:ctrlp_lines, g:ctrlp_allfiles] = [1, [], []] + +if !exists('g:ctrlp_map') | let g:ctrlp_map = '' | en +if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en + +com! -n=? -com=dir CtrlP cal ctrlp#init(0, ) + +com! CtrlPBuffer cal ctrlp#init(1) +com! CtrlPMRUFiles cal ctrlp#init(2) + +com! CtrlPClearCache cal ctrlp#clr() +com! CtrlPClearAllCaches cal ctrlp#clra() +com! CtrlPReload cal ctrlp#reset() + +com! ClearCtrlPCache cal ctrlp#clr() +com! ClearAllCtrlPCaches cal ctrlp#clra() +com! ResetCtrlP cal ctrlp#reset() + +com! CtrlPCurWD cal ctrlp#init(0, 0) +com! CtrlPCurFile cal ctrlp#init(0, 1) +com! CtrlPRoot cal ctrlp#init(0, 2) + +if g:ctrlp_map != '' && !hasmapto(':'.g:ctrlp_cmd.'', 'n') + exe 'nn ' g:ctrlp_map ':'.g:ctrlp_cmd.'' +en + +cal ctrlp#mrufiles#init() + +if !exists('g:ctrlp_extensions') | fini | en + +let s:ext = g:ctrlp_extensions + +if index(s:ext, 'tag') >= 0 + let g:ctrlp_alltags = [] + com! CtrlPTag cal ctrlp#init(ctrlp#tag#id()) +en + +if index(s:ext, 'quickfix') >= 0 + com! CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id()) +en + +if index(s:ext, 'dir') >= 0 + let g:ctrlp_alldirs = [] + com! -n=? -com=dir CtrlPDir cal ctrlp#init(ctrlp#dir#id(), ) +en + +if index(s:ext, 'buffertag') >= 0 + let g:ctrlp_buftags = {} + com! -n=? -com=buffer CtrlPBufTag + \ cal ctrlp#init(ctrlp#buffertag#cmd(0, )) + com! CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1)) +en + +if index(s:ext, 'rtscript') >= 0 + com! CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id()) +en + +unl s:ext diff --git a/bundle/git_ctrlp/readme.md b/bundle/git_ctrlp/readme.md new file mode 100644 index 0000000..3ae6360 --- /dev/null +++ b/bundle/git_ctrlp/readme.md @@ -0,0 +1,78 @@ +# ctrlp.vim +Full path fuzzy __file__, __buffer__, __mru__ and __tag__ finder for Vim. + +* Written in pure Vimscript for MacVim and Vim 7.0+. +* Full support for Vim’s regexp as search pattern. +* Built-in Most Recently Used (MRU) files monitoring. +* Built-in project’s root finder. +* Open Multiple Files. +* [Extensible][3]. + +![ctrlp][1] + +## Basic Usage +* Press `` or run `:CtrlP` to invoke CtrlP in find file mode. +* Or run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in buffer or MRU mode. + +Once CtrlP is open: + +* Press `` and `` to switch between find file, buffer, and MRU file +modes. +* Press `` to switch to filename only search instead of full path. +* Press `` to purge the cache for the current directory and get new files. +* Use `*` or `|` in the prompt to submit the string as a Vim’s regexp pattern. +* Or press `` to switch to regexp mode. +* End the input string with a colon `:` followed by a command to execute after +opening the file. +e.g. `abc:45` will open the file matched the pattern and jump to line 45. +* Submit two dots `..` as the input string to go backward the directory tree by +1 level. +* Use `` to create a new file and its parent dirs. +* Use `` to mark/unmark files and `` to open them. + +## Basic Options +* Change the mapping to invoke CtrlP: + + ```vim + let g:ctrlp_map = '' + ``` + +* When CtrlP is invoked, it automatically sets its local working directory +according to this variable: + + ```vim + let g:ctrlp_working_path_mode = 2 + ``` + + 0 - don’t manage working directory. + 1 - the parent directory of the current file. + 2 - the nearest ancestor that contains one of these directories or files: + `.git/` `.hg/` `.svn/` `.bzr/` `_darcs/` + +* If you want to exclude directories or files from the search, use the Vim’s +option `wildignore` and/or the option `g:ctrlp_custom_ignore`. Examples: + + ```vim + set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux + set wildignore+=tmp\*,*.swp,*.zip,*.exe " Windows + + let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' + let g:ctrlp_custom_ignore = { + \ 'dir': '\.git$\|\.hg$\|\.svn$', + \ 'file': '\.exe$\|\.so$\|\.dll$', + \ 'link': 'some_bad_symbolic_links', + \ } + ``` + +* Use a custom file listing command with: + + ```vim + let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux + let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows + ``` + +_Check [the docs][2] for more mappings, commands and options._ + +[1]: http://i.imgur.com/yIynr.png +[2]: https://github.com/kien/ctrlp.vim/blob/master/doc/ctrlp.txt +[3]: https://github.com/kien/ctrlp.vim/tree/extensions diff --git a/bundle/git_syntastic/.gitignore b/bundle/git_syntastic/.gitignore new file mode 100644 index 0000000..cc07c93 --- /dev/null +++ b/bundle/git_syntastic/.gitignore @@ -0,0 +1,4 @@ +*~ +*.swp +tags +.DS_Store diff --git a/bundle/git_syntastic/README.markdown b/bundle/git_syntastic/README.markdown new file mode 100644 index 0000000..78f97c6 --- /dev/null +++ b/bundle/git_syntastic/README.markdown @@ -0,0 +1,123 @@ + , + / \,,_ .'| + ,{{| /}}}}/_.' _____________________________________________ + }}}}` '{{' '. / \ + {{{{{ _ ;, \ / Gentlemen, \ + ,}}}}}} /o`\ ` ;) | | + {{{{{{ / ( | this is ... | + }}}}}} | \ | | + {{{{{{{{ \ \ | | + }}}}}}}}} '.__ _ | | _____ __ __ _ | + {{{{{{{{ /`._ (_\ / | / ___/__ ______ / /_____ ______/ /_(_)____ | + }}}}}}' | //___/ --=: \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ | + jgs `{{{{` | '--' | ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ | + }}}` | /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ | + | /____/ | + | / + \_____________________________________________/ + + + + +Syntastic is a syntax checking plugin that runs files through external syntax +checkers and displays any resulting errors to the user. This can be done on +demand, or automatically as files are saved. If syntax errors are detected, the +user is notified and is happy because they didn't have to compile their code or +execute their script to find them. + +At the time of this writing, syntax checking plugins exist for applescript, c, +coffee, cpp, css, cucumber, cuda, docbk, erlang, eruby, fortran, +gentoo_metadata, go, haml, haskell, html, javascript, json, less, lua, matlab, +perl, php, puppet, python, rst, ruby, sass/scss, sh, tcl, tex, vala, xhtml, +xml, xslt, yaml, zpt + +Screenshot +---------- + +Below is a screenshot showing the methods that Syntastic uses to display syntax +errors. Note that, in practise, you will only have a subset of these methods +enabled. + +![Screenshot 1](https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png) + +1. Errors are loaded into the location list for the corresponding window. +2. When the cursor is on a line containing an error, the error message is echoed in the command window. +3. Signs are placed beside lines with errors - note that warnings are displayed in a different color. +4. There is a configurable statusline flag you can include in your statusline config. +5. Hover the mouse over a line containing an error and the error message is displayed as a balloon. +6. (not shown) Highlighting errors with syntax highlighting. Erroneous parts of lines can be highlighted. + +Installation +------------ + +[pathogen.vim](https://github.com/tpope/vim-pathogen) is the recommended way to install syntastic. + + cd ~/.vim/bundle + git clone https://github.com/scrooloose/syntastic.git + +Then reload vim, run `:Helptags`, and check out `:help syntastic.txt`. + + +Google group +------------ + +To get information or make suggestions check out the [google group](https://groups.google.com/group/vim-syntastic). + + +FAQ +--- + +__Q. I installed syntastic but it isn't reporting any errors ...__ + +A. The most likely reason is that the syntax checker that it requires isn't installed. For example: python requires either `flake8`, `pyflakes` or `pylint` to be installed and in `$PATH`. To see which executable is required, just look in `syntax_checkers/.vim`. + +Another reason it could fail is that the error output for the syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still fails then create an issue - or better yet, create a pull request. + + +Changelog +--------- +2.3.0 (16-feb-2012) + + * Add syntastic_loc_list_height option + * Allow errors to have a "subtype" that is signed differently to standard + errors. Currently geared towards differentiating style errors from + syntax errors. Currently implemented for phpcs (technosophos). + * New checkers for: + * yaml + * haxe (davidB) + * ocaml (edwintorok) + * pylint (parantapa) + * rust (cjab) + * Updates to existing checkers: + * jslint + * jshint (gillesruppert) + * fortran (bmattern) + * sass + * html (darcyparker) + * coffee (darcyparker) + * docbk (darcyparker) + * xml + * xslt + * less (irrationalfab) + * php (AD7six, technosophos) + * cuda + * python (mitchellh, pneff) + * perl (Anthony Carapetis) + * c (naoina, zsprackett) + * puppet (frimik) + +2.2.0 (24-dec-2011) + + * only do syntax checks when files are saved (not when first opened) - add g:syntastic_check_on_open option to get the old behavior back + * bug fix with echoing error messages; fixes incompatability with cmd-t (datanoise) + * dont allow warnings to mask errors when signing/echoing errors (ashikase) + * auto close location list when leaving buffer. (millermedeiros) + * update errors appropriately when :SyntasticToggleMode is called + * updates/fixes to existing checkers: + * javascript/jshint (millermedeiros) + * javascript/jslint + * c (kongo2002) + * Support for new filetypes: + * JSON (millermedeiros, tocer) + * rst (reStructuredText files) (JNRowe) + * gentoo-metadata (JNRowe) diff --git a/bundle/git_syntastic/_assets/screenshot_1.png b/bundle/git_syntastic/_assets/screenshot_1.png new file mode 100644 index 0000000..c1b69f4 Binary files /dev/null and b/bundle/git_syntastic/_assets/screenshot_1.png differ diff --git a/bundle/git_syntastic/autoload/syntastic/c.vim b/bundle/git_syntastic/autoload/syntastic/c.vim new file mode 100644 index 0000000..73623b1 --- /dev/null +++ b/bundle/git_syntastic/autoload/syntastic/c.vim @@ -0,0 +1,199 @@ +if exists("g:loaded_syntastic_c_autoload") + finish +endif +let g:loaded_syntastic_c_autoload = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" initialize c/cpp syntax checker handlers +function! s:Init() + let s:handlers = [] + let s:cflags = {} + + call s:RegHandler('gtk', 'syntastic#c#CheckPKG', + \ ['gtk', 'gtk+-2.0', 'gtk+', 'glib-2.0', 'glib']) + call s:RegHandler('glib', 'syntastic#c#CheckPKG', + \ ['glib', 'glib-2.0', 'glib']) + call s:RegHandler('glade', 'syntastic#c#CheckPKG', + \ ['glade', 'libglade-2.0', 'libglade']) + call s:RegHandler('libsoup', 'syntastic#c#CheckPKG', + \ ['libsoup', 'libsoup-2.4', 'libsoup-2.2']) + call s:RegHandler('webkit', 'syntastic#c#CheckPKG', + \ ['webkit', 'webkit-1.0']) + call s:RegHandler('cairo', 'syntastic#c#CheckPKG', + \ ['cairo', 'cairo']) + call s:RegHandler('pango', 'syntastic#c#CheckPKG', + \ ['pango', 'pango']) + call s:RegHandler('libxml', 'syntastic#c#CheckPKG', + \ ['libxml', 'libxml-2.0', 'libxml']) + call s:RegHandler('freetype', 'syntastic#c#CheckPKG', + \ ['freetype', 'freetype2', 'freetype']) + call s:RegHandler('SDL', 'syntastic#c#CheckPKG', + \ ['sdl', 'sdl']) + call s:RegHandler('opengl', 'syntastic#c#CheckPKG', + \ ['opengl', 'gl']) + call s:RegHandler('ruby', 'syntastic#c#CheckRuby', []) + call s:RegHandler('Python\.h', 'syntastic#c#CheckPython', []) + call s:RegHandler('php\.h', 'syntastic#c#CheckPhp', []) +endfunction + +" default include directories +let s:default_includes = [ '.', '..', 'include', 'includes', + \ '../include', '../includes' ] + +" uniquify the input list +function! s:Unique(list) + let l = [] + for elem in a:list + if index(l, elem) == -1 + let l = add(l, elem) + endif + endfor + return l +endfunction + +" get the gcc include directory argument depending on the default +" includes and the optional user-defined 'g:syntastic_c_include_dirs' +function! syntastic#c#GetIncludeDirs(filetype) + let include_dirs = copy(s:default_includes) + + if exists('g:syntastic_'.a:filetype.'_include_dirs') + call extend(include_dirs, g:syntastic_{a:filetype}_include_dirs) + endif + + return join(map(s:Unique(include_dirs), '"-I" . v:val'), ' ') +endfunction + + +" search the first 100 lines for include statements that are +" given in the handlers dictionary +function! syntastic#c#SearchHeaders() + let includes = '' + let files = [] + let found = [] + let lines = filter(getline(1, 100), 'v:val =~# "#\s*include"') + + " search current buffer + for line in lines + let file = matchstr(line, '"\zs\S\+\ze"') + if file != '' + call add(files, file) + continue + endif + for handler in s:handlers + if line =~# handler["regex"] + let includes .= call(handler["func"], handler["args"]) + call add(found, handler["regex"]) + break + endif + endfor + endfor + + " search included headers + for hfile in files + if hfile != '' + let filename = expand('%:p:h') . ((has('win32') || has('win64')) ? + \ '\' : '/') . hfile + try + let lines = readfile(filename, '', 100) + catch /E484/ + continue + endtry + let lines = filter(lines, 'v:val =~# "#\s*include"') + for handler in s:handlers + if index(found, handler["regex"]) != -1 + continue + endif + for line in lines + if line =~# handler["regex"] + let includes .= call(handler["func"], handler["args"]) + call add(found, handler["regex"]) + break + endif + endfor + endfor + endif + endfor + + return includes +endfunction + +" try to find library with 'pkg-config' +" search possible libraries from first to last given +" argument until one is found +function! syntastic#c#CheckPKG(name, ...) + if executable('pkg-config') + if !has_key(s:cflags, a:name) + for i in range(a:0) + let l:cflags = system('pkg-config --cflags '.a:000[i]) + " since we cannot necessarily trust the pkg-config exit code + " we have to check for an error output as well + if v:shell_error == 0 && l:cflags !~? 'not found' + let l:cflags = ' '.substitute(l:cflags, "\n", '', '') + let s:cflags[a:name] = l:cflags + return l:cflags + endif + endfor + else + return s:cflags[a:name] + endif + endif + return '' +endfunction + +" try to find PHP includes with 'php-config' +function! syntastic#c#CheckPhp() + if executable('php-config') + if !exists('s:php_flags') + let s:php_flags = system('php-config --includes') + let s:php_flags = ' ' . substitute(s:php_flags, "\n", '', '') + endif + return s:php_flags + endif + return '' +endfunction + +" try to find the ruby headers with 'rbconfig' +function! syntastic#c#CheckRuby() + if executable('ruby') + if !exists('s:ruby_flags') + let s:ruby_flags = system('ruby -r rbconfig -e ' + \ . '''puts Config::CONFIG["archdir"]''') + let s:ruby_flags = substitute(s:ruby_flags, "\n", '', '') + let s:ruby_flags = ' -I' . s:ruby_flags + endif + return s:ruby_flags + endif + return '' +endfunction + +" try to find the python headers with distutils +function! syntastic#c#CheckPython() + if executable('python') + if !exists('s:python_flags') + let s:python_flags = system('python -c ''from distutils import ' + \ . 'sysconfig; import sys; sys.stdout.write(sysconfig.get_python_inc())''') + let s:python_flags = substitute(s:python_flags, "\n", '', '') + let s:python_flags = ' -I' . s:python_flags + endif + return s:python_flags + endif + return '' +endfunction + +" return a handler dictionary object +function! s:RegHandler(regex, function, args) + let handler = {} + let handler["regex"] = a:regex + let handler["func"] = function(a:function) + let handler["args"] = a:args + call add(s:handlers, handler) +endfunction + +call s:Init() + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/bundle/git_syntastic/doc/syntastic.txt b/bundle/git_syntastic/doc/syntastic.txt new file mode 100644 index 0000000..f0cede3 --- /dev/null +++ b/bundle/git_syntastic/doc/syntastic.txt @@ -0,0 +1,574 @@ +*syntastic.txt* Syntax checking on the fly has never been so pimp. +*syntastic* + + + It's a bird! It's a plane! ZOMG It's ... ~ + + _____ __ __ _ ~ + / ___/__ ______ / /_____ ______/ /_(_)____ ~ + \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ ~ + ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ ~ + /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ ~ + /____/ ~ + + + + Reference Manual~ + + +============================================================================== +CONTENTS *syntastic-contents* + + 1.Intro...................................|syntastic-intro| + 2.Functionality provided..................|syntastic-functionality| + 2.1.The statusline flag...............|syntastic-statusline-flag| + 2.2.Error signs.......................|syntastic-error-signs| + 2.3.Error window......................|syntastic-error-window| + 3.Commands................................|syntastic-commands| + 4.Options.................................|syntastic-options| + 5.Writing syntax checkers.................|syntastic-syntax-checkers| + 6.About...................................|syntastic-about| + 7.Changelog...............................|syntastic-changelog| + 8.Credits.................................|syntastic-credits| + 9.License.................................|syntastic-license| + + +============================================================================== +1. Intro *syntastic-intro* + +Syntastic is a syntax checking plugin that runs files through external syntax +checkers. This can be done on demand, or automatically as files are saved and +opened. If syntax errors are detected, the user is notified and is happy +because they didn't have to compile their code or execute their script to find +them. + +Syntastic comes in two parts: the syntax checker plugins, and the core script +(i.e. syntastic.vim). The syntax checker plugins are defined on a per-filetype +basis where each one wraps up an external syntax checking program. The core +script delegates off to these plugins and uses their output to provide the +syntastic functionality. At the time of this writing, syntax checking plugins +exist for c, coffee, cpp, css, cucumber, cuda, docbk, erlang, eruby, fortran, +go, haml, haskell, html, javascript, less, lua, matlab, perl, php, puppet, +python, ruby, sass/scss, sh, tcl, tex, vala, xhtml, xml, xslt, zpt + +Take a look in the syntax_checkers directory for the most up to date list. + +If your language is not supported then see |syntastic-syntax-checkers| for +details on how to implement a syntax checking plugin, and be sure to send me a +patch ;-) + +This plugin is currently only recommended for *nix users. It is functional on +Windows, but since the syntax checking plugins shell out, the command window +briefly appears whenever one is executed. + + +============================================================================== +2. Functionality provided *syntastic-functionality* + +Syntax checking can be done automatically or on demand (see +|'syntastic_mode_map'| for configuring this). + +When syntax checking is done, the features below can be used to notify the +user of errors. See |syntastic-options| for how to configure and +activate/deactivate these features. + + * A configurable statusline flag + * Lines with errors can have |signs| placed beside them - where a different + sign is used for errors and warnings. + * A |location-list| can be displayed with error messages for erroneous + buffers. + * Offending parts of lines can be highlighted (this functionality is only + provided by some syntax checkers). + * Balloons (if compiled in) can be used to display error messages for + erroneous lines when hovering the mouse over them. + + +Note: This functionality is only available if a syntax checker plugin is +present for the filetype of the buffer in question. See +|syntastic-syntax-checkers| for details. + +------------------------------------------------------------------------------ +2.1. The statusline flag *syntastic-statusline-flag* + +To use the statusline flag, this must appear in your |'statusline'| setting > + %{SyntasticStatuslineFlag()} +< +Something like this could be more useful: > + set statusline+=%#warningmsg# + set statusline+=%{SyntasticStatuslineFlag()} + set statusline+=%* +< +When syntax errors are detected a flag will be shown. The content of the flag +is derived from the |syntastic_stl_format| option +------------------------------------------------------------------------------ +2.2. Error signs *syntastic-error-signs* + +Syntastic uses the |:sign| commands to mark lines with errors and warnings in +the sign column. To enable this feature, use the |'syntastic_enable_signs'| +option. + +------------------------------------------------------------------------------ +2.3. The error window *:Errors* *syntastic-error-window* + +You can use the :Errors command to display the errors for the current buffer +in the |location-list|. + +Note that when you use :Errors, the current location list is overwritten with +Syntastic's own location list. + + +============================================================================== +3. Commands *syntastic-commands* + +:Errors *:SyntasticErrors* + +When errors have been detected, use this command to pop up the |location-list| +and display the error messages. + + +:SyntasticToggleMode *:SyntasticToggleMode* + +Toggles syntastic between active and passive mode. See |'syntastic_mode_map'| +for more info. + + +:SyntasticCheck *:SyntasticCheck* + +Manually cause a syntax check to be done. Useful in passive mode, or if the +current filetype is set to passive. See |'syntastic_mode_map'| for more info. + + +============================================================================== +4. Options *syntastic-options* + + + *'syntastic_check_on_open'* +Default: 0 +If enabled, syntastic will do syntax checks when buffers are first loaded as +well as on saving > + let g:syntastic_check_on_open=1 +< + + *'syntastic_echo_current_error'* +Default: 1 +If enabled, syntastic will error message associated with the current line to +the command window. If multiple errors are found, the first will be used. > + let g:syntastic_echo_current_error=1 +< + + *'syntastic_enable_signs'* +Default: 1 +Use this option to tell syntastic whether to use the |:sign| interface to mark +syntax errors: > + let g:syntastic_enable_signs=1 +< + + *'syntastic_enable_balloons'* +Default: 1 +Use this option to tell syntastic whether to display error messages in balloons +when the mouse is hovered over erroneous lines: > + let g:syntastic_enable_balloons = 1 +< +Note that vim must be compiled with |+balloon_eval|. + + *'syntastic_enable_highlighting'* +Default: 1 +Use this option to tell syntastic whether to use syntax highlighting to mark +errors (where possible). Highlighting can be turned off with the following > + let g:syntastic_enable_highlighting = 0 +< + + *'syntastic_auto_jump'* +Default: 0 +Enable this option if you want the cursor to jump to the first detected error +when saving or opening a file: > + let g:syntastic_auto_jump=1 +< + + *'syntastic_auto_loc_list'* +Default: 2 +Use this option to tell syntastic to automatically open and/or close the +|location-list| (see |syntastic-error-window|). + +When set to 0 the error window will not be opened or closed automatically. > + let g:syntastic_auto_loc_list=0 +< + +When set to 1 the error window will be automatically opened when errors are +detected, and closed when none are detected. > + let g:syntastic_auto_loc_list=1 +< +When set to 2 the error window will be automatically closed when no errors are +detected, but not opened automatically. > + let g:syntastic_auto_loc_list=2 +< + + *'syntastic_loc_list_height'* +Default: 10 +Use this option to specify the height of the location lists that syntastic +opens. > + let g:syntastic_loc_list_height=5 +< + + + *'syntastic_mode_map'* +Default: { "mode": "active", + "active_filetypes": [], + "passive_filetypes": [] } + +Use this option to fine tune when automatic syntax checking is done (or not +done). + +The option should be set to something like: > + + let g:syntastic_mode_map = { 'mode': 'active', + \ 'active_filetypes': ['ruby', 'php'], + \ 'passive_filetypes': ['puppet'] } +< + +"mode" can be mapped to one of two values - "active" or "passive". When set to +active, syntastic does automatic checking whenever a buffer is saved or +initially opened. When set to "passive" syntastic only checks when the user +calls :SyntasticCheck. + +The exceptions to these rules are defined with "active_filetypes" and +"passive_filetypes". In passive mode, automatic checks are still done +for all filetypes in the "active_filetypes" array. In active mode, +automatic checks are not done for any filetypes in the +"passive_filetypes" array. + +At runtime, the |:SyntasticToggleMode| command can be used to switch between +active and passive mode. + +If any of "mode", "active_filetypes", or "passive_filetypes" are not specified +then they will default to their default value as above. + + *'syntastic_quiet_warnings'* + +Use this option if you only care about syntax errors, not warnings. When set, +this option has the following effects: + * no |signs| appear unless there is at least one error, whereupon both + errors and warnings are displayed + * the |'syntastic_auto_loc_list'| option only pops up the error window if + there's at least one error, whereupon both errors and warnings are + displayed +> + let g:syntastic_quiet_warnings=1 +< + + *'syntastic_stl_format'* + +Default: [Syntax: line:%F (%t)] +Use this option to control what the syntastic statusline text contains. Several +magic flags are availble to insert information: + %e - number of errors + %w - number of warnings + %t - total number of warnings and errors + %fe - line number of first error + %fw - line number of first warning + %F - line number of first warning or error + +Several additional flags are available to hide text under certain conditions: + %E{...} - hide the text in the brackets unless there are errors + %W{...} - hide the text in the brackets unless there are warnings + %B{...} - hide the text in the brackets unless there are both warnings AND + errors +These flags cant be nested. + +Example: > + let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]' +< +If this format is used and the current buffer has 5 errors and 1 warning +starting on lines 20 and 10 respectively then this would appear on the +statusline: > + [Err: 20 #5, Warn: 10 #1] +< +If the buffer had 2 warnings, starting on line 5 then this would appear: > + [Warn: 5 #2] +< + + +============================================================================== +5. Writing syntax checkers *syntastic-syntax-checkers* + + +A syntax checker plugin is really nothing more than a single function. You +should define them in ~/.vim/syntax_checkers/.vim, but this is +purely for convenience; Syntastic doesn't actually care where these functions +are defined. + +A syntax checker plugin must define a function of the form: +> + SyntaxCheckers__GetLocList() +< +The output of this function must be of the same format as that returned by +the |getloclist()| function. See |getloclist()| and |getqflist()| for +details. + +To achieve this, the function should call |SyntasticMake()| or shell out to a +syntax checker, parse the output and munge it into the format. + +There are several syntax checker plugins provided with this plugin. The ruby +one is a good example of |SyntasticMake()|, while the haml one is a good +example of how to create the data structure manually. + + +SyntasticMake({options}) *SyntasticMake()* + {options} must be a dictionary. It can contain "makeprg" and "errorformat" + as keys (both optional). + + SyntasticMake will run |:lmake| with the given |'makeprg'| and + |'errorformat'| (using the current settings if none are supplied). It will + store the resulting error list and use it to provide all of the + |syntastic-functionality|. The previous makeprg and errorformat settings + will then be restored, as well as the location list for the window. From + the user's perspective, it will be as though |:lmake| was never run. + + Note that the given "makeprg" and "errorformat" will be set using |:let-&|, + so you should not escape spaces. + + +============================================================================== +6. About *syntastic-about* + +The author of syntastic is a mighty wild stallion, hear him roar! > + _ _ _____ _____ ___ ___ ___ ____ _ _ _ + | \ | | ____| ____|_ _|_ _|_ _/ ___| | | | | + | \| | _| | _| | | | | | | | _| |_| | | + | |\ | |___| |___ | | | | | | |_| | _ |_| + |_| \_|_____|_____|___|___|___\____|_| |_(_) + +< +He likes to trot around in the back yard reading his emails and sipping a +scolding hot cup of Earl Grey. Email him at martin.grenfell at gmail dot com. +He can also be found trolling the #vim channel on the freenode IRC network as +scrooloose. + +Bug reports, feedback, suggestions etc are welcomed. + + +The latest official releases will be on vim.org at some point. + +The latest dev versions are on github + http://github.com/scrooloose/syntastic + +============================================================================== +7. Changelog *syntastic-changelog* + +2.3.0 + - Add syntastic_loc_list_height option + - Allow errors to have a "subtype" that is signed differently to standard + errors. Currently geared towards differentiating style errors from + syntax errors. Currently implemented for phpcs (technosophos). + - New checkers for: + - yaml + - haxe (davidB) + - ocaml (edwintorok) + - pylint (parantapa) + - rust (cjab) + + - Updates to existing checkers: + - jslint + - jshint (gillesruppert) + - fortran (bmattern) + - sass + - html (darcyparker) + - coffee (darcyparker) + - docbk (darcyparker) + - xml + - xslt + - less (irrationalfab) + - php (AD7six, technosophos) + - cuda + - python (mitchellh, pneff) + - perl (Anthony Carapetis) + - c (naoina, zsprackett) + - puppet (frimik) + +2.2.0 + - only do syntax checks when files are saved (not when first opened) - add + g:syntastic_check_on_open option to get the old behavior back + - bug fix with echoing error messages; fixes incompatability with cmd-t (datanoise) + - dont allow warnings to mask errors when signing/echoing errors (ashikase) + - auto close location list when leaving buffer. (millermedeiros) + - update errors appropriately when :SyntasticToggleMode is called + - updates/fixes to existing checkers: + - javascript/jshint (millermedeiros) + - javascript/jslint + - c (kongo2002) + - Support for new filetypes: + - JSON (millermedeiros, tocer) + - rst (reStructuredText files) (JNRowe) + - gentoo-metadata (JNRowe) + + +2.1.0 + - when the cursor is on a line containing an error, echo the + error msg (kevinw) + - various bug fixes and refactoring + - updates/fixes to existing checkers: + - html (millermedeiros) + - erlang + - coffeescript + - javascript + - sh + - php (add support for phpcs - technosophos) + - add an applescript checker (Zhai Cai) + - add support for hyphenated filetypes (JNRowe) + +2.0.0 + - Add support for highlighting the erroneous parts of lines (kstep) + - Add support for displaying errors via balloons (kstep) + - Add syntastic_mode_map option to give more control over when checking + should be done. + - Add :SyntasticCheck command to force a syntax check - useful in passive + mode (justone). + - Add the option to automatically close the location list, but not + automatically open it (milkypostman) + - Add syntastic_auto_jump option to automatically jump to the first + error (milkypostman) + - Only source syntax checkers as needed - instead of loading all of them + when vim starts + + - Support for new filetypes: + - less (julienXX) + - docbook (tpope) + - matlab (jasongraham) + - go (dtjm) + - puppet (uggedal, roman, zsprackett) + - haskell (baldo, roman) + - tcl (et) + - vala (kstep) + - cuda (temporaer) + - css (oryband, sitedyno) + - fortran (Karl Yngve LervÃ¥g) + - xml (kusnier) + - xslt (kusnier) + - erlang (kTT) + - zpt (claytron) + + - updates to existing checkers: + - javascript (mogren, bryanforbes, cjab, ajduncan) + - sass/scss (tmm1, atourino, dlee, epeli) + - ruby (changa) + - perl (harleypig) + - haml (bmihelac) + - php (kstep, docteurklein) + - python (kstep, soli) + - lua (kstep) + - html (kstep) + - xhtml (kstep) + - c (kongo2002, brandonw) + - cpp (kongo2002) + - coffee (industrial) + - eruby (sergevm) + +1.2.0 + - New syntax checkers from github:kongo2002 + - c (thanks also to github:jperras) + - cpp + - lua + - sh (thanks also to github:jmcantrell) + - add coffee syntax checked by github:lstoll + - add tex syntax checker + - make html checker play nicer with html5, thanks to github:enaeseth + - escape filenames properly when invoking syntax checkers, thanks to + github:jmcantrell + - adjust the ruby syntax checker to avoid some common annoying warnings, + thanks to github:robertwahler + +1.1.0 [codenamed: tpimp] + - Dont load rubygems for ruby/eruby syntax checkers. Thanks tpope. + - Improve the javascript syntax checker to catch some warnings that were + getting missed. Thanks tpope. + - Dont automatically focus the error window. Thanks tpope. + - Add support for cucumber [tpope], haskell & perl [Anthony Carapetis], + and xhtml + - Add commands to enable/disable syntax checking at runtime. See :help + syntastic-commands. + - Add an option to specifiy syntax checkers that should be disabled by + default. See :help syntastic_disabled_filetypes. + - Dont use :signs if vim wasnt compiled with support for them. +) + +============================================================================== +8. Credits *syntastic-credits* + +Thanks to the following people for testing, bug reports, patches etc. They own, +hard. + + Mikael Fridh (frimik) + Patrice Neff (pneff ) + Gilles Ruppert (gillesruppert) + Naoya INADA (naoina) + Mitchell Hashimoto (mitchellh) + irrationalfab + Andy Dawson (AD7six) + Parantapa Bhattacharya (parantapa) + edwintorok + Darcy Parker (darcyparker) + bmattern + David Bernard (davidB) + Aleksey V. Zapparov (ixti) + Benji Fisher (benjifisher) + Lance Fetters (ashikase) + datanoise + Giuseppe Rota (grota) + tocer + James Rowe (JNRowe) + Zhai Cai + Matt Butcher (technosophos) + Kevin Watters (kevinw) + Miller Medeiros (millermedeiros) + Pawel Salata (kTT) + Fjölnir Ãsgeirsson (aptiva) + Clayton Parker (claytron) + S. Zachariah Sprackett (zsprackett) + Sylvain Soliman (soli) + Ricardo Catalinas Jiménez (jimenezrick) + kusnier + Klein Florian (docteurklein) + sitedyno + Matthew Batema (mlb-) + Nate Jones (justone) + sergevm + Karl Yngve LervÃ¥g + Pavel Argentov (argent-smith) + Andy Duncan (ajduncan) + Antonio Touriño (atourino) + Chad Jablonski (cjab) + Roman Gonzalez (roman) + Tom Wieland (industrial) + Ory Band (oryband) + Esa-Matti Suuronen (epeli) + Brandon Waskiewicz (brandonw) + dlee + temporaer + Jason Graham (jasongraham) + Sam Nguyen (dtjm) + Claes Mogren (mogren) + Eivind Uggedal (uggedal) + kstep + Andreas Baldeau (baldo) + Eric Thomas (et) + Brian Donovan (eventualbuddha) + Bryan Forbes (bryanforbes) + Aman Gupta (tmm1) + Donald Ephraim Curtis (milkypostman) + Dominique Rose-Rosette (changa) + Harley Pig (harleypig) + bmihelac + Julien Blanchard (julienXX) + Gregor Uhlenheuer (kongo2002) + Lincoln Stoll + Tim Carey-Smith (halorgium) + Tim Pope (tpope) + Travis Jeffery + Anthony Carapetis + + +============================================================================== +9. License *syntastic-license* + +Syntastic is released under the wtfpl. +See http://sam.zoy.org/wtfpl/COPYING. diff --git a/bundle/git_syntastic/plugin/syntastic.vim b/bundle/git_syntastic/plugin/syntastic.vim new file mode 100644 index 0000000..4e3486f --- /dev/null +++ b/bundle/git_syntastic/plugin/syntastic.vim @@ -0,0 +1,626 @@ +"============================================================================ +"File: syntastic.vim +"Description: vim plugin for on the fly syntax checking +"Maintainer: Martin Grenfell +"Version: 2.3.0 +"Last Change: 16 Feb, 2012 +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("g:loaded_syntastic_plugin") + finish +endif +let g:loaded_syntastic_plugin = 1 + +let s:running_windows = has("win16") || has("win32") || has("win64") + +if !s:running_windows + let s:uname = system('uname') +endif + +if !exists("g:syntastic_enable_signs") + let g:syntastic_enable_signs = 1 +endif +if !has('signs') + let g:syntastic_enable_signs = 0 +endif + +if !exists("g:syntastic_enable_balloons") + let g:syntastic_enable_balloons = 1 +endif +if !has('balloon_eval') + let g:syntastic_enable_balloons = 0 +endif + +if !exists("g:syntastic_enable_highlighting") + let g:syntastic_enable_highlighting = 1 +endif + +if !exists("g:syntastic_echo_current_error") + let g:syntastic_echo_current_error = 1 +endif + +if !exists("g:syntastic_auto_loc_list") + let g:syntastic_auto_loc_list = 2 +endif + +if !exists("g:syntastic_auto_jump") + let syntastic_auto_jump=0 +endif + +if !exists("g:syntastic_quiet_warnings") + let g:syntastic_quiet_warnings = 0 +endif + +if !exists("g:syntastic_stl_format") + let g:syntastic_stl_format = '[Syntax: line:%F (%t)]' +endif + +if !exists("g:syntastic_mode_map") + let g:syntastic_mode_map = {} +endif + +if !has_key(g:syntastic_mode_map, "mode") + let g:syntastic_mode_map['mode'] = 'active' +endif + +if !has_key(g:syntastic_mode_map, "active_filetypes") + let g:syntastic_mode_map['active_filetypes'] = [] +endif + +if !has_key(g:syntastic_mode_map, "passive_filetypes") + let g:syntastic_mode_map['passive_filetypes'] = [] +endif + +if !exists("g:syntastic_check_on_open") + let g:syntastic_check_on_open = 0 +endif + +if !exists("g:syntastic_loc_list_height") + let g:syntastic_loc_list_height = 10 +endif + +command! SyntasticToggleMode call s:ToggleMode() +command! SyntasticCheck call s:UpdateErrors(0) redraw! +command! Errors call s:ShowLocList() + +highlight link SyntasticError SpellBad +highlight link SyntasticWarning SpellCap + +augroup syntastic + if g:syntastic_echo_current_error + autocmd cursormoved * call s:EchoCurrentError() + endif + + autocmd BufReadPost * if g:syntastic_check_on_open | call s:UpdateErrors(1) | endif + autocmd BufWritePost * call s:UpdateErrors(1) + + autocmd BufWinEnter * if empty(&bt) | call s:AutoToggleLocList() | endif + autocmd BufWinLeave * if empty(&bt) | lclose | endif +augroup END + + +"refresh and redraw all the error info for this buf when saving or reading +function! s:UpdateErrors(auto_invoked) + if !empty(&buftype) + return + endif + + if !a:auto_invoked || s:ModeMapAllowsAutoChecking() + call s:CacheErrors() + end + + if s:BufHasErrorsOrWarningsToDisplay() + call setloclist(0, s:LocList()) + endif + + if g:syntastic_enable_balloons + call s:RefreshBalloons() + endif + + if g:syntastic_enable_signs + call s:RefreshSigns() + endif + + if g:syntastic_enable_highlighting + call s:HightlightErrors() + endif + + if g:syntastic_auto_jump && s:BufHasErrorsOrWarningsToDisplay() + silent! ll + endif + + call s:AutoToggleLocList() +endfunction + +"automatically open/close the location list window depending on the users +"config and buffer error state +function! s:AutoToggleLocList() + if s:BufHasErrorsOrWarningsToDisplay() + if g:syntastic_auto_loc_list == 1 + call s:ShowLocList() + endif + else + if g:syntastic_auto_loc_list > 0 + + "TODO: this will close the loc list window if one was opened by + "something other than syntastic + lclose + endif + endif +endfunction + +"lazy init the loc list for the current buffer +function! s:LocList() + if !exists("b:syntastic_loclist") + let b:syntastic_loclist = [] + endif + return b:syntastic_loclist +endfunction + +"clear the loc list for the buffer +function! s:ClearCache() + let b:syntastic_loclist = [] + unlet! b:syntastic_errors + unlet! b:syntastic_warnings +endfunction + +"detect and cache all syntax errors in this buffer +" +"depends on a function called SyntaxCheckers_{&ft}_GetLocList() existing +"elsewhere +function! s:CacheErrors() + call s:ClearCache() + + if filereadable(expand("%")) + + "sub - for _ in filetypes otherwise we cant name syntax checker + "functions legally for filetypes like "gentoo-metadata" + let fts = substitute(&ft, '-', '_', 'g') + for ft in split(fts, '\.') + if s:Checkable(ft) + let errors = SyntaxCheckers_{ft}_GetLocList() + "make errors have type "E" by default + call SyntasticAddToErrors(errors, {'type': 'E'}) + call extend(s:LocList(), errors) + endif + endfor + endif +endfunction + +"toggle the g:syntastic_mode_map['mode'] +function! s:ToggleMode() + if g:syntastic_mode_map['mode'] == "active" + let g:syntastic_mode_map['mode'] = "passive" + else + let g:syntastic_mode_map['mode'] = "active" + endif + + call s:ClearCache() + call s:UpdateErrors(1) + + echo "Syntastic: " . g:syntastic_mode_map['mode'] . " mode enabled" +endfunction + +"check the current filetypes against g:syntastic_mode_map to determine whether +"active mode syntax checking should be done +function! s:ModeMapAllowsAutoChecking() + let fts = split(&ft, '\.') + + if g:syntastic_mode_map['mode'] == 'passive' + "check at least one filetype is active + let actives = g:syntastic_mode_map["active_filetypes"] + return !empty(filter(fts, 'index(actives, v:val) != -1')) + else + "check no filetypes are passive + let passives = g:syntastic_mode_map["passive_filetypes"] + return empty(filter(fts, 'index(passives, v:val) != -1')) + endif +endfunction + +function! s:BufHasErrorsOrWarningsToDisplay() + return len(s:Errors()) || (!g:syntastic_quiet_warnings && !empty(s:LocList())) +endfunction + +function! s:Errors() + if !exists("b:syntastic_errors") + let b:syntastic_errors = s:FilterLocList({'type': "E"}) + endif + return b:syntastic_errors +endfunction + +function! s:Warnings() + if !exists("b:syntastic_warnings") + let b:syntastic_warnings = s:FilterLocList({'type': "W"}) + endif + return b:syntastic_warnings +endfunction + +"Filter a loc list (defaults to s:LocList()) by a:filters +"e.g. +" s:FilterLocList({'bufnr': 10, 'type': 'e'}) +" +"would return all errors in s:LocList() for buffer 10. +" +"Note that all comparisons are done with ==? +function! s:FilterLocList(filters, ...) + let llist = a:0 ? a:1 : s:LocList() + + let rv = [] + + for error in llist + + let passes_filters = 1 + for key in keys(a:filters) + if error[key] !=? a:filters[key] + let passes_filters = 0 + break + endif + endfor + + if passes_filters + call add(rv, error) + endif + endfor + return rv +endfunction + +if g:syntastic_enable_signs + "define the signs used to display syntax and style errors/warns + sign define SyntasticError text=>> texthl=error + sign define SyntasticWarning text=>> texthl=todo + sign define SyntasticStyleError text=S> texthl=error + sign define SyntasticStyleWarning text=S> texthl=todo +endif + +"start counting sign ids at 5000, start here to hopefully avoid conflicting +"with any other code that places signs (not sure if this precaution is +"actually needed) +let s:first_sign_id = 5000 +let s:next_sign_id = s:first_sign_id + +"place signs by all syntax errs in the buffer +function! s:SignErrors() + if s:BufHasErrorsOrWarningsToDisplay() + + let errors = s:FilterLocList({'bufnr': bufnr('')}) + for i in errors + let sign_severity = 'Error' + let sign_subtype = '' + if has_key(i,'subtype') + let sign_subtype = i['subtype'] + endif + if i['type'] ==? 'w' + let sign_severity = 'Warning' + endif + let sign_type = 'Syntastic' . sign_subtype . sign_severity + + if !s:WarningMasksError(i, errors) + exec "sign place ". s:next_sign_id ." line=". i['lnum'] ." name=". sign_type ." file=". expand("%:p") + call add(s:BufSignIds(), s:next_sign_id) + let s:next_sign_id += 1 + endif + endfor + endif +endfunction + +"return true if the given error item is a warning that, if signed, would +"potentially mask an error if displayed at the same time +function! s:WarningMasksError(error, llist) + if a:error['type'] !=? 'w' + return 0 + endif + + return len(s:FilterLocList({ 'type': "E", 'lnum': a:error['lnum'] }, a:llist)) > 0 +endfunction + +"remove the signs with the given ids from this buffer +function! s:RemoveSigns(ids) + for i in a:ids + exec "sign unplace " . i + call remove(s:BufSignIds(), index(s:BufSignIds(), i)) + endfor +endfunction + +"get all the ids of the SyntaxError signs in the buffer +function! s:BufSignIds() + if !exists("b:syntastic_sign_ids") + let b:syntastic_sign_ids = [] + endif + return b:syntastic_sign_ids +endfunction + +"update the error signs +function! s:RefreshSigns() + let old_signs = copy(s:BufSignIds()) + call s:SignErrors() + call s:RemoveSigns(old_signs) + let s:first_sign_id = s:next_sign_id +endfunction + +"display the cached errors for this buf in the location list +function! s:ShowLocList() + if !empty(s:LocList()) + let num = winnr() + exec "lopen " . g:syntastic_loc_list_height + if num != winnr() + wincmd p + endif + endif +endfunction + +"highlight the current errors using matchadd() +" +"The function `Syntastic_{&ft}_GetHighlightRegex` is used to get the regex to +"highlight errors that do not have a 'col' key (and hence cant be done +"automatically). This function must take one arg (an error item) and return a +"regex to match that item in the buffer. +" +"If the 'force_highlight_callback' key is set for an error item, then invoke +"the callback even if it can be highlighted automatically. +function! s:HightlightErrors() + call s:ClearErrorHighlights() + + let fts = substitute(&ft, '-', '_', 'g') + for ft in split(fts, '\.') + + for item in s:LocList() + + let force_callback = has_key(item, 'force_highlight_callback') && item['force_highlight_callback'] + + let group = item['type'] == 'E' ? 'SyntasticError' : 'SyntasticWarning' + if item['col'] && !force_callback + let lastcol = col([item['lnum'], '$']) + let lcol = min([lastcol, item['col']]) + call matchadd(group, '\%'.item['lnum'].'l\%'.lcol.'c') + else + + if exists("*SyntaxCheckers_". ft ."_GetHighlightRegex") + let term = SyntaxCheckers_{ft}_GetHighlightRegex(item) + if len(term) > 0 + call matchadd(group, '\%' . item['lnum'] . 'l' . term) + endif + endif + endif + endfor + endfor +endfunction + +"remove all error highlights from the window +function! s:ClearErrorHighlights() + for match in getmatches() + if stridx(match['group'], 'Syntastic') == 0 + call matchdelete(match['id']) + endif + endfor +endfunction + +"check if a syntax checker exists for the given filetype - and attempt to +"load one +function! s:Checkable(ft) + if !exists("g:loaded_" . a:ft . "_syntax_checker") + exec "runtime syntax_checkers/" . a:ft . ".vim" + endif + + return exists("*SyntaxCheckers_". a:ft ."_GetLocList") +endfunction + +"set up error ballons for the current set of errors +function! s:RefreshBalloons() + let b:syntastic_balloons = {} + if s:BufHasErrorsOrWarningsToDisplay() + for i in s:LocList() + let b:syntastic_balloons[i['lnum']] = i['text'] + endfor + set beval bexpr=SyntasticErrorBalloonExpr() + endif +endfunction + +"print as much of a:msg as possible without "Press Enter" prompt appearing +function! s:WideMsg(msg) + let old_ruler = &ruler + let old_showcmd = &showcmd + + let msg = strpart(a:msg, 0, winwidth(0)-1) + + "This is here because it is possible for some error messages to begin with + "\n which will cause a "press enter" prompt. I have noticed this in the + "javascript:jshint checker and have been unable to figure out why it + "happens + let msg = substitute(msg, "\n", "", "g") + + set noruler noshowcmd + redraw + + echo msg + + let &ruler=old_ruler + let &showcmd=old_showcmd +endfunction + +"echo out the first error we find for the current line in the cmd window +function! s:EchoCurrentError() + "If we have an error or warning at the current line, show it + let errors = s:FilterLocList({'lnum': line("."), "type": 'e'}) + let warnings = s:FilterLocList({'lnum': line("."), "type": 'w'}) + + let b:syntastic_echoing_error = len(errors) || len(warnings) + if len(errors) + return s:WideMsg(errors[0]['text']) + endif + if len(warnings) + return s:WideMsg(warnings[0]['text']) + endif + + "Otherwise, clear the status line + if b:syntastic_echoing_error + echo + let b:syntastic_echoing_error = 0 + endif +endfunction + +"load the chosen checker for the current filetype - useful for filetypes like +"javascript that have more than one syntax checker +function! s:LoadChecker(checker) + exec "runtime syntax_checkers/" . &ft . "/" . a:checker . ".vim" +endfunction + +"return a string representing the state of buffer according to +"g:syntastic_stl_format +" +"return '' if no errors are cached for the buffer +function! SyntasticStatuslineFlag() + if s:BufHasErrorsOrWarningsToDisplay() + let errors = s:Errors() + let warnings = s:Warnings() + + let num_errors = len(errors) + let num_warnings = len(warnings) + + let output = g:syntastic_stl_format + + "hide stuff wrapped in %E(...) unless there are errors + let output = substitute(output, '\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g') + + "hide stuff wrapped in %W(...) unless there are warnings + let output = substitute(output, '\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g') + + "hide stuff wrapped in %B(...) unless there are both errors and warnings + let output = substitute(output, '\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g') + + "sub in the total errors/warnings/both + let output = substitute(output, '\C%w', num_warnings, 'g') + let output = substitute(output, '\C%e', num_errors, 'g') + let output = substitute(output, '\C%t', len(s:LocList()), 'g') + + "first error/warning line num + let output = substitute(output, '\C%F', s:LocList()[0]['lnum'], 'g') + + "first error line num + let output = substitute(output, '\C%fe', num_errors ? errors[0]['lnum'] : '', 'g') + + "first warning line num + let output = substitute(output, '\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g') + + return output + else + return '' + endif +endfunction + +"A wrapper for the :lmake command. Sets up the make environment according to +"the options given, runs make, resets the environment, returns the location +"list +" +"a:options can contain the following keys: +" 'makeprg' +" 'errorformat' +" +"The corresponding options are set for the duration of the function call. They +"are set with :let, so dont escape spaces. +" +"a:options may also contain: +" 'defaults' - a dict containing default values for the returned errors +" 'subtype' - all errors will be assigned the given subtype +function! SyntasticMake(options) + let old_loclist = getloclist(0) + let old_makeprg = &makeprg + let old_shellpipe = &shellpipe + let old_shell = &shell + let old_errorformat = &errorformat + + if !s:running_windows && (s:uname !~ "FreeBSD") + "this is a hack to stop the screen needing to be ':redraw'n when + "when :lmake is run. Otherwise the screen flickers annoyingly + let &shellpipe='&>' + let &shell = '/bin/bash' + endif + + if has_key(a:options, 'makeprg') + let &makeprg = a:options['makeprg'] + endif + + if has_key(a:options, 'errorformat') + let &errorformat = a:options['errorformat'] + endif + + silent lmake! + let errors = getloclist(0) + + call setloclist(0, old_loclist) + let &makeprg = old_makeprg + let &errorformat = old_errorformat + let &shellpipe=old_shellpipe + let &shell=old_shell + + if !s:running_windows && s:uname =~ "FreeBSD" + redraw! + endif + + if has_key(a:options, 'defaults') + call SyntasticAddToErrors(errors, a:options['defaults']) + endif + + " Add subtype info if present. + if has_key(a:options, 'subtype') + call SyntasticAddToErrors(errors, {'subtype': a:options['subtype']}) + endif + + return errors +endfunction + +"get the error balloon for the current mouse position +function! SyntasticErrorBalloonExpr() + if !exists('b:syntastic_balloons') + return '' + endif + return get(b:syntastic_balloons, v:beval_lnum, '') +endfunction + +"take a list of errors and add default values to them from a:options +function! SyntasticAddToErrors(errors, options) + for i in range(0, len(a:errors)-1) + for key in keys(a:options) + if !has_key(a:errors[i], key) || empty(a:errors[i][key]) + let a:errors[i][key] = a:options[key] + endif + endfor + endfor + return a:errors +endfunction + +"take a list of syntax checkers for the current filetype and load the right +"one based on the global settings and checker executable availabity +" +"a:checkers should be a list of syntax checker names. These names are assumed +"to be the names of the vim syntax checker files that should be sourced, as +"well as the names of the actual syntax checker executables. The checkers +"should be listed in order of default preference. +" +"if a option called 'g:syntastic_[filetype]_checker' exists then attempt to +"load the checker that it points to +function! SyntasticLoadChecker(checkers) + let opt_name = "g:syntastic_" . &ft . "_checker" + + if exists(opt_name) + let opt_val = {opt_name} + if index(a:checkers, opt_val) != -1 && executable(opt_val) + call s:LoadChecker(opt_val) + else + echoerr &ft . " syntax not supported or not installed." + endif + else + for checker in a:checkers + if executable(checker) + return s:LoadChecker(checker) + endif + endfor + endif +endfunction + +" vim: set et sts=4 sw=4: diff --git a/bundle/git_syntastic/syntax_checkers/applescript.vim b/bundle/git_syntastic/syntax_checkers/applescript.vim new file mode 100644 index 0000000..eb7a6f2 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/applescript.vim @@ -0,0 +1,43 @@ +"============================================================================== +" FileName: applescript.vim +" Desc: Syntax checking plugin for syntastic.vim +" Author: Zhao Cai +" Email: caizhaoff@gmail.com +" Version: 0.2.1 +" Date Created: Thu 09 Sep 2011 10:30:09 AM EST +" Last Modified: Fri 09 Dec 2011 01:10:24 PM EST +" +" History: 0.1.0 - working, but it will run the script everytime to check +" syntax. Should use osacompile but strangely it does not give +" errors. +" +" 0.2.0 - switch to osacompile, it gives less errors compared +" with osascript. +" +" 0.2.1 - remove g:syntastic_applescript_tempfile. use +" tempname() instead. +" +" License: This program is free software. It comes without any +" warranty, to the extent permitted by applicable law. You can +" redistribute it and/or modify it under the terms of the Do What The +" Fuck You Want To Public License, Version 2, as published by Sam +" Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("loaded_applescript_syntax_checker") + finish +endif +let loaded_applescript_syntax_checker = 1 + +"bail if the user doesnt have osacompile installed +if !executable("osacompile") + finish +endif + +function! SyntaxCheckers_applescript_GetLocList() + let makeprg = 'osacompile -o ' . tempname() . '.scpt '. shellescape(expand('%')) + let errorformat = '%f:%l:%m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/c.vim b/bundle/git_syntastic/syntax_checkers/c.vim new file mode 100644 index 0000000..c20b68d --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/c.vim @@ -0,0 +1,133 @@ +"============================================================================ +"File: c.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" In order to also check header files add this to your .vimrc: +" (this usually creates a .gch file in your source directory) +" +" let g:syntastic_c_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_c_no_include_search = 1 +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_c_includes. Then the header files are being re-checked on +" the next file write. +" +" let g:syntastic_c_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_c_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4' +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_c_include_dirs. This list can be used like this: +" +" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ] +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_c_compiler_options': +" +" let g:syntastic_c_compiler_options = ' -ansi' +" +" Using the global variable 'g:syntastic_c_remove_include_errors' you can +" specify whether errors of files included via the g:syntastic_c_include_dirs' +" setting are removed from the result set: +" +" let g:syntastic_c_remove_include_errors = 1 + +if exists('loaded_c_syntax_checker') + finish +endif +let loaded_c_syntax_checker = 1 + +if !executable('gcc') + finish +endif + +let s:save_cpo = &cpo +set cpo&vim + +if !exists('g:syntastic_c_compiler_options') + let g:syntastic_c_compiler_options = '-std=gnu99' +endif + +function! SyntaxCheckers_c_GetLocList() + let makeprg = 'gcc -fsyntax-only ' + let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '. + \ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '. + \ 'each function it appears%.%#,%-GIn file included%.%#,'. + \ '%-G %#from %f:%l\,,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %m' + + " add optional user-defined compiler options + let makeprg .= g:syntastic_c_compiler_options + + let makeprg .= ' '.shellescape(expand('%')). + \ ' '.syntastic#c#GetIncludeDirs('c') + + " determine whether to parse header files as well + if expand('%') =~? '.h$' + if exists('g:syntastic_c_check_header') + let makeprg = 'gcc -c '.shellescape(expand('%')). + \ ' '.syntastic#c#GetIncludeDirs('c') + else + return [] + endif + endif + + " check if the user manually set some cflags + if !exists('b:syntastic_c_cflags') + " check whether to search for include files at all + if !exists('g:syntastic_c_no_include_search') || + \ g:syntastic_c_no_include_search != 1 + " refresh the include file search if desired + if exists('g:syntastic_c_auto_refresh_includes') && + \ g:syntastic_c_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + " search for header includes if not cached already + if !exists('b:syntastic_c_includes') + let b:syntastic_c_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_c_includes + endif + endif + else + " use the user-defined cflags + let makeprg .= b:syntastic_c_cflags + endif + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_c_remove_include_errors') && + \ g:syntastic_c_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/bundle/git_syntastic/syntax_checkers/coffee.vim b/bundle/git_syntastic/syntax_checkers/coffee.vim new file mode 100644 index 0000000..59dca75 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/coffee.vim @@ -0,0 +1,27 @@ +"============================================================================ +"File: coffee.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Lincoln Stoll +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_coffee_syntax_checker") + finish +endif +let loaded_coffee_syntax_checker = 1 + +"bail if the user doesnt have coffee installed +if !executable("coffee") + finish +endif + +function! SyntaxCheckers_coffee_GetLocList() + let makeprg = 'coffee -c -l -o /tmp '.shellescape(expand('%')) + let errorformat = 'Syntax%trror: In %f\, %m on line %l,%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/cpp.vim b/bundle/git_syntastic/syntax_checkers/cpp.vim new file mode 100644 index 0000000..7fe2e0e --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/cpp.vim @@ -0,0 +1,121 @@ +"============================================================================ +"File: cpp.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" in order to also check header files add this to your .vimrc: +" (this usually creates a .gch file in your source directory) +" +" let g:syntastic_cpp_check_header = 1 +" +" To disable the search of included header files after special +" libraries like gtk and glib add this line to your .vimrc: +" +" let g:syntastic_cpp_no_include_search = 1 +" +" In order to add some custom include directories that should be added to the +" gcc command line you can add those to the global variable +" g:syntastic_cpp_include_dirs. This list can be used like this: +" +" let g:syntastic_cpp_include_dirs = [ 'includes', 'headers' ] +" +" To enable header files being re-checked on every file write add the +" following line to your .vimrc. Otherwise the header files are checked only +" one time on initially loading the file. +" In order to force syntastic to refresh the header includes simply +" unlet b:syntastic_cpp_includes. Then the header files are being re-checked +" on the next file write. +" +" let g:syntastic_cpp_auto_refresh_includes = 1 +" +" Alternatively you can set the buffer local variable b:syntastic_cpp_cflags. +" If this variable is set for the current buffer no search for additional +" libraries is done. I.e. set the variable like this: +" +" let b:syntastic_cpp_cflags = ' -I/usr/include/libsoup-2.4' +" +" Moreover it is possible to add additional compiler options to the syntax +" checking execution via the variable 'g:syntastic_cpp_compiler_options': +" +" let g:syntastic_cpp_compiler_options = ' -std=c++0x' +" +" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can +" specify whether errors of files included via the +" g:syntastic_cpp_include_dirs' setting are removed from the result set: +" +" let g:syntastic_cpp_remove_include_errors = 1 + +if exists('loaded_cpp_syntax_checker') + finish +endif +let loaded_cpp_syntax_checker = 1 + +if !executable('g++') + finish +endif + +let s:save_cpo = &cpo +set cpo&vim + +function! SyntaxCheckers_cpp_GetLocList() + let makeprg = 'g++ -fsyntax-only ' + let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' + + if exists('g:syntastic_cpp_compiler_options') + let makeprg .= g:syntastic_cpp_compiler_options + endif + + let makeprg .= ' ' . shellescape(expand('%')) . + \ ' ' . syntastic#c#GetIncludeDirs('cpp') + + if expand('%') =~? '\%(.h\|.hpp\|.hh\)$' + if exists('g:syntastic_cpp_check_header') + let makeprg = 'g++ -c '.shellescape(expand('%')). + \ ' ' . syntastic#c#GetIncludeDirs('cpp') + else + return [] + endif + endif + + if !exists('b:syntastic_cpp_cflags') + if !exists('g:syntastic_cpp_no_include_search') || + \ g:syntastic_cpp_no_include_search != 1 + if exists('g:syntastic_cpp_auto_refresh_includes') && + \ g:syntastic_cpp_auto_refresh_includes != 0 + let makeprg .= syntastic#c#SearchHeaders() + else + if !exists('b:syntastic_cpp_includes') + let b:syntastic_cpp_includes = syntastic#c#SearchHeaders() + endif + let makeprg .= b:syntastic_cpp_includes + endif + endif + else + let makeprg .= b:syntastic_cpp_cflags + endif + + " process makeprg + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat }) + + " filter the processed errors if desired + if exists('g:syntastic_cpp_remove_include_errors') && + \ g:syntastic_cpp_remove_include_errors != 0 + return filter(errors, + \ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr('')) + else + return errors + endif +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/bundle/git_syntastic/syntax_checkers/css.vim b/bundle/git_syntastic/syntax_checkers/css.vim new file mode 100644 index 0000000..99a16b8 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/css.vim @@ -0,0 +1,31 @@ +"============================================================================ +"File: css.vim +"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net). +"Maintainer: Ory Band +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if exists("loaded_css_syntax_checker") + finish +endif +let loaded_css_syntax_checker = 1 + +" Bail if the user doesn't have `csslint` installed. +if !executable("csslint") + finish +endif + +function! SyntaxCheckers_css_GetLocList() + let makeprg = 'csslint --format=compact '.shellescape(expand('%')) + + " Print CSS Lint's error/warning messages from compact format. Ignores blank lines. + let errorformat = '%-G,%-G%f: lint free!,%f: line %l\, col %c\, %trror - %m,%f: line %l\, col %c\, %tarning - %m,%f: line %l\, col %c\, %m,' + + return SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) + +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/cucumber.vim b/bundle/git_syntastic/syntax_checkers/cucumber.vim new file mode 100644 index 0000000..c9a87e1 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/cucumber.vim @@ -0,0 +1,27 @@ +"============================================================================ +"File: cucumber.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_cucumber_syntax_checker") + finish +endif +let loaded_cucumber_syntax_checker = 1 + +"bail if the user doesnt have cucumber installed +if !executable("cucumber") + finish +endif + +function! SyntaxCheckers_cucumber_GetLocList() + let makeprg = 'cucumber --dry-run --quiet --strict --format pretty '.shellescape(expand('%')) + let errorformat = '%f:%l:%c:%m,%W %.%# (%m),%-Z%f:%l:%.%#,%-G%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/cuda.vim b/bundle/git_syntastic/syntax_checkers/cuda.vim new file mode 100644 index 0000000..816505e --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/cuda.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: cuda.vim +"Description: Syntax checking plugin for syntastic.vim +" +"Author: Hannes Schulz +" +"============================================================================ + +" in order to also check header files add this to your .vimrc: +" (this creates an empty .syntastic_dummy.cu file in your source directory) +" +" let g:syntastic_cuda_check_header = 1 + +if exists('loaded_cuda_syntax_checker') + finish +endif +let loaded_cuda_syntax_checker = 1 + +if !executable('nvcc') + finish +endif + +function! SyntaxCheckers_cuda_GetLocList() + let makeprg = 'nvcc --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null' + "let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' + let errorformat = '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m' + + if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$' + if exists('g:syntastic_cuda_check_header') + let makeprg = 'echo > .syntastic_dummy.cu ; nvcc --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null' + else + return [] + endif + endif + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/docbk.vim b/bundle/git_syntastic/syntax_checkers/docbk.vim new file mode 100644 index 0000000..cd360e4 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/docbk.vim @@ -0,0 +1,29 @@ +"============================================================================ +"File: docbk.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_docbk_syntax_checker") + finish +endif +let loaded_docbk_syntax_checker = 1 + +"bail if the user doesnt have tidy or grep installed +if !executable("xmllint") + finish +endif + +function! SyntaxCheckers_docbk_GetLocList() + + let makeprg="xmllint --xinclude --noout --postvalid ".shellescape(expand(%:p)) + let errorformat='%E%f:%l: parser error : %m,%W%f:%l: parser warning : %m,%E%f:%l:%.%# validity error : %m,%W%f:%l:%.%# validity warning : %m,%-Z%p^,%-C%.%#,%-G%.%#' + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + return loclist +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/efm_perl.pl b/bundle/git_syntastic/syntax_checkers/efm_perl.pl new file mode 100644 index 0000000..570d6e7 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/efm_perl.pl @@ -0,0 +1,153 @@ +#!/usr/bin/perl -w + +# vimparse.pl - Reformats the error messages of the Perl interpreter for use +# with the quickfix mode of Vim +# +# Copyright (©) 2001 by Jörg Ziefle +# You may use and distribute this software under the same terms as Perl itself. +# +# Usage: put one of the two configurations below in your ~/.vimrc (without the +# description and '# ') and enjoy (be sure to adjust the paths to vimparse.pl +# before): +# +# Program is run interactively with 'perl -w': +# +# set makeprg=$HOME/bin/vimparse.pl\ %\ $* +# set errorformat=%f:%l:%m +# +# Program is only compiled with 'perl -wc': +# +# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $* +# set errorformat=%f:%l:%m +# +# Usage: +# vimparse.pl [-c] [-f ] [programargs] +# +# -c compile only, don't run (perl -wc) +# -f write errors to +# +# Example usages: +# * From the command line: +# vimparse.pl program.pl +# +# vimparse.pl -c -f errorfile program.pl +# Then run vim -q errorfile to edit the errors with Vim. +# +# * From Vim: +# Edit in Vim (and save, if you don't have autowrite on), then +# type ':mak' or ':mak args' (args being the program arguments) +# to error check. +# +# Version history: +# 0.2 (04/12/2001): +# * First public version (sent to Bram) +# * -c command line option for compiling only +# * grammatical fix: 'There was 1 error.' +# * bug fix for multiple arguments +# * more error checks +# * documentation (top of file, &usage) +# * minor code clean ups +# 0.1 (02/02/2001): +# * Initial version +# * Basic functionality +# +# Todo: +# * test on more systems +# * use portable way to determine the location of perl ('use Config') +# * include option that shows perldiag messages for each error +# * allow to pass in program by STDIN +# * more intuitive behaviour if no error is found (show message) +# +# Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for +# you. + +use strict; +use Getopt::Std; + +use vars qw/$opt_c $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars' + +use constant VERSION => 0.2; + +getopts('cf:h'); + +&usage if $opt_h; # not necessarily needed, but good for further extension + +if (defined $opt_f) { + + open FILE, "> $opt_f" or do { + warn "Couldn't open $opt_f: $!. Using STDOUT instead.\n"; + undef $opt_f; + }; + +}; + +my $handle = (defined $opt_f ? \*FILE : \*STDOUT); + +(my $file = shift) or &usage; # display usage if no filename is supplied +my $args = (@ARGV ? ' ' . join ' ', @ARGV : ''); + +my @lines = `perl @{[defined $opt_c ? '-c ' : '' ]} -w "$file$args" 2>&1`; + +my $errors = 0; +foreach my $line (@lines) { + + chomp($line); + my ($file, $lineno, $message, $rest); + + if ($line =~ /^(.*)\sat\s(.*)\sline\s(\d+)(\.|,\snear\s\".*\")$/) { + + ($message, $file, $lineno, $rest) = ($1, $2, $3, $4); + $errors++; + $message .= $rest if ($rest =~ s/^,//); + print $handle "$file:$lineno:$message\n"; + + } else { next }; + +} + +if (defined $opt_f) { + + my $msg; + if ($errors == 1) { + + $msg = "There was 1 error.\n"; + + } else { + + $msg = "There were $errors errors.\n"; + + }; + + print STDOUT $msg; + close FILE; + unlink $opt_f unless $errors; + +}; + +sub usage { + + (local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program + print<] [programargs] + + -c compile only, don't run (executes 'perl -wc') + -f write errors to + +Examples: + * At the command line: + $0 program.pl + Displays output on STDOUT. + + $0 -c -f errorfile program.pl + Then run 'vim -q errorfile' to edit the errors with Vim. + + * In Vim: + Edit in Vim (and save, if you don't have autowrite on), then + type ':mak' or ':mak args' (args being the program arguments) + to error check. +EOT + + exit 0; + +}; diff --git a/bundle/git_syntastic/syntax_checkers/erlang.vim b/bundle/git_syntastic/syntax_checkers/erlang.vim new file mode 100644 index 0000000..d7dceae --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/erlang.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: erlang.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Pawel Salata +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_erlang_syntax_checker") + finish +endif +let loaded_erlang_syntax_checker = 1 + +"bail if the user doesnt have escript installed +if !executable("escript") + finish +endif + +let s:check_file = expand(':p:h') . '/erlang_check_file.erl' + +function! SyntaxCheckers_erlang_GetLocList() + let extension = expand('%:e') + if match(extension, 'hrl') >= 0 + return [] + endif + let shebang = getbufline(bufnr('%'), 1)[0] + if len(shebang) > 0 + if match(shebang, 'escript') >= 0 + let makeprg = 'escript -s '.shellescape(expand('%:p')) + else + let makeprg = s:check_file . ' '. shellescape(expand('%:p')) + endif + else + let makeprg = s:check_file . ' ' . shellescape(expand('%:p')) + endif + let errorformat = '%f:%l:\ %tarning:\ %m,%E%f:%l:\ %m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl b/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl new file mode 100755 index 0000000..8a85bf6 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/erlang_check_file.erl @@ -0,0 +1,12 @@ +#!/usr/bin/env escript +-export([main/1]). + +main([FileName]) -> + compile:file(FileName, [warn_obsolete_guard, + warn_unused_import, + warn_shadow_vars, + warn_export_vars, + strong_validation, + report, + {i, filename:dirname(FileName) ++ "/../include"} + ]). diff --git a/bundle/git_syntastic/syntax_checkers/eruby.vim b/bundle/git_syntastic/syntax_checkers/eruby.vim new file mode 100644 index 0000000..fcff063 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/eruby.vim @@ -0,0 +1,34 @@ +"============================================================================ +"File: eruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_eruby_syntax_checker") + finish +endif +let loaded_eruby_syntax_checker = 1 + +"bail if the user doesnt have ruby or cat installed +if !executable("ruby") || !executable("cat") + finish +endif + +function! SyntaxCheckers_eruby_GetLocList() + if has('win32') || has('win64') + let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| ruby -c' + else + let makeprg='sed "s/<\%=/<\%/g" '. shellescape(expand("%")) . ' \| RUBYOPT= ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| RUBYOPT= ruby -c' + endif + + let errorformat='%-GSyntax OK,%E-:%l: syntax error\, %m,%Z%p^,%W-:%l: warning: %m,%Z%p^,%-C%.%#' + return SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) + +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/fortran.vim b/bundle/git_syntastic/syntax_checkers/fortran.vim new file mode 100644 index 0000000..ee176f2 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/fortran.vim @@ -0,0 +1,44 @@ +"============================================================================ +"File: fortran.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Karl Yngve LervÃ¥g +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"Note: This syntax checker uses gfortran with the option -fsyntax-only +" to check for errors and warnings. Additional flags may be +" supplied through both local and global variables, +" b:syntastic_fortran_flags, +" g:syntastic_fortran_flags. +" This is particularly useful when the source requires module files +" in order to compile (that is when it needs modules defined in +" separate files). +" +"============================================================================ + +if exists("loaded_fortran_syntax_checker") + finish +endif +let loaded_fortran_syntax_checker = 1 + +"bail if the user doesnt have fortran installed +if !executable("gfortran") + finish +endif + +if !exists('g:syntastic_fortran_flags') + let g:syntastic_fortran_flags = '' +endif + +function! SyntaxCheckers_fortran_GetLocList() + let makeprg = 'gfortran -fsyntax-only' + let makeprg .= g:syntastic_fortran_flags + if exists('b:syntastic_fortran_flags') + let makeprg .= b:syntastic_fortran_flags + endif + let makeprg .= ' ' . shellescape(expand('%')) + let errorformat = '%-C %#,%-C %#%.%#,%A%f:%l.%c:,%Z%m,%G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/gentoo_metadata.vim b/bundle/git_syntastic/syntax_checkers/gentoo_metadata.vim new file mode 100644 index 0000000..d016a88 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/gentoo_metadata.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: gentoo-metadata.vim +"Description: Syntax checking plugin for Gentoo's metadata.xml files +"Maintainer: James Rowe +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" The DTDs required to validate metadata.xml files are available in +" $PORTDIR/metadata/dtd, and these local files can be used to significantly +" speed up validation. You can create a catalog file with: +" +" xmlcatalog --create --add rewriteURI http://www.gentoo.org/dtd/ \ +" ${PORTDIR:-/usr/portage}/metadata/dtd/ /etc/xml/gentoo +" +" See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more +" information. + +if exists("loaded_gentoo_metadata_syntax_checker") + finish +endif +let loaded_gentoo_metadata_syntax_checker = 1 + +"bail if the user doesn't have xmllint installed +if !executable("xmllint") + finish +endif + +runtime syntax_checkers/xml.vim + +function! SyntaxCheckers_gentoo_metadata_GetLocList() + return SyntaxCheckers_xml_GetLocList() +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/go.vim b/bundle/git_syntastic/syntax_checkers/go.vim new file mode 100644 index 0000000..395ae11 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/go.vim @@ -0,0 +1,22 @@ +"============================================================================ +"File: go.vim +"Description: Loads a go syntax checker from the go directory +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" Use g:syntastic_go_checker option to specify which go executable +" should be used (see below for a list of supported checkers). +" If g:syntastic_go_checker is not set, just use the first syntax +" checker that we find installed. +"============================================================================ +if exists("loaded_go_syntax_checker") + finish +endif +let loaded_go_syntax_checker = 1 + +let s:supported_checkers = ["6g", "gofmt"] +call SyntasticLoadChecker(s:supported_checkers) diff --git a/bundle/git_syntastic/syntax_checkers/go/6g.vim b/bundle/git_syntastic/syntax_checkers/go/6g.vim new file mode 100644 index 0000000..1a4249e --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/go/6g.vim @@ -0,0 +1,17 @@ +"============================================================================ +"File: 6g.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sam Nguyen +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +function! SyntaxCheckers_go_GetLocList() + let makeprg = '6g -o /dev/null %' + let errorformat = '%E%f:%l: %m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/go/gofmt.vim b/bundle/git_syntastic/syntax_checkers/go/gofmt.vim new file mode 100644 index 0000000..77abe7e --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/go/gofmt.vim @@ -0,0 +1,16 @@ +"============================================================================ +"File: gofmt.vim +"Description: Check go syntax using gofmt +"Maintainer: Brandon Thomson +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +function! SyntaxCheckers_go_GetLocList() + let makeprg = 'gofmt %' + let errorformat = '%f:%l:%c: %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/haml.vim b/bundle/git_syntastic/syntax_checkers/haml.vim new file mode 100644 index 0000000..b9ad6ad --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/haml.vim @@ -0,0 +1,26 @@ +"============================================================================ +"File: haml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_haml_syntax_checker") + finish +endif +let loaded_haml_syntax_checker = 1 + +"bail if the user doesnt have the haml binary installed +if !executable("haml") + finish +endif + +function! SyntaxCheckers_haml_GetLocList() + let makeprg = "haml -c " . shellescape(expand("%")) + let errorformat = 'Haml error on line %l: %m,Syntax error on line %l: %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/haskell.vim b/bundle/git_syntastic/syntax_checkers/haskell.vim new file mode 100644 index 0000000..07c55e8 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/haskell.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: haskell.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_haskell_syntax_checker") + finish +endif +let loaded_haskell_syntax_checker = 1 + +"bail if the user doesnt have ghc-mod installed +if !executable("ghc-mod") + finish +endif + +function! SyntaxCheckers_haskell_GetLocList() + let makeprg = + \ "{ ". + \ "ghc-mod check ". shellescape(expand('%')) . "; " . + \ "ghc-mod lint " . shellescape(expand('%')) . ";" . + \ " }" + let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'. + \ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'. + \ '%E%f:%l:%c:,%Z%m,' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + +function! SyntaxCheckers_lhaskell_GetLocList() + return SyntaxCheckers_haskell_GetLocList() +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/haxe.vim b/bundle/git_syntastic/syntax_checkers/haxe.vim new file mode 100644 index 0000000..22183ee --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/haxe.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: haxe.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: David Bernard +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_haxe_syntax_checker") + finish +endif +let loaded_haxe_syntax_checker = 1 + +"bail if the user doesn't have haxe installed +if !executable("haxe") + finish +endif + +" s:FindInParent +" find the file argument and returns the path to it. +" Starting with the current working dir, it walks up the parent folders +" until it finds the file, or it hits the stop dir. +" If it doesn't find it, it returns "Nothing" +function! s:FindInParent(fln,flsrt,flstp) + let here = a:flsrt + while ( strlen( here) > 0 ) + let p = split(globpath(here, a:fln), '\n') + if len(p) > 0 + return ['ok', here, fnamemodify(p[0], ':p:t')] + endif + let fr = match(here, '/[^/]*$') + if fr == -1 + break + endif + let here = strpart(here, 0, fr) + if here == a:flstp + break + endif + endwhile + return ['fail', '', ''] +endfunction + +function! SyntaxCheckers_haxe_GetLocList() + let [success, hxmldir, hxmlname] = s:FindInParent('*.hxml', expand('%:p:h'), '/') + if success == 'ok' + let makeprg = 'cd ' . hxmldir . '; haxe ' . hxmlname + let errorformat = '%E%f:%l: characters %c-%*[0-9] : %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + else + return SyntasticMake({}) + endif +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/html.vim b/bundle/git_syntastic/syntax_checkers/html.vim new file mode 100644 index 0000000..2c1b8b4 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/html.vim @@ -0,0 +1,86 @@ +"============================================================================ +"File: html.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_html_syntax_checker") + finish +endif +let loaded_html_syntax_checker = 1 + +"bail if the user doesnt have tidy or grep installed +if !executable("tidy") || !executable("grep") + finish +endif + +" TODO: join this with xhtml.vim for DRY's sake? +function! s:TidyEncOptByFenc() + let tidy_opts = { + \'utf-8' : '-utf8', + \'ascii' : '-ascii', + \'latin1' : '-latin1', + \'iso-2022-jp' : '-iso-2022', + \'cp1252' : '-win1252', + \'macroman' : '-mac', + \'utf-16le' : '-utf16le', + \'utf-16' : '-utf16', + \'big5' : '-big5', + \'sjis' : '-shiftjis', + \'cp850' : '-ibm858', + \} + return get(tidy_opts, &fileencoding, '-utf8') +endfunction + +let s:ignore_html_errors = [ + \ " lacks \"summary\" attribute", + \ "not approved by W3C", + \ "attribute \"placeholder\"", + \ " proprietary attribute \"charset\"", + \ " lacks \"content\" attribute", + \ "inserting \"type\" attribute", + \ "proprietary attribute \"data-" + \] + +function! s:ValidateError(text) + let valid = 0 + for i in s:ignore_html_errors + if stridx(a:text, i) != -1 + let valid = 1 + break + endif + endfor + return valid +endfunction + + +function! SyntaxCheckers_html_GetLocList() + + let encopt = s:TidyEncOptByFenc() + let makeprg="tidy ".encopt." --new-blocklevel-tags ".shellescape('section, article, aside, hgroup, header, footer, nav, figure, figcaption')." --new-inline-tags ".shellescape('video, audio, embed, mark, progress, meter, time, ruby, rt, rp, canvas, command, details, datalist')." --new-empty-tags ".shellescape('wbr, keygen')." -e ".shellescape(expand('%'))." 2>&1" + let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#' + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + " process loclist since we need to add some info and filter out valid HTML5 + " from the errors + let n = len(loclist) - 1 + let bufnum = bufnr("") + while n >= 0 + let i = loclist[n] + " filter out valid HTML5 + if s:ValidateError(i['text']) == 1 + unlet loclist[n] + else + "the file name isnt in the output so stick in the buf num manually + let i['bufnr'] = bufnum + endif + let n -= 1 + endwhile + + return loclist +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/javascript.vim b/bundle/git_syntastic/syntax_checkers/javascript.vim new file mode 100644 index 0000000..026c737 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/javascript.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: javascript.vim +"Description: Figures out which javascript syntax checker (if any) to load +" from the javascript directory. +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" Use g:syntastic_javascript_checker option to specify which jslint executable +" should be used (see below for a list of supported checkers). +" If g:syntastic_javascript_checker is not set, just use the first syntax +" checker that we find installed. +"============================================================================ +if exists("loaded_javascript_syntax_checker") + finish +endif +let loaded_javascript_syntax_checker = 1 + +let s:supported_checkers = ["gjslint", "jslint", "jsl", "jshint"] +call SyntasticLoadChecker(s:supported_checkers) diff --git a/bundle/git_syntastic/syntax_checkers/javascript/gjslint.vim b/bundle/git_syntastic/syntax_checkers/javascript/gjslint.vim new file mode 100644 index 0000000..05e1c0f --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/javascript/gjslint.vim @@ -0,0 +1,20 @@ +"============================================================================ +"File: gjslint.vim +"Description: Javascript syntax checker - using gjslint +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if !exists("g:syntastic_javascript_gjslint_conf") + let g:syntastic_javascript_gjslint_conf = "" +endif + +function! SyntaxCheckers_javascript_GetLocList() + let makeprg = "gjslint " . g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep " . shellescape(expand('%')) + let errorformat="%f:%l:(New Error -%\\?\%n) %m,%f:%l:(-%\\?%n) %m,%-G1 files checked, no errors found.,%-G%.%#" + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/javascript/jshint.vim b/bundle/git_syntastic/syntax_checkers/javascript/jshint.vim new file mode 100644 index 0000000..164b7bd --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/javascript/jshint.vim @@ -0,0 +1,21 @@ +"============================================================================ +"File: jshint.vim +"Description: Javascript syntax checker - using jshint +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if !exists("g:syntastic_javascript_jshint_conf") + let g:syntastic_javascript_jshint_conf = "" +endif + +function! SyntaxCheckers_javascript_GetLocList() + " node-jshint uses .jshintrc as config unless --config arg is present + let args = !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : '' + let makeprg = 'jshint ' . shellescape(expand("%")) . args + let errorformat = '%ELine %l:%c,%Z\\s%#Reason: %m,%C%.%#,%f: line %l\, col %c\, %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/javascript/jsl.vim b/bundle/git_syntastic/syntax_checkers/javascript/jsl.vim new file mode 100644 index 0000000..36c7efc --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/javascript/jsl.vim @@ -0,0 +1,20 @@ +"============================================================================ +"File: jsl.vim +"Description: Javascript syntax checker - using jsl +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ +if !exists("g:syntastic_javascript_jsl_conf") + let g:syntastic_javascript_jsl_conf = "" +endif + +function! SyntaxCheckers_javascript_GetLocList() + let makeprg = "jsl " . g:syntastic_javascript_jsl_conf . " -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%')) + let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/javascript/jslint.vim b/bundle/git_syntastic/syntax_checkers/javascript/jslint.vim new file mode 100644 index 0000000..a503a95 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/javascript/jslint.vim @@ -0,0 +1,28 @@ +"============================================================================ +"File: jslint.vim +"Description: Javascript syntax checker - using jslint +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"Tested with jslint 0.1.4. +"============================================================================ +if !exists("g:syntastic_javascript_jslint_conf") + let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars" +endif + +function! SyntaxCheckers_javascript_HighlightTerm(error) + let unexpected = matchstr(a:error['text'], 'Expected.*and instead saw \'\zs.*\ze\'') + if len(unexpected) < 1 | return '' | end + return '\V'.split(unexpected, "'")[1] +endfunction + +function! SyntaxCheckers_javascript_GetLocList() + let makeprg = "jslint " . g:syntastic_javascript_jslint_conf . " " . shellescape(expand('%')) + let errorformat='%E %##%n %m,%-Z%.%#Line %l\, Pos %c,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/json.vim b/bundle/git_syntastic/syntax_checkers/json.vim new file mode 100644 index 0000000..2d2652d --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/json.vim @@ -0,0 +1,23 @@ +"============================================================================ +"File: json.vim +"Description: Figures out which json syntax checker (if any) to load +" from the json directory. +"Maintainer: Miller Medeiros +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" Use g:syntastic_json_checker option to specify which jsonlint executable +" should be used (see below for a list of supported checkers). +" If g:syntastic_json_checker is not set, just use the first syntax +" checker that we find installed. +"============================================================================ +if exists("loaded_json_syntax_checker") + finish +endif +let loaded_json_syntax_checker = 1 + +let s:supported_checkers = ["jsonlint", "jsonval"] +call SyntasticLoadChecker(s:supported_checkers) diff --git a/bundle/git_syntastic/syntax_checkers/json/jsonlint.vim b/bundle/git_syntastic/syntax_checkers/json/jsonlint.vim new file mode 100644 index 0000000..6e4a4c0 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/json/jsonlint.vim @@ -0,0 +1,16 @@ +"============================================================================ +"File: jsonlint.vim +"Description: JSON syntax checker - using jsonlint +"Maintainer: Miller Medeiros +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ + +function! SyntaxCheckers_json_GetLocList() + let makeprg = 'jsonlint ' . shellescape(expand("%")) . ' --compact' + let errorformat = '%ELine %l:%c,%Z\\s%#Reason: %m,%C%.%#,%f: line %l\, col %c\, %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/json/jsonval.vim b/bundle/git_syntastic/syntax_checkers/json/jsonval.vim new file mode 100644 index 0000000..f288039 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/json/jsonval.vim @@ -0,0 +1,17 @@ +"============================================================================ +"File: jsonval.vim +"Description: JSON syntax checker - using jsonval +"Maintainer: Miller Medeiros +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +"============================================================================ + +function! SyntaxCheckers_json_GetLocList() + " based on https://gist.github.com/1196345 + let makeprg = 'jsonval '. shellescape(expand('%')) + let errorformat = '%E%f:\ %m\ at\ line\ %l,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/less.vim b/bundle/git_syntastic/syntax_checkers/less.vim new file mode 100644 index 0000000..1338ffd --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/less.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: less.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Julien Blanchard +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_less_syntax_checker") + finish +endif +let loaded_less_syntax_checker = 1 + +"bail if the user doesnt have the lessc binary installed +if !executable("lessc") + finish +endif + +if !exists("g:syntastic_less_options") + let g:syntastic_less_options = "--no-color" +endif + +function! SyntaxCheckers_less_GetLocList() + let makeprg = 'lessc '. g:syntastic_less_options .' '. shellescape(expand('%')) . ' /dev/null' + + "lessc >= 1.2 + let errorformat = '%m in %f:%l:%c' + "lessc < 1.2 + let errorformat .= ', Syntax %trror on line %l in %f,Syntax %trror on line %l,! Syntax %trror: on line %l: %m,%-G%.%#' + + return SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/lua.vim b/bundle/git_syntastic/syntax_checkers/lua.vim new file mode 100644 index 0000000..1fe3745 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/lua.vim @@ -0,0 +1,55 @@ +"============================================================================ +"File: lua.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('loaded_lua_syntax_checker') + finish +endif +let loaded_lua_syntax_checker = 1 + +" check if the lua compiler is installed +if !executable('luac') + finish +endif + +function! SyntaxCheckers_lua_GetHighlightRegex(pos) + let near = matchstr(a:pos['text'], "near '[^']\\+'") + let result = '' + if len(near) > 0 + let near = split(near, "'")[1] + if near == '' + let p = getpos('$') + let a:pos['lnum'] = p[1] + let a:pos['col'] = p[2] + let result = '\%'.p[2].'c' + else + let result = '\V'.near + endif + let open = matchstr(a:pos['text'], "(to close '[^']\\+' at line [0-9]\\+)") + if len(open) > 0 + let oline = split(open, "'")[1:2] + let line = 0+strpart(oline[1], 9) + call matchadd('SpellCap', '\%'.line.'l\V'.oline[0]) + endif + endif + return result +endfunction + +function! SyntaxCheckers_lua_GetLocList() + let makeprg = 'luac -p ' . shellescape(expand('%')) + let errorformat = 'luac: %#%f:%l: %m' + + return SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } }) + +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/matlab.vim b/bundle/git_syntastic/syntax_checkers/matlab.vim new file mode 100644 index 0000000..595b312 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/matlab.vim @@ -0,0 +1,28 @@ +"============================================================================ +"File: matlab.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Jason Graham +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("loaded_matlab_syntax_checker") + finish +endif +let loaded_matlab_syntax_checker = 1 + +"bail if the user doesn't have mlint installed +if !executable("mlint") + finish +endif + +function! SyntaxCheckers_matlab_GetLocList() + let makeprg = 'mlint -id $* '.shellescape(expand('%')) + let errorformat = 'L %l (C %c): %*[a-zA-Z0-9]: %m,L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/nasm.vim b/bundle/git_syntastic/syntax_checkers/nasm.vim new file mode 100644 index 0000000..f42cc8c --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/nasm.vim @@ -0,0 +1,32 @@ +"============================================================================ +"File: nasm.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: HÃ¥vard Pettersson +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_nasm_syntax_checker") + finish +endif +let loaded_nasm_syntax_checker = 1 + +"bail if the user doesnt have nasm installed +if !executable("nasm") + finish +endif + +function! SyntaxCheckers_nasm_GetLocList() + if has("win32") + let outfile="NUL" + else + let outfile="/dev/null" + endif + let wd = shellescape(expand("%:p:h") . "/") + let makeprg = "nasm -X gnu -f elf -I " . wd . " -o " . outfile . " " . shellescape(expand("%")) + let errorformat = '%f:%l: %t%*[^:]: %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/ocaml.vim b/bundle/git_syntastic/syntax_checkers/ocaml.vim new file mode 100644 index 0000000..6a2470f --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/ocaml.vim @@ -0,0 +1,89 @@ +"============================================================================ +"File: ocaml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Török Edwin +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +" +" By default the camlp4o preprocessor is used to check the syntax of .ml, and .mli files, +" ocamllex is used to check .mll files and menhir is used to check .mly files. +" The output is all redirected to /dev/null, nothing is written to the disk. +" +" If your source code needs camlp4r then you can define this in your .vimrc: +" +" let g:syntastic_ocaml_camlp4r = 1 +" +" If you used some syntax extensions, or you want to also typecheck the source +" code, then you can define this: +" +" let g:syntastic_ocaml_use_ocamlbuild = 1 +" +" This will run ocamlbuild .inferred.mli, so it will write to your _build +" directory (and possibly rebuild your myocamlbuild.ml plugin), only enable this +" if you are ok with that. +" +" If you are using syntax extensions / external libraries and have a properly +" set up _tags (and myocamlbuild.ml file) then it should just work +" to enable this flag and get syntax / type checks through syntastic. +" +" For best results your current directory should be the project root +" (same situation if you want useful output from :make). + +if exists("loaded_ocaml_syntax_checker") + finish +endif +let loaded_ocaml_syntax_checker = 1 + +if exists('g:syntastic_ocaml_camlp4r') && + \ g:syntastic_ocaml_camlp4r != 0 + let s:ocamlpp="camlp4r" +else + let s:ocamlpp="camlp4o" +endif + +"bail if the user doesnt have the preprocessor +if !executable(s:ocamlpp) + finish +endif + +function! SyntaxCheckers_ocaml_GetLocList() + if exists('g:syntastic_ocaml_use_ocamlbuild') && + \ g:syntastic_ocaml_use_ocamlbuild != 0 && + \ executable("ocamlbuild") && + \ isdirectory('_build') + let makeprg = "ocamlbuild -quiet -no-log -tag annot,". s:ocamlpp. " -no-links -no-hygiene -no-sanitize ". + \ shellescape(expand('%:r')).".cmi" + else + let extension = expand('%:e') + if match(extension, 'mly') >= 0 + " ocamlyacc output can't be redirected, so use menhir + if !executable("menhir") + return [] + endif + let makeprg = "menhir --only-preprocess ".shellescape(expand('%')) . " >/dev/null" + elseif match(extension,'mll') >= 0 + if !executable("ocamllex") + return [] + endif + let makeprg = "ocamllex -q -o /dev/null ".shellescape(expand('%')) + else + let makeprg = "camlp4o -o /dev/null ".shellescape(expand('%')) + endif + endif + let errorformat = '%AFile "%f"\, line %l\, characters %c-%*\d:,'. + \ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'. + \ '%AFile "%f"\, line %l\, character %c:,'. + \ '%AFile "%f"\, line %l\, character %c:%m,'. + \ '%-GPreprocessing error %.%#,'. + \ '%-GCommand exited %.%#,'. + \ '%C%tarning %n: %m,'. + \ '%C%m,'. + \ '%-G+%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/perl.vim b/bundle/git_syntastic/syntax_checkers/perl.vim new file mode 100644 index 0000000..e8aa577 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/perl.vim @@ -0,0 +1,29 @@ +"============================================================================ +"File: perl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Anthony Carapetis +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_perl_syntax_checker") + finish +endif +let loaded_perl_syntax_checker = 1 + +"bail if the user doesnt have perl installed +if !executable("perl") + finish +endif + +let s:checker = 'perl ' . shellescape(expand(':p:h') . '/efm_perl.pl') . ' -c' + +function! SyntaxCheckers_perl_GetLocList() + let makeprg = s:checker . ' ' . shellescape(expand('%')) + let errorformat = '%f:%l:%m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/php.vim b/bundle/git_syntastic/syntax_checkers/php.vim new file mode 100644 index 0000000..99c3eca --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/php.vim @@ -0,0 +1,58 @@ +"============================================================================ +"File: php.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_php_syntax_checker") + finish +endif +let loaded_php_syntax_checker = 1 + +"bail if the user doesnt have php installed +if !executable("php") + finish +endif + +"Support passing configuration directives to phpcs +if !exists("g:syntastic_phpcs_conf") + let g:syntastic_phpcs_conf = "" +endif + +if !exists("g:syntastic_phpcs_disable") + let g:syntastic_phpcs_disable = 0 +endif + +function! SyntaxCheckers_php_GetHighlightRegex(item) + let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'") + if len(unexpected) < 1 + return '' + endif + return '\V'.split(unexpected, "'")[1] +endfunction + +function! SyntaxCheckers_php_GetLocList() + + let errors = [] + + let makeprg = "php -l -d error_reporting=E_PARSE -d display_errors=0 -d error_log='' ".shellescape(expand('%')) + let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l' + let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + if empty(errors) && !g:syntastic_phpcs_disable && executable("phpcs") + let errors = errors + s:GetPHPCSErrors() + endif + + return errors +endfunction + +function! s:GetPHPCSErrors() + let makeprg = "phpcs " . g:syntastic_phpcs_conf . " --report=csv ".shellescape(expand('%')) + let errorformat = '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype': 'Style' }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/puppet.vim b/bundle/git_syntastic/syntax_checkers/puppet.vim new file mode 100644 index 0000000..51c898e --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/puppet.vim @@ -0,0 +1,54 @@ +"============================================================================ +"File: puppet.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Eivind Uggedal +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_puppet_syntax_checker") + finish +endif +let loaded_puppet_syntax_checker = 1 + +"bail if the user doesnt have puppet installed +if !executable("puppet") + finish +endif + +function! s:ExtractVersion() + let output = system("puppet --version") + let output = substitute(output, '\n$', '', '') + return split(output, '\.') +endfunction + +let s:puppetVersion = s:ExtractVersion() + +function! SyntaxCheckers_puppet_GetLocList() + "If puppet is >= version 2.7 then use the new executable + if s:puppetVersion[0] >= '2' && s:puppetVersion[1] >= '7' + let makeprg = 'puppet parser validate ' . + \ shellescape(expand('%')) . + \ ' --color=false' . + \ ' --storeconfigs' + + "add --ignoreimport for versions < 2.7.10 + if s:puppetVersion[2] < '10' + let makeprg .= ' --ignoreimport' + endif + + else + let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%')) + endif + + "some versions of puppet (e.g. 2.7.10) output the message below if there + "are any syntax errors + let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,' + + let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/python.vim b/bundle/git_syntastic/syntax_checkers/python.vim new file mode 100644 index 0000000..93a0b52 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/python.vim @@ -0,0 +1,27 @@ +"============================================================================ +"File: python.vim +"Description: Syntax checking plugin for syntastic.vim +" +"Authors: Martin Grenfell +" kstep +" Parantapa Bhattacharya +" +" +" For forcing the use of flake8, pyflakes, or pylint set +" +" let g:syntastic_python_checker = 'pyflakes' +" +" in your .vimrc. Default is flake8. +"============================================================================ + +if exists("loaded_python_syntax_checker") + finish +endif +let loaded_python_syntax_checker = 1 + +if !exists('g:syntastic_python_checker_args') + let g:syntastic_python_checker_args = '' +endif + +let s:supported_checkers = ["flake8", "pyflakes", "pylint"] +call SyntasticLoadChecker(s:supported_checkers) diff --git a/bundle/git_syntastic/syntax_checkers/python/flake8.vim b/bundle/git_syntastic/syntax_checkers/python/flake8.vim new file mode 100644 index 0000000..ef65ab8 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/python/flake8.vim @@ -0,0 +1,31 @@ +"============================================================================ +"File: flake8.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Sylvain Soliman +" kstep +" +"============================================================================ +function! SyntaxCheckers_python_GetHighlightRegex(i) + if a:i['type'] ==# 'E' + let a:i['text'] = "Syntax error" + endif + if match(a:i['text'], 'is assigned to but never used') > -1 + \ || match(a:i['text'], 'imported but unused') > -1 + \ || match(a:i['text'], 'undefined name') > -1 + \ || match(a:i['text'], 'redefinition of') > -1 + \ || match(a:i['text'], 'referenced before assignment') > -1 + \ || match(a:i['text'], 'duplicate argument') > -1 + \ || match(a:i['text'], 'after other statements') > -1 + \ || match(a:i['text'], 'shadowed by loop variable') > -1 + + let term = split(a:i['text'], "'", 1)[1] + return '\V\<'.term.'\>' + endif + return '' +endfunction + +function! SyntaxCheckers_python_GetLocList() + let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%')) + let errorformat = '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/python/pyflakes.vim b/bundle/git_syntastic/syntax_checkers/python/pyflakes.vim new file mode 100644 index 0000000..e28e1f5 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/python/pyflakes.vim @@ -0,0 +1,34 @@ +"============================================================================ +"File: pyflakes.vim +"Description: Syntax checking plugin for syntastic.vim +"Authors: Martin Grenfell +" kstep +" Parantapa Bhattacharya +" +"============================================================================ +function! SyntaxCheckers_python_GetHighlightRegex(i) + if match(a:i['text'], 'is assigned to but never used') > -1 + \ || match(a:i['text'], 'imported but unused') > -1 + \ || match(a:i['text'], 'undefined name') > -1 + \ || match(a:i['text'], 'redefinition of') > -1 + \ || match(a:i['text'], 'referenced before assignment') > -1 + \ || match(a:i['text'], 'duplicate argument') > -1 + \ || match(a:i['text'], 'after other statements') > -1 + \ || match(a:i['text'], 'shadowed by loop variable') > -1 + + let term = split(a:i['text'], "'", 1)[1] + return '\V\<'.term.'\>' + endif + return '' +endfunction + +function! SyntaxCheckers_python_GetLocList() + let makeprg = 'pyflakes '.g:syntastic_python_checker_args.' '.shellescape(expand('%')) + let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#' + + let errors = SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'text': "Syntax error"} }) + + return errors +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/python/pylint.vim b/bundle/git_syntastic/syntax_checkers/python/pylint.vim new file mode 100644 index 0000000..62676f1 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/python/pylint.vim @@ -0,0 +1,14 @@ +"============================================================================ +"File: pylint.vim +"Description: Syntax checking plugin for syntastic.vim +"Author: Parantapa Bhattacharya +" +"============================================================================ +function! SyntaxCheckers_python_GetLocList() + let makeprg = 'pylint -f parseable -r n -i y ' . + \ shellescape(expand('%')) . + \ ' \| sed ''s_: \[[RC]_: \[W_''' . + \ ' \| sed ''s_: \[[F]_:\ \[E_''' + let errorformat = '%f:%l: [%t%n%.%#] %m,%-GNo config%m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/rst.vim b/bundle/git_syntastic/syntax_checkers/rst.vim new file mode 100644 index 0000000..848e47d --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/rst.vim @@ -0,0 +1,37 @@ +"============================================================================ +"File: rst.vim +"Description: Syntax checking plugin for docutil's reStructuredText files +"Maintainer: James Rowe +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" We use rst2pseudoxml.py, as it is ever so marginally faster than the other +" rst2${x} tools in docutils. + +if exists("loaded_rst_syntax_checker") + finish +endif +let loaded_rst_syntax_checker = 1 + +"bail if the user doesn't have rst2pseudoxml.py installed +if !executable("rst2pseudoxml.py") + finish +endif + +function! SyntaxCheckers_rst_GetLocList() + let makeprg = 'rst2pseudoxml.py --report=2 --exit-status=1 ' . + \ shellescape(expand('%')) . ' /dev/null' + + let errorformat = '%f:%l:\ (%tNFO/1)\ %m, + \%f:%l:\ (%tARNING/2)\ %m, + \%f:%l:\ (%tRROR/3)\ %m, + \%f:%l:\ (%tEVERE/4)\ %m, + \%-G%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/ruby.vim b/bundle/git_syntastic/syntax_checkers/ruby.vim new file mode 100644 index 0000000..17d00ca --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/ruby.vim @@ -0,0 +1,30 @@ +"============================================================================ +"File: ruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"Supports MRI and JRuby but loads the MRI syntax checker by default. +" +"Use the g:syntastic_ruby_checker option to specify which checker to load - +"set it to "jruby" to load the jruby checker. +"============================================================================ +if exists("loaded_ruby_syntax_checker") + finish +endif +let loaded_ruby_syntax_checker = 1 + +"bail if the user doesnt have ruby installed +if !executable("ruby") + finish +endif + +if !exists("g:syntastic_ruby_checker") + let g:syntastic_ruby_checker = "mri" +endif +exec "runtime! syntax_checkers/ruby/" . g:syntastic_ruby_checker . ".vim" + diff --git a/bundle/git_syntastic/syntax_checkers/ruby/jruby.vim b/bundle/git_syntastic/syntax_checkers/ruby/jruby.vim new file mode 100644 index 0000000..bec5168 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/ruby/jruby.vim @@ -0,0 +1,16 @@ +"============================================================================ +"File: jruby.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Leonid Shevtsov +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +function! SyntaxCheckers_ruby_GetLocList() + "let makeprg = '' + "let errorformat = '' + "return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/ruby/mri.vim b/bundle/git_syntastic/syntax_checkers/ruby/mri.vim new file mode 100644 index 0000000..50a8a11 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/ruby/mri.vim @@ -0,0 +1,22 @@ +"============================================================================ +"File: mri.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +function! SyntaxCheckers_ruby_GetLocList() + " we cannot set RUBYOPT on windows like that + if has('win32') || has('win64') + let makeprg = 'ruby -W1 -T1 -c '.shellescape(expand('%')) + else + let makeprg = 'RUBYOPT= ruby -W1 -c '.shellescape(expand('%')) + endif + let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/rust.vim b/bundle/git_syntastic/syntax_checkers/rust.vim new file mode 100644 index 0000000..fef48e8 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/rust.vim @@ -0,0 +1,33 @@ +"============================================================================ +"File: rust.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Chad Jablonski +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_rust_syntax_checker") + finish +endif +let loaded_rust_syntax_checker = 1 + +"bail if the user doesnt have rustc installed +if !executable("rustc") + finish +endif + +function! SyntaxCheckers_rust_GetLocList() + let makeprg = 'rustc --parse-only '.shellescape(expand('%')) + + let errorformat = '%E%f:%l:%c: \\d%#:\\d%# %.%\{-}error:%.%\{-} %m,' . + \ '%W%f:%l:%c: \\d%#:\\d%# %.%\{-}warning:%.%\{-} %m,' . + \ '%C%f:%l %m,' . + \ '%-Z%.%#' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + + diff --git a/bundle/git_syntastic/syntax_checkers/sass.vim b/bundle/git_syntastic/syntax_checkers/sass.vim new file mode 100644 index 0000000..23bf345 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/sass.vim @@ -0,0 +1,35 @@ +"============================================================================ +"File: sass.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_sass_syntax_checker") + finish +endif +let loaded_sass_syntax_checker = 1 + +"bail if the user doesnt have the sass binary installed +if !executable("sass") + finish +endif + +"use compass imports if available +let s:imports = "" +if executable("compass") + let s:imports = "--compass" +endif + +function! SyntaxCheckers_sass_GetLocList() + let makeprg='sass '.s:imports.' --check '.shellescape(expand('%')) + let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%.%#' + let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m' + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + return loclist +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/scala.vim b/bundle/git_syntastic/syntax_checkers/scala.vim new file mode 100644 index 0000000..f6f05af --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/scala.vim @@ -0,0 +1,33 @@ +"============================================================================ +"File: scala.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Rickey Visinski +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_scala_syntax_checker") + finish +endif +let loaded_scala_syntax_checker = 1 + +"bail if the user doesnt have the scala binary installed +if !executable("scala") + finish +endif + +if !exists("g:syntastic_scala_options") + let g:syntastic_scala_options = " " +endif + +function! SyntaxCheckers_scala_GetLocList() + let makeprg = 'scala '. g:syntastic_scala_options .' '. shellescape(expand('%')) . ' /dev/null' + + let errorformat = '%f\:%l: %trror: %m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/scss.vim b/bundle/git_syntastic/syntax_checkers/scss.vim new file mode 100644 index 0000000..d3ae5e7 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/scss.vim @@ -0,0 +1,27 @@ + +"============================================================================ +"File: scss.vim +"Description: scss syntax checking plugin for syntastic +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_scss_syntax_checker") + finish +endif +let loaded_scss_syntax_checker = 1 + +"bail if the user doesnt have the sass binary installed +if !executable("sass") + finish +endif + +runtime syntax_checkers/sass.vim + +function! SyntaxCheckers_scss_GetLocList() + return SyntaxCheckers_sass_GetLocList() +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/sh.vim b/bundle/git_syntastic/syntax_checkers/sh.vim new file mode 100644 index 0000000..5b55172 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/sh.vim @@ -0,0 +1,52 @@ +"============================================================================ +"File: sh.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Gregor Uhlenheuer +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists('loaded_sh_syntax_checker') + finish +endif +let loaded_sh_syntax_checker = 1 + +function! s:GetShell() + if !exists('b:shell') || b:shell == "" + let b:shell = '' + let shebang = getbufline(bufnr('%'), 1)[0] + if len(shebang) > 0 + if match(shebang, 'bash') >= 0 + let b:shell = 'bash' + elseif match(shebang, 'zsh') >= 0 + let b:shell = 'zsh' + elseif match(shebang, 'sh') >= 0 + let b:shell = 'sh' + endif + endif + endif + return b:shell +endfunction + +function! SyntaxCheckers_sh_GetLocList() + if len(s:GetShell()) == 0 || !executable(s:GetShell()) + return [] + endif + let output = split(system(s:GetShell().' -n '.shellescape(expand('%'))), '\n') + if v:shell_error != 0 + let result = [] + for err_line in output + let line = substitute(err_line, '^[^:]*:\D\{-}\(\d\+\):.*', '\1', '') + let msg = substitute(err_line, '^[^:]*:\D\{-}\d\+: \(.*\)', '\1', '') + call add(result, {'lnum' : line, + \ 'text' : msg, + \ 'bufnr': bufnr(''), + \ 'type': 'E' }) + endfor + return result + endif + return [] +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/tcl.vim b/bundle/git_syntastic/syntax_checkers/tcl.vim new file mode 100644 index 0000000..83b5df3 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/tcl.vim @@ -0,0 +1,28 @@ +"============================================================================ +"File: tcl.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Eric Thomas +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists("loaded_tcl_syntax_checker") + finish +endif +let loaded_tcl_syntax_checker = 1 + +"bail if the user doesnt have tclsh installed +if !executable("tclsh") + finish +endif + +function! SyntaxCheckers_tcl_GetLocList() + let makeprg = 'tclsh '.shellescape(expand('%')) + let errorformat = '%f:%l:%m' + + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/tex.vim b/bundle/git_syntastic/syntax_checkers/tex.vim new file mode 100644 index 0000000..4369f4c --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/tex.vim @@ -0,0 +1,26 @@ +"============================================================================ +"File: tex.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_tex_syntax_checker") + finish +endif +let loaded_tex_syntax_checker = 1 + +"bail if the user doesnt have lacheck installed +if !executable("lacheck") + finish +endif + +function! SyntaxCheckers_tex_GetLocList() + let makeprg = 'lacheck '.shellescape(expand('%')) + let errorformat = '%-G** %f:,%E"%f"\, line %l: %m' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/vala.vim b/bundle/git_syntastic/syntax_checkers/vala.vim new file mode 100644 index 0000000..cf619f3 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/vala.vim @@ -0,0 +1,56 @@ +"============================================================================ +"File: vala.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Konstantin Stepanov (me@kstep.me) +"Notes: Add special comment line into your vala file starting with +" "// modules: " and containing space delimited list of vala +" modules, used by the file, so this script can build correct +" --pkg arguments. +" Valac compiler is not the fastest thing in the world, so you +" may want to disable this plugin with +" let g:syntastic_vala_check_disabled = 1 command in your .vimrc or +" command line. Unlet this variable to set it to 0 to reenable +" this checker. +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +if exists('loaded_vala_syntax_checker') + finish +endif +let loaded_vala_syntax_checker = 1 + +if !executable('valac') + finish +endif + +if exists('g:syntastic_vala_check_disabled') && g:syntastic_vala_check_disabled + finish +endif + +function! SyntaxCheckers_vala_GetHighlightRegex(pos) + let strlength = strlen(matchstr(a:pos['text'], '\^\+$')) + return '\%>'.(a:pos.col-1).'c.*\%<'.(a:pos.col+strlength+1).'c' +endfunction + +function! s:GetValaModules() + let modules_line = search('^// modules: ', 'n') + let modules_str = getline(modules_line) + let modules = split(strpart(modules_str, 12), '\s\+') + return modules +endfunction + +function! SyntaxCheckers_vala_GetLocList() + let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') + let makeprg = 'valac -C ' . vala_pkg_args . ' ' .shellescape(expand('%')) + let errorformat = '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,%C%m,%Z%m' + + return SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'force_highlight_callback': 1} }) +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/xhtml.vim b/bundle/git_syntastic/syntax_checkers/xhtml.vim new file mode 100644 index 0000000..80d981a --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/xhtml.vim @@ -0,0 +1,46 @@ +"============================================================================ +"File: xhtml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_xhtml_syntax_checker") + finish +endif +let loaded_xhtml_syntax_checker = 1 + +"bail if the user doesnt have tidy or grep installed +if !executable("tidy") + finish +endif + +" TODO: join this with html.vim DRY's sake? +function! s:TidyEncOptByFenc() + let tidy_opts = { + \'utf-8' : '-utf8', + \'ascii' : '-ascii', + \'latin1' : '-latin1', + \'iso-2022-jp' : '-iso-2022', + \'cp1252' : '-win1252', + \'macroman' : '-mac', + \'utf-16le' : '-utf16le', + \'utf-16' : '-utf16', + \'big5' : '-big5', + \'sjis' : '-shiftjis', + \'cp850' : '-ibm858', + \} + return get(tidy_opts, &fileencoding, '-utf8') +endfunction + +function! SyntaxCheckers_xhtml_GetLocList() + + let encopt = s:TidyEncOptByFenc() + let makeprg="tidy ".encopt." -xml -e ".shellescape(expand('%')) + let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/xml.vim b/bundle/git_syntastic/syntax_checkers/xml.vim new file mode 100644 index 0000000..55c0cdd --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/xml.vim @@ -0,0 +1,42 @@ +"============================================================================ +"File: xml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sebastian Kusnier +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" You can use a local installation of DTDs to significantly speed up validation +" and allow you to validate XML data without network access, see xmlcatalog(1) +" and http://www.xmlsoft.org/catalog.html for more information. + +if exists("loaded_xml_syntax_checker") + finish +endif +let loaded_xml_syntax_checker = 1 + +"bail if the user doesnt have tidy or grep installed +if !executable("xmllint") + finish +endif + +function! SyntaxCheckers_xml_GetLocList() + + let makeprg="xmllint --xinclude --noout --postvalid " . shellescape(expand("%:p")) + let errorformat='%E%f:%l:\ error\ :\ %m, + \%-G%f:%l:\ validity\ error\ :\ Validation\ failed:\ no\ DTD\ found\ %m, + \%W%f:%l:\ warning\ :\ %m, + \%W%f:%l:\ validity\ warning\ :\ %m, + \%E%f:%l:\ validity\ error\ :\ %m, + \%E%f:%l:\ parser\ error\ :\ %m, + \%E%f:%l:\ %m, + \%-Z%p^, + \%-G%.%#' + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + return loclist +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/xslt.vim b/bundle/git_syntastic/syntax_checkers/xslt.vim new file mode 100644 index 0000000..b9b3cac --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/xslt.vim @@ -0,0 +1,38 @@ +"============================================================================ +"File: xslt.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Sebastian Kusnier +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_xslt_syntax_checker") + finish +endif +let loaded_xslt_syntax_checker = 1 + +"bail if the user doesnt have tidy or grep installed +if !executable("xmllint") + finish +endif + +function! SyntaxCheckers_xslt_GetLocList() + + let makeprg="xmllint --xinclude --noout --postvalid " . shellescape(expand("%:p")) + let errorformat='%E%f:%l:\ error\ :\ %m, + \%-G%f:%l:\ validity\ error\ :\ Validation\ failed:\ no\ DTD\ found\ %m, + \%W%f:%l:\ warning\ :\ %m, + \%W%f:%l:\ validity\ warning\ :\ %m, + \%E%f:%l:\ validity\ error\ :\ %m, + \%E%f:%l:\ parser\ error\ :\ %m, + \%E%f:%l:\ namespace\ error\ :\ %m, + \%E%f:%l:\ %m, + \%-Z%p^, + \%-G%.%#' + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + + return loclist +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/yaml.vim b/bundle/git_syntastic/syntax_checkers/yaml.vim new file mode 100644 index 0000000..f45d849 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/yaml.vim @@ -0,0 +1,30 @@ +"============================================================================ +"File: yaml.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Martin Grenfell +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +" +"Installation: $ npm install -g js-yaml.bin +" +"============================================================================ +if exists("loaded_yaml_syntax_checker") + finish +endif +let loaded_yaml_syntax_checker = 1 + +if !executable("js-yaml") + finish +endif + +function! SyntaxCheckers_yaml_GetLocList() + let makeprg='js-yaml --compact ' . shellescape(expand('%')) + let errorformat='Error on line %l\, col %c:%m,%-G%.%#' + return SyntasticMake({ 'makeprg': makeprg, + \ 'errorformat': errorformat, + \ 'defaults': {'bufnr': bufnr("")} }) +endfunction diff --git a/bundle/git_syntastic/syntax_checkers/z80.vim b/bundle/git_syntastic/syntax_checkers/z80.vim new file mode 100644 index 0000000..15cba23 --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/z80.vim @@ -0,0 +1,31 @@ +"============================================================================ +"File: z80.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: Romain Giot +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ +if exists("loaded_z80_syntax_checker") + finish +endif +let loaded_z80_syntax_checker = 1 + +"bail if the user doesnt have z80_syntax_checker.py installed +"To obtain this application there are two solutions: +" - Install this python package: https://github.com/rgiot/pycpcdemotools +" - Copy/paste this script in your search path: https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py +if !executable("z80_syntax_checker.py") + finish +endif + +function! SyntaxCheckers_z80_GetLocList() + let makeprg = 'z80_syntax_checker.py '.shellescape(expand('%')) + let errorformat = '%f:%l %m' + let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) + return loclist +endfunction + diff --git a/bundle/git_syntastic/syntax_checkers/zpt.vim b/bundle/git_syntastic/syntax_checkers/zpt.vim new file mode 100644 index 0000000..0b0063b --- /dev/null +++ b/bundle/git_syntastic/syntax_checkers/zpt.vim @@ -0,0 +1,36 @@ +"============================================================================ +"File: zpt.vim +"Description: Syntax checking plugin for syntastic.vim +"Maintainer: claytron +"License: This program is free software. It comes without any warranty, +" to the extent permitted by applicable law. You can redistribute +" it and/or modify it under the terms of the Do What The Fuck You +" Want To Public License, Version 2, as published by Sam Hocevar. +" See http://sam.zoy.org/wtfpl/COPYING for more details. +" +"============================================================================ + +" In order for this plugin to be useful, you will need to set up the +" zpt filetype in your vimrc +" +" " set up zope page templates as the zpt filetype +" au BufNewFile,BufRead *.pt,*.cpt,*.zpt set filetype=zpt syntax=xml +" +" Then install the zptlint program, found on pypi: +" http://pypi.python.org/pypi/zptlint + +if exists("loaded_zpt_syntax_checker") + finish +endif +let loaded_zpt_syntax_checker = 1 + +" Bail if the user doesn't have zptlint installed +if !executable("zptlint") + finish +endif + +function! SyntaxCheckers_zpt_GetLocList() + let makeprg="zptlint ".shellescape(expand('%')) + let errorformat='%-P*** Error in: %f,%Z%*\s\, at line %l\, column %c,%E%*\s%m,%-Q' + return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) +endfunction diff --git a/bundle/git_taglisttoo/.gitignore b/bundle/git_taglisttoo/.gitignore new file mode 100644 index 0000000..aebb9e6 --- /dev/null +++ b/bundle/git_taglisttoo/.gitignore @@ -0,0 +1,5 @@ +*.pyc +*.swp +*.vba +tags +/build diff --git a/bundle/git_taglisttoo/Makefile b/bundle/git_taglisttoo/Makefile new file mode 100644 index 0000000..56790e2 --- /dev/null +++ b/bundle/git_taglisttoo/Makefile @@ -0,0 +1,11 @@ +SHELL=/bin/bash + +all: dist + +dist: + @rm taglisttoo.vba 2> /dev/null || true + @vim -c 'r! git ls-files autoload doc plugin' \ + -c '$$,$$d _' -c '%MkVimball taglisttoo.vba .' -c 'q!' + +clean: + @rm -R build 2> /dev/null || true diff --git a/bundle/git_taglisttoo/README.rst b/bundle/git_taglisttoo/README.rst new file mode 100644 index 0000000..aa793ba --- /dev/null +++ b/bundle/git_taglisttoo/README.rst @@ -0,0 +1,50 @@ +.. Copyright (c) 2005 - 2010, Eric Van Dewoestine + All rights reserved. + + Redistribution and use of this software in source and binary forms, with + or without modification, are permitted provided that the following + conditions are met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + + * Neither the name of Eric Van Dewoestine nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission of + Eric Van Dewoestine. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +TaglistToo is a vim plugin which provides an outline, or taglist, of a source +file in a separate window allowing you to quickly get an overview of the file +you are working on and to quickly jump to class definitions, methods, +functions, etc. + +TaglistToo is very similar to the very popular taglist.vim_ written by Yegappan +Lakshmanan, but with a focus on being extensible and customizable. TaglistToo +provides hooks allowing you to format the taglist content per file type and to +also write code to parse file types not supported well or at all by ctags. + +Please note that TaglistToo requires that vim be compiled with python support +and that you have `exuberant ctags`_ installed. + +Please see the vim help file for full documentation. + +.. _exuberant ctags: http://ctags.sourceforge.net/ +.. _taglist.vim: http://www.vim.org/scripts/script.php?script_id=273 diff --git a/autoload/taglisttoo/__init__.py b/bundle/git_taglisttoo/autoload/taglisttoo/__init__.py similarity index 86% rename from autoload/taglisttoo/__init__.py rename to bundle/git_taglisttoo/autoload/taglisttoo/__init__.py index 69e7739..29608eb 100644 --- a/autoload/taglisttoo/__init__.py +++ b/bundle/git_taglisttoo/autoload/taglisttoo/__init__.py @@ -1,5 +1,5 @@ """ -Copyright (c) 2005 - 2011, Eric Van Dewoestine +Copyright (c) 2005 - 2012, Eric Van Dewoestine All rights reserved. Redistribution and use of this software in source and binary forms, with @@ -40,6 +40,7 @@ import vim def ctags(lang, types, filename): ctags = vim.eval('g:Tlist_Ctags_Cmd') + debug = vim.eval('g:Tlist_Debug') != '0' startupinfo = None if os.name == 'nt': @@ -52,22 +53,27 @@ def ctags(lang, types, filename): stdoutfile = tempfile.TemporaryFile() stderrfile = tempfile.TemporaryFile() try: + args = [ + ctags, + '-f', '-', + '--format=2', + '--excmd=pattern', + '--extra=', + '--fields=kns', + '--fields=-afiKlmSzt', + '--sort=no', + '--language-force=%s' % lang, + '--%s-types=%s' % (lang, types), + filename, + ] + if debug: + print ' '.join(args) process = subprocess.Popen( - [ - ctags, - '-f', '-', - '--format=2', - '--excmd=pattern', - '--fields=nks', - '--sort=no', - '--language-force=%s' % lang, - '--%s-types=%s' % (lang, types), - filename, - ], - stdout=stdoutfile, - stderr=stderrfile, - stdin=subprocess.PIPE, - startupinfo=startupinfo, + args, + stdout=stdoutfile, + stderr=stderrfile, + stdin=subprocess.PIPE, + startupinfo=startupinfo, ) retcode = process.wait() @@ -84,6 +90,7 @@ def ctags(lang, types, filename): def jsctags(filename): jsctags = vim.eval('g:Tlist_JSctags_Cmd') + debug = vim.eval('g:Tlist_Debug') != '0' startupinfo = None if os.name == 'nt': @@ -95,15 +102,14 @@ def jsctags(filename): temp = tempfile.mkstemp()[1] try: + args = [jsctags, '-o', temp, filename] + if debug: + print ' '.join(args) process = subprocess.Popen( - [ - jsctags, - '-o', temp, - filename, - ], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - startupinfo=startupinfo, + args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + startupinfo=startupinfo, ) retcode = process.wait() @@ -113,7 +119,8 @@ def jsctags(filename): finally: os.unlink(temp) -def parse(filename, patterns): +def parse(filename, settings, patterns): + types = settings['tags'] f = open(filename, 'r') contents = f.read() f.close() @@ -173,6 +180,7 @@ def parse(filename, patterns): results.append({ 'type': ptype, + 'type_name': types.get(ptype, ptype), 'name': name, 'pattern': '^%s$' % pattern, 'line': line, diff --git a/autoload/taglisttoo/lang/ant.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/ant.vim similarity index 95% rename from autoload/taglisttoo/lang/ant.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/ant.vim index de14df3..6feb868 100644 --- a/autoload/taglisttoo/lang/ant.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/ant.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#ant#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['p', "]*)name\\s*=\\s*['\"](.*?)['\"]", 1], \ ['i', "]*)file\\s*=\\s*['\"](.*?)['\"]", 1], \ ['t', "]*)name\\s*=\\s*['\"](.*?)['\"]", 1], diff --git a/bundle/git_taglisttoo/autoload/taglisttoo/lang/cpp.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/cpp.vim new file mode 100644 index 0000000..edc40bf --- /dev/null +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/cpp.vim @@ -0,0 +1,118 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" Copyright (c) 2011 - 2012, Eric Van Dewoestine +" All rights reserved. +" +" Redistribution and use of this software in source and binary forms, with +" or without modification, are permitted provided that the following +" conditions are met: +" +" * Redistributions of source code must retain the above +" copyright notice, this list of conditions and the +" following disclaimer. +" +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the +" following disclaimer in the documentation and/or other +" materials provided with the distribution. +" +" * Neither the name of Eric Van Dewoestine nor the names of its +" contributors may be used to endorse or promote products derived from +" this software without specific prior written permission of +" Eric Van Dewoestine. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +" }}} + +" Parse(file, settings) {{{ +function! taglisttoo#lang#cpp#Parse(file, settings) + let tags = taglisttoo#util#ParseCtags(a:file, a:settings) + + let types = {} + for [t, n] in items(a:settings.tags) + let types[n] = t + endfor + + let parents = [] + let seen = [] + let index = 0 + for tag in tags + if tag.parent != '' && index(seen, tag.parent) == -1 + call add(seen, tag.parent) + let type_name = substitute(tag.parent, '^\(.\{-}\):.*', '\1', '') + if !has_key(types, type_name) + continue + endif + let type = types[type_name] + let name = substitute(tag.parent, '^.\{-}:\(.*\)', '\1', '') + let parts = split(name, '::') + let name = parts[-1] + + let parent_name = '' + let parent_filter = 'v:val.name == name' + + " single level nesting, so we can use the type to see if parent exists + if len(parts) == 1 + let parent_filter .= ' && v:val.type == type' + + " multi level nesting, so rely we can't use the type + else + let parent_name = join(parts[:-2], '::') + let parent_filter .= ' && v:val.parent =~ "^.\\{-}:" . parent_name . "$"' + endif + + " check if the parent already exists + let exists = filter(copy(tags), parent_filter) + if len(exists) == 0 + let parent = {} + let parent_path = '' + " the parent we are injecting has a parent, so construct its parent + " path + if parent_name != '' + let parent_list = filter(copy(tags), 'v:val.name == parent_name') + if len(parent_list) == 1 + let parent = parent_list[0] + let parent_parent = substitute(parent.parent, '^.\{-}:\(.*\)', '\1', '') + if parent_parent != '' + let parent_parent .= '::' + endif + let parent_type = a:settings.tags[parent.type] + let parent_path = parent_type . ':' . parent_parent . parent.name + endif + endif + + " injected parent before the first child occurance, taking into + " account any previously injected parents + let insert_index = len(parents) + index + call add(parents, [insert_index, { + \ 'name': name, + \ 'line': -1, + \ 'type': type, + \ 'type_name': type_name, + \ 'pattern': '', + \ 'parent': parent_path + \ }]) + endif + endif + let index += 1 + endfor + + for [idx, parent] in parents + call insert(tags, parent, idx) + endfor + + return tags +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/dtd.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/dtd.vim similarity index 94% rename from autoload/taglisttoo/lang/dtd.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/dtd.vim index 21bd866..04c3b9b 100644 --- a/autoload/taglisttoo/lang/dtd.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/dtd.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#dtd#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['e', '^\s*]*?name=['\"](.*?)['\"]", 1], \ ['i', "<([a-z]*?)\\s+[^>]*?id=['\"](.*?)['\"]", '\1 \2'], \ ]) diff --git a/autoload/taglisttoo/lang/htmldjango.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/htmldjango.vim similarity index 94% rename from autoload/taglisttoo/lang/htmldjango.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/htmldjango.vim index bb67317..f8f5568 100644 --- a/autoload/taglisttoo/lang/htmldjango.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/htmldjango.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#htmldjango#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['a', "]*?name=['\"](.*?)['\"]", 1], \ ['i', "<([a-z]*?)\\s+[^>]*?id=['\"](.*?)['\"]", '\1 \2'], \ ['b', '\{%?\s*block\s+(\w+)', 1], diff --git a/autoload/taglisttoo/lang/htmljinja.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/htmljinja.vim similarity index 84% rename from autoload/taglisttoo/lang/htmljinja.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/htmljinja.vim index f3948c4..0950aed 100644 --- a/autoload/taglisttoo/lang/htmljinja.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/htmljinja.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2012, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,11 +37,15 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#htmljinja#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + let prefix = '{%-?' + if exists('b:jinja_line_statement_prefix') + let prefix = '(?:' . prefix . '|' . b:jinja_line_statement_prefix . ')' + endif + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['a', "]*?name=['\"](.*?)['\"]", 1], \ ['i', "<([a-z]*?)\\s+[^>]*?id=['\"](.*?)['\"]", '\1 \2'], - \ ['b', '\{%?\s*block\s+(\w+)', 1], - \ ['m', '\{%-?\s*macro\s+(\w+)\s*\(', 1], + \ ['b', prefix . '\s*block\s+(\w+)', 1], + \ ['m', prefix . '\s*macro\s+(\w+)\s*\(', 1], \ ]) endfunction " }}} diff --git a/autoload/taglisttoo/lang/javascript.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/javascript.vim similarity index 52% rename from autoload/taglisttoo/lang/javascript.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/javascript.vim index 7d5f936..dbbce81 100644 --- a/autoload/taglisttoo/lang/javascript.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/javascript.vim @@ -41,136 +41,6 @@ if !exists('g:TaglistTooJSctags') endif " }}} -function! taglisttoo#lang#javascript#Format(types, tags) " {{{ - if !g:TaglistTooJSctags || !exists('g:Tlist_JSctags_Cmd') - return s:FormatRegexResults(a:types, a:tags) - endif - return s:FormatJSctagsResults(a:types, a:tags) -endfunction " }}} - -function! s:FormatJSctagsResults(types, tags) " {{{ - let formatter = taglisttoo#util#Formatter(a:tags) - call formatter.filename() - - let functions = filter(copy(a:tags), 'v:val.type == "f" && v:val.namespace == ""') - if len(functions) > 0 - call formatter.blank() - call formatter.format(a:types['f'], functions, '') - endif - - let members = filter(copy(a:tags), 'v:val.name == "includeScript"') - - let objects = filter(copy(a:tags), 'v:val.jstype == "Object"') - for object in objects - if object.namespace != '' - let object.name = object.namespace . '.' . object.name - endif - - call formatter.blank() - call formatter.heading(a:types['o'], object, '') - - let members = filter(copy(a:tags), 'v:val.type == "f" && v:val.namespace == object.name') - call formatter.format(a:types['f'], members, "\t") - endfor - - return formatter -endfunction " }}} - -function! s:FormatRegexResults(types, tags) " {{{ - let pos = getpos('.') - - let formatter = taglisttoo#util#Formatter(a:tags) - call formatter.filename() - - let object_contents = [] - - let objects = filter(copy(a:tags), 'v:val.type == "o"') - let members = filter(copy(a:tags), 'v:val.type == "m"') - let functions = filter(copy(a:tags), - \ 'v:val.type == "f" && v:val.pattern =~ "\\"') - let object_bounds = {} - for object in objects - let object_start = object.line - call cursor(object_start, 1) - while search('{', 'W') && s:SkipComments() - " no op - endwhile - let object_end = searchpair('{', '', '}', 'W', 's:SkipComments()') - - let methods = [] - let indexes = [] - let index = 0 - for fct in members - if len(fct) > 3 - let fct_line = fct.line - if fct_line > object_start && fct_line < object_end - call add(methods, fct) - elseif fct_line > object_end - break - elseif fct_line < object_end - call add(indexes, index) - endif - endif - let index += 1 - endfor - call reverse(indexes) - for i in indexes - call remove(members, i) - endfor - - let indexes = [] - let index = 0 - for fct in functions - if len(fct) > 3 - let fct_line = fct.line - if fct_line > object_start && fct_line < object_end - call add(methods, fct) - call add(indexes, index) - elseif fct_line == object_start - call add(indexes, index) - elseif fct_line > object_end - break - endif - endif - let index += 1 - endfor - call reverse(indexes) - for i in indexes - call remove(functions, i) - endfor - - if len(methods) > 0 - let parent_object = s:GetParentObject( - \ object_contents, object_bounds, object_start, object_end) - " remove methods from the parent if necessary - if len(parent_object) - call filter(parent_object.methods, 'index(methods, v:val) == -1') - endif - let object_bounds[string(object)] = [object_start, object_end] - call add(object_contents, {'object': object, 'methods': methods}) - endif - endfor - - if len(functions) > 0 - call formatter.blank() - call formatter.format(a:types['f'], functions, '') - endif - - if g:Tlist_Sort_Type == 'name' - call sort(object_contents, function('s:ObjectComparator')) - endif - - for object_content in object_contents - call formatter.blank() - call formatter.heading(a:types['o'], object_content.object, '') - call formatter.format(a:types['f'], object_content.methods, "\t") - endfor - - call setpos('.', pos) - - return formatter -endfunction " }}} - function! taglisttoo#lang#javascript#Parse(file, settings) " {{{ if g:TaglistTooJSctags && !exists('g:Tlist_JSctags_Cmd') if executable('jsctags') @@ -194,7 +64,7 @@ vim.command("let result = '%s'" % result.replace("'", "''")) PYTHONEOF if retcode - call s:EchoError('jsctags failed with error code: ' . retcode) + call taglisttoo#util#EchoError('jsctags failed with error code: ' . retcode) return endif @@ -268,36 +138,16 @@ function! s:ParseRegex(file, settings) " {{{ " Match Functions call add(patterns, ['f', '\bfunction\s+([a-zA-Z0-9_.\$]+?)\s*\(', 1]) call add(patterns, ['f', '([a-zA-Z0-9_.\$]+?)\s*=\s*function\s*\(', 1]) + call add(patterns, ['f', "\\[[\"']([A-Za-z0-9_]+)[\"']\\]\\s*=\\s*function\\s*\\(", 1]) " Match Members - call add(patterns, ['m', '\b([a-zA-Z0-9_.\$]+?)\s*:\s*function\s*\(', 1]) - return taglisttoo#util#Parse(a:file, patterns) -endfunction " }}} + call add(patterns, ['f', '\b([a-zA-Z0-9_.\$]+?)\s*:\s*function\s*\(', 1]) + let tags = taglisttoo#util#Parse(a:file, a:settings, patterns) -function s:ObjectComparator(o1, o2) " {{{ - let n1 = a:o1['object'].name - let n2 = a:o2['object'].name - return n1 == n2 ? 0 : n1 > n2 ? 1 : -1 -endfunction " }}} + call taglisttoo#util#SetNestedParents( + \ a:settings.tags, tags, ['o', 'f', 'm'], '{', '}') -function s:SkipComments() " {{{ - let synname = synIDattr(synID(line('.'), col('.'), 1), "name") - return synname =~? '\(comment\|string\)' -endfunction " }}} - -function s:GetParentObject(objects, bounds, start, end) " {{{ - for key in keys(a:bounds) - let range = a:bounds[key] - if range[0] < a:start && range[1] > a:end - for object_content in a:objects - if string(object_content.object) == key - return object_content - endif - endfor - break - endif - endfor - return {} + return tags endfunction " }}} " vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/jproperties.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/jproperties.vim similarity index 93% rename from autoload/taglisttoo/lang/jproperties.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/jproperties.vim index cac96d8..a5ac35b 100644 --- a/autoload/taglisttoo/lang/jproperties.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/jproperties.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#jproperties#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [['p', '^\s*([^#]+?)\s*=', 1]]) + return taglisttoo#util#Parse(a:file, a:settings, [['p', '^\s*([^#]+?)\s*=', 1]]) endfunction " }}} " vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/log4j.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/log4j.vim similarity index 95% rename from autoload/taglisttoo/lang/log4j.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/log4j.vim index 33a2ce0..6389afb 100644 --- a/autoload/taglisttoo/lang/log4j.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/log4j.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#log4j#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['a', "]*?name=['\"](.*?)['\"]", 1], \ ['c', "]*?name=['\"](.*?)['\"]", 1], \ ['l', "]*?name=['\"](.*?)['\"]", 1], diff --git a/autoload/taglisttoo/lang/python.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/perl.vim similarity index 67% rename from autoload/taglisttoo/lang/python.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/perl.vim index 69287b8..aee2a30 100644 --- a/autoload/taglisttoo/lang/python.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/perl.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -35,32 +35,23 @@ " SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. " }}} -" Format(types, tags) {{{ -function! taglisttoo#lang#python#Format(types, tags) - let formatter = taglisttoo#util#Formatter(a:tags) - call formatter.filename() +" Parse(file, settings) {{{ +function! taglisttoo#lang#perl#Parse(file, settings) + let tags = taglisttoo#util#ParseCtags(a:file, a:settings) - let functions = filter(copy(a:tags), 'v:val.type == "f"') - if len(functions) - call formatter.blank() - call formatter.format(a:types['f'], functions, '') - endif + let package = {} + for tag in tags + if tag.type == 'p' + let package = tag + continue + endif - let classes = filter(copy(a:tags), 'v:val.type == "c"') - if g:Tlist_Sort_Type == 'name' - call sort(classes, 'taglisttoo#util#SortTags') - endif - - for class in classes - call formatter.blank() - call formatter.heading(a:types['c'], class, '') - - let members = filter(copy(a:tags), - \ 'v:val.type == "m" && v:val.parent == "class:" . class.name') - call formatter.format(a:types['m'], members, "\t") + if len(package) + let tag['parent'] = 'package:' . package.name + endif endfor - return formatter + return tags endfunction " }}} " vim:ft=vim:fdm=marker diff --git a/bundle/git_taglisttoo/autoload/taglisttoo/lang/php.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/php.vim new file mode 100644 index 0000000..cd9fcd2 --- /dev/null +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/php.vim @@ -0,0 +1,52 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" Copyright (c) 2005 - 2011, Eric Van Dewoestine +" All rights reserved. +" +" Redistribution and use of this software in source and binary forms, with +" or without modification, are permitted provided that the following +" conditions are met: +" +" * Redistributions of source code must retain the above +" copyright notice, this list of conditions and the +" following disclaimer. +" +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the +" following disclaimer in the documentation and/or other +" materials provided with the distribution. +" +" * Neither the name of Eric Van Dewoestine nor the names of its +" contributors may be used to endorse or promote products derived from +" this software without specific prior written permission of +" Eric Van Dewoestine. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +" }}} + +" Parse(file, settings) {{{ +function! taglisttoo#lang#php#Parse(file, settings) + let tags = taglisttoo#util#Parse(a:file, a:settings, [ + \ ['f', '\bfunction\s+([a-zA-Z0-9_]+)\s*\(', 1], + \ ['c', '\bclass\s+([a-zA-Z0-9_]+)', 1], + \ ['i', '\binterface\s+([a-zA-Z0-9_]+)', 1], + \ ]) + + call taglisttoo#util#SetNestedParents( + \ a:settings.tags, tags, ['c', 'i', 'f'], '{', '}') + + return tags +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/rst.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/rst.vim similarity index 94% rename from autoload/taglisttoo/lang/rst.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/rst.vim index 96becc9..0ee6728 100644 --- a/autoload/taglisttoo/lang/rst.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/rst.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#rst#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['a', '^\s*\.\.\s_((\\:|[^:])+):\s*\n', 1], \ ['s', '^([^\n]+)\n[=^-]{4,}', 1], \ ]) diff --git a/bundle/git_taglisttoo/autoload/taglisttoo/lang/scala.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/scala.vim new file mode 100644 index 0000000..fbccbe9 --- /dev/null +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/scala.vim @@ -0,0 +1,57 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" Copyright (c) 2011, Eric Van Dewoestine +" All rights reserved. +" +" Redistribution and use of this software in source and binary forms, with +" or without modification, are permitted provided that the following +" conditions are met: +" +" * Redistributions of source code must retain the above +" copyright notice, this list of conditions and the +" following disclaimer. +" +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the +" following disclaimer in the documentation and/or other +" materials provided with the distribution. +" +" * Neither the name of Eric Van Dewoestine nor the names of its +" contributors may be used to endorse or promote products derived from +" this software without specific prior written permission of +" Eric Van Dewoestine. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +" }}} + +" Parse(file, settings) {{{ +function! taglisttoo#lang#scala#Parse(file, settings) + let tags = taglisttoo#util#Parse(a:file, a:settings, [ + \ ['p', '\bpackage\s+([a-zA-Z0-9_.]+)', 1], + \ ['c', '\bclass\s+([a-zA-Z0-9_]+)', 1], + \ ['o', '\bobject\s+([a-zA-Z0-9_]+)', 1], + \ ['t', '\btrait\s+([a-zA-Z0-9_]+)', 1], + \ ['T', '\btype\s+([a-zA-Z0-9_]+)', 1], + \ ['m', '\bdef\s+([a-zA-Z0-9_\?]+)', 1], + \ ['C', '\bval\s+([a-zA-Z0-9_]+)', 1], + \ ['l', '\bvar\s+([a-zA-Z0-9_]+)', 1], + \ ]) + + call taglisttoo#util#SetNestedParents( + \ a:settings.tags, tags, ['c', 'o', 't', 'm'], '{', '}') + + return tags +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/sql.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/sql.vim similarity index 96% rename from autoload/taglisttoo/lang/sql.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/sql.vim index ce346cd..f7cd3e4 100644 --- a/autoload/taglisttoo/lang/sql.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/sql.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#sql#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['g', 'create\s+(?:group|role)\s+([a-zA-Z0-9_.]+)', 1, 'i'], \ ['u', 'create\s+user\s+([a-zA-Z0-9_.]+)', 1, 'i'], \ ['p', 'create\s+(?:tablespace|dbspace)\s+([a-zA-Z0-9_.]+)', 1, 'i'], diff --git a/bundle/git_taglisttoo/autoload/taglisttoo/lang/vim.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/vim.vim new file mode 100644 index 0000000..a8936d7 --- /dev/null +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/vim.vim @@ -0,0 +1,51 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" Copyright (c) 2011, Eric Van Dewoestine +" All rights reserved. +" +" Redistribution and use of this software in source and binary forms, with +" or without modification, are permitted provided that the following +" conditions are met: +" +" * Redistributions of source code must retain the above +" copyright notice, this list of conditions and the +" following disclaimer. +" +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the +" following disclaimer in the documentation and/or other +" materials provided with the distribution. +" +" * Neither the name of Eric Van Dewoestine nor the names of its +" contributors may be used to endorse or promote products derived from +" this software without specific prior written permission of +" Eric Van Dewoestine. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +" }}} + +" Parse(file, settings) {{{ +function! taglisttoo#lang#vim#Parse(file, settings) + let tags = taglisttoo#util#ParseCtags(a:file, a:settings) + + for tag in tags + if tag.type == 'f' && tag.pattern =~ 's:' . tag.name . '\>' + let tag.name = 's:' . tag.name + endif + endfor + + return tags +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/autoload/taglisttoo/lang/xsd.vim b/bundle/git_taglisttoo/autoload/taglisttoo/lang/xsd.vim similarity index 94% rename from autoload/taglisttoo/lang/xsd.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/lang/xsd.vim index 62b2310..b8e7c37 100644 --- a/autoload/taglisttoo/lang/xsd.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/lang/xsd.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2011, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,7 +37,7 @@ " Parse(file, settings) {{{ function! taglisttoo#lang#xsd#Parse(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['e', "<(?:xs[d]?:)?element\\s+[^>]*?name=['\"](.*?)['\"]", 1], \ ['t', "<(?:xs[d]?:)?complexType\\s+[^>]*?name=['\"](.*?)['\"]", 1], \ ]) diff --git a/autoload/taglisttoo/taglist.vim b/bundle/git_taglisttoo/autoload/taglisttoo/taglist.vim similarity index 85% rename from autoload/taglisttoo/taglist.vim rename to bundle/git_taglisttoo/autoload/taglisttoo/taglist.vim index 40c6a68..906a5db 100644 --- a/autoload/taglisttoo/taglist.vim +++ b/bundle/git_taglisttoo/autoload/taglisttoo/taglist.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2011, Eric Van Dewoestine +" Copyright (c) 2005 - 2012, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -37,8 +37,6 @@ " Global Variables {{{ let g:TagListToo = 1 -"gryf: add autoclose functionality -let g:TagListTooAutoClose = 1 " }}} " Script Variables {{{ @@ -118,7 +116,10 @@ let s:tlist_c_settings = { " c++ language let s:tlist_cpp_settings = { - \ 'lang': 'c++', 'tags': { + \ 'lang': 'c++', + \ 'separator': '::', + \ 'parse': 'taglisttoo#lang#cpp#Parse', + \ 'tags': { \ 'n': 'namespace', \ 'v': 'variable', \ 'd': 'macro', @@ -127,7 +128,8 @@ let s:tlist_cpp_settings = { \ 'g': 'enum', \ 's': 'struct', \ 'u': 'union', - \ 'f': 'function' + \ 'f': 'function', + \ 'p': 'prototypes', \ } \ } @@ -147,6 +149,9 @@ let s:tlist_cs_settings = { \ } \ } +" clojure +let s:tlist_clojure_settings = {'lang': 'lisp', 'tags': {'f': 'function'}} + " cobol language let s:tlist_cobol_settings = { \ 'lang': 'cobol', 'tags': { @@ -238,7 +243,6 @@ let s:tlist_htmljinja_settings = { " java language let s:tlist_java_settings = { \ 'lang': 'java', - \ 'format': 'taglisttoo#lang#java#Format', \ 'tags': { \ 'p': 'package', \ 'c': 'class', @@ -250,11 +254,9 @@ let s:tlist_java_settings = { let s:tlist_javascript_settings = { \ 'lang': 'javascript', - \ 'format': 'taglisttoo#lang#javascript#Format', \ 'parse': 'taglisttoo#lang#javascript#Parse', \ 'tags': { \ 'o': 'object', - \ 'm': 'member', \ 'f': 'function', \ } \ } @@ -295,7 +297,9 @@ let s:tlist_pascal_settings = { " perl language let s:tlist_perl_settings = { - \ 'lang': 'perl', 'tags': { + \ 'lang': 'perl', + \ 'parse': 'taglisttoo#lang#perl#Parse', + \ 'tags': { \ 'c': 'constant', \ 'l': 'label', \ 'p': 'package', @@ -306,7 +310,6 @@ let s:tlist_perl_settings = { " php language let s:tlist_php_settings = { \ 'lang': 'php', - \ 'format': 'taglisttoo#lang#php#Format', \ 'parse': 'taglisttoo#lang#php#Parse', \ 'tags': { \ 'c': 'class', @@ -319,10 +322,9 @@ let s:tlist_php_settings = { " python language let s:tlist_python_settings = { \ 'lang': 'python', - \ 'format': 'taglisttoo#lang#python#Format', \ 'tags': { \ 'c': 'class', - \ 'm': 'member', + \ 'm': 'function', \ 'f': 'function' \ } \ } @@ -340,12 +342,30 @@ let s:tlist_rst_settings = { let s:tlist_ruby_settings = { \ 'lang': 'ruby', 'tags': { \ 'c': 'class', - \ 'f': 'method', - \ 'F': 'function', - \ 'm': 'singleton method' + \ 'm': 'class', + \ 'f': 'function', + \ 'F': 'singleton method' \ } \ } +" scala language +let s:tlist_scala_settings = { + \ 'lang': 'scala', + \ 'parse': 'taglisttoo#lang#scala#Parse', + \ 'tags': { + \ 'p': 'package', + \ 'c': 'class', + \ 'o': 'object', + \ 't': 'trait', + \ 'T': 'type', + \ 'm': 'method', + \ } + \ } + " parsed for correct detection of parent tags, but not displayed to reduce + " clutter + " \ 'C': 'constant', + " \ 'l': 'local variable', + " scheme language let s:tlist_scheme_settings = { \ 'lang': 'scheme', 'tags': { @@ -450,7 +470,9 @@ let s:tlist_verilog_settings = { " vim language let s:tlist_vim_settings = { - \ 'lang': 'vim', 'tags': { + \ 'lang': 'vim', + \ 'parse': 'taglisttoo#lang#vim#Parse', + \ 'tags': { \ 'a': 'autocmds', \ 'v': 'variable', \ 'f': 'function' @@ -495,7 +517,7 @@ endfunction " }}} " - 0: close function! taglisttoo#taglist#Taglist(...) if !exists('g:Tlist_Ctags_Cmd') - call s:EchoError('Unable to find a version of ctags installed.') + call taglisttoo#util#EchoError('Unable to find a version of ctags installed.') return endif @@ -680,10 +702,10 @@ function! s:ProcessTags(on_open_or_write) " {{{ if has_key(settings, 'parse') let tags = s:Function(settings.parse)(file, settings) else - let tags = s:Parse(file, settings) + let tags = taglisttoo#util#ParseCtags(file, settings) endif catch /E700/ - call s:EchoError('Unknown function: ' . settings.parse) + call taglisttoo#util#EchoError('Unknown function: ' . settings.parse) return finally if tempfile != '' @@ -719,106 +741,39 @@ function! s:ProcessTags(on_open_or_write) " {{{ call s:ShowCurrentTag() endfunction " }}} -function! s:Parse(filename, settings) " {{{ -python << PYTHONEOF -try: - settings = vim.eval('a:settings') - filename = vim.eval('a:filename') - lang = settings['lang'] - types = ''.join(settings['tags'].keys()) - - retcode, result = taglisttoo.ctags(lang, types, filename) - vim.command('let retcode = %i' % retcode) - vim.command("let result = '%s'" % result.replace("'", "''")) -except Exception as e: - vim.command("call s:EchoError('%s')" % str(e).replace("'", "''")) - vim.command('let retcode = -1') -PYTHONEOF - - if retcode - if retcode != -1 - call s:EchoError('taglist failed with error code: ' . retcode) - endif - return - endif - - if has('win32') || has('win64') || has('win32unix') - let result = substitute(result, "\\n", '\n', 'g') - endif - - let results = split(result, '\n') - while len(results) && results[0] =~ 'ctags.*: Warning:' - call remove(results, 0) - endwhile - - let types = keys(a:settings.tags) - let parsed_results = [] - for result in results - let pre = substitute(result, '\(.\{-}\)\t\/\^.*', '\1', '') - let pattern = substitute(result, '.\{-}\(\/\^.*\/;"\).*', '\1', '') - let post = substitute(result, '.\{-}\/\^.*\/;"\t', '', '') - - let [name, filename] = split(pre, '\t') - let parts = split(post, '\t') - let [type, line_str] = parts[:1] - exec 'let line = ' . substitute(line_str, 'line:', '', '') - let pattern = substitute(pattern, '^/\(.*\)/;"$', '\1', '') - let parent = len(parts) > 2 ? parts[2] : '' - - " ctags (mine at least) is not properly honoring ---kinds, so - " perform our own check here. - if index(types, type) != -1 - call add(parsed_results, { - \ 'type': type, - \ 'name': name, - \ 'pattern': pattern, - \ 'line': line, - \ 'parent': parent, - \ }) - endif - endfor - - return parsed_results -endfunction " }}} - -function! s:FormatDefault(types, tags) " {{{ - let formatter = taglisttoo#util#Formatter(a:tags) +function! s:FormatDefault(settings, tags) " {{{ + let formatter = taglisttoo#util#Formatter(a:settings, a:tags) call formatter.filename() - for key in keys(a:types) - let values = filter(copy(a:tags), 'v:val.type == key') + for key in keys(a:settings.tags) + let values = filter(copy(a:tags), + \ 'v:val.type == key && get(v:val, "parent", "") == ""') if len(values) call formatter.blank() + call formatter.format(values, "") endif - call formatter.format(a:types[key], values, "") endfor return formatter endfunction " }}} function! s:FormatEmpty(types, tags) " {{{ - return taglisttoo#util#Formatter(a:tags) + return taglisttoo#util#Formatter(a:types, a:tags) endfunction " }}} function! s:GetTagInfo() " {{{ if line('.') > len(b:taglisttoo_content[0]) - return [] + return {} endif let index = b:taglisttoo_content[0][line('.') - 1] - if index == -1 - return [] + if index == -1 || (type(index) == 1 && index == 'label') + return {} endif return b:taglisttoo_tags[index] endfunction " }}} -function! s:EchoError(message) " {{{ - echohl Error - echo a:message - echohl Normal -endfunction " }}} - function! s:EchoTag() " {{{ if g:TaglistTooTagEcho let tag_info = s:GetTagInfo() @@ -831,16 +786,26 @@ function! s:EchoTag() " {{{ endfunction " }}} function! s:FoldLevel(lnum) " {{{ - let indent = indent(a:lnum) - let next_line = nextnonblank(a:lnum + 1) - if next_line - let next_indent = indent(next_line) - if next_indent > indent - let indent = next_indent + if !exists('b:taglisttoo_content') + return -1 + endif + + let index = b:taglisttoo_content[0][a:lnum - 1] + if index == -1 + return 0 + endif + + let lnum = a:lnum + let indent = indent(lnum) + let level = (indent / &shiftwidth) + 1 + if lnum != line('$') + if indent < indent(lnum + 1) + return '>' . level + elseif lnum != 1 && indent > indent(lnum + 1) + return '<' . ((indent(lnum - 1) / &shiftwidth) + 1) endif endif - let level = indent / &shiftwidth - return level + return '=' endfunction " }}} function! s:FoldClose() " {{{ @@ -902,8 +867,7 @@ function! s:FoldPath(path) " {{{ " make sure we didn't hit a tag that looks like a label let line = getline('.') - let col = len(line) - len(substitute(line, '^\s*', '', '')) + 1 - let syntax = synIDattr(synID(fold, col, 1), 'name') + let syntax = synIDattr(synID(fold, len(line), 1), 'name') if syntax != 'TagListKeyword' call cursor(line('.') + 1, 1) continue @@ -932,8 +896,7 @@ function! s:GetFoldPath(lnum) " {{{ let indent = indent(lnum) while lnum >= 1 let line = getline(lnum) - let col = len(line) - len(substitute(line, '^\s*', '', '')) + 1 - let syntax = synIDattr(synID(lnum, col, 1), 'name') + let syntax = synIDattr(synID(lnum, len(line), 1), 'name') if syntax == 'TagListKeyword' && (lnum == a:lnum || indent(lnum) < indent) call insert(path, substitute(line, '\(^\s*\|\s*$\)', '', 'g')) endif @@ -949,11 +912,7 @@ endfunction " }}} function! s:JumpToTag() " {{{ let tag_info = s:GetTagInfo() - if !len(tag_info) - "gryf: autoclose feature - if g:TagListTooAutoClose - call taglisttoo#taglist#Taglist() - endif + if !len(tag_info) || tag_info.line == -1 || get(tag_info, 'pattern', '') == '' return endif @@ -1013,10 +972,6 @@ function! s:JumpToTag() " {{{ call s:ShowCurrentTag() endif endif - "gryf: autoclose feature - if g:TagListTooAutoClose - call taglisttoo#taglist#Taglist() - endif endfunction " }}} function! s:Window(settings, tags) " {{{ @@ -1025,15 +980,9 @@ function! s:Window(settings, tags) " {{{ let winnum = s:GetTagListWinnr() if winnum == -1 - if exists('g:VerticalToolWindowSide') && - \ g:VerticalToolWindowSide == g:TaglistTooPosition - call eclim#display#window#VerticalToolWindowOpen(s:taglisttoo_title, 10, 1) - else - let position = g:TaglistTooPosition == 'right' ? 'botright' : 'topleft' - silent exec - \ position . ' vertical ' . g:Tlist_WinWidth . - \ ' split ' . escape(s:taglisttoo_title, ' ') - endif + let position = g:TaglistTooPosition == 'right' ? 'botright' : 'topleft' + exec position . ' vertical ' . g:Tlist_WinWidth . + \ ' split ' . escape(s:taglisttoo_title, ' ') let winnum = s:GetTagListWinnr() exe winnum . 'wincmd w' @@ -1045,16 +994,26 @@ function! s:Window(settings, tags) " {{{ setlocal winfixwidth setlocal nowrap nonumber setlocal foldmethod=expr foldlevel=99 - setlocal foldexpr=s:FoldLevel(v:lnum) foldtext=getline(v:foldstart) syn match TagListFileName "^.*\%1l.*" hi link TagListFileName Identifier hi link TagListKeyword Statement hi TagListCurrentTag term=bold,underline cterm=bold,underline gui=bold,underline + hi TagListVisibilityPublic ctermfg=green guifg=SeaGreen + hi TagListVisibilityPrivate ctermfg=red guifg=Red + hi TagListVisibilityProtected ctermfg=blue guifg=Blue + hi TagListVisibilityStatic ctermfg=magenta guifg=Magenta + if has('gui') && &background == 'dark' + hi TagListVisibilityPublic guifg=#8eb157 + hi TagListVisibilityPrivate guifg=#cf6171 + hi TagListVisibilityProtected guifg=#6699cc + hi TagListVisibilityStatic guifg=#cf9ebe + endif nnoremap :call JumpToTag() " folding related mappings + nnoremap o :call FoldToggle() nnoremap za :call FoldToggle() nnoremap zA :call FoldToggle() nnoremap zc :call FoldClose() @@ -1089,18 +1048,15 @@ function! s:Window(settings, tags) " {{{ if has_key(a:settings, 'format') let formatter = a:settings.format elseif len(a:tags) - if g:Tlist_Sort_Type == 'name' - call sort(a:tags, 'taglisttoo#util#SortTags') - endif let formatter = 's:FormatDefault' else let formatter = 's:FormatEmpty' endif try - let format = s:Function(formatter)(a:settings.tags, a:tags) + let format = s:Function(formatter)(a:settings, a:tags) catch /E700/ - call s:EchoError('Unknown function: ' . formatter) + call taglisttoo#util#EchoError('Unknown function: ' . formatter) return endtry let content = format.content @@ -1142,6 +1098,9 @@ function! s:Window(settings, tags) " {{{ let b:taglisttoo_content = [format.lines, content] let b:taglisttoo_tags = a:tags let b:taglisttoo_file_bufnr = file_bufnr + + " must be after definition of buffer vars + setlocal foldexpr=s:FoldLevel(v:lnum) foldtext=getline(v:foldstart) endfunction " }}} function! s:ShowCurrentTag() " {{{ @@ -1217,14 +1176,11 @@ function! s:FileSupported(filename, ftype) " {{{ endfunction " }}} function! s:CloseIfLastWindow() " {{{ - if histget(':', -1) !~ '^bd' - let numtoolwindows = 0 - if winnr('$') == 1 - if tabpagenr('$') > 1 - tabclose - else - quitall - endif + if winnr('$') == 1 + if tabpagenr('$') > 1 + tabclose + else + quitall endif endif endfunction " }}} diff --git a/bundle/git_taglisttoo/autoload/taglisttoo/util.vim b/bundle/git_taglisttoo/autoload/taglisttoo/util.vim new file mode 100644 index 0000000..55f7463 --- /dev/null +++ b/bundle/git_taglisttoo/autoload/taglisttoo/util.vim @@ -0,0 +1,373 @@ +" Author: Eric Van Dewoestine +" +" License: {{{ +" Copyright (c) 2005 - 2012, Eric Van Dewoestine +" All rights reserved. +" +" Redistribution and use of this software in source and binary forms, with +" or without modification, are permitted provided that the following +" conditions are met: +" +" * Redistributions of source code must retain the above +" copyright notice, this list of conditions and the +" following disclaimer. +" +" * Redistributions in binary form must reproduce the above +" copyright notice, this list of conditions and the +" following disclaimer in the documentation and/or other +" materials provided with the distribution. +" +" * Neither the name of Eric Van Dewoestine nor the names of its +" contributors may be used to endorse or promote products derived from +" this software without specific prior written permission of +" Eric Van Dewoestine. +" +" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +" IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +" THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +" }}} + +" Script Variables {{{ + let s:class = '^\(class\|interface\|object\|package\|namespace\|struct\|trait\|type\)$' +" }}} + +function! taglisttoo#util#Formatter(settings, tags) " {{{ + let formatter = { + \ 'lines': [], 'content': [], 'syntax': [], 'headings': [], + \ 'settings': a:settings, 'types': a:settings.tags, + \ 'tags': a:tags, + \ } + + function! formatter.filename() dict " {{{ + call add(self.content, expand('%:t')) + call add(self.lines, -1) + endfunction " }}} + + function! formatter.format(values, indent) dict " {{{ + if type(a:values) == 4 + let tag = a:values + call self.add(tag, a:indent) + elseif type(a:values) == 3 && len(a:values) > 0 + call self.recurse(a:values, a:indent) + endif + endfunction " }}} + + function! formatter.recurse(values, indent) dict " {{{ + if !len(a:values) + return + endif + + if g:Tlist_Sort_Type == 'name' + call sort(a:values, 's:SortTagsByName') + endif + + call add(self.headings, '') + + for value in a:values + if !has_key(self.types, value.type) + continue + endif + + let tag_type = self.types[value.type] + if !self.in_heading(tag_type) && tag_type !~ s:class + call self.heading(tag_type, a:indent) + endif + + let indent = a:indent + if self.current_heading() != '' + " indent tags below a heading an extra level + let indent = a:indent . "\t" + endif + + call self.add(value, indent) + endfor + + let self.headings = self.headings[:-2] + endfunction " }}} + + function! formatter.add(value, indent) dict " {{{ + let indent = a:indent + let tag_type = self.types[a:value.type] + + let [visibility, visibility_syntax] = taglisttoo#util#GetVisibility(a:value) + let name = a:value.name + + if tag_type =~ s:class + let name .= ' : ' . tag_type + " indent nested classes, but line up w/ preceding headings. + if self.current_heading() != '' + let indent = indent[:-2] + endif + " separate top level classes with a blank line + if indent == '' + call self.blank() + endif + " push the current class heading onto the stack + if len(self.headings) + let self.headings[-1] = tag_type + endif + endif + + call add(self.lines, index(self.tags, a:value)) + call add(self.content, indent . visibility . name) + call add(self.syntax, + \ 'syn match TagListKeyword "' . tag_type . '\%' . len(self.lines) . 'l$"') + if visibility != '' + call add(self.syntax, + \ 'syn match ' . visibility_syntax . + \ ' "^\s*\M' . visibility . '\m\%' . len(self.lines) . 'l"') + endif + + let parent = '' + if get(a:value, 'parent', '') != '' + let parent_type = substitute(a:value.parent, '^\(.\{-}\):.*', '\1', '') + let parent_name = substitute(a:value.parent, '^.\{-}:\(.*\)', '\1', '') + let parent = parent_name . get(self.settings, 'separator', '.') + endif + let parent = tag_type . ':' . parent . a:value.name + let lnum = a:value.line + let next_idx = index(self.tags, a:value) + 1 + if next_idx < len(self.tags) && get(self.tags[next_idx], "parent", "") == parent + let nested = filter(self.tags[next_idx :], + \ 'get(v:val, "parent", "") == parent') + call self.recurse(nested, indent . "\t") + endif + endfunction " }}} + + function! formatter.heading(label, indent) dict " {{{ + let self.headings[-1] = a:label + call add(self.lines, 'label') + call add(self.content, a:indent . a:label) + call add(self.syntax, 'syn match TagListKeyword "^.*\%' . len(self.lines) . 'l.*"') + endfunction " }}} + + function! formatter.in_heading(name) dict " {{{ + for h in reverse(copy(self.headings)) + if h == '' + continue + endif + return h == a:name + endfor + endfunction " }}} + + function! formatter.current_heading() dict " {{{ + return len(self.headings) ? self.headings[-1] : '' + endfunction " }}} + + function! formatter.blank() dict " {{{ + if len(self.headings) + let self.headings[-1] = '' + endif + + if self.content[-1] != '' + call add(self.content, '') + call add(self.lines, -1) + endif + endfunction " }}} + + return formatter +endfunction " }}} + +function! taglisttoo#util#GetVisibility(tag) " {{{ + let pattern = a:tag.pattern + let name = escape(a:tag.name, '~') + if pattern =~ '\.*' . name + if pattern =~ '\.*' . name + return ['*', 'TagListVisibilityStatic'] + endif + return ['+', 'TagListVisibilityPublic'] + elseif pattern =~ '\.*' . name + return ['#', 'TagListVisibilityProtected'] + elseif pattern =~ '\.*' . name + return ['-', 'TagListVisibilityPrivate'] + endif + return ['', ''] +endfunction " }}} + +function! taglisttoo#util#Parse(file, settings, patterns) " {{{ +python << PYTHONEOF +filename = vim.eval('a:file') +patterns = vim.eval('a:patterns') +settings = vim.eval('a:settings') +result = taglisttoo.parse(filename, settings, patterns) +vim.command('let results = %s' % ('%r' % result).replace("\\'", "''")) +PYTHONEOF + + let tags = [] + if len(results) + for result in results + " filter false positives found in comments or strings + let lnum = result.line + let line = getline(lnum) + let col = len(line) - len(substitute(line, '^\s*', '', '')) + 1 + if synIDattr(synID(lnum, col, 1), 'name') =~? '\(comment\|string\)' || + \ synIDattr(synIDtrans(synID(lnum, col, 1)), 'name') =~? '\(comment\|string\)' + continue + endif + + call add(tags, result) + endfor + endif + + call sort(tags, 's:SortTagsByLine') + + return tags +endfunction " }}} + +function! taglisttoo#util#ParseCtags(filename, settings) " {{{ +python << PYTHONEOF +try: + settings = vim.eval('a:settings') + filename = vim.eval('a:filename') + lang = settings['lang'] + types = ''.join(settings['tags'].keys()) + + retcode, result = taglisttoo.ctags(lang, types, filename) + vim.command('let retcode = %i' % retcode) + vim.command("let result = '%s'" % result.replace("'", "''")) +except Exception as e: + vim.command("call taglisttoo#util#EchoError('%s')" % str(e).replace("'", "''")) + vim.command('let retcode = -1') +PYTHONEOF + + if retcode + if retcode != -1 + call taglisttoo#util#EchoError('taglist failed with error code: ' . retcode) + endif + return [] + endif + + if has('win32') || has('win64') || has('win32unix') + let result = substitute(result, "\\n", '\n', 'g') + endif + + let results = split(result, '\n') + while len(results) && results[0] =~ 'ctags.*: Warning:' + call remove(results, 0) + endwhile + + let types = a:settings.tags + let parsed_results = [] + for result in results + let pre = substitute(result, '\(.\{-}\)\t\/\^.*', '\1', '') + let pattern = substitute(result, '.\{-}\(\/\^.*\/;"\).*', '\1', '') + let post = substitute(result, '.\{-}\/\^.*\/;"\t', '', '') + + let [name, filename] = split(pre, '\t') + let parts = split(post, '\t') + let [type, line_str] = parts[:1] + exec 'let line = ' . substitute(line_str, 'line:', '', '') + let pattern = substitute(pattern, '^/\(.*\)/;"$', '\1', '') + let parent = len(parts) > 2 ? parts[2] : '' + + " ctags (mine at least) is not properly honoring ---kinds, so + " perform our own check here. + if has_key(types, type) + call add(parsed_results, { + \ 'type': type, + \ 'type_name': types[type], + \ 'name': name, + \ 'pattern': pattern, + \ 'line': line, + \ 'parent': parent, + \ }) + endif + endfor + + return parsed_results +endfunction " }}} + +function! taglisttoo#util#SetNestedParents(types, tags, parent_types, parent_pair_start, parent_pair_end) " {{{ + let pos = getpos('.') + + let parents = [] + + for tag in a:tags + " pop off any parents that we've moved out of scope of + while len(parents) && tag.line > parents[-1].end + let parents = parents[:-2] + endwhile + + " check if tag is a child + if len(parents) && tag.line < parents[-1].end + let parent = parents[-1] + let parent_name = '' + for parent in parents + if parent_name != '' + let parent_name .= '.' + endif + let parent_name .= parent.tag.name + endfor + let parent_name = a:types[parents[-1].tag.type] . ':' . parent_name + let tag['parent'] = parent_name + endif + + " check if tag is a potential parent + if index(a:parent_types, tag.type) != -1 + call cursor(tag.line, 1) + let next_index = index(a:tags, tag) + 1 + let next = next_index < len(a:tags) ? a:tags[next_index].line : line('$') + while search(a:parent_pair_start, 'W') && s:SkipComments() + " no op + endwhile + " handle case where the pair start/end are optional for the type in the + " current language (eg. scala), by disalowing a start found on or past + " the next tag. + if line('.') != tag.line && line('.') >= next + continue + endif + + let end = searchpair( + \ a:parent_pair_start, '', a:parent_pair_end, 'Wn', 's:SkipComments()') + call add(parents, {'tag': tag, 'start': tag.line, 'end': end}) + endif + endfor + + call setpos('.', pos) +endfunction " }}} + +function! taglisttoo#util#EchoError(message) " {{{ + echohl Error + echo a:message + echohl Normal +endfunction " }}} + +function! s:SortTagsByLine(tag1, tag2) " {{{ + let line1 = a:tag1.line + let line2 = a:tag2.line + return line1 == line2 ? 0 : line1 > line2 ? 1 : -1 +endfunction " }}} + +function! s:SortTagsByName(tag1, tag2) " {{{ + let type1 = a:tag1.type_name + let type2 = a:tag2.type_name + + if type1 != type2 + if type1 =~ s:class && type2 !~ s:class + return 1 + elseif type1 !~ s:class && type2 =~ s:class + return -1 + endif + + return type1 > type2 ? 1 : -1 + endif + + let name1 = tolower(a:tag1.name) + let name2 = tolower(a:tag2.name) + return name1 == name2 ? 0 : name1 > name2 ? 1 : -1 +endfunction " }}} + +function! s:SkipComments() " {{{ + let synname = synIDattr(synID(line('.'), col('.'), 1), "name") + return synname =~? '\(comment\|string\)' +endfunction " }}} + +" vim:ft=vim:fdm=marker diff --git a/doc/taglisttoo.txt b/bundle/git_taglisttoo/doc/taglisttoo.txt similarity index 88% rename from doc/taglisttoo.txt rename to bundle/git_taglisttoo/doc/taglisttoo.txt index 70bf946..63f6bcb 100644 --- a/doc/taglisttoo.txt +++ b/bundle/git_taglisttoo/doc/taglisttoo.txt @@ -9,7 +9,6 @@ TaglistToo *taglisttoo* *TaglistToo* Configuration |taglisttoo-configuration| Extending / Customizing |taglisttoo-customization| Parsing New File Types |taglisttoo-parse| - Customizing taglist Contents |taglisttoo-format| ----------------------------------------------------------------------------- Prerequisites *taglisttoo-prerequisites* @@ -190,7 +189,7 @@ replacement text or group used to obtain the tag name. Here is an example function which processes the web.xml file described above: > function! ParseWebXml(file, settings) - return taglisttoo#util#Parse(a:file, [ + return taglisttoo#util#Parse(a:file, a:settings, [ \ ['s', '\s*\s*(.*?)\s*', 1], \ ['m', '\s*\s*(.*?)\s*', 1], \ ]) @@ -232,34 +231,4 @@ Note: This example introduces a new file type, webxml, which doesn't exist by default in vim, so if you want to test this out on a real web.xml file you'll need to manually set the file type (:set ft=webxml). -Customizing taglist contents: *taglisttoo-format* - -In addition to parsing new file types, you can also customize the taglist -format for new or existing file types. To do so you simply tell TaglistToo to -use a different format function. Here is an example using TagListToo's python -settings: > - - let g:tlist_python_settings = { - \ 'lang': 'python', - \ 'format': 'taglisttoo#lang#python#Format', - \ 'tags': { - \ 'c': 'class', - \ 'm': 'member', - \ 'f': 'function' - \ } - \ } -> - -Instead of using the default format, TaglistToo will invoke the -taglisttoo#lang#python#Format function which in this case will group members -and functions by the class they are defined in and any global functions will -be displayed at the top of the taglist window. - -Unfortunately, implementing a function which customizes the taglist layout is -not as straight forward and writing one which parses a new file type. If you -wish to write one of these format functions, currently you are best off -copying one of the format functions defined in one of the -autoload/taglisttoo/lang/.vim files and customizing it to your needs. -Hopefully future versions of TaglistToo will make writing these easier. - vim:tw=78:ft=help:norl: diff --git a/plugin/taglisttoo.vim b/bundle/git_taglisttoo/plugin/taglisttoo.vim similarity index 97% rename from plugin/taglisttoo.vim rename to bundle/git_taglisttoo/plugin/taglisttoo.vim index e641418..90663c0 100644 --- a/plugin/taglisttoo.vim +++ b/bundle/git_taglisttoo/plugin/taglisttoo.vim @@ -1,7 +1,7 @@ " Author: Eric Van Dewoestine " " License: {{{ -" Copyright (c) 2005 - 2010, Eric Van Dewoestine +" Copyright (c) 2005 - 2012, Eric Van Dewoestine " All rights reserved. " " Redistribution and use of this software in source and binary forms, with @@ -47,6 +47,10 @@ let g:loaded_taglist = 1 " Global Variables {{{ +if !exists('g:Tlist_Debug') + let g:Tlist_Debug = 0 +endif + if !exists('g:Tlist_Ctags_Cmd') if executable('exuberant-ctags') let g:Tlist_Ctags_Cmd = 'exuberant-ctags' diff --git a/plugin/grep.vim b/bundle/grep/plugin/grep.vim similarity index 100% rename from plugin/grep.vim rename to bundle/grep/plugin/grep.vim diff --git a/bundle/gundo/README.markdown b/bundle/gundo/README.markdown new file mode 100644 index 0000000..4adeade --- /dev/null +++ b/bundle/gundo/README.markdown @@ -0,0 +1,34 @@ + +Flattr this + +Gundo.vim is Vim plugin to visualize your Vim undo tree. + +Preview +------- + +Screencast: + +### [http://screenr.com/M9l](http://screenr.com/M9l) + +Screenshot: + +gundo + +Requirements +------------ + +* Vim 7.3+ +* Python support for Vim +* Python 2.4+ + +Installation and Usage +---------------------- + +Check out the [project site][] for installation instructions. + +[project site]: http://sjl.bitbucket.org/gundo.vim/ + +License +------- + +GPLv2+, just like Mercurial. diff --git a/plugin/gundo.py b/bundle/gundo/autoload/gundo.py similarity index 99% rename from plugin/gundo.py rename to bundle/gundo/autoload/gundo.py index aedc05e..21d66f0 100644 --- a/plugin/gundo.py +++ b/bundle/gundo/autoload/gundo.py @@ -553,7 +553,10 @@ def GundoPlayTo(): return None nodes.append(current) - return reversed(nodes) if rev else nodes + if rev: + return reversed(nodes) + else: + return nodes branch = _walk_branch(start, end) diff --git a/autoload/gundo.vim b/bundle/gundo/autoload/gundo.vim similarity index 87% rename from autoload/gundo.vim rename to bundle/gundo/autoload/gundo.vim index 1b5de02..c0033a6 100644 --- a/autoload/gundo.vim +++ b/bundle/gundo/autoload/gundo.vim @@ -19,22 +19,6 @@ if v:version < '703'"{{{ finish endif"}}} -if has('python')"{{{ - let s:has_supported_python = 1 -else - let s:has_supported_python = 0 -endif - -if !s:has_supported_python - function! s:GundoDidNotLoad() - echohl WarningMsg|echomsg "Gundo requires Vim to be compiled with Python 2.4+"|echohl None - endfunction - command! -nargs=0 GundoToggle call s:GundoDidNotLoad() - finish -endif"}}} - -let s:plugin_path = escape(expand(':p:h'), '\') - if !exists('g:gundo_width')"{{{ let g:gundo_width = 45 endif"}}} @@ -59,7 +43,26 @@ endif"}}} if !exists("g:gundo_close_on_revert")"{{{ let g:gundo_close_on_revert = 0 endif"}}} +if !exists("g:gundo_prefer_python3")"{{{ + let g:gundo_prefer_python3 = 0 +endif"}}} +let s:has_supported_python = 0 +if g:gundo_prefer_python3 && has('python3')"{{{ + let s:has_supported_python = 2 +elseif has('python')" + let s:has_supported_python = 1 +endif + +if !s:has_supported_python + function! s:GundoDidNotLoad() + echohl WarningMsg|echomsg "Gundo requires Vim to be compiled with Python 2.4+"|echohl None + endfunction + command! -nargs=0 GundoToggle call s:GundoDidNotLoad() + finish +endif"}}} + +let s:plugin_path = escape(expand(':p:h'), '\') "}}} "{{{ Gundo utility functions @@ -213,6 +216,9 @@ function! s:GundoOpenGraph()"{{{ call s:GundoResizeBuffers(winnr()) endif endif + if exists("g:gundo_tree_statusline") + let &l:statusline = g:gundo_tree_statusline + endif endfunction"}}} function! s:GundoOpenPreview()"{{{ @@ -247,6 +253,9 @@ function! s:GundoOpenPreview()"{{{ endif endif endif + if exists("g:gundo_preview_statusline") + let &l:statusline = g:gundo_preview_statusline + endif endfunction"}}} function! s:GundoClose()"{{{ @@ -263,8 +272,13 @@ endfunction"}}} function! s:GundoOpen()"{{{ if !exists('g:gundo_py_loaded') - exe 'pyfile ' . s:plugin_path . '/gundo.py' - python initPythonModule() + if s:has_supported_python == 2 && g:gundo_prefer_python3 + exe 'py3file ' . s:plugin_path . '/gundo.py' + python3 initPythonModule() + else + exe 'pyfile ' . s:plugin_path . '/gundo.py' + python initPythonModule() + endif if !s:has_supported_python function! s:GundoDidNotLoad() @@ -303,6 +317,14 @@ function! s:GundoToggle()"{{{ endif endfunction"}}} +function! s:GundoShow()"{{{ + call s:GundoOpen() +endfunction"}}} + +function! s:GundoHide()"{{{ + call s:GundoClose() +endfunction"}}} + "}}} "{{{ Gundo mouse handling @@ -363,15 +385,27 @@ endfunction"}}} "{{{ Gundo rendering function! s:GundoRenderGraph()"{{{ - python GundoRenderGraph() + if s:has_supported_python == 2 && g:gundo_prefer_python3 + python3 GundoRenderGraph() + else + python GundoRenderGraph() + endif endfunction"}}} function! s:GundoRenderPreview()"{{{ - python GundoRenderPreview() + if s:has_supported_python == 2 && g:gundo_prefer_python3 + python3 GundoRenderPreview() + else + python GundoRenderPreview() + endif endfunction"}}} function! s:GundoRenderChangePreview()"{{{ - python GundoRenderChangePreview() + if s:has_supported_python == 2 && g:gundo_prefer_python3 + python3 GundoRenderChangePreview() + else + python GundoRenderChangePreview() + endif endfunction"}}} "}}} @@ -379,11 +413,19 @@ endfunction"}}} "{{{ Gundo undo/redo function! s:GundoRevert()"{{{ - python GundoRevert() + if s:has_supported_python == 2 && g:gundo_prefer_python3 + python3 GundoRevert() + else + python GundoRevert() + endif endfunction"}}} function! s:GundoPlayTo()"{{{ - python GundoPlayTo() + if s:has_supported_python == 2 && g:gundo_prefer_python3 + python3 GundoPlayTo() + else + python GundoPlayTo() + endif endfunction"}}} "}}} @@ -404,4 +446,4 @@ augroup GundoAug autocmd BufNewFile __Gundo_Preview__ call s:GundoSettingsPreview() augroup END -"}}} \ No newline at end of file +"}}} diff --git a/doc/gundo.txt b/bundle/gundo/doc/gundo.txt similarity index 95% rename from doc/gundo.txt rename to bundle/gundo/doc/gundo.txt index f05989b..ee9a0d4 100644 --- a/doc/gundo.txt +++ b/bundle/gundo/doc/gundo.txt @@ -17,6 +17,8 @@ CONTENTS *Gundo-contents* 3.7 gundo_map_move_older ...... |gundo_map_move_older| gundo_map_move_newer ...... |gundo_map_move_newer| 3.8 gundo_close_on_revert ..... |gundo_close_on_revert| + 3.9 gundo_preview_statusline .. |gundo_preview_statusline| + gundo_tree_statusline ..... |gundo_tree_statusline| 4. License ........................ |GundoLicense| 5. Bugs ........................... |GundoBugs| 6. Contributing ................... |GundoContributing| @@ -196,6 +198,14 @@ Set this to 1 to automatically close the Gundo windows when reverting. Default: 0 (windows do not automatically close) +------------------------------------------------------------------------------ +3.9 g:gundo_preview_statusline *gundo_preview_statusline* + g:gundo_tree_statusline *gundo_tree_statusline* + +Set these to a string to display it as the status line for each Gundo window. + +Default: unset (windows use the default statusline) + ============================================================================== 4. License *GundoLicense* @@ -219,6 +229,8 @@ GitHub: http://github.com/sjl/gundo.vim/ ============================================================================== 7. Changelog *GundoChangelog* +v2.3.0 + * Add statusline configuration. v2.2.2 * More performance improvements. v2.2.1 diff --git a/bundle/gundo/plugin/gundo.vim b/bundle/gundo/plugin/gundo.vim new file mode 100644 index 0000000..ed59293 --- /dev/null +++ b/bundle/gundo/plugin/gundo.vim @@ -0,0 +1,24 @@ +" ============================================================================ +" File: gundo.vim +" Description: vim global plugin to visualize your undo tree +" Maintainer: Steve Losh +" License: GPLv2+ -- look it up. +" Notes: Much of this code was thiefed from Mercurial, and the rest was +" heavily inspired by scratch.vim and histwin.vim. +" +" ============================================================================ + + +"{{{ Init +if !exists('g:gundo_debug') && (exists('g:gundo_disable') || exists('loaded_gundo') || &cp)"{{{ + finish +endif +let loaded_gundo = 1"}}} +"}}} + +"{{{ Misc +command! -nargs=0 GundoToggle call gundo#GundoToggle() +command! -nargs=0 GundoShow call gundo#GundoShow() +command! -nargs=0 GundoHide call gundo#GundoHide() +command! -nargs=0 GundoRenderGraph call gundo#GundoRenderGraph() +"}}} diff --git a/indent/html.vim b/bundle/indent_javascript/indent/html.vim similarity index 100% rename from indent/html.vim rename to bundle/indent_javascript/indent/html.vim diff --git a/indent/javascript.vim b/bundle/indent_javascript/indent/javascript.vim similarity index 100% rename from indent/javascript.vim rename to bundle/indent_javascript/indent/javascript.vim diff --git a/bundle/indent_javascript/test.html b/bundle/indent_javascript/test.html new file mode 100644 index 0000000..b475bc2 --- /dev/null +++ b/bundle/indent_javascript/test.html @@ -0,0 +1,399 @@ + + + + + + Test + + + + + diff --git a/indent/mako.vim b/bundle/indent_mako/indent/mako.vim similarity index 100% rename from indent/mako.vim rename to bundle/indent_mako/indent/mako.vim diff --git a/bundle/indent_python/indent/python.vim b/bundle/indent_python/indent/python.vim new file mode 100644 index 0000000..f9d557a --- /dev/null +++ b/bundle/indent_python/indent/python.vim @@ -0,0 +1,8 @@ +let current_file = expand('%:p') + +if match(current_file, '\cicard') < 0 + ru! indent/python_pep8.vim +else + let g:pep8_exclude=['W191'] + ru! $VIMRUNTIME/indent/python.vim +endif diff --git a/indent/python_pep8.vim b/bundle/indent_python/indent/python_pep8.vim similarity index 100% rename from indent/python_pep8.vim rename to bundle/indent_python/indent/python_pep8.vim diff --git a/plugin/jsbeautify.vim b/bundle/jsbeautify/plugin/jsbeautify.vim similarity index 100% rename from plugin/jsbeautify.vim rename to bundle/jsbeautify/plugin/jsbeautify.vim diff --git a/autoload/loremipsum.txt b/bundle/loremipsum/autoload/loremipsum.txt similarity index 100% rename from autoload/loremipsum.txt rename to bundle/loremipsum/autoload/loremipsum.txt diff --git a/autoload/loremipsum.vim b/bundle/loremipsum/autoload/loremipsum.vim similarity index 100% rename from autoload/loremipsum.vim rename to bundle/loremipsum/autoload/loremipsum.vim diff --git a/doc/loremipsum.txt b/bundle/loremipsum/doc/loremipsum.txt similarity index 100% rename from doc/loremipsum.txt rename to bundle/loremipsum/doc/loremipsum.txt diff --git a/plugin/loremipsum.vim b/bundle/loremipsum/plugin/loremipsum.vim similarity index 100% rename from plugin/loremipsum.vim rename to bundle/loremipsum/plugin/loremipsum.vim diff --git a/autoload/mark.vim b/bundle/mark/autoload/mark.vim similarity index 98% rename from autoload/mark.vim rename to bundle/mark/autoload/mark.vim index 2774465..71a8bb4 100644 --- a/autoload/mark.vim +++ b/bundle/mark/autoload/mark.vim @@ -23,7 +23,8 @@ " set l:isWrapped instead. " - FIX: Wrong logic for determining l:isWrapped lets wrap-around go undetected " when v:count >= number of total matches. [l:startLine, l:startCol] must -" be updated on every iteration. +" be updated on every iteration, and should therefore be named [l:prevLine, +" l:prevCol]. " " 17-May-2011, Ingo Karkat " - Make s:GetVisualSelection() public to allow use in suggested @@ -531,7 +532,7 @@ function! s:Search( pattern, isBackward, currentMarkPosition, searchType ) let l:isMatch = 0 let l:line = 0 while l:count > 0 - let [l:startLine, l:startCol] = [line('.'), col('.')] + let [l:prevLine, l:prevCol] = [line('.'), col('.')] " Search for next match, 'wrapscan' applies. let [l:line, l:col] = searchpos( a:pattern, (a:isBackward ? 'b' : '') ) @@ -571,9 +572,9 @@ function! s:Search( pattern, isBackward, currentMarkPosition, searchType ) " Note: No need to check 'wrapscan'; the wrapping can only occur if " 'wrapscan' is actually on. - if ! a:isBackward && (l:startLine > l:line || l:startLine == l:line && l:startCol >= l:col) + if ! a:isBackward && (l:prevLine > l:line || l:prevLine == l:line && l:prevCol >= l:col) let l:isWrapped = 1 - elseif a:isBackward && (l:startLine < l:line || l:startLine == l:line && l:startCol <= l:col) + elseif a:isBackward && (l:prevLine < l:line || l:prevLine == l:line && l:prevCol <= l:col) let l:isWrapped = 1 endif else diff --git a/doc/mark.txt b/bundle/mark/doc/mark.txt similarity index 97% rename from doc/mark.txt rename to bundle/mark/doc/mark.txt index 5528d09..1bd4080 100644 --- a/doc/mark.txt +++ b/bundle/mark/doc/mark.txt @@ -176,6 +176,9 @@ your vimrc file (or anywhere before this plugin is sourced), in the following form (where N = 1..): > highlight MarkWordN ctermbg=Cyan ctermfg=Black guibg=#8CCBEA guifg=Black Higher numbers always take precedence and are displayed above lower ones. +If you want to avoid losing the highlightings on |:colorscheme| commands, you +need to re-apply your highlights on the |ColorScheme| event, similar to how +this plugin does. The search type highlighting (in the search message) can be changed via: > highlight link SearchSpecialSearchType MoreMsg @@ -249,6 +252,10 @@ http://vim.wikia.com/wiki/Highlight_multiple_words: ============================================================================== HISTORY *mark-history* +2.5.3 02-Mar-2012 +- BUG: Version check mistakenly excluded Vim 7.1 versions that do have the + matchadd() function. Thanks to Philipp Marek for sending a patch. + 2.5.2 09-Nov-2011 Fixed various problems with wrap-around warnings: - BUG: With a single match and 'wrapscan' set, a search error was issued. @@ -397,8 +404,8 @@ Last version published by Yuheng Xie on vim.org. Initial version published by Yuheng Xie on vim.org. ============================================================================== -Copyright: (C) 2005-2008 by Yuheng Xie - (C) 2008-2011 by Ingo Karkat +Copyright: (C) 2005-2008 Yuheng Xie + (C) 2008-2012 Ingo Karkat The VIM LICENSE applies to this script; see|copyright|. Maintainer: Ingo Karkat diff --git a/plugin/mark.vim b/bundle/mark/plugin/mark.vim similarity index 98% rename from plugin/mark.vim rename to bundle/mark/plugin/mark.vim index e51c373..4bd2c1b 100644 --- a/plugin/mark.vim +++ b/bundle/mark/plugin/mark.vim @@ -1,8 +1,8 @@ " Script Name: mark.vim " Description: Highlight several words in different colors simultaneously. " -" Copyright: (C) 2005-2008 by Yuheng Xie -" (C) 2008-2011 by Ingo Karkat +" Copyright: (C) 2005-2008 Yuheng Xie +" (C) 2008-2012 Ingo Karkat " The VIM LICENSE applies to this script; see ':help copyright'. " " Maintainer: Ingo Karkat @@ -13,8 +13,12 @@ " - Requires Vim 7.1 with "matchadd()", or Vim 7.2 or higher. " - mark.vim autoload script. " -" Version: 2.5.0 +" Version: 2.5.3 " Changes: +" 02-Mar-2012, Philipp Marek +" - BUG: Version check mistakenly excluded Vim 7.1 versions that do have the +" matchadd() function. +" " 06-May-2011, Ingo Karkat " - By default, enable g:mwAutoSaveMarks, so that marks are always persisted, " but disable g:mwAutoLoadMarks, so that persisted marks have to be explicitly @@ -152,7 +156,7 @@ " -> e.g. :Mark Mark.\{-}\ze( " Avoid installing twice or when in unsupported Vim version. -if exists('g:loaded_mark') || (v:version == 701 && ! exists('*matchadd')) || (v:version < 702) +if exists('g:loaded_mark') || (v:version == 701 && ! exists('*matchadd')) || (v:version < 701) finish endif let g:loaded_mark = 1 diff --git a/doc/NERD_commenter.txt b/bundle/nerdcommenter/doc/NERD_commenter.txt similarity index 100% rename from doc/NERD_commenter.txt rename to bundle/nerdcommenter/doc/NERD_commenter.txt diff --git a/plugin/NERD_commenter.vim b/bundle/nerdcommenter/plugin/NERD_commenter.vim similarity index 100% rename from plugin/NERD_commenter.vim rename to bundle/nerdcommenter/plugin/NERD_commenter.vim diff --git a/plugin/occur.vim b/bundle/occur/plugin/occur.vim similarity index 100% rename from plugin/occur.vim rename to bundle/occur/plugin/occur.vim diff --git a/plugin/repeat.vim b/bundle/repeat/autoload/repeat.vim similarity index 100% rename from plugin/repeat.vim rename to bundle/repeat/autoload/repeat.vim diff --git a/doc/showmarks.txt b/bundle/showmarks/doc/showmarks.txt similarity index 100% rename from doc/showmarks.txt rename to bundle/showmarks/doc/showmarks.txt diff --git a/plugin/showmarks.vim b/bundle/showmarks/plugin/showmarks.vim similarity index 100% rename from plugin/showmarks.vim rename to bundle/showmarks/plugin/showmarks.vim diff --git a/after/plugin/snipMate.vim b/bundle/snipmate/after/plugin/snipMate.vim similarity index 100% rename from after/plugin/snipMate.vim rename to bundle/snipmate/after/plugin/snipMate.vim diff --git a/autoload/snipMate.vim b/bundle/snipmate/autoload/snipMate.vim similarity index 100% rename from autoload/snipMate.vim rename to bundle/snipmate/autoload/snipMate.vim diff --git a/doc/snipMate.txt b/bundle/snipmate/doc/snipMate.txt similarity index 100% rename from doc/snipMate.txt rename to bundle/snipmate/doc/snipMate.txt diff --git a/ftplugin/html_snip_helper.vim b/bundle/snipmate/ftplugin/html_snip_helper.vim similarity index 100% rename from ftplugin/html_snip_helper.vim rename to bundle/snipmate/ftplugin/html_snip_helper.vim diff --git a/plugin/snipMate.vim b/bundle/snipmate/plugin/snipMate.vim similarity index 100% rename from plugin/snipMate.vim rename to bundle/snipmate/plugin/snipMate.vim diff --git a/snippets/_.snippets b/bundle/snipmate/snippets/_.snippets similarity index 90% rename from snippets/_.snippets rename to bundle/snipmate/snippets/_.snippets index 68a5a58..45452c5 100644 --- a/snippets/_.snippets +++ b/bundle/snipmate/snippets/_.snippets @@ -22,3 +22,7 @@ snippet ~ ­ snippet ... … +snippet fn + `expand("%")` +snippet fp + `expand("%:p")` diff --git a/snippets/autoit.snippets b/bundle/snipmate/snippets/autoit.snippets similarity index 100% rename from snippets/autoit.snippets rename to bundle/snipmate/snippets/autoit.snippets diff --git a/snippets/c.snippets b/bundle/snipmate/snippets/c.snippets similarity index 100% rename from snippets/c.snippets rename to bundle/snipmate/snippets/c.snippets diff --git a/snippets/cpp.snippets b/bundle/snipmate/snippets/cpp.snippets similarity index 100% rename from snippets/cpp.snippets rename to bundle/snipmate/snippets/cpp.snippets diff --git a/snippets/html.snippets b/bundle/snipmate/snippets/html.snippets similarity index 100% rename from snippets/html.snippets rename to bundle/snipmate/snippets/html.snippets diff --git a/snippets/java.snippets b/bundle/snipmate/snippets/java.snippets similarity index 100% rename from snippets/java.snippets rename to bundle/snipmate/snippets/java.snippets diff --git a/snippets/javascript.snippets b/bundle/snipmate/snippets/javascript.snippets similarity index 100% rename from snippets/javascript.snippets rename to bundle/snipmate/snippets/javascript.snippets diff --git a/snippets/mako.snippets b/bundle/snipmate/snippets/mako.snippets similarity index 100% rename from snippets/mako.snippets rename to bundle/snipmate/snippets/mako.snippets diff --git a/snippets/mkd.snippets b/bundle/snipmate/snippets/mkd.snippets similarity index 100% rename from snippets/mkd.snippets rename to bundle/snipmate/snippets/mkd.snippets diff --git a/snippets/objc.snippets b/bundle/snipmate/snippets/objc.snippets similarity index 100% rename from snippets/objc.snippets rename to bundle/snipmate/snippets/objc.snippets diff --git a/snippets/perl.snippets b/bundle/snipmate/snippets/perl.snippets similarity index 100% rename from snippets/perl.snippets rename to bundle/snipmate/snippets/perl.snippets diff --git a/snippets/php.snippets b/bundle/snipmate/snippets/php.snippets similarity index 100% rename from snippets/php.snippets rename to bundle/snipmate/snippets/php.snippets diff --git a/snippets/python.snippets b/bundle/snipmate/snippets/python.snippets similarity index 89% rename from snippets/python.snippets rename to bundle/snipmate/snippets/python.snippets index 24bba7d..41ce05e 100644 --- a/snippets/python.snippets +++ b/bundle/snipmate/snippets/python.snippets @@ -5,11 +5,11 @@ snippet imp import ${1:module} # Module Docstring snippet docs - ''' + """ File: ${1:`Filename('$1.py', 'foo.py')`} Author: ${2:`g:snips_author`} Description: ${3} - ''' + """ snippet wh while ${1:condition}: ${2:# code...} @@ -19,7 +19,9 @@ snippet for # New Class snippet cl class ${1:ClassName}(${2:object}): - """${3:docstring for $1}""" + """ + ${3:docstring for $1} + """ def __init__(self, ${4:arg}): ${5:super($1, self).__init__()} self.$4 = $4 @@ -27,7 +29,9 @@ snippet cl # New Function snippet def def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - """${3:docstring for $1}""" + """ + ${3:docstring for $1} + """ ${4:pass} snippet deff def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): @@ -106,9 +110,11 @@ snippet docmodule """ snippet debug LOG.debug(self.${1:method_name}.__doc__.strip()) +snippet pywin + import pywin.debugger; pywin.debugger.set_trace() snippet edbg import sys - pydevdPath = r"/mnt/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc" + pydevdPath = r"/home/share/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc" if not pydevdPath in sys.path: sys.path.append(pydevdPath) import pydevd diff --git a/snippets/rst.snippets b/bundle/snipmate/snippets/rst.snippets similarity index 100% rename from snippets/rst.snippets rename to bundle/snipmate/snippets/rst.snippets diff --git a/snippets/ruby.snippets b/bundle/snipmate/snippets/ruby.snippets similarity index 100% rename from snippets/ruby.snippets rename to bundle/snipmate/snippets/ruby.snippets diff --git a/snippets/sh.snippets b/bundle/snipmate/snippets/sh.snippets similarity index 100% rename from snippets/sh.snippets rename to bundle/snipmate/snippets/sh.snippets diff --git a/snippets/snippet.snippets b/bundle/snipmate/snippets/snippet.snippets similarity index 100% rename from snippets/snippet.snippets rename to bundle/snipmate/snippets/snippet.snippets diff --git a/snippets/tcl.snippets b/bundle/snipmate/snippets/tcl.snippets similarity index 100% rename from snippets/tcl.snippets rename to bundle/snipmate/snippets/tcl.snippets diff --git a/snippets/tex.snippets b/bundle/snipmate/snippets/tex.snippets similarity index 100% rename from snippets/tex.snippets rename to bundle/snipmate/snippets/tex.snippets diff --git a/snippets/vim.snippets b/bundle/snipmate/snippets/vim.snippets similarity index 100% rename from snippets/vim.snippets rename to bundle/snipmate/snippets/vim.snippets diff --git a/snippets/xhtml.snippets b/bundle/snipmate/snippets/xhtml.snippets similarity index 100% rename from snippets/xhtml.snippets rename to bundle/snipmate/snippets/xhtml.snippets diff --git a/snippets/zsh.snippets b/bundle/snipmate/snippets/zsh.snippets similarity index 100% rename from snippets/zsh.snippets rename to bundle/snipmate/snippets/zsh.snippets diff --git a/syntax/snippet.vim b/bundle/snipmate/syntax/snippet.vim similarity index 100% rename from syntax/snippet.vim rename to bundle/snipmate/syntax/snippet.vim diff --git a/doc/surround.txt b/bundle/surround/doc/surround.txt similarity index 100% rename from doc/surround.txt rename to bundle/surround/doc/surround.txt diff --git a/plugin/surround.vim b/bundle/surround/plugin/surround.vim similarity index 100% rename from plugin/surround.vim rename to bundle/surround/plugin/surround.vim diff --git a/bundle/syntax_fitnesse/README.fitnesse b/bundle/syntax_fitnesse/README.fitnesse new file mode 100644 index 0000000..3b04d55 --- /dev/null +++ b/bundle/syntax_fitnesse/README.fitnesse @@ -0,0 +1,67 @@ +README for fitnesse.vim (Version 0.1) / May 22 2009 + + * INSTALLATION + * RELEASE NOTES + * CREDITS + + +fitnesse.vim is a syntax file (and eventually some filetype specific functions) +for editing FitNesse tests using Vim. It was created to make it easier to work +with fitnesse files. It works great in conjunction with "It's All Text" a +plugin for FireFox (found at https://addons.mozilla.org/en-US/firefox/addon/4125). + +FitNesse is a collaborative testing tool that uses Wiki markup to create test +scripts as web pages. See http://fitnesse.org for more information. + +This release is very Slim centric. + + +INSTALLATION +------------------------ + +The files in the Zip file are stored in the same folders they need to be +placed in under the vimfiles folder ( $HOME/.vim/ or %VIM%\vimfils depending +on your OS). + +1) Unzip the fitnesse.vim.zip file to the vimfiles folder. Unless you are + customizing the file, you should be OK to overwrite the files. + +2) Syntax coloring support must be enabled. + + You can do this by adding :syntax enable to your _vimrc or .vimrc file. + +3) If you want automatic detection you will need to: + + a) Check to see if you have a scripts.vim file already in place. This + file allows post loading checking of files to execute scripts. + + b) If you do not have a scripts.vim file in your vimfiles folder, rename + the scripts.vim.add file to scripts.vim. + + c) If you do have a scripts.vim file; open the scripts.vim.fitnesse_add + file and copy the text in that file to your scripts.vim file. + +RELEASE NOTES +------------------------ + +Version 0.1: + + This release supports the following syntax: + * Numerous keywords in Slim and FitNesse are supported: + scenario, script, Query:, start, check, reject, show, Comment, comment, + !see, !include, !See, null, !define, !include + * Simple collapsible sections (with folding enabled) !** *!, !**> *! + * Table cell delimiter "|" + * Cell contents + * Incomplete cell is error + * !style_(class) + * Strings in Quotes + * Scenario variables @parametername + * Symbols $symbolname + * Simple WikiWord support + +CREDITS +------------------------ + + * Bob Martin for FitNesse and Slim + * Brett Schuchert for Recommending It's All Text diff --git a/bundle/syntax_fitnesse/scripts.vim.fitnesse_add b/bundle/syntax_fitnesse/scripts.vim.fitnesse_add new file mode 100644 index 0000000..db0d3c1 --- /dev/null +++ b/bundle/syntax_fitnesse/scripts.vim.fitnesse_add @@ -0,0 +1,4 @@ + if getline(1) =~ '^#fitnesse' + setfiletype fitnesse + endif +f diff --git a/syntax/fitnesse.vim b/bundle/syntax_fitnesse/syntax/fitnesse.vim similarity index 100% rename from syntax/fitnesse.vim rename to bundle/syntax_fitnesse/syntax/fitnesse.vim diff --git a/autoload/tagbar.vim b/bundle/tagbar/autoload/tagbar.vim similarity index 100% rename from autoload/tagbar.vim rename to bundle/tagbar/autoload/tagbar.vim diff --git a/doc/tagbar.txt b/bundle/tagbar/doc/tagbar.txt similarity index 100% rename from doc/tagbar.txt rename to bundle/tagbar/doc/tagbar.txt diff --git a/plugin/tagbar.vim b/bundle/tagbar/plugin/tagbar.vim similarity index 100% rename from plugin/tagbar.vim rename to bundle/tagbar/plugin/tagbar.vim diff --git a/syntax/tagbar.vim b/bundle/tagbar/syntax/tagbar.vim similarity index 100% rename from syntax/tagbar.vim rename to bundle/tagbar/syntax/tagbar.vim diff --git a/doc/vcscommand.txt b/bundle/vcscommand/doc/vcscommand.txt similarity index 100% rename from doc/vcscommand.txt rename to bundle/vcscommand/doc/vcscommand.txt diff --git a/plugin/vcsbzr.vim b/bundle/vcscommand/plugin/vcsbzr.vim similarity index 100% rename from plugin/vcsbzr.vim rename to bundle/vcscommand/plugin/vcsbzr.vim diff --git a/plugin/vcscommand.vim b/bundle/vcscommand/plugin/vcscommand.vim similarity index 100% rename from plugin/vcscommand.vim rename to bundle/vcscommand/plugin/vcscommand.vim diff --git a/plugin/vcscvs.vim b/bundle/vcscommand/plugin/vcscvs.vim similarity index 100% rename from plugin/vcscvs.vim rename to bundle/vcscommand/plugin/vcscvs.vim diff --git a/plugin/vcsgit.vim b/bundle/vcscommand/plugin/vcsgit.vim similarity index 100% rename from plugin/vcsgit.vim rename to bundle/vcscommand/plugin/vcsgit.vim diff --git a/plugin/vcshg.vim b/bundle/vcscommand/plugin/vcshg.vim similarity index 100% rename from plugin/vcshg.vim rename to bundle/vcscommand/plugin/vcshg.vim diff --git a/plugin/vcssvk.vim b/bundle/vcscommand/plugin/vcssvk.vim similarity index 100% rename from plugin/vcssvk.vim rename to bundle/vcscommand/plugin/vcssvk.vim diff --git a/plugin/vcssvn.vim b/bundle/vcscommand/plugin/vcssvn.vim similarity index 100% rename from plugin/vcssvn.vim rename to bundle/vcscommand/plugin/vcssvn.vim diff --git a/syntax/cvsannotate.vim b/bundle/vcscommand/syntax/cvsannotate.vim similarity index 100% rename from syntax/cvsannotate.vim rename to bundle/vcscommand/syntax/cvsannotate.vim diff --git a/syntax/gitannotate.vim b/bundle/vcscommand/syntax/gitannotate.vim similarity index 100% rename from syntax/gitannotate.vim rename to bundle/vcscommand/syntax/gitannotate.vim diff --git a/syntax/hgannotate.vim b/bundle/vcscommand/syntax/hgannotate.vim similarity index 100% rename from syntax/hgannotate.vim rename to bundle/vcscommand/syntax/hgannotate.vim diff --git a/syntax/svkannotate.vim b/bundle/vcscommand/syntax/svkannotate.vim similarity index 100% rename from syntax/svkannotate.vim rename to bundle/vcscommand/syntax/svkannotate.vim diff --git a/syntax/svnannotate.vim b/bundle/vcscommand/syntax/svnannotate.vim similarity index 100% rename from syntax/svnannotate.vim rename to bundle/vcscommand/syntax/svnannotate.vim diff --git a/syntax/vcscommit.vim b/bundle/vcscommand/syntax/vcscommit.vim similarity index 100% rename from syntax/vcscommit.vim rename to bundle/vcscommand/syntax/vcscommit.vim diff --git a/autoload/vimwiki/base.vim b/bundle/vimwiki/autoload/vimwiki/base.vim similarity index 100% rename from autoload/vimwiki/base.vim rename to bundle/vimwiki/autoload/vimwiki/base.vim diff --git a/autoload/vimwiki/default.tpl b/bundle/vimwiki/autoload/vimwiki/default.tpl similarity index 100% rename from autoload/vimwiki/default.tpl rename to bundle/vimwiki/autoload/vimwiki/default.tpl diff --git a/autoload/vimwiki/diary.vim b/bundle/vimwiki/autoload/vimwiki/diary.vim similarity index 100% rename from autoload/vimwiki/diary.vim rename to bundle/vimwiki/autoload/vimwiki/diary.vim diff --git a/autoload/vimwiki/html.vim b/bundle/vimwiki/autoload/vimwiki/html.vim similarity index 100% rename from autoload/vimwiki/html.vim rename to bundle/vimwiki/autoload/vimwiki/html.vim diff --git a/autoload/vimwiki/lst.vim b/bundle/vimwiki/autoload/vimwiki/lst.vim similarity index 100% rename from autoload/vimwiki/lst.vim rename to bundle/vimwiki/autoload/vimwiki/lst.vim diff --git a/autoload/vimwiki/style.css b/bundle/vimwiki/autoload/vimwiki/style.css similarity index 100% rename from autoload/vimwiki/style.css rename to bundle/vimwiki/autoload/vimwiki/style.css diff --git a/autoload/vimwiki/tbl.vim b/bundle/vimwiki/autoload/vimwiki/tbl.vim similarity index 100% rename from autoload/vimwiki/tbl.vim rename to bundle/vimwiki/autoload/vimwiki/tbl.vim diff --git a/doc/vimwiki.txt b/bundle/vimwiki/doc/vimwiki.txt similarity index 100% rename from doc/vimwiki.txt rename to bundle/vimwiki/doc/vimwiki.txt diff --git a/ftplugin/vimwiki.vim b/bundle/vimwiki/ftplugin/vimwiki.vim similarity index 100% rename from ftplugin/vimwiki.vim rename to bundle/vimwiki/ftplugin/vimwiki.vim diff --git a/plugin/vimwiki.vim b/bundle/vimwiki/plugin/vimwiki.vim similarity index 100% rename from plugin/vimwiki.vim rename to bundle/vimwiki/plugin/vimwiki.vim diff --git a/syntax/vimwiki.vim b/bundle/vimwiki/syntax/vimwiki.vim similarity index 100% rename from syntax/vimwiki.vim rename to bundle/vimwiki/syntax/vimwiki.vim diff --git a/syntax/vimwiki_default.vim b/bundle/vimwiki/syntax/vimwiki_default.vim similarity index 100% rename from syntax/vimwiki_default.vim rename to bundle/vimwiki/syntax/vimwiki_default.vim diff --git a/syntax/vimwiki_media.vim b/bundle/vimwiki/syntax/vimwiki_media.vim similarity index 100% rename from syntax/vimwiki_media.vim rename to bundle/vimwiki/syntax/vimwiki_media.vim diff --git a/autoload/vst/default.css b/bundle/vst/autoload/vst/default.css similarity index 100% rename from autoload/vst/default.css rename to bundle/vst/autoload/vst/default.css diff --git a/autoload/vst/lightblue.css b/bundle/vst/autoload/vst/lightblue.css similarity index 100% rename from autoload/vst/lightblue.css rename to bundle/vst/autoload/vst/lightblue.css diff --git a/autoload/vst/myhtmlvst.vim b/bundle/vst/autoload/vst/myhtmlvst.vim similarity index 100% rename from autoload/vst/myhtmlvst.vim rename to bundle/vst/autoload/vst/myhtmlvst.vim diff --git a/autoload/vst/s5ui/blank.gif b/bundle/vst/autoload/vst/s5ui/blank.gif similarity index 100% rename from autoload/vst/s5ui/blank.gif rename to bundle/vst/autoload/vst/s5ui/blank.gif diff --git a/autoload/vst/s5ui/framing.css b/bundle/vst/autoload/vst/s5ui/framing.css similarity index 100% rename from autoload/vst/s5ui/framing.css rename to bundle/vst/autoload/vst/s5ui/framing.css diff --git a/autoload/vst/s5ui/iepngfix.htc b/bundle/vst/autoload/vst/s5ui/iepngfix.htc similarity index 100% rename from autoload/vst/s5ui/iepngfix.htc rename to bundle/vst/autoload/vst/s5ui/iepngfix.htc diff --git a/autoload/vst/s5ui/opera.css b/bundle/vst/autoload/vst/s5ui/opera.css similarity index 100% rename from autoload/vst/s5ui/opera.css rename to bundle/vst/autoload/vst/s5ui/opera.css diff --git a/autoload/vst/s5ui/outline.css b/bundle/vst/autoload/vst/s5ui/outline.css similarity index 100% rename from autoload/vst/s5ui/outline.css rename to bundle/vst/autoload/vst/s5ui/outline.css diff --git a/autoload/vst/s5ui/pretty.css b/bundle/vst/autoload/vst/s5ui/pretty.css similarity index 100% rename from autoload/vst/s5ui/pretty.css rename to bundle/vst/autoload/vst/s5ui/pretty.css diff --git a/autoload/vst/s5ui/print.css b/bundle/vst/autoload/vst/s5ui/print.css similarity index 100% rename from autoload/vst/s5ui/print.css rename to bundle/vst/autoload/vst/s5ui/print.css diff --git a/autoload/vst/s5ui/s5-core.css b/bundle/vst/autoload/vst/s5ui/s5-core.css similarity index 100% rename from autoload/vst/s5ui/s5-core.css rename to bundle/vst/autoload/vst/s5ui/s5-core.css diff --git a/autoload/vst/s5ui/slides.css b/bundle/vst/autoload/vst/s5ui/slides.css similarity index 100% rename from autoload/vst/s5ui/slides.css rename to bundle/vst/autoload/vst/s5ui/slides.css diff --git a/autoload/vst/s5ui/slides.js b/bundle/vst/autoload/vst/s5ui/slides.js similarity index 100% rename from autoload/vst/s5ui/slides.js rename to bundle/vst/autoload/vst/s5ui/slides.js diff --git a/autoload/vst/vst.vim b/bundle/vst/autoload/vst/vst.vim similarity index 100% rename from autoload/vst/vst.vim rename to bundle/vst/autoload/vst/vst.vim diff --git a/doc2/test.png b/bundle/vst/doc2/test.png similarity index 100% rename from doc2/test.png rename to bundle/vst/doc2/test.png diff --git a/doc2/vst-s5.txt b/bundle/vst/doc2/vst-s5.txt similarity index 100% rename from doc2/vst-s5.txt rename to bundle/vst/doc2/vst-s5.txt diff --git a/doc2/vst.txt b/bundle/vst/doc2/vst.txt similarity index 100% rename from doc2/vst.txt rename to bundle/vst/doc2/vst.txt diff --git a/plugin/vstplugin.vim b/bundle/vst/plugin/vstplugin.vim similarity index 100% rename from plugin/vstplugin.vim rename to bundle/vst/plugin/vstplugin.vim diff --git a/plugin/zoom.vim b/bundle/zoom/plugin/zoom.vim similarity index 100% rename from plugin/zoom.vim rename to bundle/zoom/plugin/zoom.vim diff --git a/bundle_pmx/compiler/autopylint.vim b/bundle_pmx/compiler/autopylint.vim new file mode 100644 index 0000000..7a20ab6 --- /dev/null +++ b/bundle_pmx/compiler/autopylint.vim @@ -0,0 +1,12 @@ +" Vim compiler file for Python +" Compiler: Static code checking tool for Python +" Maintainer: Roman 'gryf' Dobosz +" Last Change: 2010-09-12 +" Version: 1.0 +if exists("current_compiler") + finish +endif + +let current_compiler = "autopylint" +CompilerSet makeprg=$VIM\\bin\\autopylint.py\ -p8\ %:p +CompilerSet efm=%f\|\ %t\|\ %l\|\ %c\|\ %m,%f\|\ %t\|\ %l\|\ %m diff --git a/bundle_pmx/ftplugin/python/common.vim b/bundle_pmx/ftplugin/python/common.vim new file mode 100644 index 0000000..a9ec46d --- /dev/null +++ b/bundle_pmx/ftplugin/python/common.vim @@ -0,0 +1,69 @@ +setlocal cinkeys-=0# +setlocal indentkeys-=0# +setlocal expandtab +setlocal foldlevel=100 +setlocal foldmethod=indent +setlocal list +setlocal noautoindent +setlocal smartindent +setlocal cinwords=if,elif,else,for,while,try,except,finally,def,class,with +setlocal smarttab +setlocal textwidth=78 +setlocal colorcolumn=+1 +" overwrite status line +setlocal statusline=%<%F\ %{TagInStatusLine()}\ %h%m%r%=%(%l,%c%V%)\ %3p%% + +set wildignore+=*.pyc + +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 + +compiler autopylint + +if !exists('*PyLintBuf') + function PyLintBuf(save_and_close) + echohl Statement + echo "Running pylint (ctrl-c to cancel) ..." + echohl Normal + let filename = expand('%:p') + let cmd = expand('$VIM') . '\bin\autopylint.py -8 "' . filename . '"' + + if has('win32') || has('win64') + let cmd = 'cmd /c ' . cmd + endif + + exec "bel silent new " . filename . ".lint" + exec "silent! read! " . cmd + if a:save_and_close != 0 + exec "w!" + exec "bd" + endif + endfunction + command -bang -nargs=? PyLintBuf call PyLintBuf(0) +endif +map :PyLintBuf + +finish "end here. all below is just for the record. + +" Pylint function, which can be optionally mapped to some keys. Currently +" not used. +if !exists('*runPyLint') + function runPyLint() + echohl Statement + echo "Running pylint (ctrl-c to cancel) ..." + echohl Normal + :Pylint + endfunction +endif + diff --git a/bundle_pmx/ftplugin/python/pep8.vim b/bundle_pmx/ftplugin/python/pep8.vim new file mode 100644 index 0000000..2442d57 --- /dev/null +++ b/bundle_pmx/ftplugin/python/pep8.vim @@ -0,0 +1,55 @@ +if exists("b:did_pdpep8_functions") + finish " only load once +else + let b:did_pdpep8_functions = 1 +endif + +if !exists('*s:pdPep8') + function s:pdPep8() + set lazyredraw + " Close any existing cwindows. + cclose + let l:grepformat_save = &grepformat + let l:grepprogram_save = &grepprg + set grepformat&vim + set grepformat&vim + let &grepformat = '%f:%l:%m' + let &grepprg = 'c:\\Python27\\Scripts\\pep8.exe --repeat --ignore=E111' + if &readonly == 0 | update | endif + silent! grep! % + let &grepformat = l:grepformat_save + let &grepprg = l:grepprogram_save + let l:mod_total = 0 + let l:win_count = 1 + " Determine correct window height + windo let l:win_count = l:win_count + 1 + if l:win_count <= 2 | let l:win_count = 4 | endif + windo let l:mod_total = l:mod_total + winheight(0)/l:win_count | + \ execute 'resize +'.l:mod_total + " Open cwindow + execute 'belowright copen '.l:mod_total + nnoremap c :cclose + set nolazyredraw + redraw! + endfunction + command! Pep8 call s:pdPep8() +endif + +if !exists('*s:pdPep8Buf') + function s:pdPep8Buf() + echohl Statement + echo "Running pep8 (ctrl-c to cancel) ..." + echohl Normal + let file = expand('%:p') + "let cmd = 'pylint --reports=n --output-format=text "' . file . '"' + let cmd = 'c:\\Python26\\Scripts\\pep8.exe "' . file . '"' + + if has('win32') || has('win64') + let cmd = 'cmd /c "' . cmd . '"' + endif + + exec "bel silent new " . file . ".lint" + exec "silent! read! " . cmd + endfunction + command! Pep8buf call s:pdPep8Buf() +endif diff --git a/bundle_pmx/snippets/pmx.snippets b/bundle_pmx/snippets/pmx.snippets new file mode 100644 index 0000000..6876f55 --- /dev/null +++ b/bundle_pmx/snippets/pmx.snippets @@ -0,0 +1,90 @@ + +snippet edbg + import sys + pydevdPath = r"c:\eclipse\plugins\org.python.pydev.debug_2.0.0.2011040403\pysrc" + if not pydevdPath in sys.path: + sys.path.append(pydevdPath) + import pydevd + pydevd.settrace() +snippet utimport + import pdunittest.common.pmxunittest as pmxunittest + +snippet classt + class ${1:Foo}Tests(pmxunittest.TestCase): + """ + Tests for class $1 Tests + """ + def setUp(self): + """ + TODO: Setup test + """ + pass + + def tearDown(self): + """ + TODO: Cleanup test + """ + pass + + def test_${2:method}(self): + """ + Test $2 method of class $1 + """ + ${3:pass} +snippet runt + def run(): + """ + runs unit tests in "interactive" mode + """ + suite1 = pmxunittest.TestLoader().loadTestsFromTestCase(${1:ClassTests}) + suite = pmxunittest.TestSuite([suite1]) + ret = pmxunittest.TextTestRunner().run(suite) + return ret + + if __name__ == '__main__': + run() + + # How to run manually: + # + # C:\> cd L:\runtime\pdpyapp + # C:\> L: + # L:\runtime\pdpyapp> startapp pdunittest\${2:`expand("%:t:r")`} + # + # Use parameters: + # -c (--changes) to check db changes after test run + # -c -r (--report) to gather detailed html report additionally + + tested_modules = ['${3:module}'] # modules referenced by the test + automatic_run = ${4:True} # should it be run automatically? + execution_time = 0.000 # estimated time of test ru +snippet deft + def test_${1:fname}(self): + """ + Test for $1 + """ + ${2:pass} +snippet trace + import traceback + print "", 80*"-" + for _line in traceback.format_stack(): + print _line.strip() +snippet pdlog + from PDLOG import PDLOG + PDLOG(${1:31337}, ${2:"msg"}) +snippet head + """ + Project: 8202 / EBR + Description: ${2:description} + Created: ${3:00}.${4:2010}, ${5:author} + + $RCSfile: ebrfoo.py,v $ + $Source: /var/cvs/pmx/pylib/ebrfoo.py,v $ + $Date: 2010/10/06 14:24:13 $ + $Author: foo $ + $Revision: 1.0 $ + + (c) Copyright ${6:2010} Rockwell Automation, + 40-382 Katowice, Poland + """ + vcsid = "$Header: /var/cvs/pmx/pylib/ebrfoo.py,v 1.1 2009/10/06 14:24:13 foo Exp $" + ${7} diff --git a/bundle_pmx/snippets/spyce.snippets b/bundle_pmx/snippets/spyce.snippets new file mode 100644 index 0000000..fc99449 --- /dev/null +++ b/bundle_pmx/snippets/spyce.snippets @@ -0,0 +1,88 @@ +snippet #! + #!/usr/bin/python + +snippet imp + import ${1:module} +# Module Docstring +snippet docs + ''' + File: ${1:`Filename('$1.py', 'foo.py')`} + Author: ${2:`g:snips_author`} + Description: ${3} + ''' +snippet wh + while ${1:condition}: + ${2:# code...} +snippet for + for ${1:needle} in ${2:haystack}: + ${3:# code...} +# New Class +snippet cl + class ${1:ClassName}(${2:object}): + """${3:docstring for $1}""" + def __init__(self, ${4:arg}): + ${5:super($1, self).__init__()} + self.$4 = $4 + ${6} +# New Function +snippet def + def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): + """${3:docstring for $1}""" + ${4:pass} +snippet deff + def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): + ${3} +# New Method +snippet defs + def ${1:mname}(self, ${2:arg}): + ${3:pass} +# New Property +snippet property + def ${1:foo}(): + doc = "${2:The $1 property.}" + def fget(self): + ${3:return self._$1} + def fset(self, value): + ${4:self._$1 = value} +# Lambda +snippet ld + ${1:var} = lambda ${2:vars} : ${3:action} +snippet . + self. +snippet try Try/Except + try: + ${1:pass} + except ${2:Exception}, ${3:e}: + ${4:raise $3} +snippet try Try/Except/Else + try: + ${1:pass} + except ${2:Exception}, ${3:e}: + ${4:raise $3} + else: + ${5:pass} +snippet try Try/Except/Finally + try: + ${1:pass} + except ${2:Exception}, ${3:e}: + ${4:raise $3} + finally: + ${5:pass} +snippet try Try/Except/Else/Finally + try: + ${1:pass} + except ${2:Exception}, ${3:e}: + ${4:raise $3} + else: + ${5:pass} + finally: + ${6:pass} +# if __name__ == '__main__': +snippet ifmain + if __name__ == '__main__': + ${1:main()} +# __magic__ +snippet _ + __${1:init}__${2} +snippet dbg + import pywin.debugger; pywin.debugger.set_trace() diff --git a/colors/github.vim b/colors/github.vim deleted file mode 100644 index 0b0877d..0000000 --- a/colors/github.vim +++ /dev/null @@ -1,141 +0,0 @@ -" Vim color file -" -" Author: Anthony Carapetis -" -" Note: Based on github's syntax highlighting theme -" Used Brian Mock's darkspectrum as a starting point/template -" Thanks to Ryan Heath for an easy list of some of the colours: -" http://rpheath.com/posts/356-github-theme-for-syntax-gem - -hi clear - -set background=light -if version > 580 - " no guarantees for version 5.8 and below, but this makes it stop - " complaining - hi clear - if exists("syntax_on") - syntax reset - endif -endif -let g:colors_name="github" - -hi Normal guifg=#000000 guibg=#F8F8FF - -" {{{ Cursor -hi Cursor guibg=#444454 guifg=#F8F8FF -hi CursorLine guibg=#D8D8DD -hi CursorColumn guibg=#E8E8EE -" gryf: added colorcolumn highlight -hi ColorColumn guibg=#E8E8EE -" }}} - -" {{{ Diff -hi DiffAdd guifg=#003300 guibg=#DDFFDD gui=none -hi DiffChange guibg=#ececec gui=none -hi DiffText guifg=#000033 guibg=#DDDDFF gui=none -hi DiffDelete guifg=#DDCCCC guibg=#FFDDDD gui=none -" }}} - -" {{{ Folding / Line Numbering / Status Lines -hi Folded guibg=#ECECEC guifg=#808080 gui=bold -hi vimFold guibg=#ECECEC guifg=#808080 gui=bold -hi FoldColumn guibg=#ECECEC guifg=#808080 gui=bold - -hi LineNr guifg=#959595 guibg=#ECECEC gui=bold -hi NonText guifg=#808080 guibg=#ECECEC -hi Folded guifg=#808080 guibg=#ECECEC gui=bold -hi FoldeColumn guifg=#808080 guibg=#ECECEC gui=bold - -hi VertSplit guibg=#bbbbbb guifg=#bbbbbb gui=none -hi StatusLine guibg=#bbbbbb guifg=#404040 gui=bold -hi StatusLineNC guibg=#d4d4d4 guifg=#404040 gui=italic -" }}} - -" {{{ Misc -hi ModeMsg guifg=#990000 -hi MoreMsg guifg=#990000 - -hi Title guifg=#ef5939 -hi WarningMsg guifg=#ef5939 -hi SpecialKey guifg=#177F80 gui=italic - -hi MatchParen guibg=#cdcdfd guifg=#000000 -hi Underlined guifg=#000000 gui=underline -hi Directory guifg=#990000 -" }}} - -" {{{ Search, Visual, etc -hi Visual guifg=#FFFFFF guibg=#3465a4 gui=none -hi VisualNOS guifg=#FFFFFF guibg=#204a87 gui=none -hi IncSearch guibg=#cdcdfd guifg=#000000 gui=italic -hi Search guibg=#cdcdfd guifg=#000000 gui=italic -" }}} - -" {{{ Syntax groups -hi Ignore guifg=#808080 -hi Identifier guifg=#0086B3 -hi PreProc guifg=#A0A0A0 gui=bold -hi Comment guifg=#999988 -hi Constant guifg=#177F80 gui=none -hi String guifg=#D81745 -hi Function guifg=#990000 gui=bold -hi Statement guifg=#000000 gui=bold -hi Type guifg=#445588 gui=bold -hi Number guifg=#1C9898 -hi Todo guifg=#FFFFFF guibg=#990000 gui=bold -hi Special guifg=#159828 gui=bold -hi rubySymbol guifg=#960B73 -hi Error guibg=#f8f8ff guifg=#ff1100 gui=undercurl -hi Todo guibg=#f8f8ff guifg=#ff1100 gui=underline -hi Label guifg=#000000 gui=bold -hi StorageClass guifg=#000000 gui=bold -hi Structure guifg=#000000 gui=bold -hi TypeDef guifg=#000000 gui=bold -" }}} - -" {{{ Completion menus -hi WildMenu guifg=#7fbdff guibg=#425c78 gui=none - -hi Pmenu guibg=#808080 guifg=#ffffff gui=bold -hi PmenuSel guibg=#cdcdfd guifg=#000000 gui=italic -hi PmenuSbar guibg=#000000 guifg=#444444 -hi PmenuThumb guibg=#aaaaaa guifg=#aaaaaa -" }}} - -" {{{ Spelling -hi spellBad guisp=#fcaf3e -hi spellCap guisp=#73d216 -hi spellRare guisp=#fcaf3e -hi spellLocal guisp=#729fcf -" }}} - -" {{{ Aliases -hi link cppSTL Function -hi link cppSTLType Type -hi link Character Number -hi link htmlTag htmlEndTag -"hi link htmlTagName htmlTag -hi link htmlLink Underlined -hi link pythonFunction Identifier -hi link Question Type -hi link CursorIM Cursor -hi link VisualNOS Visual -hi link xmlTag Identifier -hi link xmlTagName Identifier -hi link shDeref Identifier -hi link shVariable Function -hi link rubySharpBang Special -hi link perlSharpBang Special -hi link schemeFunc Statement -"hi link shSpecialVariables Constant -"hi link bashSpecialVariables Constant -" }}} - -" {{{ Tabs (non-gui0 -hi TabLine guifg=#404040 guibg=#dddddd gui=none -hi TabLineFill guifg=#404040 guibg=#dddddd gui=none -hi TabLineSel guifg=#404040 gui=bold -" }}} -" -" vim: sw=4 ts=4 foldmethod=marker diff --git a/colors/inkpot.vim b/colors/inkpot.vim deleted file mode 100644 index 6949f35..0000000 --- a/colors/inkpot.vim +++ /dev/null @@ -1,218 +0,0 @@ -" Vim color file -" Name: inkpot.vim -" Maintainer: Ciaran McCreesh -" Homepage: http://github.com/ciaranm/inkpot/ -" -" This should work in the GUI, rxvt-unicode (88 colour mode) and xterm (256 -" colour mode). It won't work in 8/16 colour terminals. -" -" To use a black background, :let g:inkpot_black_background = 1 - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif - -let colors_name = "inkpot" - -" map a urxvt cube number to an xterm-256 cube number -fun! M(a) - return strpart("0135", a:a, 1) + 0 -endfun - -" map a urxvt colour to an xterm-256 colour -fun! X(a) - if &t_Co == 88 - return a:a - else - if a:a == 8 - return 237 - elseif a:a < 16 - return a:a - elseif a:a > 79 - return 232 + (3 * (a:a - 80)) - else - let l:b = a:a - 16 - let l:x = l:b % 4 - let l:y = (l:b / 4) % 4 - let l:z = (l:b / 16) - return 16 + M(l:x) + (6 * M(l:y)) + (36 * M(l:z)) - endif - endif -endfun - -if ! exists("g:inkpot_black_background") - let g:inkpot_black_background = 0 -endif - -if has("gui_running") - if ! g:inkpot_black_background - hi Normal gui=NONE guifg=#cfbfad guibg=#1e1e27 - else - hi Normal gui=NONE guifg=#cfbfad guibg=#000000 - endif - - hi CursorLine guibg=#2e2e37 - " gryf: added colorcolumn highlight - hi ColorColumn guibg=#2e2e37 - - hi IncSearch gui=BOLD guifg=#303030 guibg=#cd8b60 - hi Search gui=NONE guifg=#303030 guibg=#ad7b57 - hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#ce4e4e - hi WarningMsg gui=BOLD guifg=#ffffff guibg=#ce8e4e - hi ModeMsg gui=BOLD guifg=#7e7eae guibg=NONE - hi MoreMsg gui=BOLD guifg=#7e7eae guibg=NONE - hi Question gui=BOLD guifg=#ffcd00 guibg=NONE - - hi StatusLine gui=BOLD guifg=#b9b9b9 guibg=#3e3e5e - hi User1 gui=BOLD guifg=#00ff8b guibg=#3e3e5e - hi User2 gui=BOLD guifg=#7070a0 guibg=#3e3e5e - hi StatusLineNC gui=NONE guifg=#b9b9b9 guibg=#3e3e5e - hi VertSplit gui=NONE guifg=#b9b9b9 guibg=#3e3e5e - - hi WildMenu gui=BOLD guifg=#eeeeee guibg=#6e6eaf - - hi MBENormal guifg=#cfbfad guibg=#2e2e3f - hi MBEChanged guifg=#eeeeee guibg=#2e2e3f - hi MBEVisibleNormal guifg=#cfcfcd guibg=#4e4e8f - hi MBEVisibleChanged guifg=#eeeeee guibg=#4e4e8f - - hi DiffText gui=NONE guifg=#ffffcd guibg=#4a2a4a - hi DiffChange gui=NONE guifg=#ffffcd guibg=#306b8f - hi DiffDelete gui=NONE guifg=#ffffcd guibg=#6d3030 - hi DiffAdd gui=NONE guifg=#ffffcd guibg=#306d30 - - hi Cursor gui=NONE guifg=#404040 guibg=#8b8bff - hi lCursor gui=NONE guifg=#404040 guibg=#8fff8b - hi CursorIM gui=NONE guifg=#404040 guibg=#8b8bff - - hi Folded gui=NONE guifg=#cfcfcd guibg=#4b208f - hi FoldColumn gui=NONE guifg=#8b8bcd guibg=#2e2e2e - - hi Directory gui=NONE guifg=#00ff8b guibg=NONE - hi LineNr gui=NONE guifg=#8b8bcd guibg=#2e2e2e - hi NonText gui=BOLD guifg=#8b8bcd guibg=NONE - hi SpecialKey gui=BOLD guifg=#ab60ed guibg=NONE - hi Title gui=BOLD guifg=#af4f4b guibg=NONE - hi Visual gui=NONE guifg=#eeeeee guibg=#4e4e8f - - hi Comment gui=NONE guifg=#cd8b00 guibg=NONE - hi Constant gui=NONE guifg=#ffcd8b guibg=NONE - hi String gui=NONE guifg=#ffcd8b guibg=#404040 - hi Error gui=NONE guifg=#ffffff guibg=#6e2e2e - hi Identifier gui=NONE guifg=#ff8bff guibg=NONE - hi Ignore gui=NONE - hi Number gui=NONE guifg=#f0ad6d guibg=NONE - hi PreProc gui=NONE guifg=#409090 guibg=NONE - hi Special gui=NONE guifg=#c080d0 guibg=NONE - hi SpecialChar gui=NONE guifg=#c080d0 guibg=#404040 - hi Statement gui=NONE guifg=#808bed guibg=NONE - hi Todo gui=BOLD guifg=#303030 guibg=#d0a060 - hi Type gui=NONE guifg=#ff8bff guibg=NONE - hi Underlined gui=BOLD guifg=#df9f2d guibg=NONE - hi TaglistTagName gui=BOLD guifg=#808bed guibg=NONE - - hi perlSpecialMatch gui=NONE guifg=#c080d0 guibg=#404040 - hi perlSpecialString gui=NONE guifg=#c080d0 guibg=#404040 - - hi cSpecialCharacter gui=NONE guifg=#c080d0 guibg=#404040 - hi cFormat gui=NONE guifg=#c080d0 guibg=#404040 - - hi doxygenBrief gui=NONE guifg=#fdab60 guibg=NONE - hi doxygenParam gui=NONE guifg=#fdd090 guibg=NONE - hi doxygenPrev gui=NONE guifg=#fdd090 guibg=NONE - hi doxygenSmallSpecial gui=NONE guifg=#fdd090 guibg=NONE - hi doxygenSpecial gui=NONE guifg=#fdd090 guibg=NONE - hi doxygenComment gui=NONE guifg=#ad7b20 guibg=NONE - hi doxygenSpecial gui=NONE guifg=#fdab60 guibg=NONE - hi doxygenSpecialMultilineDesc gui=NONE guifg=#ad600b guibg=NONE - hi doxygenSpecialOnelineDesc gui=NONE guifg=#ad600b guibg=NONE - - if v:version >= 700 - hi Pmenu gui=NONE guifg=#eeeeee guibg=#4e4e8f - hi PmenuSel gui=BOLD guifg=#eeeeee guibg=#2e2e3f - hi PmenuSbar gui=BOLD guifg=#eeeeee guibg=#6e6eaf - hi PmenuThumb gui=BOLD guifg=#eeeeee guibg=#6e6eaf - - hi SpellBad gui=undercurl guisp=#cc6666 - hi SpellRare gui=undercurl guisp=#cc66cc - hi SpellLocal gui=undercurl guisp=#cccc66 - hi SpellCap gui=undercurl guisp=#66cccc - - hi MatchParen gui=NONE guifg=#cfbfad guibg=#4e4e8f - endif -else - if ! g:inkpot_black_background - exec "hi Normal cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(80) - else - exec "hi Normal cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(16) - endif - - exec "hi IncSearch cterm=BOLD ctermfg=" . X(80) . " ctermbg=" . X(73) - exec "hi Search cterm=NONE ctermfg=" . X(80) . " ctermbg=" . X(52) - exec "hi ErrorMsg cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(48) - exec "hi WarningMsg cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(68) - exec "hi ModeMsg cterm=BOLD ctermfg=" . X(38) . " ctermbg=" . "NONE" - exec "hi MoreMsg cterm=BOLD ctermfg=" . X(38) . " ctermbg=" . "NONE" - exec "hi Question cterm=BOLD ctermfg=" . X(52) . " ctermbg=" . "NONE" - - exec "hi StatusLine cterm=BOLD ctermfg=" . X(85) . " ctermbg=" . X(81) - exec "hi User1 cterm=BOLD ctermfg=" . X(28) . " ctermbg=" . X(81) - exec "hi User2 cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . X(81) - exec "hi StatusLineNC cterm=NONE ctermfg=" . X(84) . " ctermbg=" . X(81) - exec "hi VertSplit cterm=NONE ctermfg=" . X(84) . " ctermbg=" . X(81) - - exec "hi WildMenu cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(38) - - exec "hi MBENormal ctermfg=" . X(85) . " ctermbg=" . X(81) - exec "hi MBEChanged ctermfg=" . X(87) . " ctermbg=" . X(81) - exec "hi MBEVisibleNormal ctermfg=" . X(85) . " ctermbg=" . X(82) - exec "hi MBEVisibleChanged ctermfg=" . X(87) . " ctermbg=" . X(82) - - exec "hi DiffText cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(34) - exec "hi DiffChange cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(17) - exec "hi DiffDelete cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(32) - exec "hi DiffAdd cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(20) - - exec "hi Folded cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(35) - exec "hi FoldColumn cterm=NONE ctermfg=" . X(39) . " ctermbg=" . X(80) - - exec "hi Directory cterm=NONE ctermfg=" . X(28) . " ctermbg=" . "NONE" - exec "hi LineNr cterm=NONE ctermfg=" . X(39) . " ctermbg=" . X(80) - exec "hi NonText cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . "NONE" - exec "hi SpecialKey cterm=BOLD ctermfg=" . X(55) . " ctermbg=" . "NONE" - exec "hi Title cterm=BOLD ctermfg=" . X(48) . " ctermbg=" . "NONE" - exec "hi Visual cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(38) - - exec "hi Comment cterm=NONE ctermfg=" . X(52) . " ctermbg=" . "NONE" - exec "hi Constant cterm=NONE ctermfg=" . X(73) . " ctermbg=" . "NONE" - exec "hi String cterm=NONE ctermfg=" . X(73) . " ctermbg=" . X(81) - exec "hi Error cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(32) - exec "hi Identifier cterm=NONE ctermfg=" . X(53) . " ctermbg=" . "NONE" - exec "hi Ignore cterm=NONE" - exec "hi Number cterm=NONE ctermfg=" . X(69) . " ctermbg=" . "NONE" - exec "hi PreProc cterm=NONE ctermfg=" . X(25) . " ctermbg=" . "NONE" - exec "hi Special cterm=NONE ctermfg=" . X(55) . " ctermbg=" . "NONE" - exec "hi SpecialChar cterm=NONE ctermfg=" . X(55) . " ctermbg=" . X(81) - exec "hi Statement cterm=NONE ctermfg=" . X(27) . " ctermbg=" . "NONE" - exec "hi Todo cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(57) - exec "hi Type cterm=NONE ctermfg=" . X(71) . " ctermbg=" . "NONE" - exec "hi Underlined cterm=BOLD ctermfg=" . X(77) . " ctermbg=" . "NONE" - exec "hi TaglistTagName cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . "NONE" - - if v:version >= 700 - exec "hi Pmenu cterm=NONE ctermfg=" . X(87) . " ctermbg=" . X(82) - exec "hi PmenuSel cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(38) - exec "hi PmenuSbar cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(39) - exec "hi PmenuThumb cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(39) - - exec "hi SpellBad cterm=NONE ctermbg=" . X(32) - exec "hi SpellRare cterm=NONE ctermbg=" . X(33) - exec "hi SpellLocal cterm=NONE ctermbg=" . X(36) - exec "hi SpellCap cterm=NONE ctermbg=" . X(21) - exec "hi MatchParen cterm=NONE ctermbg=" . X(14) . "ctermfg=" . X(25) - endif -endif - -" vim: set et : diff --git a/colors/ir_black.vim b/colors/ir_black.vim deleted file mode 100644 index 06e6b5f..0000000 --- a/colors/ir_black.vim +++ /dev/null @@ -1,213 +0,0 @@ -" ir_black color scheme -" More at: http://blog.infinitered.com/entries/show/8 - - -" ******************************************************************************** -" Standard colors used in all ir_black themes: -" Note, x:x:x are RGB values -" -" normal: #f6f3e8 -" -" string: #A8FF60 168:255:96 -" string inner (punc, code, etc): #00A0A0 0:160:160 -" number: #FF73FD 255:115:253 -" comments: #7C7C7C 124:124:124 -" keywords: #96CBFE 150:203:254 -" operators: white -" class: #FFFFB6 255:255:182 -" method declaration name: #FFD2A7 255:210:167 -" regular expression: #E9C062 233:192:98 -" regexp alternate: #FF8000 255:128:0 -" regexp alternate 2: #B18A3D 177:138:61 -" variable: #C6C5FE 198:197:254 -" -" Misc colors: -" red color (used for whatever): #FF6C60 255:108:96 -" light red: #FFB6B0 255:182:176 -" -" brown: #E18964 good for special -" -" lightpurpleish: #FFCCFF -" -" Interface colors: -" background color: black -" cursor (where underscore is used): #FFA560 255:165:96 -" cursor (where block is used): white -" visual selection: #1D1E2C -" current line: #151515 21:21:21 -" search selection: #07281C 7:40:28 -" line number: #3D3D3D 61:61:61 - - -" ******************************************************************************** -" The following are the preferred 16 colors for your terminal -" Colors Bright Colors -" Black #4E4E4E #7C7C7C -" Red #FF6C60 #FFB6B0 -" Green #A8FF60 #CEFFAB -" Yellow #FFFFB6 #FFFFCB -" Blue #96CBFE #FFFFCB -" Magenta #FF73FD #FF9CFE -" Cyan #C6C5FE #DFDFFE -" White #EEEEEE #FFFFFF - - -" ******************************************************************************** -set background=dark -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "ir_black" - - -"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - -" General colors -hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE -hi NonText guifg=#070707 guibg=black gui=NONE ctermfg=black ctermbg=NONE cterm=NONE - -hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse -hi LineNr guifg=#3D3D3D guibg=black gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE - -hi VertSplit guifg=#202020 guibg=#202020 gui=NONE ctermfg=darkgray ctermbg=darkgray cterm=NONE -hi StatusLine guifg=#CCCCCC guibg=#202020 gui=italic ctermfg=white ctermbg=darkgray cterm=NONE -hi StatusLineNC guifg=black guibg=#202020 gui=NONE ctermfg=blue ctermbg=darkgray cterm=NONE - -hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE -hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE -hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=darkgray cterm=NONE - -hi SpecialKey guifg=#808080 guibg=#343434 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - -hi WildMenu guifg=green guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE -hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE -"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - -hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color -hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE -hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE - -" Message displayed in lower left, such as --INSERT-- -hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD - -if version >= 700 " Vim 7.x specific colors - hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD - hi CursorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD - hi ColorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD - hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=darkgray cterm=NONE - hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE - hi Search guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline -endif - -" Syntax highlighting -hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE -hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE -hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE - -hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE -hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE -hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE " if else end - -hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE -hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE - -hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE -hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE -hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE -hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE - -hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE -hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE -hi Operator guifg=white guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE - -hi link Character Constant -hi link Boolean Constant -hi link Float Number -hi link Repeat Statement -hi link Label Statement -hi link Exception Statement -hi link Include PreProc -hi link Define PreProc -hi link Macro PreProc -hi link PreCondit PreProc -hi link StorageClass Type -hi link Structure Type -hi link Typedef Type -hi link Tag Special -hi link SpecialChar Special -hi link SpecialComment Special -hi link Debug Special - - -" Special for Ruby -hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE -hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE -hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE -hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE -hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc -"hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield -hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE -"rubyInclude -"rubySharpBang -"rubyAccess -"rubyPredefinedVariable -"rubyBoolean -"rubyClassVariable -"rubyBeginEnd -"rubyRepeatModifier -"hi link rubyArrayDelimiter Special " [ , , ] -"rubyCurlyBlock { , , } - -hi link rubyClass Keyword -hi link rubyModule Keyword -hi link rubyKeyword Keyword -hi link rubyOperator Operator -hi link rubyIdentifier Identifier -hi link rubyInstanceVariable Identifier -hi link rubyGlobalVariable Identifier -hi link rubyClassVariable Identifier -hi link rubyConstant Type - - -" Special for Java -" hi link javaClassDecl Type -hi link javaScopeDecl Identifier -hi link javaCommentTitle javaDocSeeTag -hi link javaDocTags javaDocSeeTag -hi link javaDocParam javaDocSeeTag -hi link javaDocSeeTagParam javaDocSeeTag - -hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE -hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE -"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE - - -" Special for XML -hi link xmlTag Keyword -hi link xmlTagName Conditional -hi link xmlEndTag Identifier - - -" Special for HTML -hi link htmlTag Keyword -hi link htmlTagName Conditional -hi link htmlEndTag Identifier - - -" Special for Javascript -hi link javaScriptNumber Number - - -" Special for Python -"hi link pythonEscape Keyword - - -" Special for CSharp -hi link csXmlTag Keyword - - -" Special for PHP diff --git a/colors/jellybeans.vim b/colors/jellybeans.vim deleted file mode 100644 index 5f8610c..0000000 --- a/colors/jellybeans.vim +++ /dev/null @@ -1,460 +0,0 @@ -" Vim color file -" -" " __ _ _ _ " -" " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ " -" " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| " -" " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ " -" " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ " -" " \___/ " -" -" "A colorful, dark color scheme for Vim." -" -" File: jellybeans.vim -" Maintainer: NanoTech -" Version: 1.4 -" Last Change: April 11th, 2011 -" Contributors: Daniel Herbert , -" Henry So, Jr. , -" David Liang -" -" Copyright (c) 2009-2011 NanoTech -" -" Permission is hereby granted, free of charge, to any person obtaining a copy -" of this software and associated documentation files (the "Software"), to deal -" in the Software without restriction, including without limitation the rights -" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -" copies of the Software, and to permit persons to whom the Software is -" furnished to do so, subject to the following conditions: -" -" The above copyright notice and this permission notice shall be included in -" all copies or substantial portions of the Software. -" -" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -" THE SOFTWARE. - -set background=dark - -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "jellybeans" - -if has("gui_running") || &t_Co == 88 || &t_Co == 256 - let s:low_color = 0 -else - let s:low_color = 1 -endif - -" Color approximation functions by Henry So, Jr. and David Liang {{{ -" Added to jellybeans.vim by Daniel Herbert - -" returns an approximate grey index for the given grey level -fun! s:grey_number(x) - if &t_Co == 88 - if a:x < 23 - return 0 - elseif a:x < 69 - return 1 - elseif a:x < 103 - return 2 - elseif a:x < 127 - return 3 - elseif a:x < 150 - return 4 - elseif a:x < 173 - return 5 - elseif a:x < 196 - return 6 - elseif a:x < 219 - return 7 - elseif a:x < 243 - return 8 - else - return 9 - endif - else - if a:x < 14 - return 0 - else - let l:n = (a:x - 8) / 10 - let l:m = (a:x - 8) % 10 - if l:m < 5 - return l:n - else - return l:n + 1 - endif - endif - endif -endfun - -" returns the actual grey level represented by the grey index -fun! s:grey_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 46 - elseif a:n == 2 - return 92 - elseif a:n == 3 - return 115 - elseif a:n == 4 - return 139 - elseif a:n == 5 - return 162 - elseif a:n == 6 - return 185 - elseif a:n == 7 - return 208 - elseif a:n == 8 - return 231 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 8 + (a:n * 10) - endif - endif -endfun - -" returns the palette index for the given grey index -fun! s:grey_color(n) - if &t_Co == 88 - if a:n == 0 - return 16 - elseif a:n == 9 - return 79 - else - return 79 + a:n - endif - else - if a:n == 0 - return 16 - elseif a:n == 25 - return 231 - else - return 231 + a:n - endif - endif -endfun - -" returns an approximate color index for the given color level -fun! s:rgb_number(x) - if &t_Co == 88 - if a:x < 69 - return 0 - elseif a:x < 172 - return 1 - elseif a:x < 230 - return 2 - else - return 3 - endif - else - if a:x < 75 - return 0 - else - let l:n = (a:x - 55) / 40 - let l:m = (a:x - 55) % 40 - if l:m < 20 - return l:n - else - return l:n + 1 - endif - endif - endif -endfun - -" returns the actual color level for the given color index -fun! s:rgb_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 139 - elseif a:n == 2 - return 205 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 55 + (a:n * 40) - endif - endif -endfun - -" returns the palette index for the given R/G/B color indices -fun! s:rgb_color(x, y, z) - if &t_Co == 88 - return 16 + (a:x * 16) + (a:y * 4) + a:z - else - return 16 + (a:x * 36) + (a:y * 6) + a:z - endif -endfun - -" returns the palette index to approximate the given R/G/B color levels -fun! s:color(r, g, b) - " get the closest grey - let l:gx = s:grey_number(a:r) - let l:gy = s:grey_number(a:g) - let l:gz = s:grey_number(a:b) - - " get the closest color - let l:x = s:rgb_number(a:r) - let l:y = s:rgb_number(a:g) - let l:z = s:rgb_number(a:b) - - if l:gx == l:gy && l:gy == l:gz - " there are two possibilities - let l:dgr = s:grey_level(l:gx) - a:r - let l:dgg = s:grey_level(l:gy) - a:g - let l:dgb = s:grey_level(l:gz) - a:b - let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) - let l:dr = s:rgb_level(l:gx) - a:r - let l:dg = s:rgb_level(l:gy) - a:g - let l:db = s:rgb_level(l:gz) - a:b - let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) - if l:dgrey < l:drgb - " use the grey - return s:grey_color(l:gx) - else - " use the color - return s:rgb_color(l:x, l:y, l:z) - endif - else - " only one possibility - return s:rgb_color(l:x, l:y, l:z) - endif -endfun - -" returns the palette index to approximate the 'rrggbb' hex string -fun! s:rgb(rgb) - let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 - let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 - let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 - return s:color(l:r, l:g, l:b) -endfun - -" sets the highlighting for the given group -fun! s:X(group, fg, bg, attr, lcfg, lcbg) - if s:low_color - let l:fge = empty(a:lcfg) - let l:bge = empty(a:lcbg) - - if !l:fge && !l:bge - exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg - elseif !l:fge && l:bge - exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE" - elseif l:fge && !l:bge - exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg - endif - else - let l:fge = empty(a:fg) - let l:bge = empty(a:bg) - - if !l:fge && !l:bge - exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg) - elseif !l:fge && l:bge - exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE" - elseif l:fge && !l:bge - exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".s:rgb(a:bg) - endif - endif - - if a:attr == "" - exec "hi ".a:group." gui=none cterm=none" - else - let noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",") - if empty(noitalic) - let noitalic = "none" - endif - exec "hi ".a:group." gui=".a:attr." cterm=".noitalic - endif -endfun -" }}} - -call s:X("Normal","e8e8d3","151515","","White","") -set background=dark - -if version >= 700 - call s:X("CursorLine","","1c1c1c","","","Black") - call s:X("CursorColumn","","1c1c1c","","","Black") - " gryf: added colorcolumn highlight - call s:X("ColorColumn","","1c1c1c","","","") - call s:X("MatchParen","ffffff","80a090","bold","","DarkCyan") - - call s:X("TabLine","000000","b0b8c0","italic","","Black") - call s:X("TabLineFill","9098a0","","","","Black") - call s:X("TabLineSel","000000","f0f0f0","italic,bold","Black","White") - - " Auto-completion - call s:X("Pmenu","ffffff","606060","","White","Black") - call s:X("PmenuSel","101010","eeeeee","","Black","White") -endif - -call s:X("Visual","","404040","","","Black") -call s:X("Cursor","","b0d0f0","","","") - -call s:X("LineNr","605958","151515","none","Black","") -call s:X("Comment","888888","","italic","Grey","") -call s:X("Todo","808080","","bold","White","Black") - -call s:X("StatusLine","000000","dddddd","italic","Black","White") -call s:X("StatusLineNC","ffffff","403c41","italic","White","Black") -call s:X("VertSplit","777777","403c41","italic","Black","Black") -call s:X("WildMenu","f0a0c0","302028","","Magenta","") - -call s:X("Folded","a0a8b0","384048","italic","Black","") -call s:X("FoldColumn","a0a8b0","384048","","","Black") -hi! link SignColumn FoldColumn - -call s:X("Title","70b950","","bold","Green","") - -call s:X("Constant","cf6a4c","","","Red","") -call s:X("Special","799d6a","","","Green","") -call s:X("Delimiter","668799","","","Grey","") - -call s:X("String","99ad6a","","","Green","") -call s:X("StringDelimiter","556633","","","DarkGreen","") - -call s:X("Identifier","c6b6ee","","","LightCyan","") -call s:X("Structure","8fbfdc","","","LightCyan","") -call s:X("Function","fad07a","","","Yellow","") -call s:X("Statement","8197bf","","","DarkBlue","") -call s:X("PreProc","8fbfdc","","","LightBlue","") - -hi! link Operator Normal - -call s:X("Type","ffb964","","","Yellow","") -call s:X("NonText","606060","151515","","Black","") - -call s:X("SpecialKey","444444","1c1c1c","","Black","") - -call s:X("Search","f0a0c0","302028","underline","Magenta","") - -call s:X("Directory","dad085","","","Yellow","") -call s:X("ErrorMsg","","902020","","","DarkRed") -hi! link Error ErrorMsg -hi! link MoreMsg Special -call s:X("Question","65C254","","","Green","") - - -" Spell Checking - -call s:X("SpellBad","","902020","underline","","DarkRed") -call s:X("SpellCap","","0000df","underline","","Blue") -call s:X("SpellRare","","540063","underline","","DarkMagenta") -call s:X("SpellLocal","","2D7067","underline","","Green") - -" Diff - -hi! link diffRemoved Constant -hi! link diffAdded String - -" VimDiff - -call s:X("DiffAdd","","032218","","Black","DarkGreen") -call s:X("DiffChange","","100920","","Black","DarkMagenta") -call s:X("DiffDelete","220000","220000","","DarkRed","DarkRed") -call s:X("DiffText","","000940","","","DarkRed") - -" PHP - -hi! link phpFunctions Function -call s:X("StorageClass","c59f6f","","","Red","") -hi! link phpSuperglobal Identifier -hi! link phpQuoteSingle StringDelimiter -hi! link phpQuoteDouble StringDelimiter -hi! link phpBoolean Constant -hi! link phpNull Constant -hi! link phpArrayPair Operator - -" Ruby - -hi! link rubySharpBang Comment -call s:X("rubyClass","447799","","","DarkBlue","") -call s:X("rubyIdentifier","c6b6fe","","","Cyan","") -hi! link rubyConstant Type -hi! link rubyFunction Function - -call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","") -call s:X("rubySymbol","7697d6","","","Blue","") -hi! link rubyGlobalVariable rubyInstanceVariable -hi! link rubyModule rubyClass -call s:X("rubyControl","7597c6","","","Blue","") - -hi! link rubyString String -hi! link rubyStringDelimiter StringDelimiter -hi! link rubyInterpolationDelimiter Identifier - -call s:X("rubyRegexpDelimiter","540063","","","Magenta","") -call s:X("rubyRegexp","dd0093","","","DarkMagenta","") -call s:X("rubyRegexpSpecial","a40073","","","Magenta","") - -call s:X("rubyPredefinedIdentifier","de5577","","","Red","") - -" JavaScript -hi! link javaScriptValue Constant -hi! link javaScriptRegexpString rubyRegexp - -" CoffeeScript - -hi! link coffeeRegExp javaScriptRegexpString - -" C - -hi! link cOperator Constant - -" Objective-C/Cocoa -hi! link objcClass Type -hi! link cocoaClass objcClass -hi! link objcSubclass objcClass -hi! link objcSuperclass objcClass -hi! link objcDirective rubyClass -hi! link cocoaFunction Function -hi! link objcMethodName Identifier -hi! link objcMethodArg Normal -hi! link objcMessageName Identifier - -" Plugins, etc. - -hi! link TagListFileName Directory -call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green") - -" Manual overrides for 256-color terminals. Dark colors auto-map badly. -if !s:low_color - hi StatusLineNC ctermbg=234 - hi Folded ctermbg=236 - hi FoldColumn ctermbg=236 - hi SignColumn ctermbg=236 - hi DiffAdd ctermbg=22 - hi DiffDelete ctermbg=52 - hi DiffChange ctermbg=17 - hi DiffText ctermbg=19 -endif - -" delete functions {{{ -delf s:X -delf s:rgb -delf s:color -delf s:rgb_color -delf s:rgb_level -delf s:rgb_number -delf s:grey_color -delf s:grey_level -delf s:grey_number -" }}} diff --git a/colors/lucius.vim b/colors/lucius.vim deleted file mode 100644 index 7ca7c05..0000000 --- a/colors/lucius.vim +++ /dev/null @@ -1,259 +0,0 @@ -" Lucius vim color file -" Maintainer: Jonathan Filip -" Version: 6.1.0 - -hi clear -if exists("syntax_on") - syntax reset -endif -let colors_name="lucius" - -" Summary: -" Color scheme with dark and light versions (GUI and 256 color terminal). - -" Description: -" This color scheme was originally created by combining my favorite parts of -" the following color schemes: -" -" * oceandeep (vimscript #368) -" * peaksea (vimscript #760) -" * wombat (vimscript #1778) -" * moria (vimscript #1464) -" * zenburn (vimscript #415) -" -" Version 6+ has been revamped a bit from the original color scheme. If you -" prefer the old style, or the 'blue' version, use the 5Final release. Version -" 6+ only has a light and dark version. The new version tries to unify some of -" the colors and also adds more contrast between text and interface. -" -" The color scheme is dark, by default. You can change this by setting the -" g:lucius_style variable to "light" or "dark". Once the color scheme is -" loaded, you can use the commands "LuciusLight" or "LuciusDark" to change -" schemes quickly. -" -" Screenshots of the new version (6+): -" -" * Dark: http://i.imgur.com/IzYcB.png -" * Light: http://i.imgur.com/kfJcm.png -" -" Screenshots of the old versions (5Final): -" -" * Dark: http://i.imgur.com/z0bDr.png -" * Light: http://i.imgur.com/BXDiv.png -" * Blue: http://i.imgur.com/Ea1Gq.png -" -" colorsupport.vim (vimscript #2682) is used to help with mapping the GUI -" settings to the 256 terminal colors. -" -" This color scheme also has custom colors defined for the following plugins: -" -" * vimwiki (vimscript #2226) -" * tagbar (vimscript #3465) -" -" Installation: -" Copy the file to your vim colors directory and then do :colorscheme lucius. - -set background=dark -if exists("g:lucius_style") - if g:lucius_style == "light" - set background=light - endif -else - let g:lucius_style="dark" -endif - -" set colorcolumn=21,37,53,68,86,100 - -if g:lucius_style == "dark" || g:lucius_style == "blue" - - - hi Normal guifg=#e0e0e0 guibg=#202020 ctermfg=253 ctermbg=234 gui=none cterm=none - - if g:lucius_style == "blue" - hi Normal guibg=#002b36 - endif - - hi Comment guifg=#707070 guibg=NONE ctermfg=240 ctermbg=NONE gui=none cterm=none - - hi Constant guifg=#e0e090 guibg=NONE ctermfg=187 ctermbg=NONE gui=none cterm=none - hi BConstant guifg=#e0e090 guibg=NONE ctermfg=187 ctermbg=NONE gui=bold cterm=bold - - hi Identifier guifg=#c0e0a0 guibg=NONE ctermfg=150 ctermbg=NONE gui=none cterm=none - hi BIdentifier guifg=#c0e0a0 guibg=NONE ctermfg=150 ctermbg=NONE gui=bold cterm=bold - - hi Statement guifg=#80d0f0 guibg=NONE ctermfg=74 ctermbg=NONE gui=none cterm=none - hi BStatement guifg=#80d0f0 guibg=NONE ctermfg=74 ctermbg=NONE gui=bold cterm=bold - - hi PreProc guifg=#a0e0d0 guibg=NONE ctermfg=115 ctermbg=NONE gui=none cterm=none - hi BPreProc guifg=#a0e0d0 guibg=NONE ctermfg=115 ctermbg=NONE gui=bold cterm=bold - - hi Type guifg=#a0d0e0 guibg=NONE ctermfg=116 ctermbg=NONE gui=none cterm=none - hi BType guifg=#a0d0e0 guibg=NONE ctermfg=116 ctermbg=NONE gui=bold cterm=bold - - hi Special guifg=#c0a0d0 guibg=NONE ctermfg=182 ctermbg=NONE gui=none cterm=none - hi BSpecial guifg=#c0a0d0 guibg=NONE ctermfg=182 ctermbg=NONE gui=bold cterm=bold - - " == Text Markup == - hi Underlined guifg=fg guibg=NONE ctermfg=fg ctermbg=NONE gui=underline cterm=underline - hi Error guifg=#e07070 guibg=#503030 ctermfg=167 ctermbg=236 gui=none cterm=none - hi Todo guifg=#e0e090 guibg=#505000 ctermfg=186 ctermbg=NONE gui=none cterm=none - hi MatchParen guifg=bg guibg=#c0e070 ctermfg=bg ctermbg=192 gui=none cterm=bold - hi NonText guifg=#405060 guibg=NONE ctermfg=24 ctermbg=NONE gui=none cterm=none - hi SpecialKey guifg=#406050 guibg=NONE ctermfg=23 ctermbg=NONE gui=none cterm=none - hi Title guifg=#50b0d0 guibg=NONE ctermfg=74 ctermbg=NONE gui=bold cterm=bold - - " == Text Selection == - hi Cursor guifg=bg guibg=fg ctermfg=bg ctermbg=fg gui=none cterm=none - hi CursorIM guifg=bg guibg=fg ctermfg=bg ctermbg=fg gui=none cterm=none - hi CursorColumn guifg=NONE guibg=#484848 ctermfg=NONE ctermbg=237 gui=none cterm=none - hi CursorLine guifg=NONE guibg=#484848 ctermfg=NONE ctermbg=237 gui=none cterm=none - hi Visual guifg=NONE guibg=#205070 ctermfg=NONE ctermbg=24 gui=none cterm=none - hi VisualNOS guifg=fg guibg=NONE ctermfg=fg ctermbg=NONE gui=underline cterm=underline - hi IncSearch guifg=bg guibg=#50d0d0 ctermfg=bg ctermbg=116 gui=none cterm=none - hi Search guifg=bg guibg=#e0a020 ctermfg=bg ctermbg=214 gui=none cterm=none - - " == UI == - hi Pmenu guifg=#000000 guibg=#b0b0b0 ctermfg=bg ctermbg=252 gui=none cterm=none - hi PmenuSel guifg=#e0e0e0 guibg=#205070 ctermfg=fg ctermbg=24 gui=none cterm=none - hi PMenuSbar guifg=bg guibg=#b0b0b0 ctermfg=bg ctermbg=254 gui=none cterm=none - hi PMenuThumb guifg=NONE guibg=#808080 ctermfg=fg ctermbg=244 gui=none cterm=none - hi StatusLine guifg=bg guibg=#b0b0b0 ctermfg=bg ctermbg=252 gui=bold cterm=bold - hi StatusLineNC guifg=#404040 guibg=#b0b0b0 ctermfg=240 ctermbg=252 gui=none cterm=none - hi TabLine guifg=bg guibg=#b0b0b0 ctermfg=bg ctermbg=252 gui=none cterm=none - hi TabLineFill guifg=#404040 guibg=#b0b0b0 ctermfg=240 ctermbg=252 gui=none cterm=none - hi TabLineSel guifg=#e0e0e0 guibg=#205070 ctermfg=fg ctermbg=24 gui=bold cterm=bold - hi VertSplit guifg=#606060 guibg=#b0b0b0 ctermfg=245 ctermbg=252 gui=none cterm=none - hi Folded guifg=bg guibg=#808080 ctermfg=bg ctermbg=246 gui=none cterm=none - hi FoldColumn guifg=bg guibg=#808080 ctermfg=bg ctermbg=246 gui=none cterm=none - - " == Spelling =="{{{ - hi SpellBad guisp=#ee0000 ctermfg=fg ctermbg=160 gui=undercurl cterm=undercurl - hi SpellCap guisp=#eeee00 ctermfg=bg ctermbg=226 gui=undercurl cterm=undercurl - hi SpellRare guisp=#ffa500 ctermfg=bg ctermbg=214 gui=undercurl cterm=undercurl - hi SpellLocal guisp=#ffa500 ctermfg=bg ctermbg=214 gui=undercurl cterm=undercurl"}}} - - " == Diff == - hi DiffAdd guifg=fg guibg=#405040 ctermfg=fg ctermbg=22 gui=none cterm=none - hi DiffChange guifg=fg guibg=#605040 ctermfg=fg ctermbg=58 gui=none cterm=none - hi DiffDelete guifg=fg guibg=#504040 ctermfg=fg ctermbg=52 gui=none cterm=none - hi DiffText guifg=#e0b050 guibg=#605040 ctermfg=220 ctermbg=58 gui=bold cterm=bold - - " == Misc == - hi Directory guifg=#b0d0a0 guibg=NONE ctermfg=151 ctermbg=NONE gui=none cterm=none - hi ErrorMsg guifg=#ee0000 guibg=NONE ctermfg=196 ctermbg=NONE gui=none cterm=none - hi SignColumn guifg=#a0b0b0 guibg=#282828 ctermfg=145 ctermbg=233 gui=none cterm=none - hi LineNr guifg=bg guibg=#808080 ctermfg=bg ctermbg=246 gui=none cterm=none - hi MoreMsg guifg=#60c0d0 guibg=NONE ctermfg=117 ctermbg=NONE gui=none cterm=none - hi ModeMsg guifg=fg guibg=NONE ctermfg=fg ctermbg=NONE gui=none cterm=none - hi Question guifg=fg guibg=NONE ctermfg=fg ctermbg=NONE gui=none cterm=none - hi WarningMsg guifg=#e07060 guibg=NONE ctermfg=173 ctermbg=NONE gui=none cterm=none - hi WildMenu guifg=NONE guibg=#205070 ctermfg=NONE ctermbg=24 gui=none cterm=none - hi ColorColumn guifg=NONE guibg=#484038 ctermfg=NONE ctermbg=101 gui=none cterm=none - hi Ignore guifg=bg ctermfg=bg - - -elseif g:lucius_style == "light" - - - hi Normal guifg=#000000 guibg=#ffffff ctermfg=16 ctermbg=231 gui=none cterm=none - - hi Comment guifg=#909090 guibg=NONE ctermfg=246 ctermbg=NONE gui=none cterm=none - - hi Constant guifg=#a05000 guibg=NONE ctermfg=130 ctermbg=NONE gui=none cterm=none - hi BConstant guifg=#a05000 guibg=NONE ctermfg=130 ctermbg=NONE gui=bold cterm=bold - - hi Identifier guifg=#008000 guibg=NONE ctermfg=22 ctermbg=NONE gui=none cterm=none - hi BIdentifier guifg=#008000 guibg=NONE ctermfg=22 ctermbg=NONE gui=bold cterm=bold - - hi Statement guifg=#0040c0 guibg=NONE ctermfg=19 ctermbg=NONE gui=none cterm=none - hi BStatement guifg=#0040c0 guibg=NONE ctermfg=19 ctermbg=NONE gui=bold cterm=bold - - hi PreProc guifg=#009080 guibg=NONE ctermfg=30 ctermbg=NONE gui=none cterm=none - hi BPreProc guifg=#009080 guibg=NONE ctermfg=30 ctermbg=NONE gui=bold cterm=bold - - hi Type guifg=#0070a0 guibg=NONE ctermfg=25 ctermbg=NONE gui=none cterm=none - hi BType guifg=#0070a0 guibg=NONE ctermfg=25 ctermbg=NONE gui=bold cterm=bold - - hi Special guifg=#800080 guibg=NONE ctermfg=5 ctermbg=NONE gui=none cterm=none - hi BSpecial guifg=#800080 guibg=NONE ctermfg=5 ctermbg=NONE gui=bold cterm=bold - - " == Text Markup == - hi Underlined guifg=fg guibg=NONE ctermfg=fg ctermbg=NONE gui=underline cterm=underline - hi Error guifg=#c02620 guibg=#f0c6c0 ctermfg=1 ctermbg=181 gui=none cterm=none - hi Todo guifg=#504000 guibg=#f6f080 ctermfg=58 ctermbg=228 gui=none cterm=none - hi MatchParen guifg=NONE guibg=#40d0d0 ctermfg=NONE ctermbg=80 gui=none cterm=none - hi NonText guifg=#b0c0d0 guibg=NONE ctermfg=146 ctermbg=NONE gui=none cterm=none - hi SpecialKey guifg=#b0d0c0 guibg=NONE ctermfg=151 ctermbg=NONE gui=none cterm=none - hi Title guifg=#0060a0 guibg=NONE ctermfg=26 ctermbg=NONE gui=bold cterm=bold - - " == Text Selection == - hi Cursor guifg=bg guibg=#505050 ctermfg=bg ctermbg=239 gui=none cterm=none - hi CursorIM guifg=bg guibg=#505050 ctermfg=bg ctermbg=239 gui=none cterm=none - hi CursorColumn guifg=NONE guibg=#e8e8e8 ctermfg=NONE ctermbg=254 gui=none cterm=none - hi CursorLine guifg=NONE guibg=#e8e8e8 ctermfg=NONE ctermbg=254 gui=none cterm=none - hi Visual guifg=NONE guibg=#b0d0f0 ctermfg=NONE ctermbg=153 gui=none cterm=none - hi VisualNOS guifg=fg guibg=NONE ctermfg=fg ctermbg=NONE gui=underline cterm=underline - hi IncSearch guifg=#000000 guibg=#90d0d0 ctermfg=fg ctermbg=116 gui=none cterm=none - hi Search guifg=#000000 guibg=#f0b060 ctermfg=fg ctermbg=215 gui=none cterm=none - - " == UI == - hi Pmenu guifg=bg guibg=#505050 ctermfg=231 ctermbg=239 gui=none cterm=none - hi PmenuSel guifg=#000000 guibg=#c0e0ff ctermfg=16 ctermbg=153 gui=none cterm=none - hi PMenuSbar guifg=bg guibg=#404040 ctermfg=231 ctermbg=238 gui=none cterm=none - hi PMenuThumb guifg=#000000 guibg=#a0a0a0 ctermfg=16 ctermbg=247 gui=none cterm=none - hi StatusLine guifg=bg guibg=#505050 ctermfg=231 ctermbg=239 gui=bold cterm=bold - hi StatusLineNC guifg=#e0e0e0 guibg=#505050 ctermfg=254 ctermbg=239 gui=none cterm=none - hi TabLine guifg=bg guibg=#505050 ctermfg=231 ctermbg=239 gui=none cterm=none - hi TabLineFill guifg=#a0a0a0 guibg=#505050 ctermfg=247 ctermbg=239 gui=none cterm=none - hi TabLineSel guifg=#000000 guibg=#c0e0ff ctermfg=16 ctermbg=153 gui=none cterm=none - hi VertSplit guifg=#868686 guibg=#505050 ctermfg=102 ctermbg=239 gui=none cterm=none - hi Folded guifg=bg guibg=#a0a0a0 ctermfg=231 ctermbg=247 gui=none cterm=none - hi FoldColumn guifg=bg guibg=#a0a0a0 ctermfg=231 ctermbg=247 gui=none cterm=none - - " == Spelling == - hi SpellBad guisp=#ee0000 ctermbg=210 gui=undercurl cterm=undercurl - hi SpellCap guisp=#eeee00 ctermbg=227 gui=undercurl cterm=undercurl - hi SpellRare guisp=#ffa500 ctermbg=221 gui=undercurl cterm=undercurl - hi SpellLocal guisp=#ffa500 ctermbg=221 gui=undercurl cterm=undercurl - - " == Diff == - hi DiffAdd guifg=fg guibg=#d0e0d0 ctermfg=fg ctermbg=151 gui=none cterm=none - hi DiffChange guifg=fg guibg=#e0d6c0 ctermfg=fg ctermbg=187 gui=none cterm=none - hi DiffDelete guifg=fg guibg=#f0d0d0 ctermfg=fg ctermbg=181 gui=none cterm=none - hi DiffText guifg=#d05000 guibg=#e0d6c0 ctermfg=160 ctermbg=187 gui=bold cterm=bold - - " == Misc == - hi Directory guifg=#008000 guibg=NONE ctermfg=29 ctermbg=NONE gui=none cterm=none - hi ErrorMsg guifg=#a00000 guibg=NONE ctermfg=124 ctermbg=NONE gui=none cterm=none - hi SignColumn guifg=#708090 guibg=#f8f8f8 ctermfg=66 ctermbg=231 gui=none cterm=none - hi LineNr guifg=bg guibg=#a0a0a0 ctermfg=231 ctermbg=247 gui=none cterm=none - hi MoreMsg guifg=#2060c0 guibg=NONE ctermfg=4 ctermbg=NONE gui=none cterm=none - hi ModeMsg guifg=#000000 guibg=NONE ctermfg=16 ctermbg=NONE gui=none cterm=none - hi Question guifg=fg guibg=NONE ctermfg=NONE ctermbg=NONE gui=none cterm=none - hi WarningMsg guifg=#b03000 guibg=NONE ctermfg=9 ctermbg=NONE gui=none cterm=none - hi WildMenu guifg=#000000 guibg=#c0e0ff ctermfg=16 ctermbg=153 gui=none cterm=none - hi ColorColumn guifg=NONE guibg=#f0f0e0 ctermfg=NONE ctermbg=230 gui=none cterm=none - hi Ignore guifg=bg ctermfg=bg - - -endif - -" == Vimwiki Colors == -hi link VimwikiHeader1 BIdentifier -hi link VimwikiHeader2 BPreProc -hi link VimwikiHeader3 BStatement -hi link VimwikiHeader4 BSpecial -hi link VimwikiHeader5 BConstant -hi link VimwikiHeader6 BType - -" == Tagbar Colors == -hi link TagbarAccessPublic Constant -hi link TagbarAccessProtected Type -hi link TagbarAccessPrivate PreProc - -" == Commands == -command! LuciusLight let g:lucius_style = "light" | colorscheme lucius -command! LuciusDark let g:lucius_style = "dark" | colorscheme lucius -command! LuciusBlue let g:lucius_style = "blue" | colorscheme lucius - - diff --git a/colors/sorcerer.vim b/colors/sorcerer.vim deleted file mode 100644 index 452a78d..0000000 --- a/colors/sorcerer.vim +++ /dev/null @@ -1,205 +0,0 @@ -" 'sorcerer.vim' -- Vim color scheme. -" Maintainer: Jeet Sukumaran -" Based on 'Mustang' by Henrique C. Alves (hcarvalhoalves@gmail.com), - -set background=dark - -hi clear - -if exists("syntax_on") - syntax reset -endif - -let colors_name = "sorcerer" - -" GUI Colors {{{1 -" ============================================================================ - -hi Normal guifg=#c2c2b0 guibg=#222222 gui=NONE -hi ColorColumn guifg=NONE guibg=#1c1c1c -hi Cursor guifg=NONE guibg=#626262 gui=NONE -hi CursorColumn guibg=#2d2d2d -hi CursorLine guibg=#2d2d2d -hi DiffAdd guifg=#000000 guibg=#3cb371 gui=NONE -hi DiffDelete guifg=#000000 guibg=#aa4450 gui=NONE -hi DiffChange guifg=#000000 guibg=#4f94cd gui=NONE -hi DiffText guifg=#000000 guibg=#8ee5ee gui=NONE -hi Directory guifg=#1e90ff guibg=bg gui=NONE -hi ErrorMsg guifg=#ff6a6a guibg=NONE gui=bold -hi FoldColumn guifg=#68838b guibg=#4B4B4B gui=bold -hi Folded guifg=#406060 guibg=#232c2c gui=NONE -hi IncSearch guifg=#ffffff guibg=#ff4500 gui=bold -hi LineNr guifg=#686858 guibg=#000000 gui=NONE -hi MatchParen guifg=#fff000 guibg=#000000 gui=bold -hi ModeMsg guifg=#000000 guibg=#00ff00 gui=bold -hi MoreMsg guifg=#2e8b57 guibg=bg gui=bold -hi NonText guifg=#404050 guibg=bg gui=NONE - -hi Pmenu guifg=#ffffff guibg=#444444 -hi PmenuSel guifg=#000000 guibg=#b1d631 -" hi PmenuSbar guifg=#ffffff guibg=#c1cdc1 gui=NONE -" hi PmenuThumb guifg=#ffffff guibg=#838b83 gui=NONE - -hi Question guifg=#00ee00 guibg=NONE gui=bold -hi Search guifg=#000000 guibg=#d6e770 gui=bold -hi SignColumn guifg=#ffffff guibg=#cdcdb4 gui=NONE -hi SpecialKey guifg=#505060 guibg=NONE gui=NONE -hi SpellBad guisp=#ee2c2c gui=undercurl -hi SpellCap guisp=#0000ff gui=undercurl -hi SpellLocal guisp=#008b8b gui=undercurl -hi SpellRare guisp=#ff00ff gui=undercurl -hi StatusLine guifg=#000000 guibg=#808070 gui=bold -hi StatusLineNC guifg=#000000 guibg=#404c4c gui=italic -hi VertSplit guifg=#404c4c guibg=#404c4c gui=NONE -hi TabLine guifg=fg guibg=#d3d3d3 gui=underline -hi TabLineFill guifg=fg guibg=bg gui=reverse -hi TabLineSel guifg=fg guibg=bg gui=bold -hi Title guifg=#528b8b guibg=NONE gui=bold -hi Visual guifg=#000000 guibg=#6688aa gui=NONE -hi WarningMsg guifg=#ee9a00 guibg=bg gui=NONE -hi WildMenu guifg=#000000 guibg=#87ceeb gui=NONE - -" Syntax highlighting -hi Comment guifg=#707670 gui=italic -hi Boolean guifg=#ff9800 gui=NONE -hi String guifg=#779b70 gui=NONE -hi Identifier guifg=#9ebac2 gui=NONE -hi Function guifg=#faf4c6 gui=NONE -hi Type guifg=#7e8aa2 gui=NONE -hi Statement guifg=#90b0d1 gui=NONE -hi Keyword guifg=#90b0d1 gui=NONE -hi Constant guifg=#ff9800 gui=NONE -hi Number guifg=#cc8800 gui=NONE -hi Special guifg=#719611 gui=NONE -hi PreProc guifg=#528b8b gui=NONE -hi Todo guifg=#8f6f8f guibg=#202020 gui=italic,underline,bold - -" Diff -hi diffOldFile guifg=#88afcb guibg=NONE gui=italic -hi diffNewFile guifg=#88afcb guibg=NONE gui=italic -hi diffFile guifg=#88afcb guibg=NONE gui=italic -hi diffLine guifg=#88afcb guibg=NONE gui=italic -hi link diffSubname diffLine -hi diffAdded guifg=#3cb371 guibg=NONE gui=NONE -hi diffRemoved guifg=#aa4450 guibg=NONE gui=NONE -hi diffChanged guifg=#4f94cd guibg=NONE gui=NONE -hi link diffOnly Constant -hi link diffIdentical Constant -hi link diffDiffer Constant -hi link diffBDiffer Constant -hi link diffIsA Constant -hi link diffNoEOL Constant -hi link diffCommon Constant -hi link diffComment Constant - -" Python -hi pythonException guifg=#90b0d1 guibg=NONE gui=NONE -hi pythonExClass guifg=#996666 guibg=NONE gui=NONE -hi pythonDecorator guifg=#888555 guibg=NONE gui=NONE -hi link pythonDecoratorFunction pythonDecorator - -" 1}}} - -" 256 Colors {{{1 -" ============================================================================ -hi Normal cterm=NONE ctermbg=235 ctermfg=145 -hi ColorColumn cterm=NONE ctermbg=16 ctermfg=fg -hi Cursor cterm=NONE ctermbg=241 ctermfg=fg -hi CursorColumn cterm=NONE ctermbg=16 ctermfg=fg -hi CursorLine cterm=NONE ctermbg=236 ctermfg=fg -hi DiffAdd cterm=NONE ctermbg=71 ctermfg=16 -hi DiffDelete cterm=NONE ctermbg=124 ctermfg=16 -hi DiffChange cterm=NONE ctermbg=68 ctermfg=16 -hi DiffText cterm=NONE ctermbg=117 ctermfg=16 -hi Directory cterm=NONE ctermbg=234 ctermfg=33 -hi ErrorMsg cterm=bold ctermbg=bg ctermfg=203 -hi FoldColumn cterm=bold ctermbg=239 ctermfg=66 -hi Folded cterm=NONE ctermbg=16 ctermfg=60 -hi IncSearch cterm=bold ctermbg=202 ctermfg=231 -hi LineNr cterm=NONE ctermbg=16 ctermfg=59 -hi MatchParen cterm=bold ctermbg=16 ctermfg=226 -hi ModeMsg cterm=bold ctermbg=46 ctermfg=16 -hi MoreMsg cterm=bold ctermbg=234 ctermfg=29 -hi NonText cterm=NONE ctermbg=bg ctermfg=59 -hi Pmenu cterm=NONE ctermbg=238 ctermfg=231 -hi PmenuSbar cterm=NONE ctermbg=250 ctermfg=fg -hi PmenuSel cterm=NONE ctermbg=149 ctermfg=16 -hi Question cterm=bold ctermbg=bg ctermfg=46 -hi Search cterm=bold ctermbg=185 ctermfg=16 -hi SignColumn cterm=NONE ctermbg=187 ctermfg=231 -hi SpecialKey cterm=NONE ctermbg=bg ctermfg=59 -hi SpellBad cterm=undercurl ctermbg=bg ctermfg=196 -hi SpellCap cterm=undercurl ctermbg=bg ctermfg=21 -hi SpellLocal cterm=undercurl ctermbg=bg ctermfg=30 -hi SpellRare cterm=undercurl ctermbg=bg ctermfg=201 -hi StatusLine cterm=bold ctermbg=101 ctermfg=16 -hi StatusLineNC cterm=NONE ctermbg=102 ctermfg=16 -hi VertSplit cterm=NONE ctermbg=102 ctermfg=102 -hi TabLine cterm=bold ctermbg=102 ctermfg=16 -hi TabLineFill cterm=NONE ctermbg=102 ctermfg=16 -hi TabLineSel cterm=bold ctermbg=16 ctermfg=59 -hi Title cterm=bold ctermbg=bg ctermfg=66 -hi Visual cterm=NONE ctermbg=67 ctermfg=16 -hi WarningMsg cterm=NONE ctermbg=234 ctermfg=208 -hi WildMenu cterm=NONE ctermbg=116 ctermfg=16 - -hi Comment cterm=NONE ctermbg=bg ctermfg=65 -hi Boolean cterm=NONE ctermbg=bg ctermfg=208 -hi String cterm=NONE ctermbg=bg ctermfg=101 -hi Identifier cterm=NONE ctermbg=bg ctermfg=145 -hi Function cterm=NONE ctermbg=bg ctermfg=230 -hi Type cterm=NONE ctermbg=bg ctermfg=103 -hi Statement cterm=NONE ctermbg=bg ctermfg=110 -hi Keyword cterm=NONE ctermbg=bg ctermfg=110 -hi Constant cterm=NONE ctermbg=bg ctermfg=208 -hi Number cterm=NONE ctermbg=bg ctermfg=172 -hi Special cterm=NONE ctermbg=bg ctermfg=64 -hi PreProc cterm=NONE ctermbg=bg ctermfg=66 -hi Todo cterm=bold,underline ctermbg=234 ctermfg=96 - -hi diffOldFile cterm=NONE ctermbg=bg ctermfg=67 -hi diffNewFile cterm=NONE ctermbg=bg ctermfg=67 -hi diffFile cterm=NONE ctermbg=bg ctermfg=67 -hi diffLine cterm=NONE ctermbg=bg ctermfg=67 -hi diffAdded cterm=NONE ctermfg=bg ctermfg=71 -hi diffRemoved cterm=NONE ctermfg=bg ctermfg=124 -hi diffChanged cterm=NONE ctermfg=bg ctermfg=68 -hi link diffSubname diffLine -hi link diffOnly Constant -hi link diffIdentical Constant -hi link diffDiffer Constant -hi link diffBDiffer Constant -hi link diffIsA Constant -hi link diffNoEOL Constant -hi link diffCommon Constant -hi link diffComment Constant - -hi pythonClass cterm=NONE ctermbg=bg ctermfg=fg -hi pythonDecorator cterm=NONE ctermbg=bg ctermfg=101 -hi pythonExClass cterm=NONE ctermbg=bg ctermfg=95 -hi pythonException cterm=NONE ctermbg=bg ctermfg=110 -hi pythonFunc cterm=NONE ctermbg=bg ctermfg=fg -hi pythonFuncParams cterm=NONE ctermbg=bg ctermfg=fg -hi pythonKeyword cterm=NONE ctermbg=bg ctermfg=fg -hi pythonParam cterm=NONE ctermbg=bg ctermfg=fg -hi pythonRawEscape cterm=NONE ctermbg=bg ctermfg=fg -hi pythonSuperclasses cterm=NONE ctermbg=bg ctermfg=fg -hi pythonSync cterm=NONE ctermbg=bg ctermfg=fg - -hi Conceal cterm=NONE ctermbg=248 ctermfg=252 -hi Error cterm=NONE ctermbg=196 ctermfg=231 -hi Ignore cterm=NONE ctermbg=bg ctermfg=234 -hi InsertModeCursorLine cterm=NONE ctermbg=16 ctermfg=fg -hi NormalModeCursorLine cterm=NONE ctermbg=235 ctermfg=fg -hi PmenuThumb cterm=reverse ctermbg=bg ctermfg=fg -hi StatusLineAlert cterm=NONE ctermbg=160 ctermfg=231 -hi StatusLineUnalert cterm=NONE ctermbg=238 ctermfg=144 -hi Test cterm=NONE ctermbg=bg ctermfg=fg -hi Underlined cterm=underline ctermbg=bg ctermfg=111 -hi VisualNOS cterm=bold,underline ctermbg=bg ctermfg=fg -hi cCursor cterm=reverse ctermbg=bg ctermfg=fg -hi iCursor cterm=NONE ctermbg=210 ctermfg=16 -hi lCursor cterm=NONE ctermbg=145 ctermfg=234 -hi nCursor cterm=NONE ctermbg=46 ctermfg=16 -hi vCursor cterm=NONE ctermbg=201 ctermfg=16 -" 1}}} diff --git a/colors/tolerable256.vim b/colors/tolerable256.vim deleted file mode 100644 index e6afb8f..0000000 --- a/colors/tolerable256.vim +++ /dev/null @@ -1,267 +0,0 @@ -" Vim color file -" Maintainer: Ian Langworth -" Last Change: 2004 Dec 24 -" Email: - -" Color settings inspired by BBEdit for Mac OS, plus I liked -" the low-contrast comments from the 'oceandeep' colorscheme -" -" gryf: Nice colorscheme for printing in white, or to generate html in dark on -" bright. Added functions for converting it into terminal 256xterm codes. - -set background=light - -hi clear -if exists("syntax_on") - syntax reset -endif - -if !has("gui_running") && &t_Co != 88 && &t_Co != 256 - finish -endif - -let g:colors_name="tolerable" - -" functions {{{ -" returns an approximate grey index for the given grey level -fun! grey_number(x) - if &t_Co == 88 - if a:x < 23 - return 0 - elseif a:x < 69 - return 1 - elseif a:x < 103 - return 2 - elseif a:x < 127 - return 3 - elseif a:x < 150 - return 4 - elseif a:x < 173 - return 5 - elseif a:x < 196 - return 6 - elseif a:x < 219 - return 7 - elseif a:x < 243 - return 8 - else - return 9 - endif - else - if a:x < 14 - return 0 - else - let l:n = (a:x - 8) / 10 - let l:m = (a:x - 8) % 10 - if l:m < 5 - return l:n - else - return l:n + 1 - endif - endif - endif -endfun - -" returns the actual grey level represented by the grey index -fun! grey_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 46 - elseif a:n == 2 - return 92 - elseif a:n == 3 - return 115 - elseif a:n == 4 - return 139 - elseif a:n == 5 - return 162 - elseif a:n == 6 - return 185 - elseif a:n == 7 - return 208 - elseif a:n == 8 - return 231 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 8 + (a:n * 10) - endif - endif -endfun - -" returns the palette index for the given grey index -fun! grey_color(n) - if &t_Co == 88 - if a:n == 0 - return 16 - elseif a:n == 9 - return 79 - else - return 79 + a:n - endif - else - if a:n == 0 - return 16 - elseif a:n == 25 - return 231 - else - return 231 + a:n - endif - endif -endfun - -" returns an approximate color index for the given color level -fun! rgb_number(x) - if &t_Co == 88 - if a:x < 69 - return 0 - elseif a:x < 172 - return 1 - elseif a:x < 230 - return 2 - else - return 3 - endif - else - if a:x < 75 - return 0 - else - let l:n = (a:x - 55) / 40 - let l:m = (a:x - 55) % 40 - if l:m < 20 - return l:n - else - return l:n + 1 - endif - endif - endif -endfun - -" returns the actual color level for the given color index -fun! rgb_level(n) - if &t_Co == 88 - if a:n == 0 - return 0 - elseif a:n == 1 - return 139 - elseif a:n == 2 - return 205 - else - return 255 - endif - else - if a:n == 0 - return 0 - else - return 55 + (a:n * 40) - endif - endif -endfun - -" returns the palette index for the given R/G/B color indices -fun! rgb_color(x, y, z) - if &t_Co == 88 - return 16 + (a:x * 16) + (a:y * 4) + a:z - else - return 16 + (a:x * 36) + (a:y * 6) + a:z - endif -endfun - -" returns the palette index to approximate the given R/G/B color levels -fun! color(r, g, b) - " get the closest grey - let l:gx = grey_number(a:r) - let l:gy = grey_number(a:g) - let l:gz = grey_number(a:b) - - " get the closest color - let l:x = rgb_number(a:r) - let l:y = rgb_number(a:g) - let l:z = rgb_number(a:b) - - if l:gx == l:gy && l:gy == l:gz - " there are two possibilities - let l:dgr = grey_level(l:gx) - a:r - let l:dgg = grey_level(l:gy) - a:g - let l:dgb = grey_level(l:gz) - a:b - let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) - let l:dr = rgb_level(l:gx) - a:r - let l:dg = rgb_level(l:gy) - a:g - let l:db = rgb_level(l:gz) - a:b - let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) - if l:dgrey < l:drgb - " use the grey - return grey_color(l:gx) - else - " use the color - return rgb_color(l:x, l:y, l:z) - endif - else - " only one possibility - return rgb_color(l:x, l:y, l:z) - endif -endfun - -" returns the palette index to approximate the 'rrggbb' hex string -fun! rgb(rgb) - let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 - let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 - let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 - return color(l:r, l:g, l:b) -endfun - -" sets the highlighting for the given group -fun! X(group, fg, bg, attr) - if a:fg != "" - exec "hi ".a:group." guifg=#".a:fg." ctermfg=".rgb(a:fg) - endif - if a:bg != "" - exec "hi ".a:group." guibg=#".a:bg." ctermbg=".rgb(a:bg) - endif - if a:attr != "" - if a:attr == 'italic' - exec "hi ".a:group." gui=".a:attr." cterm=none" - else - exec "hi ".a:group." gui=".a:attr." cterm=".a:attr - endif - endif -endfun -" }}} - -call X("Cursor", "006400", "", "none") -call X("CursorLine", "", "eeeeee", "none") -call X("CursorColumn", "", "eeeeee", "none") - -call X("Normal", "000000", "ffffff", "none") -call X("NonText", "ffae1b", "", "none") - -call X("Statement", "0000ff", "", "none") -call X("Special", "ff0000", "", "none") -call X("Constant", "8b0000", "", "none") -call X("Comment", "555555", "", "none") -call X("Preproc", "008b8b", "", "none") -call X("Type", "8b008b", "", "none") -call X("Identifier", "006400", "", "none") -call X("Title", "000000", "", "none") - -call X("StatusLine", "ffffff", "333333", "none") -call X("StatusLineNC", "ffffff", "333333", "none") -call X("VertSplit", "ffffff", "333333", "none") - -call X("Visual", "000000", "00ff00", "none") -call X("Search", "", "ffff00", "none") -call X("Directory", "00008b", "", "none") -call X("WarningMsg", "ff0000", "", "none") -call X("Error", "ffffff", "ff0000", "none") -call X("Todo", "000000", "ffff00", "none") - -call X("MoreMsg", "", "", "none") -call X("ModeMsg", "", "", "none") - -" vim:set ts=4 sw=4 noet fdm=marker: diff --git a/colors/vydark.vim b/colors/vydark.vim deleted file mode 100644 index 676678c..0000000 --- a/colors/vydark.vim +++ /dev/null @@ -1,85 +0,0 @@ -" -" Vim colour file -" -" Maintainer: Vy-Shane Sin Fat -" Version: 1.2 -" -" This colour file is meant for GUI use. -" - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let g:colors_name="vydark" - - -hi Normal guifg=#bbbbbb guibg=#282828 -hi Title guifg=white -hi Cursor guibg=#ffffff -hi LineNr guifg=#444455 guibg=#292929 -hi Visual guibg=#555555 -hi NonText guifg=#292929 guibg=#292929 -hi StatusLine guifg=#bbbbbb guibg=#353535 gui=none -hi StatusLineNC guifg=#777777 guibg=#353535 gui=none -hi VertSplit guifg=#353535 guibg=#353535 gui=none -hi ModeMsg guifg=#99dd99 guibg=#394439 gui=none -hi ErrorMsg guifg=#222222 guibg=#ff8888 gui=none -hi Error guifg=#ffaaaa guibg=#333333 gui=none -hi Folded guifg=#666677 guibg=#242424 - - -" Vim 7.x specific -if version >= 700 - hi MatchParen guibg=#364836 gui=none - hi Pmenu guifg=#bbbbbb guibg=#444444 gui=none - hi PmenuSel guifg=#222222 guibg=#99bbdd gui=none - hi PmenuSbar guifg=#494949 guibg=#494949 gui=bold - hi PmenuThumb guifg=#666666 guibg=#666666 gui=bold - hi Search guifg=#dddd99 guibg=#444433 gui=none - hi IncSearch guifg=#eeeeaa guibg=#666633 gui=bold - hi CursorLine guibg=#353535 gui=none - hi ColorColumn guibg=#252525 - hi SpellBad guisp=#774444 - hi SpellCap guisp=#774444 - hi SpellLocal guisp=#774444 - hi SpellRare guisp=#774444 -endif - - -" Syntax highlighting -hi Comment guifg=#666677 gui=none -hi Todo guifg=#8888aa guibg=#303030 gui=italic -hi Operator guifg=#bbbbbb gui=none -hi Identifier guifg=#bbbbbb gui=none -hi Statement guifg=#bbbbbb gui=none -hi Type guifg=#99bbcc gui=none -hi Constant guifg=#88cc99 gui=none -hi Conditional guifg=#99bbcc gui=none -hi Delimiter guifg=#99bbdd gui=none -hi PreProc guifg=#88ddcc gui=none -hi Special guifg=#99dd99 gui=bold -hi Keyword guifg=#bbbbbb gui=none - -hi link Function Normal -hi link Character Constant -hi link String Constant -hi link Boolean Constant -hi link Number Constant -hi link Float Number -hi link Repeat Conditional -hi link Label Statement -hi link Exception Statement -hi link Include Normal -hi link Define Type -hi link Macro PreProc -hi link PreCondit PreProc -hi link StorageClass Type -hi link Structure Type -hi link Typedef Type -hi link Tag Special -hi link SpecialChar Special -hi link SpecialComment Special -hi link Debug Special - diff --git a/colors/vylight.vim b/colors/vylight.vim deleted file mode 100644 index 3900a96..0000000 --- a/colors/vylight.vim +++ /dev/null @@ -1,81 +0,0 @@ -" -" Vim colour file -" -" Maintainer: Vy-Shane Sin Fat -" Version: 1.4 -" -" This colour file is meant for GUI use. -" - -set background=light -hi clear -if exists("syntax_on") - syntax reset -endif -let g:colors_name="vylight" - - -hi Normal guifg=#111111 guibg=white -hi Title guifg=black guibg=white -hi Cursor guibg=#FF7311 -hi LineNr guifg=#bebebe guibg=#f8f8f8 -hi Visual guibg=#bbddff -hi NonText guifg=#fafafa guibg=#fafafa -hi StatusLine guifg=#222222 guibg=#eeeeee gui=none -hi StatusLineNC guifg=#888888 guibg=#eeeeee gui=none -hi VertSplit guifg=#eeeeee guibg=#eeeeee gui=none -hi ModeMsg guifg=black guibg=#bbddff gui=none -hi ErrorMsg guifg=black guibg=#ffbbbb gui=none -hi Error guifg=#bb3355 guibg=white gui=none -hi Folded guifg=#999999 guibg=#fafafa - - -" Vim 7.x specific -if version >= 700 - hi MatchParen guibg=#ccffdd gui=none - hi Pmenu guifg=#60656f guibg=#f0f5ff gui=none - hi PmenuSel guifg=white guibg=#3585ef gui=bold - hi PmenuSbar guifg=#d0d5dd guibg=#e0e5ee gui=bold - hi PmenuThumb guifg=#e0e5ee guibg=#c0c5dd gui=bold - hi Search guibg=#fcfcaa gui=none - hi IncSearch guibg=#ffff33 gui=bold - hi CursorLine guibg=#f1faff - hi ColorColumn guibg=#fafafa -endif - - -" Syntax highlighting -hi Comment guifg=#777777 gui=none -hi Todo guifg=#446644 guibg=#ddeecc gui=italic -hi Operator guifg=#1a1a1a gui=none -hi Identifier guifg=#1a1a1a gui=none -hi Statement guifg=#1a1a1a gui=none -hi Type guifg=#0050b0 gui=none -hi Constant guifg=#204070 gui=none -hi Conditional guifg=#006633 gui=none -hi Delimiter guifg=#1a1a1a gui=none -hi PreProc guifg=#006633 gui=none -hi Special guifg=#006633 gui=none -hi Keyword guifg=#007050 gui=none - -hi link Function Normal -hi link Character Constant -hi link String Constant -hi link Boolean Constant -hi link Number Constant -hi link Float Number -hi link Repeat Conditional -hi link Label Statement -hi link Exception Statement -hi link Include Normal -hi link Define PreProc -hi link Macro PreProc -hi link PreCondit PreProc -hi link StorageClass Type -hi link Structure Type -hi link Typedef Type -hi link Tag Special -hi link SpecialChar Special -hi link SpecialComment Special -hi link Debug Special - diff --git a/colors/zenburn.vim b/colors/zenburn.vim deleted file mode 100644 index 1f4acee..0000000 --- a/colors/zenburn.vim +++ /dev/null @@ -1,561 +0,0 @@ -" Vim color file -" Maintainer: Jani Nurminen -" Last Change: $Id: zenburn.vim,v 2.21 2011/04/26 12:13:41 slinky Exp slinky $ -" URL: http://slinky.imukuppi.org/zenburnpage/ -" License: GNU GPL -" -" Nothing too fancy, just some alien fruit salad to keep you in the zone. -" This syntax file was designed to be used with dark environments and -" low light situations. Of course, if it works during a daybright office, go -" ahead :) -" -" Owes heavily to other Vim color files! With special mentions -" to "BlackDust", "Camo" and "Desert". -" -" To install, copy to ~/.vim/colors directory. -" -" Alternatively, you can use Vimball installation: -" vim zenburn.vba -" :so % -" :q -" -" For details, see :help vimball -" -" After installation, use it with :colorscheme zenburn. -" See also :help syntax -" -" Credits: -" - Jani Nurminen - original Zenburn, maintainer -" - Steve Hall & Cream posse - higher-contrast Visual selection -" - Kurt Maier - 256 color console coloring, low and high contrast toggle, -" bug fixing -" - Charlie - spotted too bright StatusLine in non-high contrast mode -" - Pablo Castellazzi - CursorLine fix for 256 color mode -" - Tim Smith - force dark background -" - John Gabriele - spotted bad Ignore-group handling -" - Zac Thompson - spotted invisible NonText in low contrast mode -" - Christophe-Marie Duquesne - suggested making a Vimball, -" suggested support for ctags_highlighting.vim -" - Andrew Wagner - noted the CursorColumn bug (guifg was unintentionally set), -" unify CursorColumn colour -" - Martin Langasek - clarify the license, whitespace fixes -" - Marcin Szamotulski - support autocomplete for Zenburn configuration -" parameters -" - Clayton Parker (claytron) - Convinced by Kurt Maier to use Zenburn. Point -" out issues with LineNr, fix directory styles, and their usage in MacVim. -" - PaweÅ‚ Piekarski - Spotted bad FoldColumn and TabLine. Made better -" FoldColumn colors, fixed TabLine colors. -" -" CONFIGURABLE PARAMETERS: -" -" You can use the default (don't set any parameters), or you can -" set some parameters to tweak the Zenburn colours. -" -" To use them, put them into your .vimrc file before loading the color scheme, -" example: -" let g:zenburn_high_Contrast=1 -" colors zenburn -" -" You can also do ":let g:zenburn" then hit Ctrl-d or Tab to scroll through the -" list of configurable parameters. -" -" * You can now set a darker background for bright environments. To activate, use: -" contrast Zenburn, use: -" -" let g:zenburn_high_Contrast = 1 -" -" * For example, Vim help files uses the Ignore-group for the pipes in tags -" like "|somelink.txt|". By default, the pipes are not visible, as they -" map to Ignore group. If you wish to enable coloring of the Ignore group, -" set the following parameter to 1. Warning, it might make some syntax files -" look strange. -" -" let g:zenburn_color_also_Ignore = 1 -" -" * To get more contrast to the Visual selection, use -" -" let g:zenburn_alternate_Visual = 1 -" -" Note: this is enabled only if the old-style Visual -" if used, see g:zenburn_old_Visual -" -" * To use alternate colouring for Error message, use -" -" let g:zenburn_alternate_Error = 1 -" -" * The new default for Include is a duller orange. To use the original -" colouring for Include, use -" -" let g:zenburn_alternate_Include = 1 -" -" * Work-around to a Vim bug, it seems to misinterpret ctermfg and 234 and 237 -" as light values, and sets background to light for some people. If you have -" this problem, use: -" -" let g:zenburn_force_dark_Background = 1 -" -" * By default the CursorColumn is of a lighter colour. I find it more readable -" that way, but some people may want to align it with the darker CursorLine -" color, for visual uniformity. To do so, use: -" -" let g:zenburn_unified_CursorColumn = 1 -" -" Note: you can ignore this unless you use -" ":set cursorline cursorcolumn", since otherwise the effect won't be -" seen. -" -" * New (dark) Visual coloring has been introduced. -" The dark Visual is more aligned with the rest of the colour scheme, -" especially if you use line numbers. If you wish to use the -" old Visual coloring, use -" -" let g:zenburn_old_Visual = 1 -" -" Default is to use the new Visual. -" -" * EXPERIMENTAL FEATURE: Zenburn will automatically detect if you -" have ctags_highlighting.vim (by Al Budden, -" http://www.vim.org/scripts/script.php?script_id=2646) enabled, and -" will set sensible highlight links. Nothing will happen if you do -" not have ctags_highlighting.vim. If you do not want this feature, you can -" override the check with: -" -" let g:zenburn_disable_ctags_highlighting_support = 1 -" -" NOTE: -" -" * To turn the parameter(s) back to defaults, use UNLET or set them to 0: -" -" unlet g:zenburn_alternate_Include -" or -" let g:zenburn_alternate_Include = 0 -" -" -" That's it, enjoy! -" -" TODO -" - Visual alternate color is broken? Try GVim >= 7.0.66 if you have trouble -" - IME colouring (CursorIM) - -" Set defaults, but keep any parameters already set by the user -if ! exists("g:zenburn_high_Contrast") - let g:zenburn_high_Contrast = 0 -endif - -if ! exists("g:zenburn_color_also_Ignore") - let g:zenburn_color_also_Ignore = 0 -endif - -if ! exists("g:zenburn_alternate_Error") - let g:zenburn_alternate_Error = 0 -endif - -if ! exists("g:zenburn_force_dark_Background") - let g:zenburn_force_dark_Background = 0 -endif - -if ! exists("g:zenburn_alternate_Visual") - let g:zenburn_alternate_Visual = 0 -endif - -if ! exists("g:zenburn_alternate_Include") - let g:zenburn_alternate_Include = 0 -endif - -if ! exists("g:zenburn_unified_CursorColumn") - let g:zenburn_unified_CursorColumn = 0 -endif - -if ! exists("g:zenburn_old_Visual") - let g:zenburn_old_Visual = 0 -endif - -if ! exists("g:zenburn_disable_ctags_highlighting_support") - " enabled by default - let g:zenburn_disable_ctags_highlighting_support = 0 -endif - -" ----------------------------------------------- - -set background=dark -hi clear -if exists("syntax_on") - syntax reset -endif -let g:colors_name="zenburn" - -" check for ctags-highlighting -if exists("g:loaded_ctags_highlighting") && g:loaded_ctags_highlighting && ! g:zenburn_disable_ctags_highlighting_support - " internal - let _zenburn_ctags = 1 -endif - -hi Boolean guifg=#dca3a3 -hi Character guifg=#dca3a3 gui=bold -hi Comment guifg=#7f9f7f gui=italic -hi Conditional guifg=#f0dfaf gui=bold -hi Constant guifg=#dca3a3 gui=bold -hi Cursor guifg=#000d18 guibg=#8faf9f gui=bold -hi Debug guifg=#bca3a3 gui=bold -hi Define guifg=#ffcfaf gui=bold -hi Delimiter guifg=#8f8f8f -hi DiffAdd guifg=#709080 guibg=#313c36 gui=bold -hi DiffChange guibg=#333333 -hi DiffDelete guifg=#333333 guibg=#464646 -hi DiffText guifg=#ecbcbc guibg=#41363c gui=bold -hi Directory guifg=#9fafaf gui=bold -hi ErrorMsg guifg=#80d4aa guibg=#2f2f2f gui=bold -hi Exception guifg=#c3bf9f gui=bold -hi Float guifg=#c0bed1 -hi FoldColumn guifg=#93b3a3 guibg=#3f4040 -hi Folded guifg=#93b3a3 guibg=#3f4040 -hi Function guifg=#efef8f -hi Identifier guifg=#efdcbc -hi IncSearch guibg=#f8f893 guifg=#385f38 -hi Keyword guifg=#f0dfaf gui=bold -hi Label guifg=#dfcfaf gui=underline -hi Macro guifg=#ffcfaf gui=bold -hi ModeMsg guifg=#ffcfaf gui=none -hi MoreMsg guifg=#ffffff gui=bold -hi Number guifg=#8cd0d3 -hi Operator guifg=#f0efd0 -hi PreCondit guifg=#dfaf8f gui=bold -hi PreProc guifg=#ffcfaf gui=bold -hi Question guifg=#ffffff gui=bold -hi Repeat guifg=#ffd7a7 gui=bold -hi Search guifg=#ffffe0 guibg=#284f28 -hi SpecialChar guifg=#dca3a3 gui=bold -hi SpecialComment guifg=#82a282 gui=bold -hi Special guifg=#cfbfaf -hi SpecialKey guifg=#9ece9e -hi Statement guifg=#e3ceab gui=none -hi StatusLine guifg=#313633 guibg=#ccdc90 -hi StatusLineNC guifg=#2e3330 guibg=#88b090 -hi StorageClass guifg=#c3bf9f gui=bold -hi String guifg=#cc9393 -hi Structure guifg=#efefaf gui=bold -hi Tag guifg=#e89393 gui=bold -hi Title guifg=#efefef gui=bold -hi Todo guifg=#dfdfdf guibg=bg gui=bold -hi Typedef guifg=#dfe4cf gui=bold -hi Type guifg=#dfdfbf gui=bold -hi Underlined guifg=#dcdccc gui=underline -hi VertSplit guifg=#2e3330 guibg=#688060 -hi VisualNOS guifg=#333333 guibg=#f18c96 gui=bold,underline -hi WarningMsg guifg=#ffffff guibg=#333333 gui=bold -hi WildMenu guibg=#2c302d guifg=#cbecd0 gui=underline - -hi SpellBad guisp=#bc6c4c guifg=#dc8c6c -hi SpellCap guisp=#6c6c9c guifg=#8c8cbc -hi SpellRare guisp=#bc6c9c guifg=#bc8cbc -hi SpellLocal guisp=#7cac7c guifg=#9ccc9c - -" Entering Kurt zone -if &t_Co > 255 - hi Boolean ctermfg=181 - hi Character ctermfg=181 cterm=bold - hi Comment ctermfg=108 - hi Conditional ctermfg=223 cterm=bold - hi Constant ctermfg=181 cterm=bold - hi Cursor ctermfg=233 ctermbg=109 cterm=bold - hi Debug ctermfg=181 cterm=bold - hi Define ctermfg=223 cterm=bold - hi Delimiter ctermfg=245 - hi DiffAdd ctermfg=66 ctermbg=237 cterm=bold - hi DiffChange ctermbg=236 - hi DiffDelete ctermfg=236 ctermbg=238 - hi DiffText ctermfg=217 ctermbg=237 cterm=bold - hi Directory ctermfg=109 cterm=bold - hi ErrorMsg ctermfg=115 ctermbg=236 cterm=bold - hi Exception ctermfg=249 cterm=bold - hi Float ctermfg=251 - hi Function ctermfg=228 - hi Identifier ctermfg=223 - hi IncSearch ctermbg=228 ctermfg=238 - hi Keyword ctermfg=223 cterm=bold - hi Label ctermfg=187 cterm=underline - hi LineNr ctermfg=248 ctermbg=233 - hi Macro ctermfg=223 cterm=bold - hi ModeMsg ctermfg=223 cterm=none - hi MoreMsg ctermfg=15 cterm=bold - hi Number ctermfg=116 - hi Operator ctermfg=230 - hi PreCondit ctermfg=180 cterm=bold - hi PreProc ctermfg=223 cterm=bold - hi Question ctermfg=15 cterm=bold - hi Repeat ctermfg=223 cterm=bold - hi Search ctermfg=230 ctermbg=236 - hi SpecialChar ctermfg=181 cterm=bold - hi SpecialComment ctermfg=108 cterm=bold - hi Special ctermfg=181 - hi SpecialKey ctermfg=151 - hi Statement ctermfg=187 ctermbg=234 cterm=none - hi StatusLine ctermfg=236 ctermbg=186 - hi StatusLineNC ctermfg=235 ctermbg=108 - hi StorageClass ctermfg=249 cterm=bold - hi String ctermfg=174 - hi Structure ctermfg=229 cterm=bold - hi Tag ctermfg=181 cterm=bold - hi Title ctermfg=7 ctermbg=234 cterm=bold - hi Todo ctermfg=108 ctermbg=234 cterm=bold - hi Typedef ctermfg=253 cterm=bold - hi Type ctermfg=187 cterm=bold - hi Underlined ctermfg=188 ctermbg=234 cterm=bold - hi VertSplit ctermfg=236 ctermbg=65 - hi VisualNOS ctermfg=236 ctermbg=210 cterm=bold - hi WarningMsg ctermfg=15 ctermbg=236 cterm=bold - hi WildMenu ctermbg=236 ctermfg=194 cterm=bold - - " spellchecking, always "bright" background - hi SpellLocal ctermfg=14 ctermbg=237 - hi SpellBad ctermfg=9 ctermbg=237 - hi SpellCap ctermfg=12 ctermbg=237 - hi SpellRare ctermfg=13 ctermbg=237 - - " pmenu - hi PMenu ctermfg=248 ctermbg=0 - hi PMenuSel ctermfg=223 ctermbg=235 - - if exists("g:zenburn_high_Contrast") && g:zenburn_high_Contrast - hi Normal ctermfg=188 ctermbg=234 - hi NonText ctermfg=238 - - if exists("g:zenburn_color_also_Ignore") && g:zenburn_color_also_Ignore - hi Ignore ctermfg=238 - endif - - " hc mode, darker CursorLine, default 236 - hi CursorLine ctermbg=233 cterm=none - - if exists("g:zenburn_unified_CursorColumn") && g:zenburn_unified_CursorColumn - hi CursorColumn ctermbg=233 cterm=none - else - hi CursorColumn ctermbg=235 cterm=none - endif - else - hi Normal ctermfg=188 ctermbg=237 - hi Cursor ctermbg=109 - hi diffadd ctermbg=237 - hi diffdelete ctermbg=238 - hi difftext ctermbg=237 - hi errormsg ctermbg=237 - hi incsearch ctermbg=228 - hi linenr ctermbg=235 - hi search ctermbg=238 - hi statement ctermbg=237 - hi statusline ctermbg=144 - hi statuslinenc ctermbg=108 - hi title ctermbg=237 - hi todo ctermbg=237 - hi underlined ctermbg=237 - hi vertsplit ctermbg=65 - hi visualnos ctermbg=210 - hi warningmsg ctermbg=236 - hi wildmenu ctermbg=236 - hi NonText ctermfg=240 - - if exists("g:zenburn_color_also_Ignore") && g:zenburn_color_also_Ignore - hi Ignore ctermfg=240 - endif - - " normal mode, lighter CursorLine - hi CursorLine ctermbg=238 cterm=none - - if exists("g:zenburn_unified_CursorColumn") && g:zenburn_unified_CursorColumn - hi CursorColumn ctermbg=238 cterm=none - else - hi CursorColumn ctermbg=239 cterm=none - endif - endif - - if exists("g:zenburn_alternate_Error") && g:zenburn_alternate_Error - " use more jumpy Error - hi Error ctermfg=210 ctermbg=52 gui=bold - else - " default is something more zenburn-compatible - hi Error ctermfg=228 ctermbg=95 gui=bold - endif -endif - -if exists("g:zenburn_force_dark_Background") && g:zenburn_force_dark_Background - " Force dark background, because of a bug in VIM: VIM sets background - " automatically during "hi Normal ctermfg=X"; it misinterprets the high - " value (234 or 237 above) as a light color, and wrongly sets background to - " light. See ":help highlight" for details. - set background=dark -endif - -if exists("g:zenburn_high_Contrast") && g:zenburn_high_Contrast - " use new darker background - hi Normal guifg=#dcdccc guibg=#1f1f1f - hi CursorLine guibg=#121212 gui=bold - if exists("g:zenburn_unified_CursorColumn") && g:zenburn_unified_CursorColumn - hi CursorColumn guibg=#121212 gui=bold - else - hi CursorColumn guibg=#2b2b2b - endif - hi Pmenu guibg=#242424 guifg=#ccccbc - hi PMenuSel guibg=#353a37 guifg=#ccdc90 gui=bold - hi PmenuSbar guibg=#2e3330 guifg=#000000 - hi PMenuThumb guibg=#a0afa0 guifg=#040404 - hi MatchParen guifg=#f0f0c0 guibg=#383838 gui=bold - hi SignColumn guifg=#9fafaf guibg=#181818 gui=bold - hi TabLineFill guifg=#cfcfaf guibg=#181818 gui=bold - hi TabLineSel guifg=#efefef guibg=#1c1c1b gui=bold - hi TabLine guifg=#b6bf98 guibg=#181818 gui=bold - hi NonText guifg=#404040 gui=bold - - hi LineNr guifg=#9fafaf guibg=#161616 -else - " Original, lighter background - hi Normal guifg=#dcdccc guibg=#3f3f3f - hi CursorLine guibg=#434443 - if exists("g:zenburn_unified_CursorColumn") && g:zenburn_unified_CursorColumn - hi CursorColumn guibg=#434343 - else - hi CursorColumn guibg=#4f4f4f - endif - hi Pmenu guibg=#2c2e2e guifg=#9f9f9f - hi PMenuSel guibg=#242424 guifg=#d0d0a0 gui=bold - hi PmenuSbar guibg=#2e3330 guifg=#000000 - hi PMenuThumb guibg=#a0afa0 guifg=#040404 - hi MatchParen guifg=#b2b2a0 guibg=#2e2e2e gui=bold - hi SignColumn guifg=#9fafaf guibg=#343434 gui=bold - hi TabLineFill guifg=#cfcfaf guibg=#353535 gui=bold - hi TabLineSel guifg=#efefef guibg=#3a3a39 gui=bold - hi TabLine guifg=#b6bf98 guibg=#353535 gui=bold - hi NonText guifg=#5b605e gui=bold - - hi LineNr guifg=#9fafaf guibg=#262626 -endif - -if exists("g:zenburn_old_Visual") && g:zenburn_old_Visual - if exists("g:zenburn_alternate_Visual") && g:zenburn_alternate_Visual - " Visual with more contrast, thanks to Steve Hall & Cream posse - " gui=none fixes weird highlight problem in at least GVim 7.0.66, thanks to Kurt Maier - hi Visual guifg=#000000 guibg=#71d3b4 gui=none - hi VisualNOS guifg=#000000 guibg=#71d3b4 gui=none - else - " use default visual - hi Visual guifg=#233323 guibg=#71d3b4 gui=none - hi VisualNOS guifg=#233323 guibg=#71d3b4 gui=none - endif -else - " new Visual style - if exists("g:zenburn_high_Contrast") && g:zenburn_high_Contrast - " high contrast - "hi Visual guibg=#304a3d - "hi VisualNos guibg=#304a3d - "TODO no nice greenish in console, 65 is closest. use full black instead, - "although i like the green..! - hi Visual guibg=#0f0f0f - hi VisualNos guibg=#0f0f0f - if &t_Co > 255 - hi Visual ctermbg=0 - endif - else - " low contrast - hi Visual guibg=#2f2f2f - hi VisualNOS guibg=#2f2f2f - - if &t_Co > 255 - hi Visual ctermbg=235 - hi VisualNOS ctermbg=235 - endif - endif -endif - -if exists("g:zenburn_alternate_Error") && g:zenburn_alternate_Error - " use more jumpy Error - hi Error guifg=#e37170 guibg=#664040 gui=bold -else - " default is something more zenburn-compatible - hi Error guifg=#e37170 guibg=#3d3535 gui=none -endif - -if exists("g:zenburn_alternate_Include") && g:zenburn_alternate_Include - " original setting - hi Include guifg=#ffcfaf gui=bold -else - " new, less contrasted one - hi Include guifg=#dfaf8f gui=bold -endif - -if exists("g:zenburn_color_also_Ignore") && g:zenburn_color_also_Ignore - " color the Ignore groups - " note: if you get strange coloring for your files, turn this off (unlet) - hi Ignore guifg=#545a4f -endif - -" new tabline and fold column -if exists("g:zenburn_high_Contrast") && g:zenburn_high_Contrast - hi FoldColumn guibg=#161616 - hi Folded guibg=#161616 - hi TabLine guifg=#88b090 guibg=#313633 gui=none - hi TabLineSel guifg=#ccd990 guibg=#222222 - hi TabLineFill guifg=#88b090 guibg=#313633 gui=none - - hi SpecialKey guibg=#242424 - - if &t_Co > 255 - hi FoldColumn ctermbg=233 ctermfg=109 - hi Folded ctermbg=233 ctermfg=109 - hi TabLine ctermbg=236 ctermfg=108 cterm=none - hi TabLineSel ctermbg=235 ctermfg=186 cterm=bold - hi TabLineFill ctermbg=236 ctermfg=236 - endif -else - hi FoldColumn guibg=#333333 - hi Folded guibg=#333333 - hi TabLine guifg=#d0d0b8 guibg=#222222 gui=none - hi TabLineSel guifg=#f0f0b0 guibg=#333333 gui=bold - hi TabLineFill guifg=#dccdcc guibg=#101010 gui=none - - hi SpecialKey guibg=#444444 - - if &t_Co > 255 - hi FoldColumn ctermbg=236 ctermfg=109 - hi Folded ctermbg=236 ctermfg=109 - hi TabLine ctermbg=235 ctermfg=187 cterm=none - hi TabLineSel ctermbg=236 ctermfg=229 cterm=bold - hi TabLineFill ctermbg=233 ctermfg=233 - endif -endif - -" EXPERIMENTAL ctags_highlighting support -" link/set sensible defaults here; -" -" For now I mostly link to subset of Zenburn colors, the linkage is based -" on appearance, not semantics. In later versions I might define more new colours. -" -" HELP NEEDED to make this work properly. -if exists("_zenburn_ctags") && _zenburn_ctags - - " Highlighter seems to think a lot of things are global variables even - " though they're not. Example: python method-local variable is - " coloured as a global variable. They should not be global, since - " they're not visible outside the method. - " If this is some very bright colour group then things look bad. - hi link CTagsGlobalVariable Identifier - - hi CTagsClass guifg=#acd0b3 - if &t_Co > 255 - hi CTagsClass ctermfg=115 - endif - - hi link CTagsImport Statement - hi link CTagsMember Function - - hi link CTagsGlobalConstant Constant - - " These do not yet have support, I can't get them to appear - hi link EnumerationValue Float - hi link EnumerationName Identifier - hi link DefinedName WarningMsg - hi link LocalVariable WarningMsg - hi link Structure WarningMsg - hi link Union WarningMsg -endif - -" TODO check for more obscure syntax groups that they're ok - diff --git a/doc/buffergator.txt b/doc/buffergator.txt deleted file mode 100644 index e09e6bd..0000000 --- a/doc/buffergator.txt +++ /dev/null @@ -1,268 +0,0 @@ -*buffergator.txt* Buffer indexing and navigation plugin. - -=============================================================================== - *buffergator* *buffergator-contents* -CONTENTS~ - - 1. Introduction ........................... |buffergator-introduction| - 2. Commands ............................... |buffergator-commands| - 3. Key Mappings (Global) .................. |buffergator-global-keys| - 4. Key Mappings (Buffer Catalog) .......... |buffergator-buffer-keys| - 5. Key Mappings (Tab Page Catalog) ........ |buffergator-tabpage-keys| - 5. Options and Settings ................... |buffergator-options| - -=============================================================================== - *buffergator-introduction* -INTRODUCTION~ - -Buffergator is a plugin for listing, navigating between, and selecting buffers -to edit. Upon invocation (using the command, ":BuffergatorOpen" or -"BuffergatorToggle", or the provided key mapping, "b"), a "catalog" of -listed buffers are displayed in a separate new window split (vertical or -horizontal, based on user options; default = vertical). From this "buffer -catalog", a buffer can be selected and opened in an existing window, a new -window split (vertical or horizontal), or a new tab page. - -Selected buffers can be "previewed", i.e. opened in a window or tab page, but -with focus remaining in the buffer catalog. Even better, you can "walk" up and -down the list of buffers shown in the catalog by using (or ) / - (or ). These keys select the next/previous buffer in succession, -respectively, opening it for preview without leaving the buffer catalog -viewer. - -Buffergator also provides a way to list tab pages and buffers associated with -windows in tab pages (the "tab page catalog", which can be invoked using the -command ":BuffergatorTabsOpen" or the provided key mapping, "t"). - -By default, Buffergator provides global key maps that invoke its main -commands: "b" to open and "B" to close the buffer catalog, and -"t" to open and "T" to close the tab page catalog. If you -prefer to map other keys, or do not want any keys mapped at all, set -"g:buffergator_suppress_keymaps" to 1 in your $VIMRUNTIME. - -=============================================================================== - *buffergator-commands* -COMMANDS~ - -These following commands are provided globally by Buffergator: - -:BuffergatorOpen - Open the buffer catalog, or go to it if it is already open. - -:BuffergatorClose - Close the buffer catalog if it is already open. - -:BuffergatorToggle - Open the buffer catalog if it is closed, or close it if - it is already open. - -:BuffergatorTabsOpen - Open the tab page catalog, or go to it if it is already open. - -:BuffergatorTabsClose - Close the tab page catalog if it is already open. - -:BuffergatorTabsToggle - Open the tab page catalog if it is closed, or close it if - it is already open. - -=============================================================================== - *buffergator-global-keys* -KEY MAPPINGS (GLOBAL)~ - -Unless "g:buffergator_suppress_keymaps" is set to 1, then the following -key mappings are defined: - -b Invokes ":BuffergatorOpen": open the buffer catalog, or go - to it if it is already open. - -B Invokes ":BuffergatorClose": close the buffer catalog. - -t Invokes ":BuffergatorTabsOpen": open the tab page catalog, - or go to it if it is already open. - -T Invokes ":BuffergatorTabsClose": close the tab page - catalog. - -=============================================================================== - *buffergator-buffer-keys* -KEY MAPPINGS (BUFFER CATALOG)~ - -Invoking Buffergator results in the listed buffers being displayed in a -special Buffergator window, which is referred to as a "buffer catalog viewer". -The following key mappings are available when in the viewer. - -------------------------------------------------------------------------------- -Catalog Management~ - -cs Cycle through sort regimes. -cd Cycle through display regimes. -r Update (rebuild/refresh) index. -d Delete the selected buffer. -D Unconditionally delete the selected buffer. -x Wipe the selected buffer. -X Unconditionally wipe the selected buffer. -q Quit the index/catalog window. - -------------------------------------------------------------------------------- -Open Selected Buffer~ - -The following keys all open the currently-selected buffer and switch focus to -it. If the key presses are preceded by a number, then the buffer with that -number will be selected and opened instead of the current buffer. The catalog -buffer will be closed if 'g:buffergator_autodismiss_on_select' evaluates to -true; otherwise it will be kept open. - -, o Open the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in previous window. -s Open the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in a new vertical - split. -i Open the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in a new split. -t Open the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in a new tab page. - -------------------------------------------------------------------------------- -Preview Selected Buffer~ - -The following keys all open the currently-selected buffer, but retain focus on -the catalog viewer. If the key presses are preceded by a number, than the -buffer with that number will be opened. - -O, go Preview the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in the previous - window. -S, gs Preview the currently-selected buffer (or, if [count] is - given, buffer with number [count]), is a new vertical - split. -I, gi Preview the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in a new split -T Preview the currently-selected buffer (or, if [count] is - given, buffer with number [count]), in a new tab - page. -, Go to the next buffer entry (or, if [count] is - given, buffer with number [count]), and preview it in the - previous window. -, Go to the previous buffer entry (or, if [count] is - given, buffer with number [count]), and preview it in the - previous window. - -------------------------------------------------------------------------------- -Go to Existing Viewport Showing Buffer~ - -The following keys will try to find the selected buffer in an existing -viewport (whether on the current tab page or another). If the key presses are -preceded by a number, then the buffer with that number will be the target -buffer. - -eo If currently-selected buffer (or, if [count] is - given, buffer with number [count]), is showing in an existing - viewport on this or any other tab page, go it it; - otherwise show it in the previous window. -es If currently-selected buffer (or, if [count] is - given, buffer with number [count]), is showing in an existing - viewport on this or any other tab page, go it it; - otherwise show it in a new vertical split. -ei If currently-selected buffer (or, if [count] is - given, buffer with number [count]), is showing in an existing - viewport on this or any other tab page, go it it; - otherwise show it in a new horizontal split. -et If currently-selected buffer (or, if [count] is - given, buffer with number [count]), is showing in an existing - viewport on this or any other tab page, go it it; - otherwise show it in a new tab page. -E If currently-selected buffer (or, if [count] is - given, buffer with number [count]), is showing in an existing - viewport on this or any other tab page, go it it; - otherwise do nothing. - -------------------------------------------------------------------------------- -Window Control~ - -A Zoom/unzoom window, expanding to full height (if - horizontally split) or full width (if vertically split) - -=============================================================================== - *buffergator-tabpage-keys* -KEY MAPPINGS (TAB PAGE CATALOG)~ - -------------------------------------------------------------------------------- -Catalog Management~ - -cd Cycle through display regimes. -r Update (rebuild/refresh) index. -q Quit the index/catalog window. - -------------------------------------------------------------------------------- -Open Selected Tab Page or Tab Page Window~ - -The following keys all open the currently-selected tab page or window. - -, o Open the currently-selected tab page or window. - Select the next tab page entry. - Select the previous tab page entry. - Select the next tab page window entry. - Select the previous tab page window entry. - -------------------------------------------------------------------------------- -Window Control~ - -A Zoom/unzoom window, expanding to full height (if - horizontally split) or full width (if vertically split) - - -=============================================================================== - *buffergator-options* -OPTIONS AND SETTINGS~ - -The following options can be used to customize the behavior of this plugin: - -g:buffergator_viewport_split_policy~ - Default: "L" - Determines how a new Buffergator window will be opened. Can be one of the - following values: - "L" : vertical left (full screen height) - "R" : vertical right (full screen height) - "T" : horizontal top (full screen width) - "B" : horizontal bottom (full screen width) - -g:buffergator_autodismiss_on_select~ - Default: 1 - If true, then selection an entry with will close the catalog. Otherwise, - catalog stays open. Default is 1. - -g:buffergator_autoexpand_on_split~ - Default: 1 - If true and running in GUI mode, then the application screen will be expanded - to accommodate the Buffergator window. - -g:buffergator_split_size~ - Default: 40 - If greater than 0, this will be the width of the Buffergator window in any - vertical splitting mode, or its height in any horizontal splitting mode. - -g:buffergator_sort_regime~ - Default: "bufnum" - Sets the default sort regime for buffer listing: - "bufnum" : sort by buffer number [default] - "basename": sort by buffer file basename (followed by directory) - "filepath": sort by full buffer filepath - "extension": sort by buffer filename extension (followed by full - filepath) - "mru": sort by most recently used - -g:buffergator_display_regime~ - Default: "basename" - Sets the default sort regime for buffer listing: - "basename": display buffer basename first, - followed by directory [default] - "filepath": display full buffer filepath - "bufname": display buffer name - -g:buffergator_suppress_keymaps~ - Default: 0 - If true, then Buffergator will not automatically map "b" to - open the Buffergator catalog and "B" to close it. - - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/fuf.txt b/doc/fuf.txt deleted file mode 100644 index 2e36831..0000000 --- a/doc/fuf.txt +++ /dev/null @@ -1,1883 +0,0 @@ -*fuf.txt* buffer/file/command/tag/etc explorer with fuzzy matching. - - Copyright (c) 2007-2010 Takeshi NISHIDA - -FuzzyFinder *fuzzyfinder* *fuf* - -INTRODUCTION |fuf-introduction| -INSTALLATION |fuf-installation| -USAGE |fuf-usage| -MODES |fuf-modes| -DETAILED TOPICS |fuf-detailed-topics| -COMMANDS |fuf-commands| -OPTIONS |fuf-options| -VIMRC EXAMPLE |fuf-vimrc-example| -SPECIAL THANKS |fuf-thanks| -CHANGELOG |fuf-changelog| -ABOUT |fuf-about| - -============================================================================== -INTRODUCTION *fuf-introduction* - -FuzzyFinder provides convenient ways to quickly reach the -buffer/file/command/bookmark/tag you want. FuzzyFinder searches with the -fuzzy/partial pattern to which it converted an entered pattern. - - Entered pattern Fuzzy pattern Partial pattern ~ -> - abc *a*b*c* *abc* - dir/file dir/*f*i*l*e* dir/*file* - d*r/file d*r/*f*i*l*e* d*r/*file* - ../**/s ../**/*s* ../**/*s* - (** allows searching a directory tree.) -< -You will be happy when: - - "./AhLongLongLongLongLongFile.txt" - "./AhLongLongLongLongLongName.txt" - "./OhLongLongLongLongLongFile.txt" - "./OhLongLongLongLongLongName.txt" <- you want :O - -Type "ON" and "OhLongLongLongLongLongName.txt" will be selected. :D - -FuzzyFinder can search: - - - buffers - - files - - directories - - most recently used files - - files around most recently used files - - most recently used command-lines - - bookmarked files - - bookmarked directories - - tags - - files which are included in current tagfiles - - jump list - - change list - - buffer lines - - quickfix - - help - -FuzzyFinder also provides APIs to use its system of searching files or -selecting items. - -FuzzyFinder supports multibyte characters. - - -============================================================================== -INSTALLATION *fuf-installation* - -Put all files into your runtime directory. If you have the zip file, extract -it to your runtime directory. - -You should place the files as follows: -> - /plugin/fuf.vim - /doc/fuf.txt - ... -< -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. - -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 the following commands: - - Command 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. - -These commands open 1-line buffer to enter search pattern and start insert -mode. - -FuzzyFinder searchs for matching items with an entered pattern and shows them -in a completion menu. For more details on pattern matching, see -|fuf-search-patterns|. - -If there are a lot of matching items, FuzzyFinder limits the number of -enumerating items (|g:fuf_enumeratingLimit|) to speed up a response time, and -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. - -You can open a selected item in various ways: - - (|g:fuf_keyOpen|) - opens in a previous window. - (|g:fuf_keyOpenSplit|) - opens in a split window. - (|g:fuf_keyOpenVsplit|) - opens in a vertical-split window. - (|g:fuf_keyOpenTabpage|) - opens in a new tab page. - -To cancel and return to previous window, just leave Insert mode. - -With (|g:fuf_keySwitchMatching|), You can switch search method -between fuzzy matching and partial matching. - -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 shows another information. The height -of command-line area is changed to |g:fuf_previewHeight| when you launch a -mode supporting preview. This feature is available when |g:fuf_previewHeight| -is not 0. - - -============================================================================== -MODES *fuf-modes* - - *fuf-buffer-mode* -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 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 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 the most recently used -files and open it. - -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 the most recently -used commands and execute it. - -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-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 |: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 -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_bookmarkfile_searchRange| option to 0. - -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 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 ~ - -This mode provides an interface to select one of the files which are included -in current tagfiles and open it. - - *fuf-jumplist-mode* -Jump-List mode ~ - -This mode provides an interface to select one from the |jumplist| of the -current window and jump there. - - *fuf-changelist-mode* -Change-List mode ~ - -This mode provides an interface to select one from the |changelist| of the -current buffer and jump there. - - *fuf-quickfix-mode* -Quickfix mode ~ - -This mode provides an interface to select one from the |quickfix| list and -jump there. - - *fuf-line-mode* -Line mode ~ - -This mode provides an interface to select a line from current buffer and jump -there. - - *fuf-help-mode* -Help mode ~ - -This mode provides an interface to select a help tag and jump to the help -page. - - *fuf-givenfile-mode* -Given-File mode ~ - -This mode provides an API to open a selected file from a given list. - -API function: -> - function fuf#givenfile#launch( - \ initialPattern, partialMatching, prompt, items) -< - initialPattern - String which is inserted after launching - FuzzyFinder. - partialMatching - If non-zero, enable partial matching instead of - fuzzy matching. - prompt - Prompt string - items - List of items. - -Example of use: -> - " Open one of your dotfiles. - call fuf#givenfile#launch('', 0, '>', split(glob('~/.*'), "\n")) -< - - *fuf-givendir-mode* -Given-Directory mode ~ - -This mode provides an API to change current working directory to a selected -one from a given list. - -API function: -> - function fuf#givendir#launch( - \ initialPattern, partialMatching, prompt, items) -< - initialPattern - String which is inserted after launching - FuzzyFinder. - partialMatching - If non-zero, enable partial matching instead of - fuzzy matching. - prompt - Prompt string - items - List of items. - - -Example of use: -> - " Change current working directory to one of your runtime directory. - call fuf#givendir#launch('', 0, '>', split(&runtimepath, ',')) -< - - *fuf-givencmd-mode* -Given-Command mode ~ - -This mode provides an API to execute a selected command from a given list. - -A selected command is executed by |feedkeys()|, so it is able to emulate a -series of key input in Normal mode. - -API function: -> - function fuf#givencmd#launch( - \ initialPattern, partialMatching, prompt, items) -< - initialPattern - String which is inserted after launching - FuzzyFinder. - partialMatching - If non-zero, enable partial matching instead of - fuzzy matching. - prompt - Prompt string - items - List of items. - - -Example of use: -> - function GetAllCommands() - redir => commands - silent command - redir END - return map((split(commands, "\n")[3:]), - \ '":" . matchstr(v:val, ''^....\zs\S*'')') - endfunction - - " execute one of the user-defined commands - call fuf#givencmd#launch('', 0, '>', GetAllCommands()) - -< - - *fuf-callbackfile-mode* -Callback-File mode ~ - -This mode provides an API to find and get a file path which is selected by an -user. - -API function: -> - function fuf#callbackfile#launch( - \ initialPattern, partialMatching, prompt, exclude, listener) -< - initialPattern - String which is inserted after launching - FuzzyFinder. - partialMatching - If non-zero, enable partial matching instead of - fuzzy matching. - prompt - Prompt string. - exclude - Regexp pattern for items which you want to exclude - from completion list. - listener - |Dictionary| which has 'onComplete' and 'onAbort'. - They are called at the end of FuzzyFinder. - listener.onComplete(item, method) is called with 2 - arguments which are a name of selected item and a - number of open method when completed. - listener.onAbort() is called when aborted. - -Example of use: -> - let listener = {} - - function listener.onComplete(item, method) - echo "Item: " . a:item . "\nMethod: " . a:method - endfunction - - function listener.onAbort() - echo "Abort" - endfunction - - " Find a file from current working directory. - call fuf#callbackfile#launch('', 0, '>', '', listener) - - " Find a file from home directory. - call fuf#callbackfile#launch('~/', 0, '>', '', listener) -< - - *fuf-callbackitem-mode* -Callback-Item mode ~ - -This mode provides an API to get an item which is selected from a given list -by an user. - -API function: -> - function fuf#callbackitem#launch( - \ initialPattern, partialMatching, prompt, listener, items, forPath) -< - initialPattern - String which is inserted after launching - FuzzyFinder. - partialMatching - If non-zero, enable partial matching instead of - fuzzy matching. - prompt - Prompt string - listener - |Dictionary| which has 'onComplete' and 'onAbort'. - They are called at the end of FuzzyFinder. - listener.onComplete(item, method) is called with 2 - arguments which are a name of selected item and a - number of open method when completed. - listener.onAbort() is called when aborted. - items - List of items. - forPath - If non-zero, use a matching method for files. - -Example of use: -> - let listener = {} - - function listener.onComplete(item, method) - echo "Item: " . a:item . "\nMethod: " . a:method - endfunction - - function listener.onAbort() - echo "Abort" - endfunction - - " Select an item from a given list. - call fuf#callbackitem#launch('', 0, '>', listener, ['ed', 'vi', 'vim'], 0) - - " Select a file from a given list. - call fuf#callbackitem#launch('', 0, '>', listener, ['../foo/bar', 'baz'], 1) -< - -============================================================================== -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 ~ - -You can enter one primary pattern and zero or more refining patterns as search -patterns. An entered pattern is separated by ";" (|g:fuf_patternSeparator|), -and the first pattern is a primary pattern and the rest of patterns is a -refining pattern. -> - primary refining refining - |----------| |-------| |----| - >MruFile>bookmark.vim;autoload/;/home/ -< -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 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. - -In a mode which targets a static set of file paths (such as Buffer or MRU-File -mode, not File or Directory) and |g:fuf_splitPathMatching| is non-zero, -matching with a primary pattern is divided into head part and tail part and -done individually. -> - head tail - |------||-----| - foo/bar/baz.vim - - fuzzy matching example: - +----------------+---------+---------+---------+ - | item \ pattern | foo/bar | foo/ | bar | - +----------------+---------+---------+---------+ - | foo/bar | match | match | match | - | foo/abc | unmatch | match | unmatch | - | abc/bar | unmatch | unmatch | match | - | foobar | unmatch | unmatch | match | - | foooo/barrrr | match | match | match | - | foooo/fooooo | unmatch | match | unmatch | - +----------------+---------+---------+---------+ -< -refining pattern can match anywhere on each path in the above case. - - *fuf-sorting-of-completion-items* -Sorting Of Completion Items ~ - -FuzzyFinder sorts completion items with some rules. - -An item, one part of which is matched with a whole pattern, is placed upper. -E.g., with the pattern "bc", the item "abc" is placed upper than "bac". - -In the above case, items, each having matching part at the head of itself, are -placed upper than others. E.g., with the pattern "foo", the item "foobar" is -placed upper than "foobarbaz". - -And the shorter the length of the item after matching position puts it higher. -E.g., with the pattern "bar", the item "foobar" is placed upper than -"foobarbaz". - -If a pattern matches an item at only word boundaries of it, the item is placed -upper. E.g., with a pattern "fb", items such as "fooBarBaz" and "foo_bar_baz" -is placed upper. - -Plus, FuzzyFinder has a learning system. An item which has been completed in -the past with current pattern is placed upper. - - *fuf-reusing-window* -Reusing Of A Window Containing Target Buffer/File ~ - -If a window containing target buffer is found in current tab page when -FuzzyFinder is going to open the buffer in a split new window, move to it. If -a window containing target buffer is found in other tab page when FuzzyFinder -is going to open the buffer in a new tab page, move to it. - -You can disable that feature via 'reuse_window' options if always want to open -a buffer in a new window. - - *fuf-hiding-menu* -To Hide The Completion Menu Temporarily In FuzzyFinder ~ - -You can close it by and reopen it by . - - *fuf-abbreviation* *fuf-multiple-search* -Abbreviations And Multiple Search ~ - -You can use abbreviations and multiple search in all modes by setting -|g:fuf_abbrevMap| option. - -For example, set as below: -> - let g:fuf_abbrevMap = { - \ "^doc:" : [ - \ "~/project/**/doc/", - \ ".vim/doc/", - \ ], - \ } -< -and enter "doc:txt" in File mode, then FuzzyFinder searches by the following -patterns: - - "~/project/**/doc/*t*x*t*" - ".vim/doc/*t*x*t*" - -and show concatenated search results. - - *fuf-data-file* -Data File ~ - -FuzzyFinder writes completion statistics, MRU data, bookmark, etc to files -under |g:fuf_dataDir|. - -|: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 ~ - -Once a cache was created, It is not automatically updated to speed up the -response time by default. To update it, use |:FufRenewCache| command. - - *fuf-dot-sequence* -Going Up Parent Directories With Dot Sequence ~ - -You can go up parent directories with entering dot sequence. Dot sequence -after a path separator is expanded to "../" sequence. - - Dot sequence Expanded pattern ~ - /.. /../ - /... /../../ - /.... /../../../ - - *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 ~ - -Migemo is a search method for Japanese language. - - -============================================================================== -COMMANDS *fuf-commands* - -See also: |fuf-vimrc-example| - - *:FufBuffer* -:FufBuffer[!] [{pattern}] - Launchs Buffer mode. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufFile* -:FufFile[!] [{pattern}] - Launchs 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. - - *:FufFileWithFullCwd* -:FufFileWithFullCwd[!] [{pattern}] - Is mostly the same as |:FufFile|, except that initial pattern is a - full path of current working directory. - - *:FufFileWithCurrentBufferDir* -:FufFileWithCurrentBufferDir[!] [{pattern}] - 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. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufDirWithFullCwd* -:FufDirWithFullCwd[!] [{pattern}] - Is mostly the same as |:FufDir|, except that initial pattern is a full - path of current working directory. - - *:FufDirWithCurrentBufferDir* -:FufDirWithCurrentBufferDir[!] [{pattern}] - Is mostly the same as |:FufDir|, except that initial pattern is a path - of directory current buffer is in. - - *:FufMruFile* -:FufMruFile[!] [{pattern}] - Launchs MRU-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. - - *: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. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *: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. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufTag* -:FufTag[!] [{pattern}] - Launchs 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. - - *:FufTagWithCursorWord* -:FufTagWithCursorWord[!] [{pattern}] - 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}] - Launchs Tagged-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. - - *:FufJumpList* -:FufJumpList[!] [{pattern}] - Launchs Jump-List mode. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufChangeList* -:FufChangeList[!] [{pattern}] - Launchs Change-List mode. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufQuickfix* -:FufQuickfix[!] [{pattern}] - Launchs Quickfix mode. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufLine* -:FufLine[!] [{pattern}] - Launchs Line mode. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufHelp* -:FufHelp[!] [{pattern}] - Launchs Help mode. - - If a command was executed with a ! modifier, it does partial matching - instead of fuzzy matching. - - {pattern} will be inserted after launching FuzzyFinder. - - *:FufEditDataFile* -:FufEditDataFile - Opens a buffer for editing your data files. See |fuf-data-file| for - details. - - *: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 - Removes caches to renew completion items. See |fuf-cache| for details. - - -============================================================================== -OPTIONS *fuf-options* - - *fuf-options-for-all-modes* -For All Modes ~ - - *g:fuf_modesDisable* > - let g:fuf_modesDisable = [ 'mrufile', 'mrucmd', ] -< - List of mode names to disable. - - Modes which are listed will never be initialized and never handle any - event. - - *g:fuf_keyOpen* > - let g:fuf_keyOpen = '' -< - Key mapped to select completion item or finish input and open a - buffer/file in previous window. - - *g:fuf_keyOpenSplit* > - let g:fuf_keyOpenSplit = '' -< - Key mapped to select completion item or finish input and open a - buffer/file in split new window - - *g:fuf_keyOpenVsplit* > - let g:fuf_keyOpenVsplit = '' -< - Key mapped to select completion item or finish input and open a - buffer/file in vertical-split new window. - - *g:fuf_keyOpenTabpage* > - let g:fuf_keyOpenTabpage = '' -< - - Key mapped to select completion item or finish input and open a - buffer/file in a new tab page. - - *g:fuf_keyPreview* > - let g:fuf_keyPreview = '' -< - - Key mapped to show information of selected completion item on - command-line area. This key makes sense only in modes supporting - preview. - - *g:fuf_keyNextMode* > - let g:fuf_keyNextMode = '' -< - Key mapped to switch to next mode. - - *g:fuf_keyPrevMode* > - let g:fuf_keyPrevMode = '' -< - Key mapped to switch to previous mode. - - *g:fuf_keyPrevPattern* > - let g:fuf_keyPrevPattern = '' -< - Key mapped to recall previous entered patten from history. - - *g:fuf_keyNextPattern* > - let g:fuf_keyNextPattern = '' -< - Key mapped to recall next entered patten from history. - - *g:fuf_keySwitchMatching* > - let g:fuf_keySwitchMatching = '' -< - Key mapped to switch between fuzzy matching and partial matching. - - *g:fuf_dataDir* > - let g:fuf_dataDir = '~/.vim-fuf-data' -< - Directory path to which data files is put. If empty string, - FuzzyFinder does not write data files. - - *g:fuf_abbrevMap* > - let g:fuf_abbrevMap = {} -< - |Dictionary|. Each value must be a |List|. All matchs of a - key in entered text is expanded with the value. - - *g:fuf_patternSeparator* > - let g:fuf_patternSeparator = ';' -< - String which sparates a input pattern into a primary pattern and - refining patterns. - - *g:fuf_promptHighlight* > - let g:fuf_promptHighlight = 'Question' -< - a highlight group name for a prompt string. - - *g:fuf_ignoreCase* > - let g:fuf_ignoreCase = 1 -< - If non-zero, FuzzyFinder ignores case in search patterns. - - *g:fuf_splitPathMatching* > - let g:fuf_splitPathMatching = 1 -< - If non-zero, matching with a primary pattern is divided into head part - and tail part and done individually. - - See also: |fuf-search-patterns| - - *g:fuf_fuzzyRefining* > - let g:fuf_fuzzyRefining = 0 -< - 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 -< - If non-zero and when FuzzyFinder opens a buffer which has already been - opened, it reuses a window containing the target buffer. - - *g:fuf_timeFormat* > - let g:fuf_timeFormat = '(%Y-%m-%d %H:%M:%S)' -< - String to format time string. See |strftime()| for details. - - *g:fuf_learningLimit* > - let g:fuf_learningLimit = 100 -< - Ceiling for the number of completion statistics to be stored. - - *g:fuf_enumeratingLimit* > - let g:fuf_enumeratingLimit = 50 -< - To speed up the response time, FuzzyFinder ends enumerating completion - items when found over this. - - *g:fuf_maxMenuWidth* > - let g:fuf_maxMenuWidth = 78 -< - If a length of a completion item is more than this, it is snipped in - completion menu. - - *g:fuf_previewHeight* > - 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 -< - If non-zero, FuzzyFinder uses Migemo. - - *fuf-options-for-buffer-mode* -For Buffer Mode ~ - - *g:fuf_buffer_prompt* > - let g:fuf_buffer_prompt = '>Buffer[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_buffer_switchOrder* > - let g:fuf_buffer_switchOrder = 10 -< - Number of order for switching to the next/previous mode. If negative - number, Fuzzyfinder never switches to this mode. - - *g:fuf_buffer_mruOrder* > - let g:fuf_buffer_mruOrder = 1 -< - 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 ~ - - *g:fuf_file_prompt* > - let g:fuf_file_prompt = '>File[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_file_switchOrder* > - let g:fuf_file_switchOrder = 20 -< - Number of order for switching to the next/previous mode. If negative - number, Fuzzyfinder never switches to this mode. - - *g:fuf_file_exclude* > - 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 ~ - - *g:fuf_dir_prompt* > - let g:fuf_dir_prompt = '>Dir[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_dir_switchOrder* > - 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. - - *g:fuf_dir_exclude* > - let g:fuf_dir_exclude = '\v(^|[/\\])\.(hg|git|bzr)($|[/\\])' -< - Regexp pattern for items which you want to exclude from completion - list. - - *fuf-options-for-mrufile-mode* -For MRU-File Mode ~ - - *g:fuf_mrufile_prompt* > - let g:fuf_mrufile_prompt = '>MRU-File[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_mrufile_switchOrder* > - 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\~$|\.(o|exe|dll|bak|orig|sw[po])$|^(\/\/|\\\\|\/mnt\/|\/media\/)' -< - Regexp pattern for items which you want to exclude from completion - list. - - *g:fuf_mrufile_maxItem* > - let g:fuf_mrufile_maxItem = 200 -< - 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 ~ - - *g:fuf_mrucmd_prompt* > - let g:fuf_mrucmd_prompt = '>MRU-Cmd[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_mrucmd_switchOrder* > - 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. - - *g:fuf_mrucmd_exclude* > - let g:fuf_mrucmd_exclude = '^$' -< - Regexp pattern for items which you want to exclude from completion - list. - - *g:fuf_mrucmd_maxItem* > - let g:fuf_mrucmd_maxItem = 200 -< - This is the ceiling for the number of MRU items to be stored. - - *fuf-options-for-bookmarkfile-mode* -For Bookmark-File Mode ~ - - *g:fuf_bookmarkfile_prompt* > - let g:fuf_bookmarkfile_prompt = '>BookmarkFile[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *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_bookmarkfile_searchRange* > - let g:fuf_bookmarkfile_searchRange = 400 -< - Number of lines which FuzzyFinder searches a matching line from - bookmarked position within. - - *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. - - *fuf-options-for-tag-mode* -For Tag Mode ~ - - *g:fuf_tag_prompt* > - let g:fuf_tag_prompt = '>Tag[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_tag_switchOrder* > - 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. - - *fuf-options-for-buffertag-mode* -For Buffer-Tag Mode ~ - - *g:fuf_buffertag_prompt* > - let g:fuf_buffertag_prompt = '>Buffer-Tag[]>' -< - 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 ~ - - *g:fuf_taggedfile_prompt* > - let g:fuf_taggedfile_prompt = '>Tagged-File[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_taggedfile_switchOrder* > - 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. - - *fuf-options-for-jumplist-mode* -For Jump-List Mode ~ - - *g:fuf_jumplist_prompt* > - let g:fuf_jumplist_prompt = '>Jump-List[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_jumplist_switchOrder* > - 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. - - *fuf-options-for-changelist-mode* -For Change-List Mode ~ - - *g:fuf_changelist_prompt* > - let g:fuf_changelist_prompt = '>Change-List[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_changelist_switchOrder* > - 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. - - *fuf-options-for-quickfix-mode* -For Quickfix Mode ~ - - *g:fuf_quickfix_prompt* > - let g:fuf_quickfix_prompt = '>Quickfix[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_quickfix_switchOrder* > - 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. - - *fuf-options-for-line-mode* -For Line Mode ~ - - *g:fuf_line_prompt* > - let g:fuf_line_prompt = '>Line[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_line_switchOrder* > - 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. - - *fuf-options-for-help-mode* -For Help Mode ~ - - *g:fuf_help_prompt* > - let g:fuf_help_prompt = '>Help[]>' -< - Prompt string. "[]" will be substituted with indicators. - - *g:fuf_help_switchOrder* > - 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. - - -============================================================================== -VIMRC EXAMPLE *fuf-vimrc-example* - -> - let g:fuf_modesDisable = [] - let g:fuf_mrufile_maxItem = 400 - let g:fuf_mrucmd_maxItem = 400 - 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 -< - -============================================================================== -SPECIAL THANKS *fuf-thanks* - -- Vincent Wang -- Ingo Karkat -- Nikolay Golubev -- Brian Doyle -- id:secondlife -- Nathan Neff - - -============================================================================== -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. - - Added key mapping to switch between fuzzy matching and partial matching. - - Changed the default values of g:fuf_file_exclude for ignoring "*.dll". - - Changed Tag mode and Tagged-File mode to cache parsed data to files in - "~/.vim-fuf-cache/". - - Fixed a bug that repeating preview key produced no effect. - - Fixed a bug that File mode and Directory mode didn't list items in a - directory whose name includes uppercase characters. (Thanks, ryo7000) - -3.4: - - Added new feature which makes it possible to preview selected completion - item. - - Changed matching rules and added g:fuf_splitPathMatching. - - Changed sorting rules. - - Changed the default values of g:fuf_file_exclude and g:fuf_dir_exclude in - order to ignore ".hg", ".git", and ".bzr" directories. - - Changed the default value of g:fuf_mrufile_exclude in order to ignore - network files (\\*) on Windows and ignore /mnt/* and /media/* on Unix like - systems. - - Fixed a bug that an exclude pattern of File, Dir, and Callback-File mode - can't be changed. - -3.3: - - Added Jump-List mode, Change-List mode, and Quickfix mode which enable - jumps with jump list, change list, and quickfix list. - - Added new feature which deletes selected bookmark with FuzzyFinder and - g:fuf_bookmark_keyDelete option. - - Changed default values of g:fuf_keyPrevPattern. - - Changed to show error message when incompatible with a installed vim. - -3.2: - - Added g:fuf_promptHighlight option to integrate such options for each - mode. - - Changed APIs of Given-File, Given-Directory, Given-Command, Callback-File, - and Callback-Item modes to be able to set a prompt string. - - Changed default values of g:fuf_keyPrevPattern and g:fuf_keyNextPattern. - - Fixed a bug that MRU-File data was not updated When a file was opened with - FuzzyFinder. - - Fixed a bug with scoring matchings for sorting. Thanks to Vincent. - - Brought back the removed feature which is switching to an other mode in - FuzzyFinder. - -3.1: - - Added new feature to recall patterns which have been entered before from - history. - -3.0: - - Redesigned the whole plugin for improvements of maintainability and - performance. "fuzzyfinder" is abbreviated to "fuf" in the sorce code and - filenames. All commands and options are renamed. - - Added new feature which is refining pattern. - - Improved the rules for sorting completion items. Thanks to the suggestion - by Nathan, the rule for boundary matching was implemented. - - Changed to open one line buffer of FuzzyFinder with :topleft command - instead of :leftabove. The window will alway appear at the top and occupy - the full with of the vim window. Thanks to Jan Christoph. - - Changed default filename of information file. - - Changed MRU-File mode and MRU-Command mode to be disabled by default - due to performance and side effect issues. - - Removed the feature which is switching to an other mode in FuzzyFinder. - - Removed the feature which is temporarily switching 'ignorecase' in - FuzzyFinder. - -2.22.3: - - Fixed a bug that Fuzzyfinder could not open files with '$' in the name on - Windows. - -2.22.2: - - Changed to consider a length of a date/time string when abbreviates long - completion items. - - Fixed a bug that '**/' pattern did not search for files directly under the - current working directory in File mode. Thanks to Martin for reporting. - -2.22.1: - - Fixed a bug that Fuzzyfinder could not expand abbreviations to patterns - including '\' correctly. - - Fixed to show item number in Given-File, Given-Directory, and - Given-Command mode. - -2.22.0: - - More improved the abbreviation method for long completion items. - - Added Given-File mode for third-party script to select a file from a given - list and open. - - Added Given-Directory mode for third-party script to select a directory - from a given list and change current working directory to it. - - Added Given-Command mode for third-party script to select a command from a - given list and execute. - - Changed ways to launch Callback-File mode and Callback-item mode. - -2.21.0: - - Improved a method of trimming long completion items. Thanks to Andy, - pyrhockz, and Nathan. - - Changed not to map command-line for MRU-Command mode if - g:FuzzyFinderOptions.MruCmd.mode_available is set 0 before loading - fuzzyfinder.vim. - - Added Callback-File mode and Callback-Item mode for third-party script to - find a file/directory or an item from a given list using Fuzzyfinder. - - Changed not to append ".." to a completion menu in File/Directory mode. - Use dot sequence feature. - - Changed default value of g:FuzzyFinderOptions.File.excluded_path option. - - Changed default value of g:FuzzyFinderOptions.Dir.excluded_path option. - - Fixed a bug that couldn't jump to a tag. Thanks to Thinca. - -2.20: - - Added help files which are doc/fuzzyfinder.txt and doc/fuzzyfinder.jax. - - Fixed a bug that an error occurs if current directory included spaces. - Thanks id:cho45 and id:secondlife. - - Implemented a feature to reuse a window containing target buffer. - - Added g:FuzzyFinderOptions.Buffer.reuse_window option. - - Added g:FuzzyFinderOptions.File.reuse_window option. - - Added g:FuzzyFinderOptions.MruFile.reuse_window option. - - Added g:FuzzyFinderOptions.Bookmark.reuse_window option. - - Added g:FuzzyFinderOptions.TaggedFile.reuse_window option. - - Changed to use 'omnifunc' instead of 'completefunc'. Now you can use - to delete all entered characters. - - Changed default value of g:FuzzyFinderOptions.Base.key_open_tab option. - - Changed default value of g:FuzzyFinderOptions.Base.key_next_mode option. - - Changed default value of g:FuzzyFinderOptions.Base.key_prev_mode option. - - Changed default value of g:FuzzyFinderOptions.Base.key_ignore_case option. - - Changed to truncate long completion items from the head instead of tail. - - Added g:FuzzyFinderOptions.Base.max_menu_width option instead of - g:FuzzyFinderOptions.Base.trim_length option. - - Added :FuzzyFinderFileWithFullCwd command. - - Added :FuzzyFinderFileWithCurrentBufferDir command. - - Added :FuzzyFinderDirWithFullCwd command. - - Added :FuzzyFinderDirWithCurrentBufferDir command. - - Added :FuzzyFinderTagWithCursorWord command. - - Renamed :FuzzyFinderRemoveCache command to :FuzzyFinderRenewCache. - -2.19: - - Changed MRU-File mode that always formats completion items to be relative - to the home directory. - - Fixed a bug that a file was opened in an unintended window with Tag List - plugin. Thanks Alexey. - - Fixed a bug that garbage characters were entered when switched current - mode. Thanks id:lugecy. - -2.18: - - Improved rules for the sorting of completion items. - - Changed not to learn a completion if an entered pattern is empty. - - Fixed a bug that Buffer mode did not work. Thanks ryo7000. - -2.17: - - Introduced a learning system for the sorting of completion items. - - Added g:FuzzyFinderOptions.Base.learning_limit option. - - Changed the specification of the information file. Please remove your - information file for Fuzzyfinder. - -2.16: - - Improved response time by caching in MRU-File mode. - - Fixed a bug in Bookmark mode that Fuzzyfinder did not jump to the - Bookmarked line number when Bookmarked pattern was not found. - -2.15: - - Added Bookmark mode. - - Removed Favorite-file mode. Use Bookmark mode instead. - - Fixed not to record a entry of input() in MRU-Command mode. - -2.14: - - Changed to show buffer status in Buffer mode. - - Fixed a bug that an error occurs when nonexistent buffer-name was entered - in Buffer mode. Thanks Maxim Kim. - - Added 'enumerating_limit' option. Thanks id:secondlife. - - Removed 'matching_limit' option. Use 'enumerating_limit' instead. - -2.13: - - Fixed a bug that a directory disappeared when a file in that directory was - being opened in File/Mru-File mode. - -2.12: - - Changed to be able to show completion items in the order of recently used - in Buffer mode. - - Added g:FuzzyFinderOptions.Buffer.mru_order option. - -2.11: - - Changed that a dot sequence of entered pattern is expanded to parent - directories in File/Dir mode. - E.g.: "foo/...bar" -> "foo/../../bar" - - Fixed a bug that a prompt string was excessively inserted. - -2.10: - - Changed not to show a current buffer in a completion menu. - - Fixed a bug that a filename to open was not been escaped. - - Added 'prompt' option. - - Added 'prompt_highlight' option. - - Removed g:FuzzyFinderOptions.MruFile.no_special_buffer option. - -2.9: - - Enhanced behavior in Fuzzyfinder and added 'smart_bs' option. - - Fixed a bug that entered pattern was not been escaped. - - Fixed not to insert "zv" with "c/pattern" command in Normal mode. - - Avoid the slow down problem caused by filereadable() check for the MRU - information in BufEnter/BufWritePost. - -2.8.1: - - Fixed a bug caused by the non-escaped buffer name "[Fuzzyfinder]". - - Fixed a command to open in a new tab page in Buffer mode. -2.8: - - Added 'trim_length' option. - - Added 'switch_order' option. - - Fixed a bug that entered command did not become the newest in the history. - - Fixed a bug that folds could not open with in a command-line when - searching. - - Removed 'excluded_indicator' option. Now a completion list in Buffer mode - is the same as a result of :buffers. - -2.7: - - Changed to find an item whose index is matched with the number suffixed - with entered pattern. - - Fixed the cache bug after changing current directory in File mode. - -2.6.2: - - Fixed not to miss changes in options when updates the MRU information. - -2.6.1: - - Fixed a bug related to floating-point support. - - Added support for GetLatestVimScripts. - -2.6: - - Revived MRU-command mode. The problem with a command-line abbreviation was - solved. - - Changed the specification of the information file. - - Added :FuzzyFinderEditInfo command. - -2.5.1: - - Fixed to be able to match "foo/./bar" by "foo/**/bar" in File mode. - - Fixed to be able to open a space-containing file in File mode. - - Fixed to honor the current working directory properly in File mode. - -2.5: - - Fixed the bug that a wrong initial text is entered after switching to a - next mode. - - Fixed the bug that it does not return to previous window after leaving - Fuzzyfinder one. - -2.4: - - Fixed the bug that Fuzzyfinder fails to open a file caused by auto-cd - plugin/script. - -2.3: - - Added a key mapping to open items in a new tab page and - 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. - - Fixed not to push up a buffer number unlimitedly. - -2.2: - - Added new feature, which is the partial matching. - - Fixed the bug that an error occurs when "'" was entered. - -2.1: - - Restructured the option system AGAIN. Sorry :p - - Changed to inherit a typed text when switching a mode without leaving - Insert mode. - - Changed commands which launch explorers to be able to take a argument for - initial text. - - Changed to complete file names by relative path and not full path in the - buffer/mru-file/tagged-file mode. - - Changed to highlight a typed text when the completion item was not found - or the completion process was aborted. - - Changed to create caches for each tag file and not working directory in - the tag/tagged-file mode. - - Fixed the bug that the buffer mode couldn't open a unnamed buffer. - - Added 'matching_limit' option. - - Removed 'max_match' option. Use 'matching_limit' option instead. - - Removed 'initial_text' option. Use command argument instead. - - Removed the MRU-command mode. - -2.0: - - Added the tag mode. - - Added the tagged-file mode. - - Added :FuzzyFinderRemoveCache command. - - Restructured the option system. many options are changed names or default - values of some options. - - Changed to hold and reuse caches of completion lists by default. - - Changed to set filetype 'fuzzyfinder'. - - Disabled the MRU-command mode by default because there are problems. - - Removed FuzzyFinderAddMode command. - -1.5: - - Added the directory mode. - - Fixed the bug that it caused an error when switch a mode in Insert mode. - - Changed g:FuzzyFinder_KeySwitchMode type to a list. - -1.4: - - Changed the specification of the information file. - - Added the MRU-commands mode. - - Renamed :FuzzyFinderAddFavorite command to :FuzzyFinderAddFavFile. - - Renamed g:FuzzyFinder_MruModeVars option to g:FuzzyFinder_MruFileModeVars. - - Renamed g:FuzzyFinder_FavoriteModeVars option to - g:FuzzyFinder_FavFileModeVars. - - Changed to show registered time of each item in MRU/favorite mode. - - Added 'timeFormat' option for MRU/favorite modes. - -1.3: - - Fixed a handling of multi-byte characters. - -1.2: - - Added support for Migemo. (Migemo is Japanese search method.) - -1.1: - - Added the favorite mode. - - Added new features, which are abbreviations and multiple search. - - Added 'abbrevMap' option for each mode. - - Added g:FuzzyFinder_MruModeVars['ignoreSpecialBuffers'] option. - - Fixed the bug that it did not work correctly when a user have mapped - or . - -1.0: - - Added the MRU mode. - - Added commands to add and use original mode. - - Improved the sorting algorithm for completion items. - - Added 'initialInput' option to automatically insert a text at the - beginning of a mode. - - Changed that 'excludedPath' option works for the entire path. - - Renamed some options. - - Changed default values of some options. - - Packed the mode-specific options to dictionaries. - - Removed some options. - -0.6: - - Fixed some bugs. - -0.5: - - Improved response by aborting processing too many items. - - Changed to be able to open a buffer/file not only in previous window but - also in new window. - - Fixed a bug that recursive searching with '**' does not work. - - Added g:FuzzyFinder_CompletionItemLimit option. - - Added g:FuzzyFinder_KeyOpen option. - -0.4: - - Improved response of the input. - - Improved the sorting algorithm for completion items. It is based on the - matching level. 1st is perfect matching, 2nd is prefix matching, and 3rd - is fuzzy matching. - - Added g:FuzzyFinder_ExcludePattern option. - - Removed g:FuzzyFinder_WildIgnore option. - - Removed g:FuzzyFinder_EchoPattern option. - - Removed g:FuzzyFinder_PathSeparator option. - - Changed the default value of g:FuzzyFinder_MinLengthFile from 1 to 0. - -0.3: - - Added g:FuzzyFinder_IgnoreCase option. - - Added g:FuzzyFinder_KeyToggleIgnoreCase option. - - Added g:FuzzyFinder_EchoPattern option. - - Changed the open command in a buffer mode from ":edit" to ":buffer" to - avoid being reset cursor position. - - Changed the default value of g:FuzzyFinder_KeyToggleMode from to - because does not work on some CUI environments. - - Changed to avoid being loaded by Vim before 7.0. - - Fixed a bug with making a fuzzy pattern which has '\'. - -0.2: - - A bug it does not work on Linux is fixed. - -0.1: - - First release. - - -============================================================================== -ABOUT *fuf-about* *fuf-contact* *fuf-author* - -Author: Takeshi NISHIDA -Licence: MIT Licence -URL: http://www.vim.org/scripts/script.php?script_id=1984 - http://bitbucket.org/ns9tks/vim-fuzzyfinder/ - -Bugs/Issues/Suggestions/Improvements ~ - -Please submit to http://bitbucket.org/ns9tks/vim-fuzzyfinder/issues/ . - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/l9.txt b/doc/l9.txt deleted file mode 100644 index 8664ad4..0000000 --- a/doc/l9.txt +++ /dev/null @@ -1,73 +0,0 @@ -*l9.txt* Vim-script library - - Copyright (c) 2009-2010 Takeshi NISHIDA - -l9 *l9* - -INTRODUCTION |l9-introduction| -INSTALLATION |l9-installation| -USAGE |l9-usage| -CHANGELOG |l9-changelog| -ABOUT |l9-about| - -============================================================================== -INTRODUCTION *l9-introduction* - -l9 is a Vim-script library, which provides some utility functions and commands -for programming in Vim. - -============================================================================== - INSTALLATION *l9-installation* - -Put all files into your runtime directory. If you have the zip file, extract -it to your runtime directory. - -You should place the files as follows: -> - /plugin/l9.vim - /doc/l9.txt - ... -< -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 the plugin. - -Then update your help tags files to enable fuzzyfinder help. See -|add-local-help| for details. - -============================================================================== -USAGE *l9-usage* - -See source code. - -============================================================================== -CHANGELOG *l9-changelog* - -1.1: - - Added l9#zip() - - Added l9#tempvariables#getList() - - Changed l9#guardScriptLoading() - - Removed l9#tempvariables#swap() - -1.0.1: - - Fixed a bug that floating point numbers weren't evaluated correctly and - caused errors on some non-English locales. - -1.0: - - First release. - - -============================================================================== -ABOUT *l9-about* *l9-contact* *l9-author* - -Author: Takeshi NISHIDA -Licence: MIT Licence -URL: http://www.vim.org/scripts/script.php?script_id=3252 - http://bitbucket.org/ns9tks/vim-l9/ - -Bugs/Issues/Suggestions/Improvements ~ - -Please submit to http://bitbucket.org/ns9tks/vim-l9/issues/ . - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/tags b/doc/tags deleted file mode 100644 index 45305c0..0000000 --- a/doc/tags +++ /dev/null @@ -1,1068 +0,0 @@ -'NERDAllowAnyVisualDelims' NERD_commenter.txt /*'NERDAllowAnyVisualDelims'* -'NERDBlockComIgnoreEmpty' NERD_commenter.txt /*'NERDBlockComIgnoreEmpty'* -'NERDCommentWholeLinesInVMode' NERD_commenter.txt /*'NERDCommentWholeLinesInVMode'* -'NERDCompactSexyComs' NERD_commenter.txt /*'NERDCompactSexyComs'* -'NERDCreateDefaultMappings' NERD_commenter.txt /*'NERDCreateDefaultMappings'* -'NERDDefaultNesting' NERD_commenter.txt /*'NERDDefaultNesting'* -'NERDLPlace' NERD_commenter.txt /*'NERDLPlace'* -'NERDMenuMode' NERD_commenter.txt /*'NERDMenuMode'* -'NERDRPlace' NERD_commenter.txt /*'NERDRPlace'* -'NERDRemoveAltComs' NERD_commenter.txt /*'NERDRemoveAltComs'* -'NERDRemoveExtraSpaces' NERD_commenter.txt /*'NERDRemoveExtraSpaces'* -'NERDSpaceDelims' NERD_commenter.txt /*'NERDSpaceDelims'* -'NERDUsePlaceHolders' NERD_commenter.txt /*'NERDUsePlaceHolders'* -'loaded_nerd_comments' NERD_commenter.txt /*'loaded_nerd_comments'* -'showmarks_enable' showmarks.txt /*'showmarks_enable'* -'showmarks_hlline_lower' showmarks.txt /*'showmarks_hlline_lower'* -'showmarks_hlline_other' showmarks.txt /*'showmarks_hlline_other'* -'showmarks_hlline_upper' showmarks.txt /*'showmarks_hlline_upper'* -'showmarks_ignore_name' showmarks.txt /*'showmarks_ignore_name'* -'showmarks_ignore_type' showmarks.txt /*'showmarks_ignore_type'* -'showmarks_include' showmarks.txt /*'showmarks_include'* -'showmarks_textother' showmarks.txt /*'showmarks_textother'* -'showmarks_textupper' showmarks.txt /*'showmarks_textupper'* -'snippets' snipMate.txt /*'snippets'* -.snippet snipMate.txt /*.snippet* -.snippets snipMate.txt /*.snippets* -:Ack ack.txt /*:Ack* -:AckAdd ack.txt /*:AckAdd* -:CVSEdit vcscommand.txt /*:CVSEdit* -:CVSEditors vcscommand.txt /*:CVSEditors* -:CVSUnedit vcscommand.txt /*:CVSUnedit* -:CVSWatch vcscommand.txt /*:CVSWatch* -:CVSWatchAdd vcscommand.txt /*:CVSWatchAdd* -:CVSWatchOff vcscommand.txt /*:CVSWatchOff* -:CVSWatchOn vcscommand.txt /*:CVSWatchOn* -:CVSWatchRemove vcscommand.txt /*:CVSWatchRemove* -:CVSWatchers vcscommand.txt /*:CVSWatchers* -:Date: vimblogger_ft.txt /*:Date:* -:DeleteBlogArticle vimblogger_ft.txt /*:DeleteBlogArticle* -: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* -:FufEditDataFile fuf.txt /*:FufEditDataFile* -:FufFile fuf.txt /*:FufFile* -:FufFileWithCurrentBufferDir fuf.txt /*:FufFileWithCurrentBufferDir* -:FufFileWithFullCwd fuf.txt /*:FufFileWithFullCwd* -:FufHelp fuf.txt /*:FufHelp* -:FufJumpList fuf.txt /*:FufJumpList* -: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* -:FufTagWithCursorWord fuf.txt /*:FufTagWithCursorWord* -:FufTaggedFile fuf.txt /*:FufTaggedFile* -:Id: vimblogger_ft.txt /*:Id:* -:LAck ack.txt /*:LAck* -:LAckAdd ack.txt /*:LAckAdd* -:Loremipsum loremipsum.txt /*:Loremipsum* -:Loreplace loremipsum.txt /*:Loreplace* -:Mark mark.txt /*:Mark* -:MarkClear mark.txt /*:MarkClear* -:MarkLoad mark.txt /*:MarkLoad* -:MarkSave mark.txt /*:MarkSave* -:Modified: vimblogger_ft.txt /*:Modified:* -:PreviewBlogArticle vimblogger_ft.txt /*:PreviewBlogArticle* -:SendBlogArticle vimblogger_ft.txt /*:SendBlogArticle* -:Tags: vimblogger_ft.txt /*:Tags:* -:Title: vimblogger_ft.txt /*:Title:* -:TlistToo taglisttoo.txt /*:TlistToo* -:VCSAdd vcscommand.txt /*:VCSAdd* -:VCSAnnotate vcscommand.txt /*:VCSAnnotate* -:VCSBlame vcscommand.txt /*:VCSBlame* -:VCSCommit vcscommand.txt /*:VCSCommit* -:VCSDelete vcscommand.txt /*:VCSDelete* -:VCSDiff vcscommand.txt /*:VCSDiff* -:VCSGotoOriginal vcscommand.txt /*:VCSGotoOriginal* -:VCSInfo vcscommand.txt /*:VCSInfo* -:VCSLock vcscommand.txt /*:VCSLock* -:VCSLog vcscommand.txt /*:VCSLog* -:VCSRemove vcscommand.txt /*:VCSRemove* -:VCSRevert vcscommand.txt /*:VCSRevert* -:VCSReview vcscommand.txt /*:VCSReview* -:VCSStatus vcscommand.txt /*:VCSStatus* -:VCSUnlock vcscommand.txt /*:VCSUnlock* -:VCSUpdate vcscommand.txt /*:VCSUpdate* -:VCSVimDiff vcscommand.txt /*:VCSVimDiff* -:VWS vimwiki.txt /*:VWS* -:Vimwiki2HTML vimwiki.txt /*:Vimwiki2HTML* -:Vimwiki2HTMLBrowse vimwiki.txt /*:Vimwiki2HTMLBrowse* -:VimwikiAll2HTML vimwiki.txt /*:VimwikiAll2HTML* -:VimwikiDeleteLink vimwiki.txt /*:VimwikiDeleteLink* -:VimwikiDiaryIndex vimwiki.txt /*:VimwikiDiaryIndex* -:VimwikiDiaryNextDay vimwiki.txt /*:VimwikiDiaryNextDay* -:VimwikiDiaryPrevDay vimwiki.txt /*:VimwikiDiaryPrevDay* -:VimwikiFollowLink vimwiki.txt /*:VimwikiFollowLink* -:VimwikiGenerateLinks vimwiki.txt /*:VimwikiGenerateLinks* -:VimwikiGoBackLink vimwiki.txt /*:VimwikiGoBackLink* -:VimwikiGoto vimwiki.txt /*:VimwikiGoto* -:VimwikiIndex vimwiki.txt /*:VimwikiIndex* -:VimwikiMakeDiaryNote vimwiki.txt /*:VimwikiMakeDiaryNote* -:VimwikiNextLink vimwiki.txt /*:VimwikiNextLink* -:VimwikiPrevLink vimwiki.txt /*:VimwikiPrevLink* -:VimwikiRenameLink vimwiki.txt /*:VimwikiRenameLink* -:VimwikiSearch vimwiki.txt /*:VimwikiSearch* -:VimwikiSplitLink vimwiki.txt /*:VimwikiSplitLink* -:VimwikiTabIndex vimwiki.txt /*:VimwikiTabIndex* -:VimwikiTabMakeDiaryNote vimwiki.txt /*:VimwikiTabMakeDiaryNote* -:VimwikiTable vimwiki.txt /*:VimwikiTable* -:VimwikiTableMoveColumnLeft vimwiki.txt /*:VimwikiTableMoveColumnLeft* -:VimwikiTableMoveColumnRight vimwiki.txt /*:VimwikiTableMoveColumnRight* -:VimwikiTabnewLink vimwiki.txt /*:VimwikiTabnewLink* -:VimwikiToggleListItem vimwiki.txt /*:VimwikiToggleListItem* -:VimwikiUISelect vimwiki.txt /*:VimwikiUISelect* -:VimwikiVSplitLink vimwiki.txt /*:VimwikiVSplitLink* -# mark.txt /*#* -/ mark.txt /*\/* -? mark.txt /*?* -m mark.txt /*m* -n mark.txt /*n* -r mark.txt /*r* -star mark.txt /*star* -ExtractSnips() snipMate.txt /*ExtractSnips()* -ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* -Filename() snipMate.txt /*Filename()* -Gundo-contents gundo.txt /*Gundo-contents* -GundoBugs gundo.txt /*GundoBugs* -GundoChangelog gundo.txt /*GundoChangelog* -GundoConfig gundo.txt /*GundoConfig* -GundoContributing gundo.txt /*GundoContributing* -GundoCredits gundo.txt /*GundoCredits* -GundoIntro gundo.txt /*GundoIntro* -GundoLicense gundo.txt /*GundoLicense* -GundoUsage gundo.txt /*GundoUsage* -NERDComAbout NERD_commenter.txt /*NERDComAbout* -NERDComAlignedComment NERD_commenter.txt /*NERDComAlignedComment* -NERDComAltDelim NERD_commenter.txt /*NERDComAltDelim* -NERDComAppendComment NERD_commenter.txt /*NERDComAppendComment* -NERDComChangelog NERD_commenter.txt /*NERDComChangelog* -NERDComComment NERD_commenter.txt /*NERDComComment* -NERDComCredits NERD_commenter.txt /*NERDComCredits* -NERDComDefaultDelims NERD_commenter.txt /*NERDComDefaultDelims* -NERDComEOLComment NERD_commenter.txt /*NERDComEOLComment* -NERDComFunctionality NERD_commenter.txt /*NERDComFunctionality* -NERDComFunctionalityDetails NERD_commenter.txt /*NERDComFunctionalityDetails* -NERDComFunctionalitySummary NERD_commenter.txt /*NERDComFunctionalitySummary* -NERDComHeuristics NERD_commenter.txt /*NERDComHeuristics* -NERDComInsertComment NERD_commenter.txt /*NERDComInsertComment* -NERDComInstallation NERD_commenter.txt /*NERDComInstallation* -NERDComInvertComment NERD_commenter.txt /*NERDComInvertComment* -NERDComIssues NERD_commenter.txt /*NERDComIssues* -NERDComLicense NERD_commenter.txt /*NERDComLicense* -NERDComMappings NERD_commenter.txt /*NERDComMappings* -NERDComMinimalComment NERD_commenter.txt /*NERDComMinimalComment* -NERDComNERDComment NERD_commenter.txt /*NERDComNERDComment* -NERDComNestedComment NERD_commenter.txt /*NERDComNestedComment* -NERDComNesting NERD_commenter.txt /*NERDComNesting* -NERDComOptions NERD_commenter.txt /*NERDComOptions* -NERDComOptionsDetails NERD_commenter.txt /*NERDComOptionsDetails* -NERDComOptionsSummary NERD_commenter.txt /*NERDComOptionsSummary* -NERDComSexyComment NERD_commenter.txt /*NERDComSexyComment* -NERDComSexyComments NERD_commenter.txt /*NERDComSexyComments* -NERDComToggleComment NERD_commenter.txt /*NERDComToggleComment* -NERDComUncommentLine NERD_commenter.txt /*NERDComUncommentLine* -NERDComYankComment NERD_commenter.txt /*NERDComYankComment* -NERDCommenter NERD_commenter.txt /*NERDCommenter* -NERDCommenterContents NERD_commenter.txt /*NERDCommenterContents* -NERD_commenter.txt NERD_commenter.txt /*NERD_commenter.txt* -ResetSnippets() snipMate.txt /*ResetSnippets()* -ShowMarksClearAll showmarks.txt /*ShowMarksClearAll* -ShowMarksClearMark showmarks.txt /*ShowMarksClearMark* -ShowMarksOn showmarks.txt /*ShowMarksOn* -ShowMarksPlaceMark showmarks.txt /*ShowMarksPlaceMark* -ShowMarksToggle showmarks.txt /*ShowMarksToggle* -TaglistToo taglisttoo.txt /*TaglistToo* -VCSCommandCVSDiffOpt vcscommand.txt /*VCSCommandCVSDiffOpt* -VCSCommandCVSExec vcscommand.txt /*VCSCommandCVSExec* -VCSCommandCommitOnWrite vcscommand.txt /*VCSCommandCommitOnWrite* -VCSCommandDeleteOnHide vcscommand.txt /*VCSCommandDeleteOnHide* -VCSCommandDiffSplit vcscommand.txt /*VCSCommandDiffSplit* -VCSCommandDisableAll vcscommand.txt /*VCSCommandDisableAll* -VCSCommandDisableExtensionMappings vcscommand.txt /*VCSCommandDisableExtensionMappings* -VCSCommandDisableMappings vcscommand.txt /*VCSCommandDisableMappings* -VCSCommandDisableMenu vcscommand.txt /*VCSCommandDisableMenu* -VCSCommandEdit vcscommand.txt /*VCSCommandEdit* -VCSCommandEnableBufferSetup vcscommand.txt /*VCSCommandEnableBufferSetup* -VCSCommandMapPrefix vcscommand.txt /*VCSCommandMapPrefix* -VCSCommandMappings vcscommand.txt /*VCSCommandMappings* -VCSCommandMenuPriority vcscommand.txt /*VCSCommandMenuPriority* -VCSCommandMenuRoot vcscommand.txt /*VCSCommandMenuRoot* -VCSCommandResultBufferNameExtension vcscommand.txt /*VCSCommandResultBufferNameExtension* -VCSCommandResultBufferNameFunction vcscommand.txt /*VCSCommandResultBufferNameFunction* -VCSCommandSVKExec vcscommand.txt /*VCSCommandSVKExec* -VCSCommandSVNDiffExt vcscommand.txt /*VCSCommandSVNDiffExt* -VCSCommandSVNDiffOpt vcscommand.txt /*VCSCommandSVNDiffOpt* -VCSCommandSVNExec vcscommand.txt /*VCSCommandSVNExec* -VCSCommandSplit vcscommand.txt /*VCSCommandSplit* -VCSCommandVCSTypeOverride vcscommand.txt /*VCSCommandVCSTypeOverride* -VCSCommandVCSTypePreference vcscommand.txt /*VCSCommandVCSTypePreference* -VimwikiWeblinkHandler vimwiki.txt /*VimwikiWeblinkHandler* -abc fuf.txt /*abc* -ack ack.txt /*ack* -ack-author ack.txt /*ack-author* -ack.txt ack.txt /*ack.txt* -b:VCSCommandCommand vcscommand.txt /*b:VCSCommandCommand* -b:VCSCommandOriginalBuffer vcscommand.txt /*b:VCSCommandOriginalBuffer* -b:VCSCommandSourceFile vcscommand.txt /*b:VCSCommandSourceFile* -b:VCSCommandVCSType vcscommand.txt /*b:VCSCommandVCSType* -b:loremipsum_file loremipsum.txt /*b:loremipsum_file* -buffergator buffergator.txt /*buffergator* -buffergator-buffer-keys buffergator.txt /*buffergator-buffer-keys* -buffergator-commands buffergator.txt /*buffergator-commands* -buffergator-contents buffergator.txt /*buffergator-contents* -buffergator-global-keys buffergator.txt /*buffergator-global-keys* -buffergator-introduction buffergator.txt /*buffergator-introduction* -buffergator-options buffergator.txt /*buffergator-options* -buffergator-tabpage-keys buffergator.txt /*buffergator-tabpage-keys* -buffergator.txt buffergator.txt /*buffergator.txt* -cs surround.txt /*cs* -cvscommand-changes vcscommand.txt /*cvscommand-changes* -docinfo vimblogger_ft.txt /*docinfo* -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-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* -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* -fuf-file-mode fuf.txt /*fuf-file-mode* -fuf-givencmd-mode fuf.txt /*fuf-givencmd-mode* -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-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* -fuf-line-mode fuf.txt /*fuf-line-mode* -fuf-migemo fuf.txt /*fuf-migemo* -fuf-modes fuf.txt /*fuf-modes* -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-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* -fuf-options-for-jumplist-mode fuf.txt /*fuf-options-for-jumplist-mode* -fuf-options-for-line-mode fuf.txt /*fuf-options-for-line-mode* -fuf-options-for-mrucmd-mode fuf.txt /*fuf-options-for-mrucmd-mode* -fuf-options-for-mrufile-mode fuf.txt /*fuf-options-for-mrufile-mode* -fuf-options-for-quickfix-mode fuf.txt /*fuf-options-for-quickfix-mode* -fuf-options-for-tag-mode fuf.txt /*fuf-options-for-tag-mode* -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* -fuf-thanks fuf.txt /*fuf-thanks* -fuf-usage fuf.txt /*fuf-usage* -fuf-vimrc-example fuf.txt /*fuf-vimrc-example* -fuf.txt fuf.txt /*fuf.txt* -fuzzyfinder fuf.txt /*fuzzyfinder* -g:TagList_title taglisttoo.txt /*g:TagList_title* -g:TaglistTooEnabled taglisttoo.txt /*g:TaglistTooEnabled* -g:TaglistTooPosition taglisttoo.txt /*g:TaglistTooPosition* -g:TaglistTooTagEcho taglisttoo.txt /*g:TaglistTooTagEcho* -g:Tlist_Auto_Open taglisttoo.txt /*g:Tlist_Auto_Open* -g:Tlist_Ctags_Cmd taglisttoo.txt /*g:Tlist_Ctags_Cmd* -g:Tlist_Sort_Type taglisttoo.txt /*g:Tlist_Sort_Type* -g:Tlist_WinWidth taglisttoo.txt /*g:Tlist_WinWidth* -g:blogger_browser vimblogger_ft.txt /*g:blogger_browser* -g:blogger_confirm_del vimblogger_ft.txt /*g:blogger_confirm_del* -g:blogger_draft vimblogger_ft.txt /*g:blogger_draft* -g:blogger_login vimblogger_ft.txt /*g:blogger_login* -g:blogger_maxarticles vimblogger_ft.txt /*g:blogger_maxarticles* -g:blogger_name vimblogger_ft.txt /*g:blogger_name* -g:blogger_pass vimblogger_ft.txt /*g:blogger_pass* -g:blogger_pygments_class vimblogger_ft.txt /*g:blogger_pygments_class* -g:blogger_stylesheets vimblogger_ft.txt /*g:blogger_stylesheets* -g:fuf_abbrevMap fuf.txt /*g:fuf_abbrevMap* -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* -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_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_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* -g:fuf_keyNextPattern fuf.txt /*g:fuf_keyNextPattern* -g:fuf_keyOpen fuf.txt /*g:fuf_keyOpen* -g:fuf_keyOpenSplit fuf.txt /*g:fuf_keyOpenSplit* -g:fuf_keyOpenTabpage fuf.txt /*g:fuf_keyOpenTabpage* -g:fuf_keyOpenVsplit fuf.txt /*g:fuf_keyOpenVsplit* -g:fuf_keyPrevMode fuf.txt /*g:fuf_keyPrevMode* -g:fuf_keyPrevPattern fuf.txt /*g:fuf_keyPrevPattern* -g:fuf_keyPreview fuf.txt /*g:fuf_keyPreview* -g:fuf_keySwitchMatching fuf.txt /*g:fuf_keySwitchMatching* -g:fuf_learningLimit fuf.txt /*g:fuf_learningLimit* -g:fuf_line_prompt fuf.txt /*g:fuf_line_prompt* -g:fuf_line_switchOrder fuf.txt /*g:fuf_line_switchOrder* -g:fuf_maxMenuWidth fuf.txt /*g:fuf_maxMenuWidth* -g:fuf_modesDisable fuf.txt /*g:fuf_modesDisable* -g:fuf_mrucmd_exclude fuf.txt /*g:fuf_mrucmd_exclude* -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* -g:fuf_previewHeight fuf.txt /*g:fuf_previewHeight* -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_splitPathMatching fuf.txt /*g:fuf_splitPathMatching* -g:fuf_tag_prompt fuf.txt /*g:fuf_tag_prompt* -g:fuf_tag_switchOrder fuf.txt /*g:fuf_tag_switchOrder* -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* -g:fuf_useMigemo fuf.txt /*g:fuf_useMigemo* -g:loremipsum_files loremipsum.txt /*g:loremipsum_files* -g:loremipsum_marker loremipsum.txt /*g:loremipsum_marker* -g:loremipsum_paragraph_template loremipsum.txt /*g:loremipsum_paragraph_template* -g:loremipsum_words loremipsum.txt /*g:loremipsum_words* -g:mwAutoLoadMarks mark.txt /*g:mwAutoLoadMarks* -g:mwAutoSaveMarks mark.txt /*g:mwAutoSaveMarks* -g:mwHistAdd mark.txt /*g:mwHistAdd* -g:snippets_dir snipMate.txt /*g:snippets_dir* -g:snips_author snipMate.txt /*g:snips_author* -g:tagbar_autoclose tagbar.txt /*g:tagbar_autoclose* -g:tagbar_autofocus tagbar.txt /*g:tagbar_autofocus* -g:tagbar_autoshowtag tagbar.txt /*g:tagbar_autoshowtag* -g:tagbar_compact tagbar.txt /*g:tagbar_compact* -g:tagbar_ctags_bin tagbar.txt /*g:tagbar_ctags_bin* -g:tagbar_expand tagbar.txt /*g:tagbar_expand* -g:tagbar_foldlevel tagbar.txt /*g:tagbar_foldlevel* -g:tagbar_iconchars tagbar.txt /*g:tagbar_iconchars* -g:tagbar_left tagbar.txt /*g:tagbar_left* -g:tagbar_singleclick tagbar.txt /*g:tagbar_singleclick* -g:tagbar_sort tagbar.txt /*g:tagbar_sort* -g:tagbar_systemenc tagbar.txt /*g:tagbar_systemenc* -g:tagbar_updateonsave_maxlines tagbar.txt /*g:tagbar_updateonsave_maxlines* -g:tagbar_width tagbar.txt /*g:tagbar_width* -g:vimwiki_CJK_length vimwiki.txt /*g:vimwiki_CJK_length* -g:vimwiki_auto_checkbox vimwiki.txt /*g:vimwiki_auto_checkbox* -g:vimwiki_badsyms vimwiki.txt /*g:vimwiki_badsyms* -g:vimwiki_browsers vimwiki.txt /*g:vimwiki_browsers* -g:vimwiki_camel_case vimwiki.txt /*g:vimwiki_camel_case* -g:vimwiki_conceallevel vimwiki.txt /*g:vimwiki_conceallevel* -g:vimwiki_dir_link vimwiki.txt /*g:vimwiki_dir_link* -g:vimwiki_file_exts vimwiki.txt /*g:vimwiki_file_exts* -g:vimwiki_fold_lists vimwiki.txt /*g:vimwiki_fold_lists* -g:vimwiki_fold_trailing_empty_lines vimwiki.txt /*g:vimwiki_fold_trailing_empty_lines* -g:vimwiki_folding vimwiki.txt /*g:vimwiki_folding* -g:vimwiki_global_ext vimwiki.txt /*g:vimwiki_global_ext* -g:vimwiki_hl_cb_checked vimwiki.txt /*g:vimwiki_hl_cb_checked* -g:vimwiki_hl_headers vimwiki.txt /*g:vimwiki_hl_headers* -g:vimwiki_html_header_numbering vimwiki.txt /*g:vimwiki_html_header_numbering* -g:vimwiki_html_header_numbering_sym vimwiki.txt /*g:vimwiki_html_header_numbering_sym* -g:vimwiki_list vimwiki.txt /*g:vimwiki_list* -g:vimwiki_list_ignore_newline vimwiki.txt /*g:vimwiki_list_ignore_newline* -g:vimwiki_listsyms vimwiki.txt /*g:vimwiki_listsyms* -g:vimwiki_lower vimwiki.txt /*g:vimwiki_lower* -g:vimwiki_menu vimwiki.txt /*g:vimwiki_menu* -g:vimwiki_stripsym vimwiki.txt /*g:vimwiki_stripsym* -g:vimwiki_table_auto_fmt vimwiki.txt /*g:vimwiki_table_auto_fmt* -g:vimwiki_upper vimwiki.txt /*g:vimwiki_upper* -g:vimwiki_use_calendar vimwiki.txt /*g:vimwiki_use_calendar* -g:vimwiki_use_mouse vimwiki.txt /*g:vimwiki_use_mouse* -g:vimwiki_user_htmls vimwiki.txt /*g:vimwiki_user_htmls* -g:vimwiki_valid_html_tags vimwiki.txt /*g:vimwiki_valid_html_tags* -g:vimwiki_w32_dir_enc vimwiki.txt /*g:vimwiki_w32_dir_enc* -gundo.txt gundo.txt /*gundo.txt* -gundo_close_on_revert gundo.txt /*gundo_close_on_revert* -gundo_disable gundo.txt /*gundo_disable* -gundo_help gundo.txt /*gundo_help* -gundo_map_move_newer gundo.txt /*gundo_map_move_newer* -gundo_map_move_older gundo.txt /*gundo_map_move_older* -gundo_preview_bottom gundo.txt /*gundo_preview_bottom* -gundo_preview_height gundo.txt /*gundo_preview_height* -gundo_right gundo.txt /*gundo_right* -gundo_width gundo.txt /*gundo_width* -i_CTRL-G_S surround.txt /*i_CTRL-G_S* -i_CTRL-G_s surround.txt /*i_CTRL-G_s* -i_CTRL-R_ snipMate.txt /*i_CTRL-R_* -l9 l9.txt /*l9* -l9-about l9.txt /*l9-about* -l9-author l9.txt /*l9-author* -l9-changelog l9.txt /*l9-changelog* -l9-contact l9.txt /*l9-contact* -l9-installation l9.txt /*l9-installation* -l9-introduction l9.txt /*l9-introduction* -l9-usage l9.txt /*l9-usage* -l9.txt l9.txt /*l9.txt* -list-snippets snipMate.txt /*list-snippets* -loremipsum#Generate() loremipsum.txt /*loremipsum#Generate()* -loremipsum#GenerateInline() loremipsum.txt /*loremipsum#GenerateInline()* -loremipsum#Insert() loremipsum.txt /*loremipsum#Insert()* -loremipsum#Replace() loremipsum.txt /*loremipsum#Replace()* -loremipsum.txt loremipsum.txt /*loremipsum.txt* -mark-configuration mark.txt /*mark-configuration* -mark-dependencies mark.txt /*mark-dependencies* -mark-description mark.txt /*mark-description* -mark-highlight-colors mark.txt /*mark-highlight-colors* -mark-highlighting mark.txt /*mark-highlighting* -mark-history mark.txt /*mark-history* -mark-ideas mark.txt /*mark-ideas* -mark-installation mark.txt /*mark-installation* -mark-known-problems mark.txt /*mark-known-problems* -mark-limitations mark.txt /*mark-limitations* -mark-mappings mark.txt /*mark-mappings* -mark-persistence mark.txt /*mark-persistence* -mark-searching mark.txt /*mark-searching* -mark-todo mark.txt /*mark-todo* -mark-usage mark.txt /*mark-usage* -mark-whitespace-indifferent mark.txt /*mark-whitespace-indifferent* -mark.txt mark.txt /*mark.txt* -mark.vim mark.txt /*mark.vim* -multi_snip snipMate.txt /*multi_snip* -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* -showmarks-configuration showmarks.txt /*showmarks-configuration* -showmarks-contents showmarks.txt /*showmarks-contents* -showmarks-highlighting showmarks.txt /*showmarks-highlighting* -showmarks-mappings showmarks.txt /*showmarks-mappings* -showmarks.txt showmarks.txt /*showmarks.txt* -snipMate snipMate.txt /*snipMate* -snipMate-$# snipMate.txt /*snipMate-$#* -snipMate-${#:} snipMate.txt /*snipMate-${#:}* -snipMate-${#} snipMate.txt /*snipMate-${#}* -snipMate-author snipMate.txt /*snipMate-author* -snipMate-commands snipMate.txt /*snipMate-commands* -snipMate-contact snipMate.txt /*snipMate-contact* -snipMate-description snipMate.txt /*snipMate-description* -snipMate-disadvantages snipMate.txt /*snipMate-disadvantages* -snipMate-expandtab snipMate.txt /*snipMate-expandtab* -snipMate-features snipMate.txt /*snipMate-features* -snipMate-filename snipMate.txt /*snipMate-filename* -snipMate-indenting snipMate.txt /*snipMate-indenting* -snipMate-placeholders snipMate.txt /*snipMate-placeholders* -snipMate-remap snipMate.txt /*snipMate-remap* -snipMate-settings snipMate.txt /*snipMate-settings* -snipMate-usage snipMate.txt /*snipMate-usage* -snipMate.txt snipMate.txt /*snipMate.txt* -snippet snipMate.txt /*snippet* -snippet-syntax snipMate.txt /*snippet-syntax* -snippets snipMate.txt /*snippets* -surround surround.txt /*surround* -surround-author surround.txt /*surround-author* -surround-customizing surround.txt /*surround-customizing* -surround-issues surround.txt /*surround-issues* -surround-mappings surround.txt /*surround-mappings* -surround-replacements surround.txt /*surround-replacements* -surround-targets surround.txt /*surround-targets* -surround.txt surround.txt /*surround.txt* -tagbar tagbar.txt /*tagbar* -tagbar-autoopen tagbar.txt /*tagbar-autoopen* -tagbar-commands tagbar.txt /*tagbar-commands* -tagbar-configuration tagbar.txt /*tagbar-configuration* -tagbar-contents tagbar.txt /*tagbar-contents* -tagbar-credits tagbar.txt /*tagbar-credits* -tagbar-extend tagbar.txt /*tagbar-extend* -tagbar-features tagbar.txt /*tagbar-features* -tagbar-highlight tagbar.txt /*tagbar-highlight* -tagbar-history tagbar.txt /*tagbar-history* -tagbar-installation tagbar.txt /*tagbar-installation* -tagbar-intro tagbar.txt /*tagbar-intro* -tagbar-issues tagbar.txt /*tagbar-issues* -tagbar-keys tagbar.txt /*tagbar-keys* -tagbar-other tagbar.txt /*tagbar-other* -tagbar-pseudotags tagbar.txt /*tagbar-pseudotags* -tagbar-requirements tagbar.txt /*tagbar-requirements* -tagbar-todo tagbar.txt /*tagbar-todo* -tagbar-usage tagbar.txt /*tagbar-usage* -tagbar.txt tagbar.txt /*tagbar.txt* -taglisttoo taglisttoo.txt /*taglisttoo* -taglisttoo-configuration taglisttoo.txt /*taglisttoo-configuration* -taglisttoo-customization taglisttoo.txt /*taglisttoo-customization* -taglisttoo-format taglisttoo.txt /*taglisttoo-format* -taglisttoo-overview taglisttoo.txt /*taglisttoo-overview* -taglisttoo-parse taglisttoo.txt /*taglisttoo-parse* -taglisttoo-prerequisites taglisttoo.txt /*taglisttoo-prerequisites* -taglisttoo-usage taglisttoo.txt /*taglisttoo-usage* -taglisttoo.txt taglisttoo.txt /*taglisttoo.txt* -vS surround.txt /*vS* -v_m mark.txt /*v_m* -v_r mark.txt /*v_r* -vcscommand vcscommand.txt /*vcscommand* -vcscommand-buffer-management vcscommand.txt /*vcscommand-buffer-management* -vcscommand-buffer-variables vcscommand.txt /*vcscommand-buffer-variables* -vcscommand-bugs vcscommand.txt /*vcscommand-bugs* -vcscommand-commands vcscommand.txt /*vcscommand-commands* -vcscommand-config vcscommand.txt /*vcscommand-config* -vcscommand-contents vcscommand.txt /*vcscommand-contents* -vcscommand-customize vcscommand.txt /*vcscommand-customize* -vcscommand-events vcscommand.txt /*vcscommand-events* -vcscommand-install vcscommand.txt /*vcscommand-install* -vcscommand-intro vcscommand.txt /*vcscommand-intro* -vcscommand-manual vcscommand.txt /*vcscommand-manual* -vcscommand-mappings vcscommand.txt /*vcscommand-mappings* -vcscommand-mappings-override vcscommand.txt /*vcscommand-mappings-override* -vcscommand-naming vcscommand.txt /*vcscommand-naming* -vcscommand-options vcscommand.txt /*vcscommand-options* -vcscommand-ssh vcscommand.txt /*vcscommand-ssh* -vcscommand-ssh-config vcscommand.txt /*vcscommand-ssh-config* -vcscommand-ssh-env vcscommand.txt /*vcscommand-ssh-env* -vcscommand-ssh-other vcscommand.txt /*vcscommand-ssh-other* -vcscommand-ssh-wrapper vcscommand.txt /*vcscommand-ssh-wrapper* -vcscommand-statusline vcscommand.txt /*vcscommand-statusline* -vcscommand.txt vcscommand.txt /*vcscommand.txt* -vgS surround.txt /*vgS* -vimblogger_ft.txt vimblogger_ft.txt /*vimblogger_ft.txt* -vimwiki vimwiki.txt /*vimwiki* -vimwiki-calendar vimwiki.txt /*vimwiki-calendar* -vimwiki-changelog vimwiki.txt /*vimwiki-changelog* -vimwiki-commands vimwiki.txt /*vimwiki-commands* -vimwiki-contents vimwiki.txt /*vimwiki-contents* -vimwiki-developers vimwiki.txt /*vimwiki-developers* -vimwiki-diary vimwiki.txt /*vimwiki-diary* -vimwiki-folding vimwiki.txt /*vimwiki-folding* -vimwiki-global-commands vimwiki.txt /*vimwiki-global-commands* -vimwiki-global-mappings vimwiki.txt /*vimwiki-global-mappings* -vimwiki-help vimwiki.txt /*vimwiki-help* -vimwiki-license vimwiki.txt /*vimwiki-license* -vimwiki-local-commands vimwiki.txt /*vimwiki-local-commands* -vimwiki-local-mappings vimwiki.txt /*vimwiki-local-mappings* -vimwiki-mappings vimwiki.txt /*vimwiki-mappings* -vimwiki-multiple-wikies vimwiki.txt /*vimwiki-multiple-wikies* -vimwiki-nohtml vimwiki.txt /*vimwiki-nohtml* -vimwiki-option-auto_export vimwiki.txt /*vimwiki-option-auto_export* -vimwiki-option-css_name vimwiki.txt /*vimwiki-option-css_name* -vimwiki-option-diary_header vimwiki.txt /*vimwiki-option-diary_header* -vimwiki-option-diary_index vimwiki.txt /*vimwiki-option-diary_index* -vimwiki-option-diary_link_count vimwiki.txt /*vimwiki-option-diary_link_count* -vimwiki-option-diary_rel_path vimwiki.txt /*vimwiki-option-diary_rel_path* -vimwiki-option-ext vimwiki.txt /*vimwiki-option-ext* -vimwiki-option-index vimwiki.txt /*vimwiki-option-index* -vimwiki-option-maxhi vimwiki.txt /*vimwiki-option-maxhi* -vimwiki-option-nested_syntaxes vimwiki.txt /*vimwiki-option-nested_syntaxes* -vimwiki-option-path vimwiki.txt /*vimwiki-option-path* -vimwiki-option-path_html vimwiki.txt /*vimwiki-option-path_html* -vimwiki-option-syntax vimwiki.txt /*vimwiki-option-syntax* -vimwiki-option-template_default vimwiki.txt /*vimwiki-option-template_default* -vimwiki-option-template_ext vimwiki.txt /*vimwiki-option-template_ext* -vimwiki-option-template_path vimwiki.txt /*vimwiki-option-template_path* -vimwiki-options vimwiki.txt /*vimwiki-options* -vimwiki-placeholders vimwiki.txt /*vimwiki-placeholders* -vimwiki-prerequisites vimwiki.txt /*vimwiki-prerequisites* -vimwiki-syntax vimwiki.txt /*vimwiki-syntax* -vimwiki-syntax-blockquotes vimwiki.txt /*vimwiki-syntax-blockquotes* -vimwiki-syntax-comments vimwiki.txt /*vimwiki-syntax-comments* -vimwiki-syntax-headers vimwiki.txt /*vimwiki-syntax-headers* -vimwiki-syntax-hr vimwiki.txt /*vimwiki-syntax-hr* -vimwiki-syntax-links vimwiki.txt /*vimwiki-syntax-links* -vimwiki-syntax-lists vimwiki.txt /*vimwiki-syntax-lists* -vimwiki-syntax-paragraphs vimwiki.txt /*vimwiki-syntax-paragraphs* -vimwiki-syntax-preformatted vimwiki.txt /*vimwiki-syntax-preformatted* -vimwiki-syntax-tables vimwiki.txt /*vimwiki-syntax-tables* -vimwiki-syntax-typefaces vimwiki.txt /*vimwiki-syntax-typefaces* -vimwiki-table-mappings vimwiki.txt /*vimwiki-table-mappings* -vimwiki-table-of-contents vimwiki.txt /*vimwiki-table-of-contents* -vimwiki-tables vimwiki.txt /*vimwiki-tables* -vimwiki-template vimwiki.txt /*vimwiki-template* -vimwiki-temporary-wiki vimwiki.txt /*vimwiki-temporary-wiki* -vimwiki-text-objects vimwiki.txt /*vimwiki-text-objects* -vimwiki-title vimwiki.txt /*vimwiki-title* -vimwiki-toc vimwiki.txt /*vimwiki-toc* -vimwiki-todo-lists vimwiki.txt /*vimwiki-todo-lists* -vimwiki.txt vimwiki.txt /*vimwiki.txt* -vimwiki_- vimwiki.txt /*vimwiki_-* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_wd vimwiki.txt /*vimwiki_wd* -vimwiki_wh vimwiki.txt /*vimwiki_wh* -vimwiki_whh vimwiki.txt /*vimwiki_whh* -vimwiki_wr vimwiki.txt /*vimwiki_wr* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_ vimwiki.txt /*vimwiki_* -vimwiki_= vimwiki.txt /*vimwiki_=* -vimwiki_gqq vimwiki.txt /*vimwiki_gqq* -vimwiki_gww vimwiki.txt /*vimwiki_gww* -vimwiki_i_ vimwiki.txt /*vimwiki_i_* -vimwiki_i_ vimwiki.txt /*vimwiki_i_* -vimwiki_i_ vimwiki.txt /*vimwiki_i_* -viwmiki-global-options vimwiki.txt /*viwmiki-global-options* -viwmiki-local-options vimwiki.txt /*viwmiki-local-options* -vs surround.txt /*vs* -yS surround.txt /*yS* -ySS surround.txt /*ySS* -ys surround.txt /*ys* -yss surround.txt /*yss* diff --git a/indent/python.vim b/indent/python.vim deleted file mode 100644 index 3e50e4a..0000000 --- a/indent/python.vim +++ /dev/null @@ -1,10 +0,0 @@ -" This dirty hack for boys from BTH will be erased after this embrassing -" project end. -let current_file = expand('%:p') - -if match(current_file, '\cicard') < 0 - source $HOME/.vim/indent/python_pep8.vim -else - let g:pep8_exclude=['W191'] - source $VIMRUNTIME/indent/python.vim -endif diff --git a/plugin/buffergator.vim b/plugin/buffergator.vim deleted file mode 100644 index a40193e..0000000 --- a/plugin/buffergator.vim +++ /dev/null @@ -1,1640 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -"" Buffergator -"" -"" Vim document buffer navigation utility -"" -"" Copyright 2011 Jeet Sukumaran. -"" -"" This program is free software; you can redistribute it and/or modify -"" it under the terms of the GNU General Public License as published by -"" the Free Software Foundation; either version 3 of the License, or -"" (at your option) any later version. -"" -"" This program is distributed in the hope that it will be useful, -"" but WITHOUT ANY WARRANTY; without even the implied warranty of -"" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -"" GNU General Public License -"" for more details. -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Reload and Compatibility Guard {{{1 -" ============================================================================ -" Reload protection. -if (exists('g:did_buffergator') && g:did_buffergator) || &cp || version < 700 - finish -endif -let g:did_buffergator = 1 - -" avoid line continuation issues (see ':help user_41.txt') -let s:save_cpo = &cpo -set cpo&vim -" 1}}} - -" Global Plugin Options {{{1 -" ============================================================================= -if !exists("g:buffergator_viewport_split_policy") - let g:buffergator_viewport_split_policy = "L" -endif -if !exists("g:buffergator_move_wrap") - let g:buffergator_move_wrap = 1 -endif -if !exists("g:buffergator_autodismiss_on_select") - let g:buffergator_autodismiss_on_select = 1 -endif -if !exists("g:buffergator_autoexpand_on_split") - let g:buffergator_autoexpand_on_split = 1 -endif -if !exists("g:buffergator_split_size") - let g:buffergator_split_size = 40 -endif -if !exists("g:buffergator_sort_regime") - let g:buffergator_sort_regime = "bufnum" -endif -if !exists("g:buffergator_display_regime") - let g:buffergator_display_regime = "basename" -endif -" 1}}} - -" Script Data and Variables {{{1 -" ============================================================================= - -" Split Modes {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -" Split modes are indicated by a single letter. Upper-case letters indicate -" that the SCREEN (i.e., the entire application "window" from the operating -" system's perspective) should be split, while lower-case letters indicate -" that the VIEWPORT (i.e., the "window" in Vim's terminology, referring to the -" various subpanels or splits within Vim) should be split. -" Split policy indicators and their corresponding modes are: -" ``/`d`/`D' : use default splitting mode -" `n`/`N` : NO split, use existing window. -" `L` : split SCREEN vertically, with new split on the left -" `l` : split VIEWPORT vertically, with new split on the left -" `R` : split SCREEN vertically, with new split on the right -" `r` : split VIEWPORT vertically, with new split on the right -" `T` : split SCREEN horizontally, with new split on the top -" `t` : split VIEWPORT horizontally, with new split on the top -" `B` : split SCREEN horizontally, with new split on the bottom -" `b` : split VIEWPORT horizontally, with new split on the bottom -let s:buffergator_viewport_split_modes = { - \ "d" : "sp", - \ "D" : "sp", - \ "N" : "buffer", - \ "n" : "buffer", - \ "L" : "topleft vert sbuffer", - \ "l" : "leftabove vert sbuffer", - \ "R" : "botright vert sbuffer", - \ "r" : "rightbelow vert sbuffer", - \ "T" : "topleft sbuffer", - \ "t" : "leftabove sbuffer", - \ "B" : "botright sbuffer", - \ "b" : "rightbelow sbuffer", - \ } -" 2}}} - -" Catalog Sort Regimes {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -let s:buffergator_catalog_sort_regimes = ['basename', 'filepath', 'extension', 'bufnum', 'mru'] -let s:buffergator_catalog_sort_regime_desc = { - \ 'basename' : ["basename", "by basename (followed by directory)"], - \ 'filepath' : ["filepath", "by (full) filepath"], - \ 'extension' : ["ext", "by extension (followed by full filepath)"], - \ 'bufnum' : ["bufnum", "by buffer number"], - \ 'mru' : ["mru", "by most recently used"], - \ } -let s:buffergator_default_catalog_sort_regime = "bufnum" -" 2}}} - -" Catalog Display Regimes {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -let s:buffergator_catalog_display_regimes = ['basename', 'filepath', 'bufname'] -let s:buffergator_catalog_display_regime_desc = { - \ 'basename' : ["basename", "basename (followed by directory)"], - \ 'filepath' : ["filepath", "full filepath"], - \ 'bufname' : ["bufname", "buffer name"], - \ } -let s:buffergator_default_display_regime = "basename" -" 2}}} - -" MRU {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -let s:buffergator_mru = [] -" 2}}} -" 1}}} - -" Utilities {{{1 -" ============================================================================== - -" Text Formatting {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -function! s:_format_align_left(text, width, fill_char) - let l:fill = repeat(a:fill_char, a:width-len(a:text)) - return a:text . l:fill -endfunction - -function! s:_format_align_right(text, width, fill_char) - let l:fill = repeat(a:fill_char, a:width-len(a:text)) - return l:fill . a:text -endfunction - -function! s:_format_time(secs) - if exists("*strftime") - return strftime("%Y-%m-%d %H:%M:%S", a:secs) - else - return (localtime() - a:secs) . " secs ago" - endif -endfunction - -function! s:_format_escaped_filename(file) - if exists('*fnameescape') - return fnameescape(a:file) - else - return escape(a:file," \t\n*?[{`$\\%#'\"|!<") - endif -endfunction - -" trunc: -1 = truncate left, 0 = no truncate, +1 = truncate right -function! s:_format_truncated(str, max_len, trunc) - if len(a:str) > a:max_len - if a:trunc > 0 - return strpart(a:str, a:max_len - 4) . " ..." - elseif a:trunc < 0 - return '... ' . strpart(a:str, len(a:str) - a:max_len + 4) - endif - else - return a:str - endif -endfunction - -" Pads/truncates text to fit a given width. -" align: -1/0 = align left, 0 = no align, 1 = align right -" trunc: -1 = truncate left, 0 = no truncate, +1 = truncate right -function! s:_format_filled(str, width, align, trunc) - let l:prepped = a:str - if a:trunc != 0 - let l:prepped = s:Format_Truncate(a:str, a:width, a:trunc) - endif - if len(l:prepped) < a:width - if a:align > 0 - let l:prepped = s:_format_align_right(l:prepped, a:width, " ") - elseif a:align < 0 - let l:prepped = s:_format_align_left(l:prepped, a:width, " ") - endif - endif - return l:prepped -endfunction - -" 2}}} - -" Messaging {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -function! s:NewMessenger(name) - - " allocate a new pseudo-object - let l:messenger = {} - let l:messenger["name"] = a:name - if empty(a:name) - let l:messenger["title"] = "buffergator" - else - let l:messenger["title"] = "buffergator (" . l:messenger["name"] . ")" - endif - - function! l:messenger.format_message(leader, msg) dict - return self.title . ": " . a:leader.a:msg - endfunction - - function! l:messenger.format_exception( msg) dict - return a:msg - endfunction - - function! l:messenger.send_error(msg) dict - redraw - echohl ErrorMsg - echomsg self.format_message("[ERROR] ", a:msg) - echohl None - endfunction - - function! l:messenger.send_warning(msg) dict - redraw - echohl WarningMsg - echomsg self.format_message("[WARNING] ", a:msg) - echohl None - endfunction - - function! l:messenger.send_status(msg) dict - redraw - echohl None - echomsg self.format_message("", a:msg) - endfunction - - function! l:messenger.send_info(msg) dict - redraw - echohl None - echo self.format_message("", a:msg) - endfunction - - return l:messenger - -endfunction -" 2}}} - -" Catalog, Buffer, Windows, Files, etc. Management {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -" Searches for all buffers that have a buffer-scoped variable `varname` -" with value that matches the expression `expr`. Returns list of buffer -" numbers that meet the criterion. -function! s:_find_buffers_with_var(varname, expr) - let l:results = [] - for l:bni in range(1, bufnr("$")) - if !bufexists(l:bni) - continue - endif - let l:bvar = getbufvar(l:bni, "") - if empty(a:varname) - call add(l:results, l:bni) - elseif has_key(l:bvar, a:varname) && l:bvar[a:varname] =~ a:expr - call add(l:results, l:bni) - endif - endfor - return l:results -endfunction - -" Returns split mode to use for a new Buffergator viewport. -function! s:_get_split_mode() - if has_key(s:buffergator_viewport_split_modes, g:buffergator_viewport_split_policy) - return s:buffergator_viewport_split_modes[g:buffergator_viewport_split_policy] - else - call s:_buffergator_messenger.send_error("Unrecognized split mode specified by 'g:buffergator_viewport_split_policy': " . g:buffergator_viewport_split_policy) - endif -endfunction - -" Detect filetype. From the 'taglist' plugin. -" Copyright (C) 2002-2007 Yegappan Lakshmanan -function! s:_detect_filetype(fname) - " Ignore the filetype autocommands - let old_eventignore = &eventignore - set eventignore=FileType - " Save the 'filetype', as this will be changed temporarily - let old_filetype = &filetype - " Run the filetypedetect group of autocommands to determine - " the filetype - exe 'doautocmd filetypedetect BufRead ' . a:fname - " Save the detected filetype - let ftype = &filetype - " Restore the previous state - let &filetype = old_filetype - let &eventignore = old_eventignore - return ftype -endfunction - -function! s:_is_full_width_window(win_num) - if winwidth(a:win_num) == &columns - return 1 - else - return 0 - endif -endfunction! - -function! s:_is_full_height_window(win_num) - if winheight(a:win_num) + &cmdheight + 1 == &lines - return 1 - else - return 0 - endif -endfunction! - -" Moves (or adds) the given buffer number to the top of the list -function! s:_update_mru(acmd_bufnr) - let bnum = a:acmd_bufnr + 0 - if bnum == 0 - return - endif - call filter(s:buffergator_mru, 'v:val !=# bnum') - call insert(s:buffergator_mru, bnum, 0) -endfunction - -" 2}}} - -" Sorting {{{2 -" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -" comparison function used for sorting dictionaries by value -function! s:_compare_dicts_by_value(m1, m2, key) - if a:m1[a:key] < a:m2[a:key] - return -1 - elseif a:m1[a:key] > a:m2[a:key] - return 1 - else - return 0 - endif -endfunction - -" comparison function used for sorting buffers catalog by buffer number -function! s:_compare_dicts_by_bufnum(m1, m2) - return s:_compare_dicts_by_value(a:m1, a:m2, "bufnum") -endfunction - -" comparison function used for sorting buffers catalog by buffer name -function! s:_compare_dicts_by_bufname(m1, m2) - return s:_compare_dicts_by_value(a:m1, a:m2, "bufname") -endfunction - -" comparison function used for sorting buffers catalog by (full) filepath -function! s:_compare_dicts_by_filepath(m1, m2) - if a:m1["parentdir"] < a:m2["parentdir"] - return -1 - elseif a:m1["parentdir"] > a:m2["parentdir"] - return 1 - else - if a:m1["basename"] < a:m2["basename"] - return -1 - elseif a:m1["basename"] > a:m2["basename"] - return 1 - else - return 0 - endif - endif -endfunction - -" comparison function used for sorting buffers catalog by extension -function! s:_compare_dicts_by_extension(m1, m2) - if a:m1["extension"] < a:m2["extension"] - return -1 - elseif a:m1["extension"] > a:m2["extension"] - return 1 - else - return s:_compare_dicts_by_filepath(a:m1, a:m2) - endif -endfunction - -" comparison function used for sorting buffers catalog by basename -function! s:_compare_dicts_by_basename(m1, m2) - return s:_compare_dicts_by_value(a:m1, a:m2, "basename") -endfunction - -" comparison function used for sorting buffers catalog by mru -function! s:_compare_dicts_by_mru(m1, m2) - let l:i1 = index(s:buffergator_mru, a:m1['bufnum']) - let l:i2 = index(s:buffergator_mru, a:m2['bufnum']) - if l:i1 < l:i2 - return -1 - elseif l:i1 > l:i2 - return 1 - else - return 0 - endif -endfunction - -" 2}}} - -" 1}}} - -" CatalogViewer {{{1 -" ============================================================================ - -function! s:NewCatalogViewer(name, title) - - " initialize - let l:catalog_viewer = {} - let l:catalog_viewer["bufname"] = a:name - let l:catalog_viewer["title"] = a:title - let l:buffergator_bufs = s:_find_buffers_with_var("is_buffergator_buffer", 1) - if len(l:buffergator_bufs) > 0 - let l:catalog_viewer["bufnum"] = l:buffergator_bufs[0] - endif - let l:catalog_viewer["jump_map"] = {} - let l:catalog_viewer["split_mode"] = s:_get_split_mode() - let l:catalog_viewer["sort_regime"] = g:buffergator_sort_regime - let l:catalog_viewer["display_regime"] = g:buffergator_display_regime - let l:catalog_viewer["is_zoomed"] = 0 - let l:catalog_viewer["columns_expanded"] = 0 - let l:catalog_viewer["lines_expanded"] = 0 - - " Initialize object state. - let l:catalog_viewer["bufnum"] = -1 - - function! l:catalog_viewer.list_buffers() dict - let bcat = [] - redir => buffers_output - execute('silent ls') - redir END - let l:buffers_output_rows = split(l:buffers_output, "\n") - for l:buffers_output_row in l:buffers_output_rows - let l:parts = matchlist(l:buffers_output_row, '^\s*\(\d\+\)\(.....\) "\(.*\)"') - let l:info = {} - let l:info["bufnum"] = l:parts[1] + 0 - if l:parts[2][0] == "u" - let l:info["is_unlisted"] = 1 - let l:info["is_listed"] = 0 - else - let l:info["is_unlisted"] = 0 - let l:info["is_listed"] = 1 - endif - if l:parts[2][1] == "%" - let l:info["is_current"] = 1 - let l:info["is_alternate"] = 0 - elseif l:parts[2][1] == "#" - let l:info["is_current"] = 0 - let l:info["is_alternate"] = 1 - else - let l:info["is_current"] = 0 - let l:info["is_alternate"] = 0 - endif - if l:parts[2][2] == "a" - let l:info["is_active"] = 1 - let l:info["is_loaded"] = 1 - let l:info["is_visible"] = 1 - elseif l:parts[2][2] == "h" - let l:info["is_active"] = 0 - let l:info["is_loaded"] = 1 - let l:info["is_visible"] = 0 - else - let l:info["is_active"] = 0 - let l:info["is_loaded"] = 0 - let l:info["is_visible"] = 0 - endif - if l:parts[2][3] == "-" - let l:info["is_modifiable"] = 0 - let l:info["is_readonly"] = 0 - elseif l:parts[2][3] == "=" - let l:info["is_modifiable"] = 1 - let l:info["is_readonly"] = 1 - else - let l:info["is_modifiable"] = 1 - let l:info["is_readonly"] = 0 - endif - if l:parts[2][4] == "+" - let l:info["is_modified"] = 1 - let l:info["is_readerror"] = 0 - elseif l:parts[2][4] == "x" - let l:info["is_modified"] = 0 - let l:info["is_readerror"] = 0 - else - let l:info["is_modified"] = 0 - let l:info["is_readerror"] = 0 - endif - let l:info["bufname"] = parts[3] - let l:info["filepath"] = fnamemodify(l:info["bufname"], ":p") - let l:info["basename"] = fnamemodify(l:info["bufname"], ":t") - let l:info["parentdir"] = fnamemodify(l:info["bufname"], ":p:h") - let l:info["extension"] = fnamemodify(l:info["bufname"], ":e") - call add(bcat, l:info) - " let l:buffers_info[l:info[l:key]] = l:info - endfor - let l:sort_func = "s:_compare_dicts_by_" . self.sort_regime - return sort(bcat, l:sort_func) - endfunction - - " Opens viewer if closed, closes viewer if open. - function! l:catalog_viewer.toggle() dict - " get buffer number of the catalog view buffer, creating it if neccessary - if self.bufnum < 0 || !bufexists(self.bufnum) - call self.open() - else - let l:bfwn = bufwinnr(self.bufnum) - if l:bfwn >= 0 - call self.close(1) - else - call self.open() - endif - endif - endfunction - - " Creates a new buffer, renders and opens it. - function! l:catalog_viewer.create_buffer() dict - " get a new buf reference - let self.bufnum = bufnr(self.bufname, 1) - " get a viewport onto it - call self.activate_viewport() - " initialize it (includes "claiming" it) - call self.initialize_buffer() - " render it - call self.render_buffer() - endfunction - - " Opens a viewport on the buffer according, creating it if neccessary - " according to the spawn mode. Valid buffer number must already have been - " obtained before this is called. - function! l:catalog_viewer.activate_viewport() dict - let l:bfwn = bufwinnr(self.bufnum) - if l:bfwn == winnr() - " viewport wth buffer already active and current - return - elseif l:bfwn >= 0 - " viewport with buffer exists, but not current - execute(l:bfwn . " wincmd w") - else - " create viewport - let self.split_mode = s:_get_split_mode() - " gryf: PLEASE! Stop this annoying resizing. - "call self.expand_screen() - execute("silent keepalt keepjumps " . self.split_mode . " " . self.bufnum) - if g:buffergator_viewport_split_policy =~ '[RrLl]' && g:buffergator_split_size - execute("vertical resize " . g:buffergator_split_size) - setlocal winfixwidth - elseif g:buffergator_viewport_split_policy =~ '[TtBb]' && g:buffergator_split_size - execute("resize " . g:buffergator_split_size) - setlocal winfixheight - endif - endif - endfunction - - " Sets up buffer environment. - function! l:catalog_viewer.initialize_buffer() dict - call self.claim_buffer() - call self.setup_buffer_opts() - call self.setup_buffer_syntax() - call self.setup_buffer_commands() - call self.setup_buffer_keymaps() - call self.setup_buffer_folding() - call self.setup_buffer_statusline() - endfunction - - " 'Claims' a buffer by setting it to point at self. - function! l:catalog_viewer.claim_buffer() dict - call setbufvar("%", "is_buffergator_buffer", 1) - call setbufvar("%", "buffergator_catalog_viewer", self) - call setbufvar("%", "buffergator_last_render_time", 0) - call setbufvar("%", "buffergator_cur_line", 0) - endfunction - - " 'Unclaims' a buffer by stripping all buffergator vars - function! l:catalog_viewer.unclaim_buffer() dict - for l:var in ["is_buffergator_buffer", - \ "buffergator_catalog_viewer", - \ "buffergator_last_render_time", - \ "buffergator_cur_line" - \ ] - if exists("b:" . l:var) - unlet b:{l:var} - endif - endfor - endfunction - - " Sets buffer options. - function! l:catalog_viewer.setup_buffer_opts() dict - setlocal buftype=nofile - setlocal noswapfile - setlocal nowrap - set bufhidden=hide - setlocal nobuflisted - setlocal nolist - setlocal noinsertmode - setlocal nonumber - setlocal cursorline - setlocal nospell - endfunction - - " Sets buffer commands. - function! l:catalog_viewer.setup_buffer_commands() dict - " command! -bang -nargs=* Bdfilter :call b:buffergator_catalog_viewer.set_filter('', ) - augroup BuffergatorCatalogViewer - au! - autocmd CursorHold,CursorHoldI,CursorMoved,CursorMovedI,BufEnter,BufLeave call b:buffergator_catalog_viewer.highlight_current_line() - autocmd BufLeave let s:_buffergator_last_catalog_viewed = b:buffergator_catalog_viewer - augroup END - endfunction - - function! l:catalog_viewer.disable_editing_keymaps() dict - """" Disabling of unused modification keys - for key in [".", "p", "P", "C", "x", "X", "r", "R", "i", "I", "a", "A", "D", "S", "U"] - try - execute "nnoremap " . key . " " - catch // - endtry - endfor - endfunction - - " Sets buffer folding. - function! l:catalog_viewer.setup_buffer_folding() dict - " if has("folding") - " "setlocal foldcolumn=3 - " setlocal foldmethod=syntax - " setlocal foldlevel=4 - " setlocal foldenable - " setlocal foldtext=BuffergatorFoldText() - " " setlocal fillchars=fold:\ " - " setlocal fillchars=fold:. - " endif - endfunction - - " Close and quit the viewer. - function! l:catalog_viewer.close(restore_prev_window) dict - if self.bufnum < 0 || !bufexists(self.bufnum) - return - endif - call self.contract_screen() - if a:restore_prev_window - if !self.is_usable_viewport(winnr("#")) && self.first_usable_viewport() ==# -1 - else - try - if !self.is_usable_viewport(winnr("#")) - execute(self.first_usable_viewport() . "wincmd w") - else - execute('wincmd p') - endif - catch // - endtry - endif - endif - execute("bwipe " . self.bufnum) - endfunction - - function! l:catalog_viewer.expand_screen() dict - if has("gui_running") && g:buffergator_autoexpand_on_split && g:buffergator_split_size - if g:buffergator_viewport_split_policy =~ '[RL]' - let self.pre_expand_columns = &columns - let &columns += g:buffergator_split_size - let self.columns_expanded = &columns - self.pre_expand_columns - else - let self.columns_expanded = 0 - endif - if g:buffergator_viewport_split_policy =~ '[TB]' - let self.pre_expand_lines = &lines - let &lines += g:buffergator_split_size - let self.lines_expanded = &lines - self.pre_expand_lines - else - let self.lines_expanded = 0 - endif - endif - endfunction - - function! l:catalog_viewer.contract_screen() dict - if self.columns_expanded - \ && &columns - self.columns_expanded > 20 - let new_size = &columns - self.columns_expanded - if new_size < self.pre_expand_columns - let new_size = self.pre_expand_columns - endif - let &columns = new_size - endif - if self.lines_expanded - \ && &lines - self.lines_expanded > 20 - let new_size = &lines - self.lines_expanded - if new_size < self.pre_expand_lines - let new_size = self.pre_expand_lines - endif - let &lines = new_size - endif - endfunction - - function! l:catalog_viewer.highlight_current_line() - " if line(".") != b:buffergator_cur_line - let l:prev_line = b:buffergator_cur_line - let b:buffergator_cur_line = line(".") - 3match none - exec '3match BuffergatorCurrentEntry /^\%'. b:buffergator_cur_line .'l.*/' - " endif - endfunction - - " Clears the buffer contents. - function! l:catalog_viewer.clear_buffer() dict - call cursor(1, 1) - exec 'silent! normal! "_dG' - endfunction - - " from NERD_Tree, via VTreeExplorer: determine the number of windows open - " to this buffer number. - function! l:catalog_viewer.num_viewports_on_buffer(bnum) dict - let cnt = 0 - let winnum = 1 - while 1 - let bufnum = winbufnr(winnum) - if bufnum < 0 - break - endif - if bufnum ==# a:bnum - let cnt = cnt + 1 - endif - let winnum = winnum + 1 - endwhile - return cnt - endfunction - - " from NERD_Tree: find the window number of the first normal window - function! l:catalog_viewer.first_usable_viewport() dict - let i = 1 - while i <= winnr("$") - let bnum = winbufnr(i) - if bnum != -1 && getbufvar(bnum, '&buftype') ==# '' - \ && !getwinvar(i, '&previewwindow') - \ && (!getbufvar(bnum, '&modified') || &hidden) - return i - endif - - let i += 1 - endwhile - return -1 - endfunction - - " from NERD_Tree: returns 0 if opening a file from the tree in the given - " window requires it to be split, 1 otherwise - function! l:catalog_viewer.is_usable_viewport(winnumber) dict - "gotta split if theres only one window (i.e. the NERD tree) - if winnr("$") ==# 1 - return 0 - endif - let oldwinnr = winnr() - execute(a:winnumber . "wincmd p") - let specialWindow = getbufvar("%", '&buftype') != '' || getwinvar('%', '&previewwindow') - let modified = &modified - execute(oldwinnr . "wincmd p") - "if its a special window e.g. quickfix or another explorer plugin then we - "have to split - if specialWindow - return 0 - endif - if &hidden - return 1 - endif - return !modified || self.num_viewports_on_buffer(winbufnr(a:winnumber)) >= 2 - endfunction - - " Acquires a viewport to show the source buffer. Returns the split command - " to use when switching to the buffer. - function! l:catalog_viewer.acquire_viewport(split_cmd) - if self.split_mode == "buffer" && empty(a:split_cmd) - " buffergator used original buffer's viewport, - " so the the buffergator viewport is the viewport to use - return "" - endif - if !self.is_usable_viewport(winnr("#")) && self.first_usable_viewport() ==# -1 - " no appropriate viewport is available: create new using default - " split mode - " TODO: maybe use g:buffergator_viewport_split_policy? - if empty(a:split_cmd) - return "sb" - else - return a:split_cmd - endif - else - try - if !self.is_usable_viewport(winnr("#")) - execute(self.first_usable_viewport() . "wincmd w") - else - execute('wincmd p') - endif - catch /^Vim\%((\a\+)\)\=:E37/ - echo v:exception - catch /^Vim\%((\a\+)\)\=:/ - echo v:exception - endtry - return a:split_cmd - endif - endfunction - - " Finds next occurrence of specified pattern. - function! l:catalog_viewer.goto_pattern(pattern, direction) dict range - if a:direction == "b" || a:direction == "p" - let l:flags = "b" - " call cursor(line(".")-1, 0) - else - let l:flags = "" - " call cursor(line(".")+1, 0) - endif - if g:buffergator_move_wrap - let l:flags .= "w" - else - let l:flags .= "W" - endif - let l:flags .= "e" - let l:lnum = -1 - for i in range(v:count1) - if search(a:pattern, l:flags) < 0 - break - else - let l:lnum = 1 - endif - endfor - if l:lnum < 0 - if l:flags[0] == "b" - call s:_buffergator_messenger.send_info("No previous results") - else - call s:_buffergator_messenger.send_info("No more results") - endif - return 0 - else - return 1 - endif - endfunction - - " Cycles sort regime. - function! l:catalog_viewer.cycle_sort_regime() dict - let l:cur_regime = index(s:buffergator_catalog_sort_regimes, self.sort_regime) - let l:cur_regime += 1 - if l:cur_regime < 0 || l:cur_regime >= len(s:buffergator_catalog_sort_regimes) - let self.sort_regime = s:buffergator_catalog_sort_regimes[0] - else - let self.sort_regime = s:buffergator_catalog_sort_regimes[l:cur_regime] - endif - call self.open(1) - let l:sort_desc = get(s:buffergator_catalog_sort_regime_desc, self.sort_regime, ["??", "in unspecified order"])[1] - call s:_buffergator_messenger.send_info("sorted " . l:sort_desc) - endfunction - - " Cycles display regime. - function! l:catalog_viewer.cycle_display_regime() dict - let l:cur_regime = index(s:buffergator_catalog_display_regimes, self.display_regime) - let l:cur_regime += 1 - if l:cur_regime < 0 || l:cur_regime >= len(s:buffergator_catalog_display_regimes) - let self.display_regime = s:buffergator_catalog_display_regimes[0] - else - let self.display_regime = s:buffergator_catalog_display_regimes[l:cur_regime] - endif - call self.open(1) - let l:display_desc = get(s:buffergator_catalog_display_regime_desc, self.display_regime, ["??", "in unspecified order"])[1] - call s:_buffergator_messenger.send_info("displaying " . l:display_desc) - endfunction - - " Rebuilds catalog. - function! l:catalog_viewer.rebuild_catalog() dict - call self.open(1) - endfunction - - " Zooms/unzooms window. - function! l:catalog_viewer.toggle_zoom() dict - let l:bfwn = bufwinnr(self.bufnum) - if l:bfwn < 0 - return - endif - if self.is_zoomed - " if s:_is_full_height_window(l:bfwn) && !s:_is_full_width_window(l:bfwn) - if g:buffergator_viewport_split_policy =~ '[RrLl]' - if !g:buffergator_split_size - let l:new_size = &columns / 3 - else - let l:new_size = g:buffergator_split_size - endif - if l:new_size > 0 - execute("vertical resize " . string(l:new_size)) - endif - let self.is_zoomed = 0 - " elseif s:_is_full_width_window(l:bfwn) && !s:_is_full_height_window(l:bfwn) - elseif g:buffergator_viewport_split_policy =~ '[TtBb]' - if !g:buffergator_split_size - let l:new_size = &lines / 3 - else - let l:new_size = g:buffergator_split_size - endif - if l:new_size > 0 - execute("resize " . string(l:new_size)) - endif - let self.is_zoomed = 0 - endif - else - " if s:_is_full_height_window(l:bfwn) && !s:_is_full_width_window(l:bfwn) - if g:buffergator_viewport_split_policy =~ '[RrLl]' - if &columns > 20 - execute("vertical resize " . string(&columns-10)) - let self.is_zoomed = 1 - endif - " elseif s:_is_full_width_window(l:bfwn) && !s:_is_full_height_window(l:bfwn) - elseif g:buffergator_viewport_split_policy =~ '[TtBb]' - if &lines > 20 - execute("resize " . string(&lines-10)) - let self.is_zoomed = 1 - endif - endif - endif - endfunction - - " functions to be implemented by derived classes - function! l:catalog_viewer.update_buffers_info() dict - endfunction - - function! l:catalog_viewer.open(...) dict - endfunction - - function! l:catalog_viewer.setup_buffer_syntax() dict - endfunction - - function! l:catalog_viewer.setup_buffer_keymaps() dict - endfunction - - function! l:catalog_viewer.render_buffer() dict - endfunction - - function! l:catalog_viewer.setup_buffer_statusline() dict - endfunction - - function! l:catalog_viewer.append_line(text, jump_to_bufnum) dict - endfunction - - return l:catalog_viewer - -endfunction - -" 1}}} - -" BufferCatalogViewer {{{1 -" ============================================================================ -function! s:NewBufferCatalogViewer() - - " initialize - let l:catalog_viewer = s:NewCatalogViewer("[[buffergator: buffers]]", "buffergator") - let l:catalog_viewer["calling_bufnum"] = -1 - let l:catalog_viewer["buffers_catalog"] = {} - - " Populates the buffer list - function! l:catalog_viewer.update_buffers_info() dict - let self.buffers_catalog = self.list_buffers() - return self.buffers_catalog - endfunction - - " Opens the buffer for viewing, creating it if needed. - " First argument, if given, should be false if the buffers info is *not* - " to be repopulated; defaults to 1 - " Second argument, if given, should be number of calling window. - function! l:catalog_viewer.open(...) dict - " populate data - if (a:0 == 0 || a:1 > 0) - call self.update_buffers_info() - endif - " store calling buffer - if (a:0 >= 2 && a:2) - let self.calling_bufnum = a:2 - else - let self.calling_bufnum = bufnr("%") - endif - " get buffer number of the catalog view buffer, creating it if neccessary - if self.bufnum < 0 || !bufexists(self.bufnum) - " create and render a new buffer - call self.create_buffer() - else - " buffer exists: activate a viewport on it according to the - " spawning mode, re-rendering the buffer with the catalog if needed - call self.activate_viewport() - call self.render_buffer() - " if (a:0 > 0 && a:1) || b:buffergator_catalog_viewer != self - " call self.render_buffer() - " else - " " search for calling buffer number in jump map, - " " when found, go to that line - " endif - endif - endfunction - - - " Sets buffer syntax. - function! l:catalog_viewer.setup_buffer_syntax() dict - if has("syntax") - syn region BuffergatorModifiedFileLine start='^\[\s\{-}.\{-1,}\s\{-}\] + ' keepend oneline end='$' - syn region BuffergatorUnmodifiedFileLine start='^\[\s\{-}.\{-1,}\s\{-}\] ' keepend oneline end='$' - syn match BuffergatorModifiedFileSyntaxKey '^\zs\[\s\{-}.\{-1,}\s\{-}\]\ze' containedin=BuffergatorModifiedFileLine nextgroup=BuffergatorModifiedFilename - syn match BuffergatorUnmodifiedFileSyntaxKey '^\zs\[\s\{-}.\{-1,}\s\{-}\]\ze' containedin=BuffergatorUnmodifiedFileLine nextgroup=BuffergatorUnmodifiedFilename - syn match BuffergatorModifiedFilename ' + .\+$' containedin=BuffergatorModifiedFilenameEntry - syn match BuffergatorUnmodifiedFilename ' .\+$' containedin=BuffergatorUnmodifiedFileLine - highlight! link BuffergatorModifiedFileSyntaxKey LineNr - highlight! link BuffergatorUnmodifiedFileSyntaxKey LineNr - highlight! link BuffergatorModifiedFileFlag WarningMsg - highlight! link BuffergatorModifiedFilename WarningMsg - highlight! def BuffergatorCurrentEntry gui=reverse cterm=reverse term=reverse - endif - endfunction - - " Sets buffer key maps. - function! l:catalog_viewer.setup_buffer_keymaps() dict - - call self.disable_editing_keymaps() - - if !exists("g:buffergator_use_new_keymap") || !g:buffergator_use_new_keymap - - """" Catalog management - noremap cs :call b:buffergator_catalog_viewer.cycle_sort_regime() - noremap cd :call b:buffergator_catalog_viewer.cycle_display_regime() - noremap r :call b:buffergator_catalog_viewer.rebuild_catalog() - noremap q :call b:buffergator_catalog_viewer.close(1) - noremap d :call b:buffergator_catalog_viewer.delete_target(0, 0) - noremap D :call b:buffergator_catalog_viewer.delete_target(0, 1) - noremap x :call b:buffergator_catalog_viewer.delete_target(1, 0) - noremap X :call b:buffergator_catalog_viewer.delete_target(1, 1) - - """"" Selection: show target and switch focus - noremap :call b:buffergator_catalog_viewer.visit_target(!g:buffergator_autodismiss_on_select, 0, "") - noremap o :call b:buffergator_catalog_viewer.visit_target(!g:buffergator_autodismiss_on_select, 0, "") - " gryf: let's keep it stright: s should split, v should vsplit - noremap s :call b:buffergator_catalog_viewer.visit_target(!g:buffergator_autodismiss_on_select, 0, "sb") - noremap v :call b:buffergator_catalog_viewer.visit_target(!g:buffergator_autodismiss_on_select, 0, "vert sb") - noremap t :call b:buffergator_catalog_viewer.visit_target(!g:buffergator_autodismiss_on_select, 0, "tab sb") - - """"" Preview: show target , keeping focus on catalog - " gryf: also here, I want to have consistent shortcuts - noremap O :call b:buffergator_catalog_viewer.visit_target(1, 1, "") - noremap go :call b:buffergator_catalog_viewer.visit_target(1, 1, "") - noremap S :call b:buffergator_catalog_viewer.visit_target(1, 1, "sb") - noremap gs :call b:buffergator_catalog_viewer.visit_target(1, 1, "sb") - noremap V :call b:buffergator_catalog_viewer.visit_target(1, 1, "vert sb") - noremap gv :call b:buffergator_catalog_viewer.visit_target(1, 1, "vert sb") - noremap T :call b:buffergator_catalog_viewer.visit_target(1, 1, "tab sb") - noremap :call b:buffergator_catalog_viewer.goto_index_entry("n", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("n", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p", 1, 1) - - """"" Preview: go to existing window showing target - noremap E :call b:buffergator_catalog_viewer.visit_open_target(1, !g:buffergator_autodismiss_on_select, "") - noremap eo :call b:buffergator_catalog_viewer.visit_open_target(0, !g:buffergator_autodismiss_on_select, "") - noremap es :call b:buffergator_catalog_viewer.visit_open_target(0, !g:buffergator_autodismiss_on_select, "vert sb") - noremap ei :call b:buffergator_catalog_viewer.visit_open_target(0, !g:buffergator_autodismiss_on_select, "sb") - noremap et :call b:buffergator_catalog_viewer.visit_open_target(0, !g:buffergator_autodismiss_on_select, "tab sb") - - else - - """" Catalog management - noremap s :call b:buffergator_catalog_viewer.cycle_sort_regime() - noremap i :call b:buffergator_catalog_viewer.cycle_display_regime() - noremap u :call b:buffergator_catalog_viewer.rebuild_catalog() - noremap q :call b:buffergator_catalog_viewer.close(1) - noremap d :call b:buffergator_catalog_viewer.delete_target(0, 0) - noremap D :call b:buffergator_catalog_viewer.delete_target(0, 1) - noremap x :call b:buffergator_catalog_viewer.delete_target(1, 0) - noremap X :call b:buffergator_catalog_viewer.delete_target(1, 1) - - " open target - noremap :call b:buffergator_catalog_viewer.visit_target(!g:buffergator_autodismiss_on_select, 0, "") - - " show target line in other window, keeping catalog open and in focus - noremap . :call b:buffergator_catalog_viewer.visit_target(1, 1, "") - noremap po :call b:buffergator_catalog_viewer.visit_target(1, 1, "") - noremap ps :call b:buffergator_catalog_viewer.visit_target(1, 1, "sb") - noremap pv :call b:buffergator_catalog_viewer.visit_target(1, 1, "vert sb") - noremap pt :call b:buffergator_catalog_viewer.visit_target(1, 1, "tab sb") - noremap :call b:buffergator_catalog_viewer.goto_index_entry("n", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("n", 1, 1) - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p", 1, 1) - - " go to target line in other window, keeping catalog open - noremap o :call b:buffergator_catalog_viewer.visit_target(1, 0, "") - noremap ws :call b:buffergator_catalog_viewer.visit_target(1, 0, "sb") - noremap wv :call b:buffergator_catalog_viewer.visit_target(1, 0, "vert sb") - noremap t :call b:buffergator_catalog_viewer.visit_target(1, 0, "tab sb") - - " open target line in other window, closing catalog - noremap O :call b:buffergator_catalog_viewer.visit_target(0, 0, "") - noremap wS :call b:buffergator_catalog_viewer.visit_target(0, 0, "sb") - noremap wV :call b:buffergator_catalog_viewer.visit_target(0, 0, "vert sb") - noremap T :call b:buffergator_catalog_viewer.visit_target(0, 0, "tab sb") - - endif - - " other - noremap A :call b:buffergator_catalog_viewer.toggle_zoom() - - endfunction - - " Populates the buffer with the catalog index. - function! l:catalog_viewer.render_buffer() dict - setlocal modifiable - call self.claim_buffer() - call self.clear_buffer() - call self.setup_buffer_syntax() - let self.jump_map = {} - let l:initial_line = 1 - for l:bufinfo in self.buffers_catalog - if self.calling_bufnum == l:bufinfo.bufnum - let l:initial_line = line("$") - endif - let l:bufnum_str = s:_format_filled(l:bufinfo.bufnum, 3, 1, 0) - let l:line = "[" . l:bufnum_str . "] " - if l:bufinfo.is_modified - let l:line .= "+ " - else - let l:line .= " " - endif - if self.display_regime == "basename" - let l:line .= s:_format_align_left(l:bufinfo.basename, 30, " ") - let l:line .= l:bufinfo.parentdir - elseif self.display_regime == "filepath" - let l:line .= l:bufinfo.filepath - elseif self.display_regime == "bufname" - let l:line .= l:bufinfo.bufname - else - throw s:_buffergator_messenger.format_exception("Invalid display regime: '" . self.display_regime . "'") - endif - call self.append_line(l:line, l:bufinfo.bufnum) - endfor - let b:buffergator_last_render_time = localtime() - try - " remove extra last line - execute('normal! GV"_X') - catch // - endtry - setlocal nomodifiable - call cursor(l:initial_line, 1) - " call self.goto_index_entry("n", 0, 1) - endfunction - - " Visits the specified buffer in the previous window, if it is already - " visible there. If not, then it looks for the first window with the - " buffer showing and visits it there. If no windows are showing the - " buffer, ... ? - function! l:catalog_viewer.visit_buffer(bufnum, split_cmd) dict - " acquire window - let l:split_cmd = self.acquire_viewport(a:split_cmd) - " switch to buffer in acquired window - let l:old_switch_buf = &switchbuf - if empty(l:split_cmd) - " explicit split command not given: switch to buffer in current - " window - let &switchbuf="useopen" - execute("silent buffer " . a:bufnum) - else - " explcit split command given: split current window - let &switchbuf="split" - execute("silent keepalt keepjumps " . l:split_cmd . " " . a:bufnum) - endif - let &switchbuf=l:old_switch_buf - endfunction - - function! l:catalog_viewer.get_target_bufnum(cmd_count) dict - if a:cmd_count == 0 - let l:cur_line = line(".") - if !has_key(l:self.jump_map, l:cur_line) - call s:_buffergator_messenger.send_info("Not a valid navigation line") - return -1 - endif - let [l:jump_to_bufnum] = self.jump_map[l:cur_line].target - return l:jump_to_bufnum - else - let l:jump_to_bufnum = a:cmd_count - if bufnr(l:jump_to_bufnum) == -1 - call s:_buffergator_messenger.send_info("Not a valid buffer number: " . string(l:jump_to_bufnum) ) - return -1 - endif - for lnum in range(1, line("$")) - if self.jump_map[lnum].target[0] == l:jump_to_bufnum - call cursor(lnum, 1) - return l:jump_to_bufnum - endif - endfor - call s:_buffergator_messenger.send_info("Not a listed buffer number: " . string(l:jump_to_bufnum) ) - return -1 - endif - endfunction - - " Go to the selected buffer. - function! l:catalog_viewer.visit_target(keep_catalog, refocus_catalog, split_cmd) dict range - let l:jump_to_bufnum = self.get_target_bufnum(v:count) - if l:jump_to_bufnum == -1 - return 0 - endif - let l:cur_tab_num = tabpagenr() - if !a:keep_catalog - call self.close(0) - endif - call self.visit_buffer(l:jump_to_bufnum, a:split_cmd) - if a:keep_catalog && a:refocus_catalog - execute("tabnext " . l:cur_tab_num) - execute(bufwinnr(self.bufnum) . "wincmd w") - endif - call s:_buffergator_messenger.send_info(expand(bufname(l:jump_to_bufnum))) - endfunction - - " Go to the selected buffer, preferentially using a window that already is - " showing it; if not, create a window using split_cmd - function! l:catalog_viewer.visit_open_target(unconditional, keep_catalog, split_cmd) dict range - let l:jump_to_bufnum = self.get_target_bufnum(v:count) - if l:jump_to_bufnum == -1 - return 0 - endif - let wnr = bufwinnr(l:jump_to_bufnum) - if wnr != -1 - execute(wnr . "wincmd w") - if !a:keep_catalog - call self.close(0) - endif - return - endif - let l:cur_tab_num = tabpagenr() - for tabnum in range(1, tabpagenr('$')) - execute("tabnext " . tabnum) - let wnr = bufwinnr(l:jump_to_bufnum) - if wnr != -1 - execute(wnr . "wincmd w") - if !a:keep_catalog - call self.close(0) - endif - return - endif - endfor - execute("tabnext " . l:cur_tab_num) - if !a:unconditional - call self.visit_target(a:keep_catalog, 0, a:split_cmd) - endif - endfunction - - function! l:catalog_viewer.delete_target(wipe, force) dict range - let l:bufnum_to_delete = self.get_target_bufnum(v:count) - if l:bufnum_to_delete == -1 - return 0 - endif - if !bufexists(l:bufnum_to_delete) - call s:_buffergator_messenger.send_info("Not a valid or existing buffer") - return 0 - endif - if a:wipe && a:force - let l:operation_desc = "unconditionally wipe" - let l:cmd = "bw!" - elseif a:wipe && !a:force - let l:operation_desc = "wipe" - let l:cmd = "bw" - elseif !a:wipe && a:force - let l:operation_desc = "unconditionally delete" - let l:cmd = "bd!" - elseif !a:wipe && !a:force - let l:operation_desc = "delete" - let l:cmd = "bd" - endif - - " store current window number - let l:cur_win_num = winnr() - - " find alternate buffer to switch to - let l:alternate_buffer = -1 - for abufnum in range(l:bufnum_to_delete, 1, -1) - if bufexists(abufnum) && buflisted(abufnum) && abufnum != l:bufnum_to_delete - let l:alternate_buffer = abufnum - break - endif - endfor - if l:alternate_buffer == -1 && bufnr("$") > l:bufnum_to_delete - for abufnum in range(l:bufnum_to_delete+1, bufnr("$")) - if bufexists(abufnum) && buflisted(abufnum) && abufnum != l:bufnum_to_delete - let l:alternate_buffer = abufnum - break - endif - endfor - endif - if l:alternate_buffer == -1 - call s:_buffergator_messenger.send_warning("Cowardly refusing to delete last listed buffer") - return 0 - endif - - let l:changed_win_bufs = [] - for winnum in range(1, winnr('$')) - let wbufnum = winbufnr(winnum) - if wbufnum == l:bufnum_to_delete - call add(l:changed_win_bufs, winnum) - execute(winnum . "wincmd w") - execute("silent keepalt keepjumps buffer " . l:alternate_buffer) - endif - endfor - - let l:bufname = expand(bufname(l:bufnum_to_delete)) - try - execute(l:cmd . string(l:bufnum_to_delete)) - call self.open(1, l:alternate_buffer) - let l:message = l:bufname . " " . l:operation_desc . "d" - call s:_buffergator_messenger.send_info(l:message) - catch /E89/ - for winnum in l:changed_win_bufs - execute(winnum . "wincmd w") - execute("silent keepalt keepjumps buffer " . l:bufnum_to_delete) - endfor - execute(l:cur_win_num . "wincmd w") - let l:message = 'Failed to ' . l:operation_desc . ' "' . l:bufname . '" because it is modified; use unconditional version of this command to force operation' - call s:_buffergator_messenger.send_error(l:message) - catch // - for winnum in l:changed_win_bufs - execute(winnum . "wincmd w") - execute("silent keepalt keepjumps buffer " . l:bufnum_to_delete) - endfor - execute(l:cur_win_num . "wincmd w") - let l:message = 'Failed to ' . l:operation_desc . ' "' . l:bufname . '"' - call s:_buffergator_messenger.send_error(l:message) - endtry - - endfunction - - " Finds next line with occurrence of a rendered index - function! l:catalog_viewer.goto_index_entry(direction, visit_target, refocus_catalog) dict range - if v:count > 0 - let l:target_bufnum = v:count - if bufnr(l:target_bufnum) == -1 - call s:_buffergator_messenger.send_info("Not a valid buffer number: " . string(l:target_bufnum) ) - return -1 - endif - let l:ok = 0 - for lnum in range(1, line("$")) - if self.jump_map[lnum].target[0] == l:target_bufnum - call cursor(lnum, 1) - let l:ok = 1 - break - endif - endfor - if !l:ok - call s:_buffergator_messenger.send_info("Not a listed buffer number: " . string(l:target_bufnum) ) - return -1 - endif - else - let l:ok = self.goto_pattern("^\[", a:direction) - execute("normal! zz") - endif - if l:ok && a:visit_target - call self.visit_target(1, a:refocus_catalog, "") - endif - endfunction - - " Sets buffer status line. - function! l:catalog_viewer.setup_buffer_statusline() dict - setlocal statusline=%{BuffergatorBuffersStatusLine()} - endfunction - - " Appends a line to the buffer and registers it in the line log. - function! l:catalog_viewer.append_line(text, jump_to_bufnum) dict - let l:line_map = { - \ "target" : [a:jump_to_bufnum], - \ } - if a:0 > 0 - call extend(l:line_map, a:1) - endif - let self.jump_map[line("$")] = l:line_map - call append(line("$")-1, a:text) - endfunction - - " return object - return l:catalog_viewer - - -endfunction -" 1}}} - -" TabCatalogViewer {{{1 -" ============================================================================ -function! s:NewTabCatalogViewer() - - " initialize - let l:catalog_viewer = s:NewCatalogViewer("[[buffergator: tabs]]", "buffergator") - let l:catalog_viewer["tab_catalog"] = [] - - " Opens the buffer for viewing, creating it if needed. - " First argument, if given, should be false if the buffers info is *not* - " to be repopulated; defaults to 1 - function! l:catalog_viewer.open(...) dict - " populate data - if (a:0 == 0 || a:1 > 0) - call self.update_buffers_info() - endif - " get buffer number of the catalog view buffer, creating it if neccessary - if self.bufnum < 0 || !bufexists(self.bufnum) - " create and render a new buffer - call self.create_buffer() - else - " buffer exists: activate a viewport on it according to the - " spawning mode, re-rendering the buffer with the catalog if needed - call self.activate_viewport() - call self.render_buffer() - endif - endfunction - - " Populates the buffer list - function! l:catalog_viewer.update_buffers_info() dict - let self.tab_catalog = [] - for tabnum in range(1, tabpagenr('$')) - call add(self.tab_catalog, tabpagebuflist(tabnum)) - endfor - return self.tab_catalog - endfunction - - " Populates the buffer with the catalog index. - function! l:catalog_viewer.render_buffer() dict - setlocal modifiable - let l:cur_tab_num = tabpagenr() - call self.claim_buffer() - call self.clear_buffer() - call self.setup_buffer_syntax() - let self.jump_map = {} - let l:initial_line = 1 - for l:tidx in range(len(self.tab_catalog)) - let l:tabinfo = self.tab_catalog[tidx] - if l:cur_tab_num - 1 == l:tidx - let l:initial_line = line("$") - endif - " let l:tabfield = "==== Tab Page [" . string(l:tidx+1) . "] ====" - let l:tabfield = "TAB PAGE " . string(l:tidx+1) . ":" - call self.append_line(l:tabfield, l:tidx+1, 1) - for widx in range(len(l:tabinfo)) - let l:tabbufnum = l:tabinfo[widx] - let l:tabbufname = bufname(l:tabbufnum) - let subline = "[" . s:_format_filled(l:tabbufnum, 3, 1, 0) . "] " - if getbufvar(l:tabbufnum, "&mod") == 1 - let subline .= "+ " - else - let subline .= " " - endif - if self.display_regime == "basename" - let l:subline .= s:_format_align_left(fnamemodify(l:tabbufname, ":t"), 30, " ") - let l:subline .= fnamemodify(l:tabbufname, ":p:h") - elseif self.display_regime == "filepath" - let l:subline .= fnamemodify(l:tabbufname, ":p") - elseif self.display_regime == "bufname" - let l:subline .= l:tabbufname - else - throw s:_buffergator_messenger.format_exception("Invalid display regime: '" . self.display_regime . "'") - endif - call self.append_line(l:subline, l:tidx+1, l:widx+1) - endfor - endfor - let b:buffergator_last_render_time = localtime() - try - " remove extra last line - execute('normal! GV"_X') - catch // - endtry - setlocal nomodifiable - call cursor(l:initial_line, 1) - " call self.goto_index_entry("n", 0, 1) - endfunction - - function! l:catalog_viewer.setup_buffer_syntax() dict - if has("syntax") - syn match BuffergatorTabPageLine '^TAB PAGE \d\+\:$' - " syn match BuffergatorTabPageLineStart '^==== Tab Page \[' nextgroup=BuffergatorTabPageNumber - " syn match BuffergatorTabPageNumber '\d\+' nextgroup=BuffergatorTabPageLineEnd - " syn match BuffergatorTabPageLineEnd '\] ====$' - syn region BuffergatorModifiedFileLine start='^\[\s\{-}.\{-1,}\s\{-}\] + ' keepend oneline end='$' - syn region BuffergatorUnmodifiedFileLine start='^\[\s\{-}.\{-1,}\s\{-}\] ' keepend oneline end='$' - syn match BuffergatorModifiedFileSyntaxKey '^\zs\[\s\{-}.\{-1,}\s\{-}\]\ze' containedin=BuffergatorModifiedFileLine nextgroup=BuffergatorModifiedFilename - syn match BuffergatorUnmodifiedFileSyntaxKey '^\zs\[\s\{-}.\{-1,}\s\{-}\]\ze' containedin=BuffergatorUnmodifiedFileLine nextgroup=BuffergatorUnmodifiedFilename - syn match BuffergatorModifiedFilename ' + .\+$' containedin=BuffergatorModifiedFilenameEntry - syn match BuffergatorUnmodifiedFilename ' .\+$' containedin=BuffergatorUnmodifiedFileLine - highlight! link BuffergatorModifiedFileSyntaxKey LineNr - highlight! link BuffergatorUnmodifiedFileSyntaxKey LineNr - highlight! link BuffergatorModifiedFileFlag WarningMsg - highlight! link BuffergatorModifiedFilename WarningMsg - highlight! link BuffergatorTabPageLine Title - " highlight! link BufergatorModifiedFilename NonText - " highlight! link BufergatorUnmodifiedFilename NonText - " highlight! link BuffergatorTabPageLineStart Title - " highlight! link BuffergatorTabPageNumber Special - " highlight! link BuffergatorTabPageLineEnd Title - highlight! def BuffergatorCurrentEntry gui=reverse cterm=reverse term=reverse - endif - endfunction - - function! l:catalog_viewer.setup_buffer_keymaps() dict - - call self.disable_editing_keymaps() - - noremap cd :call b:buffergator_catalog_viewer.cycle_display_regime() - noremap r :call b:buffergator_catalog_viewer.rebuild_catalog() - noremap q :call b:buffergator_catalog_viewer.close(1) - - noremap :call b:buffergator_catalog_viewer.visit_target() - noremap o :call b:buffergator_catalog_viewer.visit_target() - - noremap :call b:buffergator_catalog_viewer.goto_index_entry("n") - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p") - noremap :call b:buffergator_catalog_viewer.goto_index_entry("p") - noremap :call b:buffergator_catalog_viewer.goto_win_entry("n") - noremap :call b:buffergator_catalog_viewer.goto_win_entry("p") - noremap A :call b:buffergator_catalog_viewer.toggle_zoom() - - endfunction - - " Appends a line to the buffer and registers it in the line log. - function! l:catalog_viewer.append_line(text, jump_to_tabnum, jump_to_winnum) dict - let l:line_map = { - \ "target" : [a:jump_to_tabnum, a:jump_to_winnum], - \ } - if a:0 > 0 - call extend(l:line_map, a:1) - endif - let self.jump_map[line("$")] = l:line_map - call append(line("$")-1, a:text) - endfunction - - function! l:catalog_viewer.goto_index_entry(direction) dict - let l:ok = self.goto_pattern("^T", a:direction) - execute("normal! zz") - " if l:ok && a:visit_target - " call self.visit_target(1, a:refocus_catalog, "") - " endif - endfunction - - function! l:catalog_viewer.goto_win_entry(direction) dict - let l:ok = self.goto_pattern('^\[', a:direction) - execute("normal! zz") - endfunction - - " Go to the selected buffer. - function! l:catalog_viewer.visit_target() dict - let l:cur_line = line(".") - if !has_key(l:self.jump_map, l:cur_line) - call s:_buffergator_messenger.send_info("Not a valid navigation line") - return 0 - endif - let [l:jump_to_tabnum, l:jump_to_winnum] = self.jump_map[l:cur_line].target - call self.close(0) - execute("tabnext " . l:jump_to_tabnum) - execute(l:jump_to_winnum . "wincmd w") - " call s:_buffergator_messenger.send_info(expand(bufname(l:jump_to_bufnum))) - endfunction - - function! l:catalog_viewer.setup_buffer_statusline() dict - setlocal statusline=%{BuffergatorTabsStatusLine()} - endfunction - - " return object - return l:catalog_viewer - -endfunction -" 1}}} - -" Global Functions {{{1 -" ============================================================================== -function! BuffergatorBuffersStatusLine() - let l:line = line(".") - let l:status_line = "[[buffergator]]" - if has_key(b:buffergator_catalog_viewer.jump_map, l:line) - let l:status_line .= " Buffer " . string(l:line) . " of " . string(len(b:buffergator_catalog_viewer.buffers_catalog)) - endif - return l:status_line -endfunction -function! BuffergatorTabsStatusLine() - let l:status_line = "[[buffergator]]" - let l:line = line(".") - if has_key(b:buffergator_catalog_viewer.jump_map, l:line) - let l:status_line .= " Tab Page: " . b:buffergator_catalog_viewer.jump_map[l:line].target[0] - let l:status_line .= ", Window: " . b:buffergator_catalog_viewer.jump_map[l:line].target[1] - endif - return l:status_line -endfunction -" 1}}} - -" Global Initialization {{{1 -" ============================================================================== -if exists("s:_buffergator_messenger") - unlet s:_buffergator_messenger -endif -let s:_buffergator_messenger = s:NewMessenger("") -let s:_catalog_viewer = s:NewBufferCatalogViewer() -let s:_tab_catalog_viewer = s:NewTabCatalogViewer() - -" Autocommands that update the most recenly used buffers -autocmd BufRead * call s:_update_mru(expand('')) -autocmd BufNewFile * call s:_update_mru(expand('')) -autocmd BufWritePost * call s:_update_mru(expand('')) -" 1}}} - -" Functions Supporting User Commands {{{1 -" ============================================================================== - -function! s:OpenBuffergator() - call s:_tab_catalog_viewer.close(1) - call s:_catalog_viewer.open() -endfunction - -function! s:OpenBuffergatorTabs() - call s:_catalog_viewer.close(1) - call s:_tab_catalog_viewer.open(1) -endfunction - -function! s:CloseBuffergator() - call s:_catalog_viewer.close(1) - call s:_tab_catalog_viewer.close(1) -endfunction - -function! s:ToggleBuffergator() - call s:_tab_catalog_viewer.close(1) - call s:_catalog_viewer.toggle() -endfunction - -function! s:ToggleBuffergatorTabs() - call s:_catalog_viewer.close(1) - call s:_tab_catalog_viewer.toggle() -endfunction - -" 1}}} - -" Public Command and Key Maps {{{1 -" ============================================================================== -command! BuffergatorToggle :call ToggleBuffergator() -command! BuffergatorClose :call CloseBuffergator() -command! BuffergatorOpen :call OpenBuffergator() -command! BuffergatorTabsToggle :call ToggleBuffergatorTabs() -command! BuffergatorTabsOpen :call OpenBuffergatorTabs() -command! BuffergatorTabsClose :call CloseBuffergatorTabs() - -if !exists('g:buffergator_suppress_keymaps') || !g:buffergator_suppress_keymaps - " nnoremap :BuffergatorToggle - nnoremap b :BuffergatorOpen - nnoremap B :BuffergatorClose - nnoremap t :BuffergatorTabsOpen - nnoremap T :BuffergatorTabsClose -endif - -" 1}}} - -" Restore State {{{1 -" ============================================================================ -" restore options -let &cpo = s:save_cpo -" 1}}} - -" vim:foldlevel=4: diff --git a/plugin/buffers.vim b/plugin/buffers.vim deleted file mode 100644 index 2cafd0b..0000000 --- a/plugin/buffers.vim +++ /dev/null @@ -1,547 +0,0 @@ -" ============================================================================ -" File: buffers.vim -" Description: vim plugin that provides buffers helpers. Almost all of parts -" are taken from Eclim project -" Maintainer: Roman 'gryf' Dobosz -" Last Change: 2011-07-16 -" License: This program is free software: you can redistribute it and/or -" modify it under the terms of the GNU General Public License as -" published by the Free Software Foundation, either version 3 of -" the License, or (at your option) any later version. -" -" This program is distributed in the hope that it will be useful, -" but WITHOUT ANY WARRANTY; without even the implied warranty of -" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -" GNU General Public License for more details. -" -" You should have received a copy of the GNU General Public -" License along with this program. If not, see -" . -" ============================================================================ -let s:Eclim_ver = '1.7.1' - -" Eclim: {{{1 -" files: -" - plugin/eclim.vim (global vars) -" - plugin/common.vim (commands) - -" Global Variables {{{2 - -if has("signs") - if !exists("g:EclimSignLevel") - let g:EclimSignLevel = 5 - endif -else - let g:EclimSignLevel = 0 -endif - -if !exists("g:EclimInfoHighlight") - let g:EclimInfoHighlight = "Statement" -endif - -if !exists("g:EclimLogLevel") - let g:EclimLogLevel = 4 -endif - -if !exists("g:EclimTraceHighlight") - let g:EclimTraceHighlight = "Normal" -endif -if !exists("g:EclimDebugHighlight") - let g:EclimDebugHighlight = "Normal" -endif -if !exists("g:EclimInfoHighlight") - let g:EclimInfoHighlight = "Statement" -endif -if !exists("g:EclimWarningHighlight") - let g:EclimWarningHighlight = "WarningMsg" -endif -if !exists("g:EclimErrorHighlight") - let g:EclimErrorHighlight = "Error" -endif -if !exists("g:EclimFatalHighlight") - let g:EclimFatalHighlight = "Error" -endif - -if !exists("g:EclimShowCurrentError") - let g:EclimShowCurrentError = 1 -endif - -if !exists("g:EclimShowCurrentErrorBalloon") - let g:EclimShowCurrentErrorBalloon = 1 -endif - -if !exists("g:EclimOpenQFLists") - let g:EclimOpenQFLists = 1 -endif - -" }}} - -" Command Declarations {{{2 - -if !exists(":Buffers") - command Buffers :call s:Buffers() -endif - -" }}} - -" End Eclim: }}} - -" Common Buffers: {{{1 - -" Global Variables {{{2 -if !exists('g:EclimBuffersSort') - let g:EclimBuffersSort = 'file' -endif -if !exists('g:EclimBuffersSortDirection') - let g:EclimBuffersSortDirection = 'asc' -endif -if !exists('g:EclimBuffersDefaultAction') - let g:EclimBuffersDefaultAction = 'edit' -endif -" }}} - -" Buffers() eclim/autoload/eclim/common/buffers.vim {{{2 -" Like, :buffers, but opens a temporary buffer. -function! s:Buffers() - redir => list - silent exec 'buffers' - redir END - - let buffers = [] - let filelength = 0 - for entry in split(list, '\n') - let buffer = {} - let buffer.status = substitute(entry, '\s*[0-9]\+\s\+\(.\{-}\)\s\+".*', '\1', '') - let buffer.path = substitute(entry, '.\{-}"\(.\{-}\)".*', '\1', '') - let buffer.path = fnamemodify(buffer.path, ':p') - let buffer.file = fnamemodify(buffer.path, ':p:t') - let buffer.dir = fnamemodify(buffer.path, ':p:h') - exec 'let buffer.bufnr = ' . substitute(entry, '\s*\([0-9]\+\).*', '\1', '') - exec 'let buffer.lnum = ' . - \ substitute(entry, '.*"\s\+line\s\+\([0-9]\+\).*', '\1', '') - call add(buffers, buffer) - - if len(buffer.file) > filelength - let filelength = len(buffer.file) - endif - endfor - - if g:EclimBuffersSort != '' - call sort(buffers, 'BufferCompare') - endif - - let lines = [] - for buffer in buffers - call add(lines, s:BufferEntryToLine(buffer, filelength)) - endfor - - call TempWindow('[buffers]', lines) - - setlocal modifiable noreadonly - call append(line('$'), ['', '" use ? to view help']) - setlocal nomodifiable readonly - - let b:eclim_buffers = buffers - - " syntax - set ft=eclim_buffers - hi link BufferActive Special - hi link BufferHidden Comment - syntax match BufferActive /+\?active\s\+\(\[RO\]\)\?/ - syntax match BufferHidden /+\?hidden\s\+\(\[RO\]\)\?/ - syntax match Comment /^".*/ - - " mappings - nnoremap :call BufferOpen2(g:EclimBuffersDefaultAction) - nnoremap E :call BufferOpen2('edit') - nnoremap S :call BufferOpen2('split') - nnoremap T :call BufferOpen('tablast \| tabnew') - nnoremap D :call BufferDelete() - nnoremap R :Buffers - - " assign to buffer var to get around weird vim issue passing list containing - " a string w/ a '<' in it on execution of mapping. - let b:buffers_help = [ - \ ' - open buffer with default action', - \ 'E - open with :edit', - \ 'S - open in a new split window', - \ 'T - open in a new tab', - \ 'D - delete the buffer', - \ 'R - refresh the buffer list', - \ ] - nnoremap ? - \ :call BufferHelp(b:buffers_help, 'vertical', 40) - - "augroup eclim_buffers - " autocmd! - " autocmd BufAdd,BufWinEnter,BufDelete,BufWinLeave * - " \ call eclim#common#buffers#BuffersUpdate() - " autocmd BufUnload autocmd! eclim_buffers - "augroup END -endfunction " }}} - -" BufferCompare(buffer1, buffer2) eclim/autoload/eclim/common/buffers.vim {{{2 -function! BufferCompare(buffer1, buffer2) - exec 'let attr1 = a:buffer1.' . g:EclimBuffersSort - exec 'let attr2 = a:buffer2.' . g:EclimBuffersSort - let compare = attr1 == attr2 ? 0 : attr1 > attr2 ? 1 : -1 - if g:EclimBuffersSortDirection == 'desc' - let compare = 0 - compare - endif - return compare -endfunction " }}} - -" s:BufferDelete() {{{2 -function! s:BufferDelete() - let line = line('.') - if line > len(b:eclim_buffers) - return - endif - - let index = line - 1 - setlocal modifiable - setlocal noreadonly - exec line . ',' . line . 'delete _' - setlocal nomodifiable - setlocal readonly - let buffer = b:eclim_buffers[index] - call remove(b:eclim_buffers, index) - - let winnr = bufwinnr(buffer.bufnr) - if winnr != -1 - " if active in a window, go to the window to delete the buffer since that - " keeps eclim's prevention of closing the last non-utility window working - " properly. - let curwin = winnr() - exec winnr . 'winc w' - bdelete - exec curwin . 'winc w' - else - exec 'bd ' . buffer.bufnr - endif -endfunction " }}} - -" s:BufferEntryToLine(buffer, filelength) eclim/autoload/eclim/common/buffers.vim {{{2 -function! s:BufferEntryToLine(buffer, filelength) - let line = '' - let line .= a:buffer.status =~ '+' ? '+' : ' ' - let line .= a:buffer.status =~ 'a' ? 'active' : 'hidden' - let line .= a:buffer.status =~ '[-=]' ? ' [RO] ' : ' ' - let line .= a:buffer.file - - let pad = a:filelength - len(a:buffer.file) + 2 - while pad > 0 - let line .= ' ' - let pad -= 1 - endwhile - - let line .= a:buffer.dir - return line -endfunction " }}} - -" s:BufferOpen(cmd) eclim/autoload/eclim/common/buffers.vim {{{2 -function! s:BufferOpen(cmd) - let line = line('.') - if line > len(b:eclim_buffers) - return - endif - - let file = bufname(b:eclim_buffers[line - 1].bufnr) - let winnr = b:winnr - close - exec winnr . 'winc w' - call GoToBufferWindowOrOpen(file, a:cmd) -endfunction " }}} - -" End Common Buffers: }}} - -" Util: {{{1 - -" Script Variables eclim/autoload/eclim/util.vim {{{2 - let s:buffer_write_closing_commands = '^\s*\(' . - \ 'wq\|xa\|' . - \ '\d*w[nN]\|\d*wp\|' . - \ 'ZZ' . - \ '\)' - - let s:bourne_shells = ['sh', 'bash', 'dash', 'ksh', 'zsh'] - let s:c_shells = ['csh', 'tcsh'] - - let s:show_current_error_displaying = 0 -" }}} - -" DelayedCommand(command, [delay]) eclim/autoload/eclim/util.vim {{{2 -" Executes a delayed command. Useful in cases where one would expect an -" autocommand event (WinEnter, etc) to fire, but doesn't, or you need a -" command to execute after other autocommands have finished. -" Note: Nesting is not supported. A delayed command cannot be invoke off -" another delayed command. -function! DelayedCommand(command, ...) - let uid = fnamemodify(tempname(), ':t:r') - if &updatetime > 1 - exec 'let g:eclim_updatetime_save' . uid . ' = &updatetime' - endif - exec 'let g:eclim_delayed_command' . uid . ' = a:command' - let &updatetime = len(a:000) ? a:000[0] : 1 - exec 'augroup delayed_command' . uid - exec 'autocmd CursorHold * ' . - \ ' if exists("g:eclim_updatetime_save' . uid . '") | ' . - \ ' let &updatetime = g:eclim_updatetime_save' . uid . ' | ' . - \ ' unlet g:eclim_updatetime_save' . uid . ' | ' . - \ ' endif | ' . - \ ' exec g:eclim_delayed_command' . uid . ' | ' . - \ ' unlet g:eclim_delayed_command' . uid . ' | ' . - \ ' autocmd! delayed_command' . uid - exec 'augroup END' -endfunction " }}} - -" EscapeBufferName(name) eclim/autoload/eclim/util.vim {{{2 -" Escapes the supplied buffer name so that it can be safely used by buf* -" functions. -function! EscapeBufferName(name) - let name = a:name - " escaping the space in cygwin could lead to the dos path error message that - " cygwin throws when a dos path is referenced. - if !has('win32unix') - let name = escape(a:name, ' ') - endif - return substitute(name, '\(.\{-}\)\[\(.\{-}\)\]\(.\{-}\)', '\1[[]\2[]]\3', 'g') -endfunction " }}} - -" GoToBufferWindow(buf) eclim/autoload/eclim/util.vim {{{2 -" Focuses the window containing the supplied buffer name or buffer number. -" Returns 1 if the window was found, 0 otherwise. -function! GoToBufferWindow(buf) - if type(a:buf) == 0 - let winnr = bufwinnr(a:buf) - else - let name = EscapeBufferName(a:buf) - let winnr = bufwinnr(bufnr('^' . name . '$')) - endif - if winnr != -1 - exec winnr . "winc w" - call DelayedCommand('doautocmd WinEnter') - return 1 - endif - return 0 -endfunction " }}} - -" GoToBufferWindowOrOpen(name, cmd) eclim/autoload/eclim/util.vim {{{2 -" Gives focus to the window containing the buffer for the supplied file, or if -" none, opens the file using the supplied command. -function! GoToBufferWindowOrOpen(name, cmd) - let name = EscapeBufferName(a:name) - let winnr = bufwinnr(bufnr('^' . name)) - if winnr != -1 - exec winnr . "winc w" - call DelayedCommand('doautocmd WinEnter') - else - let cmd = a:cmd - " if splitting and the buffer is a unamed empty buffer, then switch to an - " edit. - if cmd == 'split' && expand('%') == '' && - \ !&modified && line('$') == 1 && getline(1) == '' - let cmd = 'edit' - endif - silent exec cmd . ' ' . escape(Simplify(a:name), ' ') - endif -endfunction " }}} - - -" GoToBufferWindowRegister(buf) eclim/autoload/eclim/util.vim {{{2 -" Registers the autocmd for returning the user to the supplied buffer when the -" current buffer is closed. -function! GoToBufferWindowRegister(buf) - exec 'autocmd BufWinLeave ' . - \ 'call GoToBufferWindow("' . escape(a:buf, '\') . '") | ' . - \ 'doautocmd BufEnter' -endfunction " }}} - -" Simplify(file) eclim/autoload/eclim/util.vim {{{2 -" Simply the supplied file to the shortest valid name. -function! Simplify(file) - let file = a:file - - " Don't run simplify on url files, it will screw them up. - if file !~ '://' - let file = simplify(file) - endif - - " replace all '\' chars with '/' except those escaping spaces. - let file = substitute(file, '\\\([^[:space:]]\)', '/\1', 'g') - let cwd = substitute(getcwd(), '\', '/', 'g') - if cwd !~ '/$' - let cwd .= '/' - endif - - if file =~ '^' . cwd - let file = substitute(file, '^' . cwd, '', '') - endif - - return file -endfunction " }}} - -" TempWindow(name, lines, [readonly]) eclim/autoload/eclim/util.vim {{{2 -" Opens a temp window w/ the given name and contents which is readonly unless -" specified otherwise. -function! TempWindow(name, lines, ...) - let filename = expand('%:p') - let winnr = winnr() - - call TempWindowClear(a:name) - let name = EscapeBufferName(a:name) - - if bufwinnr(name) == -1 - silent! noautocmd exec "botright 10sview " . escape(a:name, ' []') - setlocal nowrap - setlocal winfixheight - setlocal noswapfile - setlocal nobuflisted - setlocal buftype=nofile - setlocal bufhidden=delete - silent doautocmd WinEnter - else - let temp_winnr = bufwinnr(name) - if temp_winnr != winnr() - exec temp_winnr . 'winc w' - silent doautocmd WinEnter - endif - endif - - setlocal modifiable - setlocal noreadonly - call append(1, a:lines) - retab - silent 1,1delete _ - - if len(a:000) == 0 || a:000[0] - setlocal nomodified - setlocal nomodifiable - setlocal readonly - endif - - silent doautocmd BufEnter - - " Store filename and window number so that plugins can use it if necessary. - if filename != expand('%:p') - let b:filename = filename - let b:winnr = winnr - - augroup eclim_temp_window - autocmd! BufWinLeave - call GoToBufferWindowRegister(b:filename) - augroup END - endif -endfunction " }}} - -" TempWindowClear(name) eclim/autoload/eclim/util.vim {{{2 -" Clears the contents of the temp window with the given name. -function! TempWindowClear(name) - let name = EscapeBufferName(a:name) - if bufwinnr(name) != -1 - let curwinnr = winnr() - exec bufwinnr(name) . "winc w" - setlocal modifiable - setlocal noreadonly - silent 1,$delete _ - exec curwinnr . "winc w" - endif -endfunction " }}} - -" End Util: }}} - -" Eclim Help: {{{1 - -" BufferHelp(lines, orientation, size) eclim/autoload/eclim/help.vim {{{ -" Function to display a help window for the current buffer. -function! BufferHelp(lines, orientation, size) - let orig_bufnr = bufnr('%') - let name = expand('%') - if name =~ '^\W.*\W$' - let name = name[:-2] . ' Help' . name[len(name) - 1] - else - let name .= ' Help' - endif - - let bname = EscapeBufferName(name) - - let orient = a:orientation == 'vertical' ? 'v' : '' - if bufwinnr(bname) != -1 - exec 'bd ' . bufnr(bname) - return - endif - - silent! noautocmd exec a:size . orient . "new " . escape(name, ' ') - if a:orientation == 'vertical' - setlocal winfixwidth - else - setlocal winfixheight - endif - setlocal nowrap - setlocal noswapfile nobuflisted nonumber - setlocal buftype=nofile bufhidden=delete - nnoremap ? :bd - nnoremap q :bd - - setlocal modifiable noreadonly - silent 1,$delete _ - call append(1, a:lines) - retab - silent 1,1delete _ - - if len(a:000) == 0 || a:000[0] - setlocal nomodified nomodifiable readonly - endif - - let help_bufnr = bufnr('%') - augroup eclim_help_buffer - autocmd! BufWinLeave - autocmd BufWinLeave nested autocmd! eclim_help_buffer * - exec 'autocmd BufWinLeave nested ' . - \ 'autocmd! eclim_help_buffer * ' - exec 'autocmd! BufWinLeave ' - exec 'autocmd BufWinLeave nested bd ' . help_bufnr - augroup END - - return help_bufnr -endfunction " }}} - -" }}} - -" Gryfs Mods: {{{ - -" s:BufferOpen2(cmd) (gryf) {{{2 -function! s:BufferOpen2(cmd) - let line = line('.') - if line > len(b:eclim_buffers) - return - endif - - let bufnr = b:eclim_buffers[line - 1].bufnr - let winnr = b:winnr - close - exec winnr . 'winc w' - call s:GoToBufferWindowOrOpen2(bufnr, a:cmd) -endfunction " }}} - -" GoToBufferWindowOrOpen2(nr, cmd) (gryf) {{{2 -" modified function GoToBufferWindowOrOpen. instead of buffer name it accepts -" buffer number. -function! s:GoToBufferWindowOrOpen2(nr, cmd) - let winnr = bufwinnr(a:nr) - if winnr != -1 - exec winnr . "winc w" - call DelayedCommand('doautocmd WinEnter') - else - if a:cmd == 'edit' - silent exec 'buffer ' . a:nr - elseif a:cmd == 'split' - silent exec 'sbuffer ' . a:nr - endif - endif -endfunction " }}} - -" End Gryfs Mods: }}} - -" vim:ft=vim:fdm=marker - diff --git a/plugin/fuf.vim b/plugin/fuf.vim deleted file mode 100644 index 9826dab..0000000 --- a/plugin/fuf.vim +++ /dev/null @@ -1,158 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2010 Takeshi NISHIDA -" -" GetLatestVimScripts: 1984 1 :AutoInstall: FuzzyFinder -"============================================================================= -" LOAD GUARD {{{1 - -try - if !l9#guardScriptLoading(expand(':p'), 702, 101, []) - finish - endif -catch /E117/ - echoerr '***** L9 library must be installed! *****' - finish -endtry - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS {{{1 - -" -function s:initialize() - "--------------------------------------------------------------------------- - 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 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 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 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 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 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 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 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 l9#defineVariableDefault('g:fuf_bookmarkdir_prompt' , '>Bookmark-Dir[]>') - call l9#defineVariableDefault('g:fuf_bookmarkdir_switchOrder', 80) - call l9#defineVariableDefault('g:fuf_bookmarkdir_keyDelete' , '') - "--------------------------------------------------------------------------- - call l9#defineVariableDefault('g:fuf_tag_prompt' , '>Tag[]>') - call l9#defineVariableDefault('g:fuf_tag_switchOrder', 90) - "--------------------------------------------------------------------------- - 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 l9#defineVariableDefault('g:fuf_taggedfile_prompt' , '>Tagged-File[]>') - call l9#defineVariableDefault('g:fuf_taggedfile_switchOrder', 110) - "--------------------------------------------------------------------------- - call l9#defineVariableDefault('g:fuf_jumplist_prompt' , '>Jump-List[]>') - call l9#defineVariableDefault('g:fuf_jumplist_switchOrder', 120) - "--------------------------------------------------------------------------- - call l9#defineVariableDefault('g:fuf_changelist_prompt' , '>Change-List[]>') - call l9#defineVariableDefault('g:fuf_changelist_switchOrder', 130) - "--------------------------------------------------------------------------- - call l9#defineVariableDefault('g:fuf_quickfix_prompt' , '>Quickfix[]>') - call l9#defineVariableDefault('g:fuf_quickfix_switchOrder', 140) - "--------------------------------------------------------------------------- - call l9#defineVariableDefault('g:fuf_line_prompt' , '>Line[]>') - call l9#defineVariableDefault('g:fuf_line_switchOrder', 150) - "--------------------------------------------------------------------------- - 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:renewCachesOfAllModes() - for m in fuf#getModeNames() - call fuf#{m}#renewCache() - endfor -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -call s:initialize() - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/plugin/gundo.vim b/plugin/gundo.vim deleted file mode 100644 index 5d6d9d7..0000000 --- a/plugin/gundo.vim +++ /dev/null @@ -1,401 +0,0 @@ -" ============================================================================ -" File: gundo.vim -" Description: vim global plugin to visualize your undo tree -" Maintainer: Steve Losh -" License: GPLv2+ -- look it up. -" Notes: Much of this code was thiefed from Mercurial, and the rest was -" heavily inspired by scratch.vim and histwin.vim. -" -" ============================================================================ - - -"{{{ Init - -if !exists('g:gundo_debug') && (exists('g:gundo_disable') || exists('loaded_gundo') || &cp)"{{{ - finish -endif -let loaded_gundo = 1"}}} - -if v:version < '703'"{{{ - function! s:GundoDidNotLoad() - echohl WarningMsg|echomsg "Gundo unavailable: requires Vim 7.3+"|echohl None - endfunction - command! -nargs=0 GundoToggle call s:GundoDidNotLoad() - finish -endif"}}} - -if has('python')"{{{ - let s:has_supported_python = 1 -else - let s:has_supported_python = 0 -endif - -if !s:has_supported_python - function! s:GundoDidNotLoad() - echohl WarningMsg|echomsg "Gundo requires Vim to be compiled with Python 2.4+"|echohl None - endfunction - command! -nargs=0 GundoToggle call s:GundoDidNotLoad() - finish -endif"}}} - -let s:plugin_path = escape(expand(':p:h'), '\') - -if !exists('g:gundo_width')"{{{ - let g:gundo_width = 45 -endif"}}} -if !exists('g:gundo_preview_height')"{{{ - let g:gundo_preview_height = 15 -endif"}}} -if !exists('g:gundo_preview_bottom')"{{{ - let g:gundo_preview_bottom = 0 -endif"}}} -if !exists('g:gundo_right')"{{{ - let g:gundo_right = 0 -endif"}}} -if !exists('g:gundo_help')"{{{ - let g:gundo_help = 1 -endif"}}} -if !exists("g:gundo_map_move_older")"{{{ - let g:gundo_map_move_older = 'j' -endif"}}} -if !exists("g:gundo_map_move_newer")"{{{ - let g:gundo_map_move_newer = 'k' -endif"}}} -if !exists("g:gundo_close_on_revert")"{{{ - let g:gundo_close_on_revert = 0 -endif"}}} - -"}}} - -"{{{ Gundo utility functions - -function! s:GundoGetTargetState()"{{{ - let target_line = matchstr(getline("."), '\v\[[0-9]+\]') - return matchstr(target_line, '\v[0-9]+') -endfunction"}}} - -function! s:GundoGoToWindowForBufferName(name)"{{{ - if bufwinnr(bufnr(a:name)) != -1 - exe bufwinnr(bufnr(a:name)) . "wincmd w" - return 1 - else - return 0 - endif -endfunction"}}} - -function! s:GundoIsVisible()"{{{ - if bufwinnr(bufnr("__Gundo__")) != -1 || bufwinnr(bufnr("__Gundo_Preview__")) != -1 - return 1 - else - return 0 - endif -endfunction"}}} - -function! s:GundoInlineHelpLength()"{{{ - if g:gundo_help - return 6 - else - return 0 - endif -endfunction"}}} - -"}}} - -"{{{ Gundo buffer settings - -function! s:GundoMapGraph()"{{{ - exec 'nnoremap