From d597a38b7abbb97bde6aaa034b43b273e7b8f866 Mon Sep 17 00:00:00 2001 From: Felix Wong Date: Sat, 28 Dec 2013 00:22:23 -0800 Subject: [PATCH 01/37] pretty sure .svn not needed anymore --- autoload/.svn/entries | 99 -- autoload/.svn/text-base/fuf.vim.svn-base | 1155 ----------------- autoload/.svn/text-base/snipMate.vim.svn-base | 433 ------ 3 files changed, 1687 deletions(-) delete mode 100644 autoload/.svn/entries delete mode 100644 autoload/.svn/text-base/fuf.vim.svn-base delete mode 100644 autoload/.svn/text-base/snipMate.vim.svn-base diff --git a/autoload/.svn/entries b/autoload/.svn/entries deleted file mode 100644 index b5d86893..00000000 --- a/autoload/.svn/entries +++ /dev/null @@ -1,99 +0,0 @@ -10 - -dir -24 -svn://orangoo.com/vim/autoload -svn://orangoo.com/vim - - - -2010-01-15T19:53:13.037300Z -2 -amix - - - - - - - - - - - - - - -f0bd9f4a-2ac3-40fc-bab3-7711922a5bd5 - -fuf -dir - -fuf.vim -file - - - - -2009-12-03T15:37:36.000000Z -cd795290ec0c8e87d61563c8553f6a5a -2010-01-15T19:52:41.083563Z -1 -amix - - - - - - - - - - - - - - - - - - - - - -34950 - -snipMate.vim -file - - - - -2010-01-15T16:14:44.000000Z -935ed920e29eeb56885cba09798db5ce -2010-01-15T19:52:41.083563Z -1 -amix - - - - - - - - - - - - - - - - - - - - - -14083 - diff --git a/autoload/.svn/text-base/fuf.vim.svn-base b/autoload/.svn/text-base/fuf.vim.svn-base deleted file mode 100644 index 0a91d3a5..00000000 --- a/autoload/.svn/text-base/fuf.vim.svn-base +++ /dev/null @@ -1,1155 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if exists('g:loaded_autoload_fuf') || v:version < 702 - finish -endif -let g:loaded_autoload_fuf = 1 - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS {{{1 - - - -function fuf#getPathSeparator() - return (!&shellslash && (has('win32') || has('win64')) ? '\' : '/') -endfunction - -" Removes duplicates -" this function doesn't change list of argument. -function fuf#unique(items) - let sorted = sort(a:items) - if len(sorted) < 2 - return sorted - endif - let last = remove(sorted, 0) - let result = [last] - for item in sorted - if item != last - call add(result, item) - let last = item - endif - endfor - return result -endfunction - -" [ [0], [1,2], [3] ] -> [ 0, 1, 2, 3 ] -" this function doesn't change list of argument. -function fuf#concat(items) - let result = [] - for l in a:items - let result += l - endfor - return result -endfunction - -" filter() with the maximum number of items -" this function doesn't change list of argument. -function fuf#filterWithLimit(items, expr, limit) - if a:limit <= 0 - return filter(copy(a:items), a:expr) - endif - let result = [] - let stride = a:limit * 3 / 2 " x1.5 - for i in range(0, len(a:items) - 1, stride) - let result += filter(a:items[i : i + stride - 1], a:expr) - if len(result) >= a:limit - return remove(result, 0, a:limit - 1) - endif - endfor - return result -endfunction - -" -function fuf#countModifiedFiles(files, time) - return len(filter(copy(a:files), 'getftime(v:val) > a:time')) -endfunction - -" -function fuf#getCurrentTagFiles() - return sort(filter(map(tagfiles(), 'fnamemodify(v:val, '':p'')'), 'filereadable(v:val)')) -endfunction - -" -function fuf#mapToSetSerialIndex(in, offset) - for i in range(len(a:in)) - let a:in[i].index = i + a:offset - endfor - return a:in -endfunction - -" -function fuf#updateMruList(mrulist, newItem, maxItem, exclude) - let result = copy(a:mrulist) - let result = filter(result,'v:val.word != a:newItem.word') - let result = insert(result, a:newItem) - let result = filter(result, 'v:val.word !~ a:exclude') - return result[0 : a:maxItem - 1] -endfunction - -" takes suffix number. if no digits, returns -1 -function fuf#suffixNumber(str) - let s = matchstr(a:str, '\d\+$') - return (len(s) ? str2nr(s) : -1) -endfunction - -" "foo/bar/buz/hoge" -> { head: "foo/bar/buz/", tail: "hoge" } -function fuf#splitPath(path) - let head = matchstr(a:path, '^.*[/\\]') - return { - \ 'head' : head, - \ 'tail' : a:path[strlen(head):] - \ } -endfunction - -" "foo/.../bar/...hoge" -> "foo/.../bar/../../hoge" -function fuf#expandTailDotSequenceToParentDir(pattern) - return substitute(a:pattern, '^\(.*[/\\]\)\?\zs\.\(\.\+\)\ze[^/\\]*$', - \ '\=repeat(".." . fuf#getPathSeparator(), len(submatch(2)))', '') -endfunction - -" -function fuf#hash224(str) - let a = 0x00000800 " shift 11 bit - let b = 0x001fffff " extract 11 bit - let nHash = 7 - let hashes = repeat([0], nHash) - for i in range(len(a:str)) - let iHash = i % nHash - let hashes[iHash] = hashes[iHash] * a + hashes[iHash] / b - let hashes[iHash] += char2nr(a:str[i]) - endfor - return join(map(hashes, 'printf("%08x", v:val)'), '') -endfunction - -" -function fuf#formatPrompt(prompt, partialMatching) - let indicator = (a:partialMatching ? '!' : '') - return substitute(a:prompt, '[]', indicator, 'g') -endfunction - -" -function fuf#getFileLines(file) - let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$')) - let lines = getbufline(bufnr, 1, '$') - if !empty(lines) - return lines - endif - try - return readfile(expand(a:file)) - catch /.*/ - endtry - return [] -endfunction - -" -function fuf#makePreviewLinesAround(lines, indices, page, maxHeight) - let index = ((empty(a:indices) ? 0 : a:indices[0]) - \ + a:page * a:maxHeight) % len(a:lines) - if empty(a:lines) || a:maxHeight <= 0 - return [] - endif - let beg = max([0, index - a:maxHeight / 2]) - let end = min([beg + a:maxHeight, len(a:lines)]) - let beg = max([0, end - a:maxHeight]) - let lines = [] - for i in range(beg, end - 1) - let mark = (count(a:indices, i) ? '>' : ' ') - call add(lines, printf('%s%4d ', mark, i + 1) . a:lines[i]) - endfor - return lines -endfunction - -" a:file: a path string or a buffer number -function fuf#makePreviewLinesForFile(file, count, maxHeight) - let lines = fuf#getFileLines(a:file) - if empty(lines) - return [] - endif - let bufnr = (type(a:file) ==# type(0) ? a:file : bufnr('^' . a:file . '$')) - if exists('s:bufferCursorPosMap[bufnr]') - let indices = [s:bufferCursorPosMap[bufnr][1] - 1] - else - let indices = [] - endif - return fuf#makePreviewLinesAround( - \ lines, indices, a:count, a:maxHeight) -endfunction - -" -function fuf#echoWithHl(msg, hl) - execute "echohl " . a:hl - echo a:msg - echohl None -endfunction - -" -function fuf#inputHl(prompt, text, hl) - execute "echohl " . a:hl - let s = input(a:prompt, a:text) - echohl None - return s -endfunction - -" -function fuf#openBuffer(bufNr, mode, reuse) - if a:reuse && ((a:mode == s:OPEN_TYPE_SPLIT && - \ s:moveToWindowOfBufferInCurrentTabPage(a:bufNr)) || - \ (a:mode == s:OPEN_TYPE_VSPLIT && - \ s:moveToWindowOfBufferInCurrentTabPage(a:bufNr)) || - \ (a:mode == s:OPEN_TYPE_TAB && - \ s:moveToWindowOfBufferInOtherTabPage(a:bufNr))) - return - endif - execute printf({ - \ s:OPEN_TYPE_CURRENT : '%sbuffer' , - \ s:OPEN_TYPE_SPLIT : '%ssbuffer' , - \ s:OPEN_TYPE_VSPLIT : 'vertical %ssbuffer', - \ s:OPEN_TYPE_TAB : 'tab %ssbuffer' , - \ }[a:mode], a:bufNr) -endfunction - -" -function fuf#openFile(path, mode, reuse) - let bufNr = bufnr('^' . a:path . '$') - if bufNr > -1 - call fuf#openBuffer(bufNr, a:mode, a:reuse) - else - execute { - \ s:OPEN_TYPE_CURRENT : 'edit ' , - \ s:OPEN_TYPE_SPLIT : 'split ' , - \ s:OPEN_TYPE_VSPLIT : 'vsplit ' , - \ s:OPEN_TYPE_TAB : 'tabedit ', - \ }[a:mode] . fnameescape(fnamemodify(a:path, ':~:.')) - endif -endfunction - -" -function fuf#openTag(tag, mode) - execute { - \ s:OPEN_TYPE_CURRENT : 'tjump ' , - \ s:OPEN_TYPE_SPLIT : 'stjump ' , - \ s:OPEN_TYPE_VSPLIT : 'vertical stjump ', - \ s:OPEN_TYPE_TAB : 'tab stjump ' , - \ }[a:mode] . a:tag -endfunction - -" -function fuf#openHelp(tag, mode) - execute { - \ s:OPEN_TYPE_CURRENT : 'help ' , - \ s:OPEN_TYPE_SPLIT : 'help ' , - \ s:OPEN_TYPE_VSPLIT : 'vertical help ', - \ s:OPEN_TYPE_TAB : 'tab help ' , - \ }[a:mode] . a:tag -endfunction - -" -function fuf#prejump(mode) - execute { - \ s:OPEN_TYPE_CURRENT : '' , - \ s:OPEN_TYPE_SPLIT : 'split' , - \ s:OPEN_TYPE_VSPLIT : 'vsplit' , - \ s:OPEN_TYPE_TAB : 'tab split', - \ }[a:mode] -endfunction - -" -function fuf#compareRanks(i1, i2) - if exists('a:i1.ranks') && exists('a:i2.ranks') - for i in range(min([len(a:i1.ranks), len(a:i2.ranks)])) - if a:i1.ranks[i] > a:i2.ranks[i] - return +1 - elseif a:i1.ranks[i] < a:i2.ranks[i] - return -1 - endif - endfor - endif - return 0 -endfunction - -" -function fuf#makePathItem(fname, menu, appendsDirSuffix) - let pathPair = fuf#splitPath(a:fname) - let dirSuffix = (a:appendsDirSuffix && isdirectory(a:fname) - \ ? fuf#getPathSeparator() - \ : '') - return { - \ 'word' : a:fname . dirSuffix, - \ 'wordForPrimaryHead': s:toLowerForIgnoringCase(pathPair.head), - \ 'wordForPrimaryTail': s:toLowerForIgnoringCase(pathPair.tail), - \ 'wordForBoundary' : s:toLowerForIgnoringCase(s:getWordBoundaries(pathPair.tail)), - \ 'wordForRefining' : s:toLowerForIgnoringCase(a:fname . dirSuffix), - \ 'wordForRank' : s:toLowerForIgnoringCase(pathPair.tail), - \ 'menu' : a:menu, - \ } -endfunction - -" -function fuf#makeNonPathItem(word, menu) - let wordL = s:toLowerForIgnoringCase(a:word) - return { - \ 'word' : a:word, - \ 'wordForPrimary' : wordL, - \ 'wordForBoundary': s:toLowerForIgnoringCase(s:getWordBoundaries(a:word)), - \ 'wordForRefining': wordL, - \ 'wordForRank' : wordL, - \ 'menu' : a:menu, - \ } -endfunction - -" -function s:interpretPrimaryPatternForPathTail(pattern) - let pattern = fuf#expandTailDotSequenceToParentDir(a:pattern) - let pairL = fuf#splitPath(s:toLowerForIgnoringCase(pattern)) - return { - \ 'primary' : pattern, - \ 'primaryForRank': pairL.tail, - \ 'matchingPairs' : [['v:val.wordForPrimaryTail', pairL.tail],], - \ } -endfunction - -" -function s:interpretPrimaryPatternForPath(pattern) - let pattern = fuf#expandTailDotSequenceToParentDir(a:pattern) - let patternL = s:toLowerForIgnoringCase(pattern) - let pairL = fuf#splitPath(patternL) - if g:fuf_splitPathMatching - let matches = [ - \ ['v:val.wordForPrimaryHead', pairL.head], - \ ['v:val.wordForPrimaryTail', pairL.tail], - \ ] - else - let matches = [ - \ ['v:val.wordForPrimaryHead . v:val.wordForPrimaryTail', patternL], - \ ] - endif - return { - \ 'primary' : pattern, - \ 'primaryForRank': pairL.tail, - \ 'matchingPairs' : matches, - \ } -endfunction - -" -function s:interpretPrimaryPatternForNonPath(pattern) - let patternL = s:toLowerForIgnoringCase(a:pattern) - return { - \ 'primary' : a:pattern, - \ 'primaryForRank': patternL, - \ 'matchingPairs' : [['v:val.wordForPrimary', patternL],], - \ } -endfunction - -" -function fuf#makePatternSet(patternBase, interpreter, partialMatching) - let MakeMatchingExpr = function(a:partialMatching - \ ? 's:makePartialMatchingExpr' - \ : 's:makeFuzzyMatchingExpr') - let [primary; refinings] = split(a:patternBase, g:fuf_patternSeparator, 1) - let elements = call(a:interpreter, [primary]) - let primaryExprs = map(elements.matchingPairs, 'MakeMatchingExpr(v:val[0], v:val[1])') - let refiningExprs = map(refinings, 's:makeRefiningExpr(v:val)') - return { - \ 'primary' : elements.primary, - \ 'primaryForRank': elements.primaryForRank, - \ 'filteringExpr' : join(primaryExprs + refiningExprs, ' && '), - \ } -endfunction - -" -function fuf#enumExpandedDirsEntries(dir, exclude) - " Substitutes "\" because on Windows, "**\" doesn't include ".\", - " but "**/" include "./". I don't know why. - let dirNormalized = substitute(a:dir, '\', '/', 'g') - let entries = split(glob(dirNormalized . "*" ), "\n") + - \ split(glob(dirNormalized . ".*"), "\n") - " removes "*/." and "*/.." - call filter(entries, 'v:val !~ ''\v(^|[/\\])\.\.?$''') - call map(entries, 'fuf#makePathItem(v:val, "", 1)') - if len(a:exclude) - call filter(entries, 'v:val.word !~ a:exclude') - endif - return entries -endfunction - -" -function fuf#mapToSetAbbrWithSnippedWordAsPath(items) - let maxLenStats = {} - call map(a:items, 's:makeFileAbbrInfo(v:val, maxLenStats)') - let snippedHeads = - \ map(maxLenStats, 's:getSnippedHead(v:key[: -2], v:val)') - return map(a:items, 's:setAbbrWithFileAbbrData(v:val, snippedHeads)') -endfunction - -" -function fuf#setAbbrWithFormattedWord(item, abbrIndex) - let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0) - let abbrPrefix = (exists('a:item.abbrPrefix') ? a:item.abbrPrefix : '') - let a:item.abbr = abbrPrefix . a:item.word - if a:abbrIndex - let a:item.abbr = printf('%4d: ', a:item.index) . a:item.abbr - endif - let a:item.abbr = s:snipTail(a:item.abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK) - return a:item -endfunction - -" -function fuf#defineLaunchCommand(CmdName, modeName, prefixInitialPattern) - execute printf('command! -bang -narg=? %s call fuf#launch(%s, %s . , len())', - \ a:CmdName, 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 - -" -function fuf#launch(modeName, initialPattern, partialMatching) - if exists('s:runningHandler') - call fuf#echoWithHl('FuzzyFinder is running.', 'WarningMsg') - endif - if count(g:fuf_modes, a:modeName) == 0 - echoerr 'This mode is not available: ' . a:modeName - return - endif - let s:runningHandler = fuf#{a:modeName}#createHandler(copy(s:handlerBase)) - let s:runningHandler.info = fuf#loadInfoFile(s:runningHandler.getModeName()) - let s:runningHandler.partialMatching = a:partialMatching - let s:runningHandler.bufNrPrev = bufnr('%') - let s:runningHandler.lastCol = -1 - call s:runningHandler.onModeEnterPre() - call s:setTemporaryGlobalOption('completeopt', 'menuone') - call s:setTemporaryGlobalOption('ignorecase', 0) - if s:runningHandler.getPreviewHeight() > 0 - call s:setTemporaryGlobalOption( - \ 'cmdheight', s:runningHandler.getPreviewHeight() + 1) - endif - call s:activateFufBuffer() - augroup FufLocal - autocmd! - autocmd CursorMovedI 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 . ', 0)' ], - \ [ g:fuf_keyOpenSplit , 'onCr(' . s:OPEN_TYPE_SPLIT . ', 0)' ], - \ [ g:fuf_keyOpenVsplit , 'onCr(' . s:OPEN_TYPE_VSPLIT . ', 0)' ], - \ [ g:fuf_keyOpenTabpage , 'onCr(' . s:OPEN_TYPE_TAB . ', 0)' ], - \ [ '' , 'onBs()' ], - \ [ '' , 'onBs()' ], - \ [ g:fuf_keyPreview , 'onPreviewBase()' ], - \ [ g:fuf_keyNextMode , 'onSwitchMode(+1)' ], - \ [ g:fuf_keyPrevMode , 'onSwitchMode(-1)' ], - \ [ g:fuf_keySwitchMatching, 'onSwitchMatching()' ], - \ [ g:fuf_keyPrevPattern , 'onRecallPattern(+1)' ], - \ [ g:fuf_keyNextPattern , 'onRecallPattern(-1)' ], - \ ] - call fuf#defineKeyMappingInHandler(key, func) - endfor - " Starts Insert mode and makes CursorMovedI event now. Command prompt is - " needed to forces a completion menu to update every typing. - call setline(1, s:runningHandler.getPrompt() . a:initialPattern) - call s:runningHandler.onModeEnterPost() - call feedkeys("A", 'n') " startinsert! does not work in InsertLeave event handler - redraw -endfunction - -" -function fuf#loadInfoFile(modeName) - try - let lines = readfile(expand(g:fuf_infoFile)) - " compatibility check - if count(lines, s:INFO_FILE_VERSION_LINE) == 0 - call s:warnOldInfoFile() - let g:fuf_infoFile = '' - throw 1 - endif - catch /.*/ - let lines = [] - endtry - let s:lastInfoMap = s:deserializeInfoMap(lines) - if !exists('s:lastInfoMap[a:modeName]') - let s:lastInfoMap[a:modeName] = {} - endif - return extend(s:lastInfoMap[a:modeName], { 'data': [], 'stats': [] }, 'keep') -endfunction - -" if a:modeName is empty, a:info is treated as a map of information -function fuf#saveInfoFile(modeName, info) - if empty(a:modeName) - let s:lastInfoMap = a:info - else - let s:lastInfoMap[a:modeName] = a:info - endif - let lines = [ s:INFO_FILE_VERSION_LINE ] + s:serializeInfoMap(s:lastInfoMap) - try - call writefile(lines, expand(g:fuf_infoFile)) - catch /.*/ - endtry -endfunction - -" -function fuf#editInfoFile() - new - silent file `='[fuf-info]'` - let s:bufNrInfo = bufnr('%') - setlocal filetype=vim - setlocal bufhidden=delete - setlocal buftype=acwrite - setlocal noswapfile - augroup FufInfo - autocmd! - autocmd BufWriteCmd call s:onBufWriteCmdInfoFile() - augroup END - execute '0read ' . expand(g:fuf_infoFile) - setlocal nomodified -endfunction - -" -function fuf#getRunningHandler() - return s:runningHandler -endfunction - -" -function fuf#onComplete(findstart, base) - return s:runningHandler.onComplete(a:findstart, a:base) -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS/VARIABLES {{{1 - -let s:INFO_FILE_VERSION_LINE = "VERSION\t300" -let s:ABBR_SNIP_MASK = '...' -let s:OPEN_TYPE_CURRENT = 1 -let s:OPEN_TYPE_SPLIT = 2 -let s:OPEN_TYPE_VSPLIT = 3 -let s:OPEN_TYPE_TAB = 4 - -" wildcard -> regexp -function s:convertWildcardToRegexp(expr) - let re = escape(a:expr, '\') - for [pat, sub] in [ [ '*', '\\.\\*' ], [ '?', '\\.' ], [ '[', '\\[' ], ] - let re = substitute(re, pat, sub, 'g') - endfor - return '\V' . re -endfunction - -" a:pattern: 'str' -> '\V\.\*s\.\*t\.\*r\.\*' -function s:makeFuzzyMatchingExpr(target, pattern) - let wi = '' - for c in split(a:pattern, '\zs') - if wi =~# '[^*?]$' && c !~ '[*?]' - let wi .= '*' - endif - let wi .= c - endfor - return s:makePartialMatchingExpr(a:target, wi) -endfunction - -" a:pattern: 'str' -> '\Vstr' -" 'st*r' -> '\Vst\.\*r' -function s:makePartialMatchingExpr(target, pattern) - let patternMigemo = s:makeAdditionalMigemoPattern(a:pattern) - if a:pattern !~ '[*?]' && empty(patternMigemo) - " NOTE: stridx is faster than regexp matching - return 'stridx(' . a:target . ', ' . string(a:pattern) . ') >= 0' - endif - return a:target . ' =~# ' . - \ string(s:convertWildcardToRegexp(a:pattern)) . patternMigemo -endfunction - -" -function s:makeRefiningExpr(pattern) - let expr = s:makePartialMatchingExpr('v:val.wordForRefining', a:pattern) - if a:pattern =~# '\D' - return expr - else - return '(' . expr . ' || v:val.index == ' . string(a:pattern) . ')' - endif -endfunction - -" -function s:makeAdditionalMigemoPattern(pattern) - if !g:fuf_useMigemo || a:pattern =~# '[^\x01-\x7e]' - return '' - endif - return '\|\m' . substitute(migemo(a:pattern), '\\_s\*', '.*', 'g') -endfunction - -" Snips a:str and add a:mask if the length of a:str is more than a:len -function s:snipHead(str, len, mask) - if a:len >= len(a:str) - return a:str - elseif a:len <= len(a:mask) - return a:mask - endif - return a:mask . a:str[-a:len + len(a:mask):] -endfunction - -" Snips a:str and add a:mask if the length of a:str is more than a:len -function s:snipTail(str, len, mask) - if a:len >= len(a:str) - return a:str - elseif a:len <= len(a:mask) - return a:mask - endif - return a:str[:a:len - 1 - len(a:mask)] . a:mask -endfunction - -" Snips a:str and add a:mask if the length of a:str is more than a:len -function s:snipMid(str, len, mask) - if a:len >= len(a:str) - return a:str - elseif a:len <= len(a:mask) - return a:mask - endif - let len_head = (a:len - len(a:mask)) / 2 - let len_tail = a:len - len(a:mask) - len_head - return (len_head > 0 ? a:str[: len_head - 1] : '') . a:mask . - \ (len_tail > 0 ? a:str[-len_tail :] : '') -endfunction - -" -function s:getWordBoundaries(word) - return substitute(a:word, '\a\zs\l\+\|\zs\A', '', 'g') -endfunction - -" -function s:toLowerForIgnoringCase(str) - return (g:fuf_ignoreCase ? tolower(a:str) : a:str) -endfunction - -" -function s:setRanks(item, pattern, exprBoundary, stats) - "let word2 = substitute(a:eval_word, '\a\zs\l\+\|\zs\A', '', 'g') - let a:item.ranks = [ - \ s:evaluateLearningRank(a:item.word, a:stats), - \ -s:scoreSequentialMatching(a:item.wordForRank, a:pattern), - \ -s:scoreBoundaryMatching(a:item.wordForBoundary, - \ a:pattern, a:exprBoundary), - \ a:item.index, - \ ] - return a:item -endfunction - -" -function s:evaluateLearningRank(word, stats) - for i in range(len(a:stats)) - if a:stats[i].word ==# a:word - return i - endif - endfor - return len(a:stats) -endfunction - -let g:s = "" -" range of return value is [0.0, 1.0] -function s:scoreSequentialMatching(word, pattern) - if empty(a:pattern) - return 0.0 - endif - let pos = stridx(a:word, a:pattern) - if pos < 0 - return 0.0 - endif - let lenRest = len(a:word) - len(a:pattern) - pos - return (pos == 0 ? 0.5 : 0.0) + 0.5 / (lenRest + 1) -endfunction - -" range of return value is [0.0, 1.0] -function s:scoreBoundaryMatching(wordForBoundary, pattern, exprBoundary) - if empty(a:pattern) - return 0.0 - endif - if !eval(a:exprBoundary) - return 0 - endif - return 0.5 + 0.5 * s:scoreSequentialMatching(a:wordForBoundary, a:pattern) -endfunction - -" -function s:highlightPrompt(prompt) - syntax clear - execute printf('syntax match %s /^\V%s/', g:fuf_promptHighlight, escape(a:prompt, '\')) -endfunction - -" -function s:highlightError() - syntax clear - syntax match Error /^.*$/ -endfunction - -" returns 0 if the buffer is not found. -function s:moveToWindowOfBufferInCurrentTabPage(bufNr) - if count(tabpagebuflist(), a:bufNr) == 0 - return 0 - endif - execute bufwinnr(a:bufNr) . 'wincmd w' - return 1 -endfunction - -" returns 0 if the buffer is not found. -function s:moveToOtherTabPageOpeningBuffer(bufNr) - for tabNr in range(1, tabpagenr('$')) - if tabNr != tabpagenr() && count(tabpagebuflist(tabNr), a:bufNr) > 0 - execute 'tabnext ' . tabNr - return 1 - endif - endfor - return 0 -endfunction - -" returns 0 if the buffer is not found. -function s:moveToWindowOfBufferInOtherTabPage(bufNr) - if !s:moveToOtherTabPageOpeningBuffer(a:bufNr) - return 0 - endif - return s:moveToWindowOfBufferInCurrentTabPage(a:bufNr) -endfunction - -" -function s:expandAbbrevMap(pattern, abbrevMap) - let result = [a:pattern] - for [pattern, subs] in items(a:abbrevMap) - let exprs = result - let result = [] - for expr in exprs - let result += map(copy(subs), 'substitute(expr, pattern, escape(v:val, ''\''), "g")') - endfor - endfor - return fuf#unique(result) -endfunction - -" -function s:makeFileAbbrInfo(item, maxLenStats) - let head = matchstr(a:item.word, '^.*[/\\]\ze.') - let a:item.abbr = { 'head' : head, - \ 'tail' : a:item.word[strlen(head):], - \ 'key' : head . '.', - \ 'prefix' : printf('%4d: ', a:item.index), } - if exists('a:item.abbrPrefix') - let a:item.abbr.prefix .= a:item.abbrPrefix - endif - let len = len(a:item.abbr.prefix) + len(a:item.word) + - \ (exists('a:item.menu') ? len(a:item.menu) + 2 : 0) - if !exists('a:maxLenStats[a:item.abbr.key]') || len > a:maxLenStats[a:item.abbr.key] - let a:maxLenStats[a:item.abbr.key] = len - endif - return a:item -endfunction - -" -function s:getSnippedHead(head, baseLen) - return s:snipMid(a:head, len(a:head) + g:fuf_maxMenuWidth - a:baseLen, s:ABBR_SNIP_MASK) -endfunction - -" -function s:setAbbrWithFileAbbrData(item, snippedHeads) - let lenMenu = (exists('a:item.menu') ? len(a:item.menu) + 2 : 0) - let abbr = a:item.abbr.prefix . a:snippedHeads[a:item.abbr.key] . a:item.abbr.tail - let a:item.abbr = s:snipTail(abbr, g:fuf_maxMenuWidth - lenMenu, s:ABBR_SNIP_MASK) - return a:item -endfunction - -let s:bufNrFuf = -1 - -" -function s:openFufBuffer() - if !bufexists(s:bufNrFuf) - topleft 1new - silent file `='[fuf]'` - let s:bufNrFuf = bufnr('%') - elseif bufwinnr(s:bufNrFuf) == -1 - topleft 1split - execute 'silent ' . s:bufNrFuf . 'buffer' - delete _ - elseif bufwinnr(s:bufNrFuf) != bufwinnr('%') - execute bufwinnr(s:bufNrFuf) . 'wincmd w' - endif -endfunction - -function s:setLocalOptionsForFufBuffer() - setlocal filetype=fuf - setlocal bufhidden=delete - setlocal buftype=nofile - setlocal noswapfile - setlocal nobuflisted - setlocal modifiable - setlocal nocursorline " for highlighting - setlocal nocursorcolumn " for highlighting - setlocal omnifunc=fuf#onComplete -endfunction - -" -function s:activateFufBuffer() - " lcd . : To avoid the strange behavior that unnamed buffer changes its cwd - " if 'autochdir' was set on. - lcd . - let cwd = getcwd() - call s:openFufBuffer() - " lcd ... : countermeasure against auto-cd script - lcd `=cwd` - call s:setLocalOptionsForFufBuffer() - redraw " for 'lazyredraw' - if exists(':AcpLock') - AcpLock - elseif exists(':AutoComplPopLock') - AutoComplPopLock - endif -endfunction - -" -function s:deactivateFufBuffer() - if exists(':AcpUnlock') - AcpUnlock - elseif exists(':AutoComplPopUnlock') - AutoComplPopUnlock - endif - " must close after returning to previous window - wincmd p - execute s:bufNrFuf . 'bdelete' -endfunction - -let s:originalGlobalOptions = {} - -" -function s:setTemporaryGlobalOption(name, value) - call extend(s:originalGlobalOptions, { a:name : eval('&' . a:name) }, 'keep') - execute printf('let &%s = a:value', a:name) -endfunction - -" -function s:restoreTemporaryGlobalOptions() - for [name, value] in items(s:originalGlobalOptions) - execute printf('let &%s = value', name) - endfor - let s:originalGlobalOptions = {} -endfunction - -" -function s:warnOldInfoFile() - call fuf#echoWithHl(printf("=================================================================\n" . - \ " Sorry, but your information file for FuzzyFinder is no longer \n" . - \ " compatible with this version of FuzzyFinder. Please remove \n" . - \ " %-63s\n" . - \ "=================================================================\n" , - \ '"' . expand(g:fuf_infoFile) . '".'), - \ 'WarningMsg') - echohl Question - call input('Press Enter') - echohl None -endfunction - -" -function s:serializeInfoMap(infoMap) - let lines = [] - for [m, info] in items(a:infoMap) - for [key, value] in items(info) - let lines += map(copy(value), 'm . "\t" . key . "\t" . string(v:val)') - endfor - endfor - return lines -endfunction - -" -function s:deserializeInfoMap(lines) - let infoMap = {} - for e in filter(map(a:lines, 'matchlist(v:val, ''^\v(\S+)\s+(\S+)\s+(.+)$'')'), '!empty(v:val)') - if !exists('infoMap[e[1]]') - let infoMap[e[1]] = {} - endif - if !exists('infoMap[e[1]][e[2]]') - let infoMap[e[1]][e[2]] = [] - endif - call add(infoMap[e[1]][e[2]], eval(e[3])) - endfor - return infoMap -endfunction - -" -function s:onBufWriteCmdInfoFile() - call fuf#saveInfoFile('', s:deserializeInfoMap(getline(1, '$'))) - setlocal nomodified - execute printf('%dbdelete! ', s:bufNrInfo) - echo "Information file updated" -endfunction - -" }}}1 -"============================================================================= -" s:handlerBase {{{1 - -let s:handlerBase = {} - -"----------------------------------------------------------------------------- -" PURE VIRTUAL FUNCTIONS {{{2 -" -" " -" s:handler.getModeName() -" -" " -" s:handler.getPrompt() -" -" " returns true if the mode deals with file paths. -" s:handler.targetsPath() -" -" " -" s:handler.getCompleteItems(patternSet) -" -" " -" s:handler.onOpen(word, mode) -" -" " Before entering FuzzyFinder buffer. This function should return in a short time. -" s:handler.onModeEnterPre() -" -" " After entering FuzzyFinder buffer. -" s:handler.onModeEnterPost() -" -" " After leaving FuzzyFinder buffer. -" s:handler.onModeLeavePost(opened) -" -" }}}2 -"----------------------------------------------------------------------------- - -" -function s:handlerBase.concretize(deriv) - call extend(self, a:deriv, 'error') - return self -endfunction - -" -function s:handlerBase.addStat(pattern, word) - let stat = { 'pattern' : a:pattern, 'word' : a:word } - call filter(self.info.stats, 'v:val !=# stat') - call insert(self.info.stats, stat) - let self.info.stats = self.info.stats[0 : g:fuf_learningLimit - 1] -endfunction - -" -function s:handlerBase.getMatchingCompleteItems(patternBase) - let MakeMatchingExpr = function(self.partialMatching - \ ? 's:makePartialMatchingExpr' - \ : 's:makeFuzzyMatchingExpr') - let patternSet = self.makePatternSet(a:patternBase) - let exprBoundary = s:makeFuzzyMatchingExpr('a:wordForBoundary', patternSet.primaryForRank) - let stats = filter( - \ copy(self.info.stats), 'v:val.pattern ==# patternSet.primaryForRank') - let items = self.getCompleteItems(patternSet.primary) - " NOTE: In order to know an excess, plus 1 to limit number - let items = fuf#filterWithLimit( - \ items, patternSet.filteringExpr, g:fuf_enumeratingLimit + 1) - return map(items, - \ 's:setRanks(v:val, patternSet.primaryForRank, exprBoundary, stats)') -endfunction - -" -function s:handlerBase.onComplete(findstart, base) - if a:findstart - return 0 - elseif !self.existsPrompt(a:base) - return [] - endif - call s:highlightPrompt(self.getPrompt()) - let items = [] - for patternBase in s:expandAbbrevMap(self.removePrompt(a:base), g:fuf_abbrevMap) - let items += self.getMatchingCompleteItems(patternBase) - if len(items) > g:fuf_enumeratingLimit - let items = items[ : g:fuf_enumeratingLimit - 1] - call s:highlightError() - break - endif - endfor - if empty(items) - call s:highlightError() - else - call sort(items, 'fuf#compareRanks') - call feedkeys("\\", 'n') - let self.lastFirstWord = items[0].word - endif - return items -endfunction - -" -function s:handlerBase.existsPrompt(line) - return strlen(a:line) >= strlen(self.getPrompt()) && - \ a:line[:strlen(self.getPrompt()) -1] ==# self.getPrompt() -endfunction - -" -function s:handlerBase.removePrompt(line) - return a:line[(self.existsPrompt(a:line) ? strlen(self.getPrompt()) : 0):] -endfunction - -" -function s:handlerBase.restorePrompt(line) - let i = 0 - while i < len(self.getPrompt()) && i < len(a:line) && self.getPrompt()[i] ==# a:line[i] - let i += 1 - endwhile - return self.getPrompt() . a:line[i : ] -endfunction - -" -function s:handlerBase.onCursorMovedI() - if !self.existsPrompt(getline('.')) - call setline('.', self.restorePrompt(getline('.'))) - call feedkeys("\", '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 lastPattern = self.removePrompt(getline('.')) - call s:restoreTemporaryGlobalOptions() - call s:deactivateFufBuffer() - call fuf#saveInfoFile(self.getModeName(), self.info) - let fOpen = exists('s:reservedCommand') - if fOpen - call self.onOpen(s:reservedCommand[0], s:reservedCommand[1]) - unlet s:reservedCommand - endif - call self.onModeLeavePost(fOpen) - if exists('s:reservedMode') - call fuf#launch(s:reservedMode, lastPattern, self.partialMatching) - unlet s:reservedMode - endif -endfunction - -" -function s:handlerBase.onCr(openType, fCheckDir) - if pumvisible() - call feedkeys(printf("\\=fuf#getRunningHandler().onCr(%d, %d) ? '' : ''\", - \ a:openType, self.targetsPath()), 'n') - return - endif - if !empty(self.lastPattern) - call self.addStat(self.lastPattern, self.removePrompt(getline('.'))) - endif - if a:fCheckDir && getline('.') =~# '[/\\]$' - " To clear i_ 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() - let pattern = self.removePrompt(getline('.')[ : col('.') - 2]) - if empty(pattern) - let numBs = 0 - elseif !g:fuf_smartBs - let numBs = 1 - elseif pattern[-len(g:fuf_patternSeparator) : ] ==# g:fuf_patternSeparator - let numBs = len(split(pattern, g:fuf_patternSeparator, 1)[-2]) - \ + len(g:fuf_patternSeparator) - elseif self.targetsPath() && pattern[-1 : ] =~# '[/\\]' - let numBs = len(matchstr(pattern, '[^/\\]*.$')) - else - let numBs = 1 - endif - call feedkeys((pumvisible() ? "\" : "") . repeat("\", numBs), 'n') -endfunction - -" -function s:handlerBase.onPreviewBase() - if self.getPreviewHeight() <= 0 - return - elseif !pumvisible() - return - elseif !self.existsPrompt(getline('.')) - let word = self.removePrompt(getline('.')) - elseif !exists('self.lastFirstWord') - return - else - let word = self.lastFirstWord - endif - redraw - if exists('self.lastPreviewInfo') && self.lastPreviewInfo.word ==# word - let self.lastPreviewInfo.count += 1 - else - let self.lastPreviewInfo = {'word': word, 'count': 0} - endif - let lines = self.makePreviewLines(word, self.lastPreviewInfo.count) - let lines = lines[: self.getPreviewHeight() - 1] - call map(lines, 'substitute(v:val, "\t", repeat(" ", &tabstop), "g")') - call map(lines, 's:snipTail(v:val, &columns - 1, s:ABBR_SNIP_MASK)') - echo join(lines, "\n") -endfunction - -" -function s:handlerBase.onSwitchMode(shift) - let modes = copy(g:fuf_modes) - call map(modes, '{ "ranks": [ fuf#{v:val}#getSwitchOrder(), v:val ] }') - call filter(modes, 'v:val.ranks[0] >= 0') - call sort(modes, 'fuf#compareRanks') - let s:reservedMode = self.getModeName() - for i in range(len(modes)) - if modes[i].ranks[1] ==# self.getModeName() - let s:reservedMode = modes[(i + a:shift) % len(modes)].ranks[1] - break - endif - endfor - call feedkeys("\", '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.info.stats), 'v:val.pattern') - if !exists('self.indexRecall') - let self.indexRecall = -1 - endif - let self.indexRecall += a:shift - if self.indexRecall < 0 - let self.indexRecall = -1 - elseif self.indexRecall >= len(patterns) - let self.indexRecall = len(patterns) - 1 - else - call setline('.', self.getPrompt() . patterns[self.indexRecall]) - call feedkeys("\", 'n') - endif -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -augroup FufGlobal - autocmd! - autocmd BufLeave * let s:bufferCursorPosMap[bufnr('')] = getpos('.') -augroup END - -let s:bufferCursorPosMap = {} - -" }}}1 -"============================================================================= -" vim: set fdm=marker: - diff --git a/autoload/.svn/text-base/snipMate.vim.svn-base b/autoload/.svn/text-base/snipMate.vim.svn-base deleted file mode 100644 index dcd28f66..00000000 --- a/autoload/.svn/text-base/snipMate.vim.svn-base +++ /dev/null @@ -1,433 +0,0 @@ -fun! Filename(...) - let filename = expand('%:t:r') - if filename == '' | return a:0 == 2 ? a:2 : '' | endif - return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g') -endf - -fun s:RemoveSnippet() - unl! g:snipPos s:curPos s:snipLen s:endCol s:endLine s:prevLen - \ s:lastBuf s:oldWord - if exists('s:update') - unl s:startCol s:origWordLen s:update - if exists('s:oldVars') | unl s:oldVars s:oldEndCol | endif - endif - aug! snipMateAutocmds -endf - -fun snipMate#expandSnip(snip, col) - let lnum = line('.') | let col = a:col - - let snippet = s:ProcessSnippet(a:snip) - " Avoid error if eval evaluates to nothing - if snippet == '' | return '' | endif - - " Expand snippet onto current position with the tab stops removed - let snipLines = split(substitute(snippet, '$\d\+\|${\d\+.\{-}}', '', 'g'), "\n", 1) - - let line = getline(lnum) - let afterCursor = strpart(line, col - 1) - " Keep text after the cursor - if afterCursor != "\t" && afterCursor != ' ' - let line = strpart(line, 0, col - 1) - let snipLines[-1] .= afterCursor - else - let afterCursor = '' - " For some reason the cursor needs to move one right after this - if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore' - let col += 1 - endif - endif - - call setline(lnum, line.snipLines[0]) - - " Autoindent snippet according to previous indentation - let indent = matchend(line, '^.\{-}\ze\(\S\|$\)') + 1 - call append(lnum, map(snipLines[1:], "'".strpart(line, 0, indent - 1)."'.v:val")) - - " Open any folds snippet expands into - if &fen | sil! exe lnum.','.(lnum + len(snipLines) - 1).'foldopen' | endif - - let [g:snipPos, s:snipLen] = s:BuildTabStops(snippet, lnum, col - indent, indent) - - if s:snipLen - aug snipMateAutocmds - au CursorMovedI * call s:UpdateChangedSnip(0) - au InsertEnter * call s:UpdateChangedSnip(1) - aug END - let s:lastBuf = bufnr(0) " Only expand snippet while in current buffer - let s:curPos = 0 - let s:endCol = g:snipPos[s:curPos][1] - let s:endLine = g:snipPos[s:curPos][0] - - call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1]) - let s:prevLen = [line('$'), col('$')] - if g:snipPos[s:curPos][2] != -1 | return s:SelectWord() | endif - else - unl g:snipPos s:snipLen - " Place cursor at end of snippet if no tab stop is given - let newlines = len(snipLines) - 1 - call cursor(lnum + newlines, indent + len(snipLines[-1]) - len(afterCursor) - \ + (newlines ? 0: col - 1)) - endif - return '' -endf - -" Prepare snippet to be processed by s:BuildTabStops -fun s:ProcessSnippet(snip) - let snippet = a:snip - " Evaluate eval (`...`) expressions. - " Using a loop here instead of a regex fixes a bug with nested "\=". - if stridx(snippet, '`') != -1 - while match(snippet, '`.\{-}`') != -1 - let snippet = substitute(snippet, '`.\{-}`', - \ substitute(eval(matchstr(snippet, '`\zs.\{-}\ze`')), - \ "\n\\%$", '', ''), '') - endw - let snippet = substitute(snippet, "\r", "\n", 'g') - endif - - " Place all text after a colon in a tab stop after the tab stop - " (e.g. "${#:foo}" becomes "${:foo}foo"). - " This helps tell the position of the tab stops later. - let snippet = substitute(snippet, '${\d\+:\(.\{-}\)}', '&\1', 'g') - - " Update the a:snip so that all the $# become the text after - " the colon in their associated ${#}. - " (e.g. "${1:foo}" turns all "$1"'s into "foo") - let i = 1 - while stridx(snippet, '${'.i) != -1 - let s = matchstr(snippet, '${'.i.':\zs.\{-}\ze}') - if s != '' - let snippet = substitute(snippet, '$'.i, s.'&', 'g') - endif - let i += 1 - endw - - if &et " Expand tabs to spaces if 'expandtab' is set. - return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g') - endif - return snippet -endf - -" Counts occurences of haystack in needle -fun s:Count(haystack, needle) - let counter = 0 - let index = stridx(a:haystack, a:needle) - while index != -1 - let index = stridx(a:haystack, a:needle, index+1) - let counter += 1 - endw - return counter -endf - -" Builds a list of a list of each tab stop in the snippet containing: -" 1.) The tab stop's line number. -" 2.) The tab stop's column number -" (by getting the length of the string between the last "\n" and the -" tab stop). -" 3.) The length of the text after the colon for the current tab stop -" (e.g. "${1:foo}" would return 3). If there is no text, -1 is returned. -" 4.) If the "${#:}" construct is given, another list containing all -" the matches of "$#", to be replaced with the placeholder. This list is -" composed the same way as the parent; the first item is the line number, -" and the second is the column. -fun s:BuildTabStops(snip, lnum, col, indent) - let snipPos = [] - let i = 1 - let withoutVars = substitute(a:snip, '$\d\+', '', 'g') - while stridx(a:snip, '${'.i) != -1 - let beforeTabStop = matchstr(withoutVars, '^.*\ze${'.i.'\D') - let withoutOthers = substitute(withoutVars, '${\('.i.'\D\)\@!\d\+.\{-}}', '', 'g') - - let j = i - 1 - call add(snipPos, [0, 0, -1]) - let snipPos[j][0] = a:lnum + s:Count(beforeTabStop, "\n") - let snipPos[j][1] = a:indent + len(matchstr(withoutOthers, '.*\(\n\|^\)\zs.*\ze${'.i.'\D')) - if snipPos[j][0] == a:lnum | let snipPos[j][1] += a:col | endif - - " Get all $# matches in another list, if ${#:name} is given - if stridx(withoutVars, '${'.i.':') != -1 - let snipPos[j][2] = len(matchstr(withoutVars, '${'.i.':\zs.\{-}\ze}')) - let dots = repeat('.', snipPos[j][2]) - call add(snipPos[j], []) - let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g') - while match(withoutOthers, '$'.i.'\(\D\|$\)') != -1 - let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\(\D\|$\)') - call add(snipPos[j][3], [0, 0]) - let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n") - let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum - \ ? len(matchstr(beforeMark, '.*\n\zs.*')) - \ : a:col + len(beforeMark)) - let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\(\D\|$\)', '', '') - endw - endif - let i += 1 - endw - return [snipPos, i - 1] -endf - -fun snipMate#jumpTabStop(backwards) - let leftPlaceholder = exists('s:origWordLen') - \ && s:origWordLen != g:snipPos[s:curPos][2] - if leftPlaceholder && exists('s:oldEndCol') - let startPlaceholder = s:oldEndCol + 1 - endif - - if exists('s:update') - call s:UpdatePlaceholderTabStops() - else - call s:UpdateTabStops() - endif - - " Don't reselect placeholder if it has been modified - if leftPlaceholder && g:snipPos[s:curPos][2] != -1 - if exists('startPlaceholder') - let g:snipPos[s:curPos][1] = startPlaceholder - else - let g:snipPos[s:curPos][1] = col('.') - let g:snipPos[s:curPos][2] = 0 - endif - endif - - let s:curPos += a:backwards ? -1 : 1 - " Loop over the snippet when going backwards from the beginning - if s:curPos < 0 | let s:curPos = s:snipLen - 1 | endif - - if s:curPos == s:snipLen - let sMode = s:endCol == g:snipPos[s:curPos-1][1]+g:snipPos[s:curPos-1][2] - call s:RemoveSnippet() - return sMode ? "\" : TriggerSnippet() - endif - - call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1]) - - let s:endLine = g:snipPos[s:curPos][0] - let s:endCol = g:snipPos[s:curPos][1] - let s:prevLen = [line('$'), col('$')] - - return g:snipPos[s:curPos][2] == -1 ? '' : s:SelectWord() -endf - -fun s:UpdatePlaceholderTabStops() - let changeLen = s:origWordLen - g:snipPos[s:curPos][2] - unl s:startCol s:origWordLen s:update - if !exists('s:oldVars') | return | endif - " Update tab stops in snippet if text has been added via "$#" - " (e.g., in "${1:foo}bar$1${2}"). - if changeLen != 0 - let curLine = line('.') - - for pos in g:snipPos - if pos == g:snipPos[s:curPos] | continue | endif - let changed = pos[0] == curLine && pos[1] > s:oldEndCol - let changedVars = 0 - let endPlaceholder = pos[2] - 1 + pos[1] - " Subtract changeLen from each tab stop that was after any of - " the current tab stop's placeholders. - for [lnum, col] in s:oldVars - if lnum > pos[0] | break | endif - if pos[0] == lnum - if pos[1] > col || (pos[2] == -1 && pos[1] == col) - let changed += 1 - elseif col < endPlaceholder - let changedVars += 1 - endif - endif - endfor - let pos[1] -= changeLen * changed - let pos[2] -= changeLen * changedVars " Parse variables within placeholders - " e.g., "${1:foo} ${2:$1bar}" - - if pos[2] == -1 | continue | endif - " Do the same to any placeholders in the other tab stops. - for nPos in pos[3] - let changed = nPos[0] == curLine && nPos[1] > s:oldEndCol - for [lnum, col] in s:oldVars - if lnum > nPos[0] | break | endif - if nPos[0] == lnum && nPos[1] > col - let changed += 1 - endif - endfor - let nPos[1] -= changeLen * changed - endfor - endfor - endif - unl s:endCol s:oldVars s:oldEndCol -endf - -fun s:UpdateTabStops() - let changeLine = s:endLine - g:snipPos[s:curPos][0] - let changeCol = s:endCol - g:snipPos[s:curPos][1] - if exists('s:origWordLen') - let changeCol -= s:origWordLen - unl s:origWordLen - endif - let lnum = g:snipPos[s:curPos][0] - let col = g:snipPos[s:curPos][1] - " Update the line number of all proceeding tab stops if has - " been inserted. - if changeLine != 0 - let changeLine -= 1 - for pos in g:snipPos - if pos[0] >= lnum - if pos[0] == lnum | let pos[1] += changeCol | endif - let pos[0] += changeLine - endif - if pos[2] == -1 | continue | endif - for nPos in pos[3] - if nPos[0] >= lnum - if nPos[0] == lnum | let nPos[1] += changeCol | endif - let nPos[0] += changeLine - endif - endfor - endfor - elseif changeCol != 0 - " Update the column of all proceeding tab stops if text has - " been inserted/deleted in the current line. - for pos in g:snipPos - if pos[1] >= col && pos[0] == lnum - let pos[1] += changeCol - endif - if pos[2] == -1 | continue | endif - for nPos in pos[3] - if nPos[0] > lnum | break | endif - if nPos[0] == lnum && nPos[1] >= col - let nPos[1] += changeCol - endif - endfor - endfor - endif -endf - -fun s:SelectWord() - let s:origWordLen = g:snipPos[s:curPos][2] - let s:oldWord = strpart(getline('.'), g:snipPos[s:curPos][1] - 1, - \ s:origWordLen) - let s:prevLen[1] -= s:origWordLen - if !empty(g:snipPos[s:curPos][3]) - let s:update = 1 - let s:endCol = -1 - let s:startCol = g:snipPos[s:curPos][1] - 1 - endif - if !s:origWordLen | return '' | endif - let l = col('.') != 1 ? 'l' : '' - if &sel == 'exclusive' - return "\".l.'v'.s:origWordLen."l\" - endif - return s:origWordLen == 1 ? "\".l.'gh' - \ : "\".l.'v'.(s:origWordLen - 1)."l\" -endf - -" This updates the snippet as you type when text needs to be inserted -" into multiple places (e.g. in "${1:default text}foo$1bar$1", -" "default text" would be highlighted, and if the user types something, -" UpdateChangedSnip() would be called so that the text after "foo" & "bar" -" are updated accordingly) -" -" It also automatically quits the snippet if the cursor is moved out of it -" while in insert mode. -fun s:UpdateChangedSnip(entering) - if exists('g:snipPos') && bufnr(0) != s:lastBuf - call s:RemoveSnippet() - elseif exists('s:update') " If modifying a placeholder - if !exists('s:oldVars') && s:curPos + 1 < s:snipLen - " Save the old snippet & word length before it's updated - " s:startCol must be saved too, in case text is added - " before the snippet (e.g. in "foo$1${2}bar${1:foo}"). - let s:oldEndCol = s:startCol - let s:oldVars = deepcopy(g:snipPos[s:curPos][3]) - endif - let col = col('.') - 1 - - if s:endCol != -1 - let changeLen = col('$') - s:prevLen[1] - let s:endCol += changeLen - else " When being updated the first time, after leaving select mode - if a:entering | return | endif - let s:endCol = col - 1 - endif - - " If the cursor moves outside the snippet, quit it - if line('.') != g:snipPos[s:curPos][0] || col < s:startCol || - \ col - 1 > s:endCol - unl! s:startCol s:origWordLen s:oldVars s:update - return s:RemoveSnippet() - endif - - call s:UpdateVars() - let s:prevLen[1] = col('$') - elseif exists('g:snipPos') - if !a:entering && g:snipPos[s:curPos][2] != -1 - let g:snipPos[s:curPos][2] = -2 - endif - - let col = col('.') - let lnum = line('.') - let changeLine = line('$') - s:prevLen[0] - - if lnum == s:endLine - let s:endCol += col('$') - s:prevLen[1] - let s:prevLen = [line('$'), col('$')] - endif - if changeLine != 0 - let s:endLine += changeLine - let s:endCol = col - endif - - " Delete snippet if cursor moves out of it in insert mode - if (lnum == s:endLine && (col > s:endCol || col < g:snipPos[s:curPos][1])) - \ || lnum > s:endLine || lnum < g:snipPos[s:curPos][0] - call s:RemoveSnippet() - endif - endif -endf - -" This updates the variables in a snippet when a placeholder has been edited. -" (e.g., each "$1" in "${1:foo} $1bar $1bar") -fun s:UpdateVars() - let newWordLen = s:endCol - s:startCol + 1 - let newWord = strpart(getline('.'), s:startCol, newWordLen) - if newWord == s:oldWord || empty(g:snipPos[s:curPos][3]) - return - endif - - let changeLen = g:snipPos[s:curPos][2] - newWordLen - let curLine = line('.') - let startCol = col('.') - let oldStartSnip = s:startCol - let updateTabStops = changeLen != 0 - let i = 0 - - for [lnum, col] in g:snipPos[s:curPos][3] - if updateTabStops - let start = s:startCol - if lnum == curLine && col <= start - let s:startCol -= changeLen - let s:endCol -= changeLen - endif - for nPos in g:snipPos[s:curPos][3][(i):] - " This list is in ascending order, so quit if we've gone too far. - if nPos[0] > lnum | break | endif - if nPos[0] == lnum && nPos[1] > col - let nPos[1] -= changeLen - endif - endfor - if lnum == curLine && col > start - let col -= changeLen - let g:snipPos[s:curPos][3][i][1] = col - endif - let i += 1 - endif - - " "Very nomagic" is used here to allow special characters. - call setline(lnum, substitute(getline(lnum), '\%'.col.'c\V'. - \ escape(s:oldWord, '\'), escape(newWord, '\&'), '')) - endfor - if oldStartSnip != s:startCol - call cursor(0, startCol + s:startCol - oldStartSnip) - endif - - let s:oldWord = newWord - let g:snipPos[s:curPos][2] = newWordLen -endf -" vim:noet:sw=4:ts=4:ft=vim From cff6903b729fbf273e1b31faf117b549da98197f Mon Sep 17 00:00:00 2001 From: Felix Wong Date: Sat, 28 Dec 2013 00:23:35 -0800 Subject: [PATCH 02/37] updated link for zencoding --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77b710d0..63ac00a6 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ I recommend reading the docs of these plugins to understand them better. Each of * [ctrlp.vim](https://github.com/kien/ctrlp.vim): Fuzzy file, buffer, mru and tag finder. In my config it's mapped to ``, because `` is used by YankRing * [mru.vim](https://github.com/vim-scripts/mru.vim): Plugin to manage Most Recently Used (MRU) files. Includes my own fork which adds syntax highlighting to MRU. This plugin can be opened with `` * [open_file_under_cursor.vim](https://github.com/amix/open_file_under_cursor.vim): Open file under cursor when pressing `gf` -* [zencoding](https://github.com/mattn/zencoding-vim): Expanding abbreviation like zen-coding, very useful for editing XML, HTML. +* [zencoding](https://github.com/mattn/emmet-vim): Expanding abbreviation like zen-coding, very useful for editing XML, HTML. * [vim-indent-object](https://github.com/michaeljsmith/vim-indent-object): Defines a new text object representing lines of code at the same indent level. Useful for python/vim scripts * [taglist.vim](https://github.com/vim-scripts/taglist.vim): Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc) * [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors): Sublime Text style multiple selections for Vim, CTRL+N is remapped to CTRL+S (due to YankRing) From 08a64d943dab56ca8b5896a150531487ac0fa1c6 Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 28 Dec 2013 18:23:13 +0000 Subject: [PATCH 03/37] Updated plugins. Fixed some issues related to empty space and peaksea. Using Source Code Pro as default font --- sources_forked/peaksea/colors/peaksea.vim | 2 +- sources_non_forked/vim-airline/README.md | 9 +- .../autoload/airline/extensions.vim | 4 + .../autoload/airline/extensions/branch.vim | 9 +- .../autoload/airline/extensions/eclim.vim | 16 ++-- .../autoload/airline/extensions/hunks.vim | 6 +- .../autoload/airline/extensions/quickfix.vim | 2 +- .../autoload/airline/extensions/tabline.vim | 43 ++++++--- .../tabline/{formatters.vim => default.vim} | 35 ++------ .../extensions/tabline/unique_tail.vim | 27 ++++++ .../tabline/unique_tail_improved.vim | 88 +++++++++++++++++++ .../autoload/airline/extensions/tmuxline.vim | 26 ++++++ .../airline/extensions/whitespace.vim | 4 +- .../autoload/airline/themes/kolor.vim | 59 +++++++++++++ .../vim-airline/doc/airline.txt | 30 ++++++- .../vim-bundle-mako/indent/mako.vim | 1 + .../vim-bundle-mako/syntax/mako.vim | 3 + .../vim-coffee-script/compiler/coffee.vim | 4 +- .../vim-fugitive/plugin/fugitive.vim | 9 +- sources_non_forked/vim-less/README.md | 2 +- sources_non_forked/vim-less/indent/less.vim | 9 +- sources_non_forked/vim-less/syntax/less.vim | 2 +- .../vim-markdown/ftplugin/markdown.vim | 1 + .../vim-markdown/syntax/markdown.vim | 1 + .../vim-snipmate/Contributors.md | 1 + .../vim-snipmate/autoload/snipMate.vim | 23 +++-- .../vim-snippets/UltiSnips/eruby.snippets | 8 ++ .../UltiSnips/php/symfony2.snippets | 48 +++++++--- .../vim-snippets/UltiSnips/twig.snippets | 33 +++++++ .../vim-snippets/snippets/php.snippets | 41 +++++++++ .../vim-snippets/snippets/puppet.snippets | 20 +++-- .../vim-snippets/snippets/ruby.snippets | 2 +- .../vim-snippets/snippets/slim.snippets | 64 ++++++++++++++ vimrcs/extended.vim | 6 +- vimrcs/plugins_config.vim | 5 ++ 35 files changed, 553 insertions(+), 90 deletions(-) rename sources_non_forked/vim-airline/autoload/airline/extensions/tabline/{formatters.vim => default.vim} (54%) create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/themes/kolor.vim create mode 100644 sources_non_forked/vim-snippets/UltiSnips/twig.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/slim.snippets diff --git a/sources_forked/peaksea/colors/peaksea.vim b/sources_forked/peaksea/colors/peaksea.vim index 7b95aadd..f3eafe43 100644 --- a/sources_forked/peaksea/colors/peaksea.vim +++ b/sources_forked/peaksea/colors/peaksea.vim @@ -281,7 +281,7 @@ elseif &background=='dark' hi ModeMsg guifg=fg guibg=#000080 gui=NONE hi VisualNOS guifg=fg guibg=#000080 gui=NONE hi SpecialKey guifg=#b0d0f0 guibg=NONE gui=NONE - hi NonText guifg=#6080f0 guibg=#101010 gui=NONE + hi NonText guifg=#202020 guibg=#202020 gui=NONE hi Directory guifg=#80c0e0 guibg=NONE gui=NONE hi ErrorMsg guifg=#d0d090 guibg=#800000 gui=NONE hi MoreMsg guifg=#c0e080 guibg=NONE gui=NONE diff --git a/sources_non_forked/vim-airline/README.md b/sources_non_forked/vim-airline/README.md index dd59b889..3ff5ac3a 100644 --- a/sources_non_forked/vim-airline/README.md +++ b/sources_non_forked/vim-airline/README.md @@ -7,7 +7,7 @@ Lean & mean status/tabline for vim that's light as air. # Features * Tiny core written with extensibility in mind ([open/closed principle][8]). -* Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [eclim][34], [lawrencium][21] and [virtualenv][31]. +* Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [eclim][34], [lawrencium][21], [virtualenv][31], [tmuxline][35]. * Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols. * Optimized for speed; it loads in under a millisecond. * Extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki. @@ -67,6 +67,9 @@ vim-airline integrates with a variety of plugins out of the box. These extensio #### [virtualenv][31] ![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png) +#### [tmuxline][35] +![image](https://f.cloud.github.com/assets/1532071/1559276/4c28fbac-4fc7-11e3-90ef-7e833d980f98.gif) + ## Extras vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also: @@ -125,6 +128,9 @@ This plugin follows the standard runtime path structure, and as such it can be i `:help airline` +The default setting of 'laststatus' is for the statusline to not appear until a split is created. If you want it to appear all the time, add the following to your vimrc: +`set laststatus=2` + # Integrating with powerline fonts For the nice looking powerline symbols to appear, you will need to install a patched font. Instructions can be found in the official powerline [documentation][20]. Prepatched fonts can be found in the [powerline-fonts][3] repository. @@ -197,3 +203,4 @@ MIT License. Copyright (c) 2013 Bailey Ling. [32]: https://github.com/chriskempson/base16-vim [33]: https://github.com/bling/vim-airline/wiki/Test-Plan [34]: http://eclim.org +[35]: https://github.com/edkolev/tmuxline.vim diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions.vim b/sources_non_forked/vim-airline/autoload/airline/extensions.vim index 8707dbd7..790bfd1b 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions.vim @@ -195,6 +195,10 @@ function! airline#extensions#load() call airline#extensions#tabline#init(s:ext) endif + if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline') + call airline#extensions#tmuxline#init(s:ext) + endif + " load all other extensions not part of the default distribution for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") " we have to check both resolved and unresolved paths, since it's possible diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim index 87a70693..2177f64c 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim @@ -14,7 +14,7 @@ let s:empty_message = get(g:, 'airline#extensions#branch#empty_message', \ get(g:, 'airline_branch_empty_message', '')) let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) -function! airline#extensions#branch#get_head() +function! airline#extensions#branch#head() let head = '' if s:has_fugitive && !exists('b:mercurial_dir') @@ -42,6 +42,13 @@ function! airline#extensions#branch#get_head() endif return empty(head) || !s:check_in_path() + \ ? '' + \ : head +endfunction + +function! airline#extensions#branch#get_head() + let head = airline#extensions#branch#head() + return empty(head) \ ? s:empty_message \ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.(g:airline_symbols.space), head) endfunction diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim index ff6a84fe..68360466 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim @@ -17,12 +17,18 @@ endfunction function! airline#extensions#eclim#get_warnings() let eclimList = eclim#display#signs#GetExisting() + if !empty(eclimList) - let errorsLine = eclimList[0]['line'] - let errorsNumber = len(eclimList) - let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]" - if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == '' - return errors.(g:airline_symbols.space) + " Remove any non-eclim signs (see eclim#display#signs#Update) + call filter(eclimList, "v:val.name =~ '^\(qf_\)\?\(error\|info\|warning\)$'") + + if !empty(eclimList) + let errorsLine = eclimList[0]['line'] + let errorsNumber = len(eclimList) + let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]" + if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == '' + return errors.(g:airline_symbols.space) + endif endif endif return '' diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim index 73c0e2ea..084dd7b5 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim @@ -16,8 +16,12 @@ function! s:get_hunks_signify() return [] endfunction +function! s:is_branch_empty() + return exists('*airline#extensions#branch#head') && empty(airline#extensions#branch#head()) +endfunction + function! s:get_hunks_gitgutter() - if !get(g:, 'gitgutter_enabled', 0) + if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty() return '' endif return GitGutterGetHunkSummary() diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim index 7afad864..f000e027 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim @@ -24,7 +24,7 @@ function! s:get_text() let nr = bufnr('%') for buf in split(buffers, '\n') - if match(buf, '\v^\s+'.nr) > -1 + if match(buf, '\v^\s*'.nr) > -1 if match(buf, '\[Quickfix List\]') > -1 return g:airline#extensions#quickfix#quickfix_text else diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim index b80d16e6..cf3d7df2 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim @@ -5,6 +5,7 @@ let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') let s:excludes = get(g:, 'airline#extensions#tabline#excludes', []) let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0) let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) +let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1) let s:builder_context = { \ 'active' : 1, @@ -103,7 +104,7 @@ function! airline#extensions#tabline#title(n) endfunction function! airline#extensions#tabline#get_buffer_name(nr) - return airline#extensions#tabline#formatters#{s:formatter}(a:nr, get(s:, 'current_buffer_list', [])) + return airline#extensions#tabline#{s:formatter}#format(a:nr, get(s:, 'current_buffer_list', s:get_buffer_list())) endfunction function! s:get_buffer_list() @@ -179,9 +180,16 @@ function! s:get_visible_buffers() return buffers endfunction +let s:current_bufnr = -1 +let s:current_tabnr = -1 +let s:current_tabline = '' function! s:get_buffers() - let b = airline#builder#new(s:builder_context) let cur = bufnr('%') + if cur == s:current_bufnr + return s:current_tabline + endif + + let b = airline#builder#new(s:builder_context) let tab_bufs = tabpagebuflist(tabpagenr()) for nr in s:get_visible_buffers() if nr < 0 @@ -207,13 +215,22 @@ function! s:get_buffers() call b.add_section('airline_tabfill', '') call b.split() call b.add_section('airline_tabtype', ' buffers ') - return b.build() + + let s:current_bufnr = cur + let s:current_tabline = b.build() + return s:current_tabline endfunction function! s:get_tabs() + let curbuf = bufnr('%') + let curtab = tabpagenr() + if curbuf == s:current_bufnr && curtab == s:current_tabnr + return s:current_tabline + endif + let b = airline#builder#new(s:builder_context) for i in range(1, tabpagenr('$')) - if i == tabpagenr() + if i == curtab let group = 'airline_tabsel' if g:airline_detect_modified for bi in tabpagebuflist(i) @@ -226,18 +243,24 @@ function! s:get_tabs() let group = 'airline_tab' endif let val = '%(' - if s:tab_nr_type == 0 - let val .= ' %{len(tabpagebuflist('.i.'))}' - else - let val .= (g:airline_symbols.space).i + if s:show_tab_nr + if s:tab_nr_type == 0 + let val .= ' %{len(tabpagebuflist('.i.'))}' + else + let val .= (g:airline_symbols.space).i + endif endif call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)') endfor + call b.add_raw('%T') call b.add_section('airline_tabfill', '') call b.split() call b.add_section('airline_tab', ' %999XX ') call b.add_section('airline_tabtype', ' tabs ') - return b.build() -endfunction + let s:current_bufnr = curbuf + let s:current_tabnr = curtab + let s:current_tabline = b.build() + return s:current_tabline +endfunction diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/formatters.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim similarity index 54% rename from sources_non_forked/vim-airline/autoload/airline/extensions/tabline/formatters.vim rename to sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim index 656ba225..f1c87e4f 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/formatters.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim @@ -7,7 +7,7 @@ let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) let s:buf_modified_symbol = g:airline_symbols.modified -function! airline#extensions#tabline#formatters#default(bufnr, buffers) +function! airline#extensions#tabline#default#format(bufnr, buffers) let _ = '' let name = bufname(a:bufnr) @@ -21,40 +21,15 @@ function! airline#extensions#tabline#formatters#default(bufnr, buffers) endif endif - return s:wrap_name(a:bufnr, _) + return airline#extensions#tabline#default#wrap_name(a:bufnr, _) endfunction -function! airline#extensions#tabline#formatters#unique_tail(bufnr, buffers) - let duplicates = {} - let tails = {} - let map = {} - for nr in a:buffers - let name = bufname(nr) - if empty(name) - let map[nr] = '[No Name]' - else - let tail = fnamemodify(name, ':t') - if has_key(tails, tail) - let duplicates[nr] = nr - endif - let tails[tail] = 1 - let map[nr] = s:wrap_name(nr, tail) - endif - endfor - - for nr in values(duplicates) - let map[nr] = s:wrap_name(nr, fnamemodify(bufname(nr), ':p:.')) - endfor - - return map[a:bufnr] -endfunction - -function! s:wrap_name(bufnr, buffer_name) +function! airline#extensions#tabline#default#wrap_name(bufnr, buffer_name) let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : '' - let _ .= a:buffer_name + let _ .= substitute(a:buffer_name, '\\', '/', 'g') + if getbufvar(a:bufnr, '&modified') == 1 let _ .= s:buf_modified_symbol endif return _ endfunction - diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim new file mode 100644 index 00000000..eb622f5e --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim @@ -0,0 +1,27 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +function! airline#extensions#tabline#unique_tail#format(bufnr, buffers) + let duplicates = {} + let tails = {} + let map = {} + for nr in a:buffers + let name = bufname(nr) + if empty(name) + let map[nr] = '[No Name]' + else + let tail = fnamemodify(name, ':t') + if has_key(tails, tail) + let duplicates[nr] = nr + endif + let tails[tail] = 1 + let map[nr] = airline#extensions#tabline#default#wrap_name(nr, tail) + endif + endfor + + for nr in values(duplicates) + let map[nr] = airline#extensions#tabline#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.')) + endfor + + return map[a:bufnr] +endfunction diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim new file mode 100644 index 00000000..12b28ae6 --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim @@ -0,0 +1,88 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +let s:skip_symbol = '…' + +function! airline#extensions#tabline#unique_tail_improved#format(bufnr, buffers) + if len(a:buffers) <= 1 " don't need to compare bufnames if has less than one buffer opened + return airline#extensions#tabline#default#format(a:bufnr, a:buffers) + endif + + let curbuf_tail = fnamemodify(bufname(a:bufnr), ':t') + let do_deduplicate = 0 + let path_tokens = {} + + for nr in a:buffers + let name = bufname(nr) + if !empty(name) && nr != a:bufnr && fnamemodify(name, ':t') == curbuf_tail + let do_deduplicate = 1 + let tokens = reverse(split(substitute(fnamemodify(name, ':p:.:h'), '\\', '/', 'g'), '/')) + let token_index = 0 + for token in tokens + if token == '.' | break | endif + if !has_key(path_tokens, token_index) + let path_tokens[token_index] = {} + endif + let path_tokens[token_index][token] = 1 + let token_index += 1 + endfor + endif + endfor + + if do_deduplicate == 1 + let path = [] + let token_index = 0 + for token in reverse(split(substitute(fnamemodify(bufname(a:bufnr), ':p:.:h'), '\\', '/', 'g'), '/')) + if token == '.' | break | endif + let duplicated = 0 + let uniq = 1 + let single = 1 + if has_key(path_tokens, token_index) + let duplicated = 1 + if len(keys(path_tokens[token_index])) > 1 | let single = 0 | endif + if has_key(path_tokens[token_index], token) | let uniq = 0 | endif + endif + call insert(path, {'token': token, 'duplicated': duplicated, 'uniq': uniq, 'single': single}) + let token_index += 1 + endfor + + let buf_name = [curbuf_tail] + let has_uniq = 0 + let has_skipped = 0 + for token1 in reverse(path) + if !token1['duplicated'] && len(buf_name) > 1 + call insert(buf_name, s:skip_symbol) + let has_skipped = 0 + break + endif + + if has_uniq == 1 + call insert(buf_name, s:skip_symbol) + let has_skipped = 0 + break + endif + + if token1['uniq'] == 0 && token1['single'] == 1 + let has_skipped = 1 + else + if has_skipped == 1 + call insert(buf_name, s:skip_symbol) + let has_skipped = 0 + endif + call insert(buf_name, token1['token']) + endif + + if token1['uniq'] == 1 + let has_uniq = 1 + endif + endfor + + if has_skipped == 1 + call insert(buf_name, s:skip_symbol) + endif + + return airline#extensions#tabline#default#wrap_name(a:bufnr, join(buf_name, '/')) + else + return airline#extensions#tabline#default#format(a:bufnr, a:buffers) + endif +endfunction diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim new file mode 100644 index 00000000..4bc0a5f9 --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim @@ -0,0 +1,26 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +if !exists(':Tmuxline') + finish +endif + +let s:tmuxline_snapshot_file = get(g:, 'airline#extensions#tmuxline#snapshot_file', '') +let s:color_template = get(g:, 'airline#extensions#tmuxline#color_template', 'normal') + +function! airline#extensions#tmuxline#init(ext) + call a:ext.add_theme_func('airline#extensions#tmuxline#set_tmux_colors') +endfunction + +function! airline#extensions#tmuxline#set_tmux_colors(palette) + let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal' + let mode_palette = a:palette[color_template] + + let tmuxline_theme = tmuxline#api#create_theme_from_airline(mode_palette) + call tmuxline#api#set_theme(tmuxline_theme) + + if strlen(s:tmuxline_snapshot_file) + call tmuxline#api#snapshot(s:tmuxline_snapshot_file) + endif +endfunction + diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim index c8910af6..002fba1d 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim @@ -16,10 +16,12 @@ let s:default_checks = ['indent', 'trailing'] let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]') let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]') +let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000) + let s:enabled = 1 function! airline#extensions#whitespace#check() - if &readonly || !&modifiable || !s:enabled + if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines return '' endif diff --git a/sources_non_forked/vim-airline/autoload/airline/themes/kolor.vim b/sources_non_forked/vim-airline/autoload/airline/themes/kolor.vim new file mode 100644 index 00000000..e61f56f2 --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/themes/kolor.vim @@ -0,0 +1,59 @@ +let g:airline#themes#kolor#palette = {} + +let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ] +let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ] +let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ] + +let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + +let g:airline#themes#kolor#palette.normal_modified = { + \ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] , + \ } + + +let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ] +let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ] +let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ] +let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#kolor#palette.insert_modified = { + \ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] , + \ } + + +let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert) +let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ] +let g:airline#themes#kolor#palette.replace_modified = { + \ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] , + \ } + + +let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ] +let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ] +let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ] +let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) +let g:airline#themes#kolor#palette.visual_modified = { + \ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] , + \ } + + +let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ] +let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ] +let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ] +let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) +let g:airline#themes#kolor#palette.inactive_modified = { + \ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] , + \ } + + +let g:airline#themes#kolor#palette.accents = { + \ 'red': [ '#d96e8a' , '' , 168 , '' ] + \ } + + +if !get(g:, 'loaded_ctrlp', 0) + finish +endif +let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( + \ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ], + \ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ], + \ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ]) diff --git a/sources_non_forked/vim-airline/doc/airline.txt b/sources_non_forked/vim-airline/doc/airline.txt index 2816c290..bfe7cb3f 100644 --- a/sources_non_forked/vim-airline/doc/airline.txt +++ b/sources_non_forked/vim-airline/doc/airline.txt @@ -355,6 +355,9 @@ eclim * configure which whitespace checks to enable. > let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing' ] < +* configure the maximum number of lines where whitespace checking is enabled. > + let g:airline#extensions#whitespace#max_lines = 20000 +< * configure whether a message should be displayed. > let g:airline#extensions#whitespace#show_message = 1 < @@ -376,11 +379,14 @@ eclim let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default) let g:airline#extensions#tabline#tab_nr_type = 1 " tab number < +* enable/disable displaying tab number in tabs mode. > + let g:airline#extensions#tabline#show_tab_nr = 1 + * defines the name of a formatter for how buffer names are displayed. > let g:airline#extensions#tabline#formatter = 'default' " here is how you can define a 'foo' formatter: - function! airline#extensions#tabline#formatters#foo(bufnr, buffers) + function! airline#extensions#tabline#foo#format(bufnr, buffers) return fnamemodify(bufname(a:bufnr), ':t') endfunction let g:airline#extensions#tabline#formatter = 'foo' @@ -403,6 +409,10 @@ eclim " there is another file of the same name, in which it will display it along " with the containing parent directory. let g:airline#extensions#tabline#formatter = 'unique_tail' + + " The `unique_tail_improved` - another algorithm, that will smartly uniquify + " buffers names with similar filename, suppressing common parts of paths. + let g:airline#extensions#tabline#formatter = 'unique_tail_improved' < * configure the minimum number of buffers needed to show the tabline. > let g:airline#extensions#tabline#buffer_min_count = 0 @@ -423,6 +433,24 @@ eclim < Note: Enabling this extension will modify 'showtabline' and 'guioptions'. +------------------------------------- *airline-tmuxline* +tmuxline + +* enable/disable tmuxline integration > + let g:airline#extensions#tmuxline#enabled = 0 +< +* configure which mode colors should be used in tmux statusline > + let airline#extensions#tmuxline#color_template = 'normal' (default) + let airline#extensions#tmuxline#color_template = 'insert' + let airline#extensions#tmuxline#color_template = 'visual' + let airline#extensions#tmuxline#color_template = 'replace' +< +* if specified, setting this option will trigger writing to the file whenever the + airline theme is applied, i.e. when :AirlineTheme is executed and on vim + startup > + airline#extensions#tmuxline#snapshot_file = "~/.tmux-statusline-colors.conf" +< + ============================================================================== ADVANCED CUSTOMIZATION *airline-advanced-customization* diff --git a/sources_non_forked/vim-bundle-mako/indent/mako.vim b/sources_non_forked/vim-bundle-mako/indent/mako.vim index bd85ac5e..8f6b97b6 100644 --- a/sources_non_forked/vim-bundle-mako/indent/mako.vim +++ b/sources_non_forked/vim-bundle-mako/indent/mako.vim @@ -257,6 +257,7 @@ endif " [-- --] call MakoIndentPush('%def') +call MakoIndentPush('%block') call MakoIndentPush('%call') call MakoIndentPush('%doc') call MakoIndentPush('%text') diff --git a/sources_non_forked/vim-bundle-mako/syntax/mako.vim b/sources_non_forked/vim-bundle-mako/syntax/mako.vim index 8fc489ba..36bc4a7c 100644 --- a/sources_non_forked/vim-bundle-mako/syntax/mako.vim +++ b/sources_non_forked/vim-bundle-mako/syntax/mako.vim @@ -60,6 +60,9 @@ syn region makoAttributeValue containedin=MakoTag contained start=/'/ skip=/\\'/ syn region makoTag matchgroup=makoDelim start="<%\(def\|call\|page\|include\|namespace\|inherit\|block\|[a-zA-Z_][a-zA-Z0-9_]*:[a-zA-Z_][a-zA-Z0-9_]*\)\>" end="/\?>" syn match makoDelim "" +syn region makoJavaScript matchgroup=makoDelim start=+<%block .*js.*>+ keepend end=++ contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc,makoLine,makoBlock,makoVariable +syn region makoCssStyle matchgroup=makoDelim start=+<%block .*css.*>+ keepend end=++ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc,makoLine,makoBlock,makoVariable + " Newline Escapes syn match makoEscape /\\$/ diff --git a/sources_non_forked/vim-coffee-script/compiler/coffee.vim b/sources_non_forked/vim-coffee-script/compiler/coffee.vim index a70fa64c..9a91d354 100644 --- a/sources_non_forked/vim-coffee-script/compiler/coffee.vim +++ b/sources_non_forked/vim-coffee-script/compiler/coffee.vim @@ -75,8 +75,8 @@ augroup CoffeeUpdateMakePrg " Set autocmd locally if compiler was set locally. if &l:makeprg =~ s:pat - autocmd BufFilePost,BufWritePost call s:UpdateMakePrg() + autocmd BufWritePre,BufFilePost call s:UpdateMakePrg() else - autocmd BufFilePost,BufWritePost call s:UpdateMakePrg() + autocmd BufWritePre,BufFilePost call s:UpdateMakePrg() endif augroup END diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index 51e52d88..d81705e1 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -130,6 +130,12 @@ function! fugitive#extract_git_dir(path) abort let root = s:shellslash(simplify(fnamemodify(a:path, ':p:s?[\/]$??'))) let previous = "" while root !=# previous + if root =~# '\v^//%([^/]+/?)?$' + " This is for accessing network shares from Cygwin Vim. There won't be + " any git directory called //.git or //serverName/.git so let's avoid + " checking for them since such checks are extremely slow. + break + endif let dir = s:sub(root, '[\/]$', '') . '/.git' let type = getftype(dir) if type ==# 'dir' && fugitive#is_git_dir(dir) @@ -163,7 +169,7 @@ function! fugitive#detect(path) endif endif if exists('b:git_dir') - silent doautocmd User Fugitive + silent doautocmd User FugitiveBoot cnoremap fnameescape(recall()) nnoremap y :call setreg(v:register, recall()) let buffer = fugitive#buffer() @@ -176,6 +182,7 @@ function! fugitive#detect(path) call buffer.setvar('&tags', escape(b:git_dir.'/'.&filetype.'.tags', ', ').','.buffer.getvar('&tags')) endif endif + silent doautocmd User Fugitive endif endfunction diff --git a/sources_non_forked/vim-less/README.md b/sources_non_forked/vim-less/README.md index 697ad124..e9d9b5f7 100644 --- a/sources_non_forked/vim-less/README.md +++ b/sources_non_forked/vim-less/README.md @@ -35,7 +35,7 @@ in `after/syntax/css.vim` or `after/syntax/css/*.vim`. ### Map .less to .css , lessc is required. - nnoremap ,m :w !lessc % > %:t:r.css + nnoremap m :w !lessc % > %:t:r.css ## Credits diff --git a/sources_non_forked/vim-less/indent/less.vim b/sources_non_forked/vim-less/indent/less.vim index fea8846d..556c2d08 100644 --- a/sources_non_forked/vim-less/indent/less.vim +++ b/sources_non_forked/vim-less/indent/less.vim @@ -1,11 +1,10 @@ " Vim indent file -" Language: LessCSS -" Maintainer: Leonard Ehrenfried -" Last Change: 2011 Sep 26 +" Language: LessCSS +" Maintainer: Leonard Ehrenfried +" Last Change: 2011 Sep 26 if exists("b:did_indent") finish endif -runtime! indent/css.vim - +runtime! indent/css.vim \ No newline at end of file diff --git a/sources_non_forked/vim-less/syntax/less.vim b/sources_non_forked/vim-less/syntax/less.vim index fa5a247e..44bf470e 100644 --- a/sources_non_forked/vim-less/syntax/less.vim +++ b/sources_non_forked/vim-less/syntax/less.vim @@ -35,7 +35,7 @@ syn match lessClass "[[:alnum:]_-]\+" contained " string functions syn keyword lessFunction escape e % containedin=cssDefinition contained " misc functions -syn keyword lessFunction color unit containedin=cssDefinition contained +syn keyword lessFunction unit containedin=cssDefinition contained " math functions syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained " color definition diff --git a/sources_non_forked/vim-markdown/ftplugin/markdown.vim b/sources_non_forked/vim-markdown/ftplugin/markdown.vim index 022da06e..5d6ebecd 100644 --- a/sources_non_forked/vim-markdown/ftplugin/markdown.vim +++ b/sources_non_forked/vim-markdown/ftplugin/markdown.vim @@ -1,6 +1,7 @@ " Vim filetype plugin " Language: Markdown " Maintainer: Tim Pope +" Last Change: 2013 May 30 if exists("b:did_ftplugin") finish diff --git a/sources_non_forked/vim-markdown/syntax/markdown.vim b/sources_non_forked/vim-markdown/syntax/markdown.vim index 3024f2f7..4ba02b26 100644 --- a/sources_non_forked/vim-markdown/syntax/markdown.vim +++ b/sources_non_forked/vim-markdown/syntax/markdown.vim @@ -2,6 +2,7 @@ " Language: Markdown " Maintainer: Tim Pope " Filenames: *.markdown +" Last Change: 2013 May 30 if exists("b:current_syntax") finish diff --git a/sources_non_forked/vim-snipmate/Contributors.md b/sources_non_forked/vim-snipmate/Contributors.md index 33380c1d..117ea62b 100644 --- a/sources_non_forked/vim-snipmate/Contributors.md +++ b/sources_non_forked/vim-snipmate/Contributors.md @@ -8,6 +8,7 @@ It is currently maintained by [Rok Garbas](rok@garbas.si), [Marc Weber](marco-oweber@gmx.de), and [Adnan Zafar](https://github.com/ajzafar) with additional contributions from: +* [907th](https://github.com/907th) * [alderz](https://github.com/alderz) * [asymmetric](https://github.com/asymmetric) * [bpugh](https://github.com/bpugh) diff --git a/sources_non_forked/vim-snipmate/autoload/snipMate.vim b/sources_non_forked/vim-snipmate/autoload/snipMate.vim index bb3ecdfd..19304995 100644 --- a/sources_non_forked/vim-snipmate/autoload/snipMate.vim +++ b/sources_non_forked/vim-snipmate/autoload/snipMate.vim @@ -706,12 +706,25 @@ fun! s:ChooseSnippet(snippets) return funcref#Call(a:snippets[keys(a:snippets)[idx]]) endf -fun! snipMate#ShowAvailableSnips() - let col = col('.') - let word = matchstr(getline('.'), '\S\+\%'.col.'c') +fun! snipMate#WordBelowCursor() + return matchstr(getline('.'), '\S\+\%' . col('.') . 'c') +endf - let snippets = map(snipMate#GetSnippetsForWordBelowCursor(word, '*', 0),'v:val[0]') - let matches = filter(snippets, "v:val =~# '\\V\\^" . escape(word, '\') . "'") +fun! snipMate#GetSnippetsForWordBelowCursorForComplete(word) + let snippets = map(snipMate#GetSnippetsForWordBelowCursor(a:word, '*', 0), 'v:val[0]') + return filter(snippets, "v:val =~# '\\V\\^" . escape(a:word, '\') . "'") +endf + +fun! snipMate#CanBeTriggered() + let word = snipMate#WordBelowCursor() + let matches = snipMate#GetSnippetsForWordBelowCursorForComplete(word) + return len(matches) > 0 +endf + +fun! snipMate#ShowAvailableSnips() + let col = col('.') + let word = snipMate#WordBelowCursor() + let matches = snipMate#GetSnippetsForWordBelowCursorForComplete(word) " Pretty hacky, but really can't have the tab swallowed! if len(matches) == 0 diff --git a/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets b/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets index 88f71791..cd462fb2 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets @@ -24,6 +24,14 @@ def textmate_var(var, snip): endglobal +snippet % "<% ${0} %>" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` +endsnippet + +snippet = "<%= ${0} %>" +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +endsnippet + ########################################################################### # GENERATED FROM get_tm_snippets.py + REGEX REPLACE # ########################################################################### diff --git a/sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets b/sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets index b5ff0ee3..77f923f6 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets @@ -1,7 +1,7 @@ # sugguestion? report bugs? # go to https://github.com/chrisyue/vim-snippets/issues -snippet contr "symfony2 controller" b +snippet contr "Symfony2 controller" b namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) @@ -25,19 +25,19 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() } endsnippet -snippet act "symfony2 action" b +snippet act "Symfony2 action" b /** * @Route("${3}", name="${4}") * @Method({${5:"POST"}}) + * @Template() */ public function ${1}Action(${2}) { ${6} - return $this->redirect($this->generateUrl('home', [], false)); } endsnippet -snippet actt "symfony2 action and template" b +snippet actt "Symfony2 action and template" b /** * @Route("${3}", name="${4}") * @Method({${5:"GET"}}) @@ -51,7 +51,7 @@ public function ${1}Action(${2}) abspath = os.path.abspath(path)` endsnippet -snippet comm "symfony2 command" b +snippet comm "Symfony2 command" b namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) @@ -74,14 +74,12 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() { protected function configure() { - $this - ->setName('${1}') + $this->setName('${1}') ->setDescription('${2}') ->setDefinition([ new InputArgument('', InputArgument::REQUIRED, ''), new InputOption('', null, InputOption::VALUE_NONE, ''), - ]) - ; + ]); } protected function execute(InputInterface $input, OutputInterface $output) @@ -90,7 +88,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() } endsnippet -snippet subs "symfony2 subscriber" b +snippet subs "Symfony2 subscriber" b namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) @@ -121,7 +119,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() } endsnippet -snippet transf "symfony2 form data transformer" b +snippet transf "Symfony2 form data transformer" b namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) @@ -155,7 +153,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() } endsnippet -snippet ent "symfony2 doctrine entity" b +snippet ent "Symfony2 doctrine entity" b namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) @@ -192,7 +190,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() } endsnippet -snippet form "symfony2 form type" b +snippet form "Symfony2 form type" b namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) @@ -235,3 +233,27 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() } } endsnippet + +snippet ev "Symfony2 event" b +namespace `!p +abspath = os.path.abspath(path) +m = re.search(r'[A-Z].+(?=/)', abspath) +if m: + snip.rv = m.group().replace('/', '\\') +`; + +use Symfony\Component\EventDispatcher\Event; + +/** + * ${2:@author `whoami`} + */ +class `!p +snip.rv = re.match(r'.*(?=\.)', fn).group() +` extends Event +{ +} +endsnippet + +snippet redir "Symfony2 redirect" +$this->redirect($this->generateUrl('${1}', ${2})); +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/twig.snippets b/sources_non_forked/vim-snippets/UltiSnips/twig.snippets new file mode 100644 index 00000000..9db43f7d --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/twig.snippets @@ -0,0 +1,33 @@ +snippet bl "twig block" b +{% block ${1} %} +${2} +{% endblock $1 %} +endsnippet + +snippet js "twig javascripts" b +{% javascripts '${1}' %} + +{% endjavascripts %} +endsnippet + +snippet css "twig stylesheets" b +{% stylesheets '${1}' %} + +{% endstylesheets %} +endsnippet + +snippet if "twig if" b +{% if ${1} %} +${2} +{% endif %} +endsnippet + +snippet for "twig for" b +{% for ${1} in ${2} %} +${3} +{% endfor %} +endsnippet + +snippet ext "twig extends" b +{% extends ${1} %} +endsnippet diff --git a/sources_non_forked/vim-snippets/snippets/php.snippets b/sources_non_forked/vim-snippets/snippets/php.snippets index 1793d41c..d7b21eb5 100644 --- a/sources_non_forked/vim-snippets/snippets/php.snippets +++ b/sources_non_forked/vim-snippets/snippets/php.snippets @@ -557,3 +557,44 @@ snippet CSVIterator snippet is isset($1{VISUAL}) + +# phpunit +snippet ase + $this->assertEquals(${1:expected}, ${2:actual}); + +snippet asne + $this->assertNotEquals(${1:expected}, ${2:actual}); + +snippet asf + $this->assertFalse(${1:Something}); + +snippet ast + $this->assertTrue(${1:Something}); + +snippet asfex + $this->assertFileExists(${1:path/to/file}); + +snippet asfnex + $this->assertFileNotExists(${1:path/to/file}); + +snippet ascon + $this->assertContains(${1:Search Value}, ${2:Array or Iterator}); + +snippet ashk + $this->assertArrayHasKey(${1:key}, ${2:array}); + +snippet asnhk + this->assertArrayNotHasKey(${1:value}, ${2:array}); + +snippet ascha + $this->assertClassHasAttribute('${1:Attribute Name}', '${2:ClassName}'); + +snippet asi + $this->assertInstanceOf(${1:expected}, ${2:actual}); + +snippet tc + public function test${1:name_of_the_test}() + { + ${0:code} + } + diff --git a/sources_non_forked/vim-snippets/snippets/puppet.snippets b/sources_non_forked/vim-snippets/snippets/puppet.snippets index d35608dd..2e451e41 100644 --- a/sources_non_forked/vim-snippets/snippets/puppet.snippets +++ b/sources_non_forked/vim-snippets/snippets/puppet.snippets @@ -223,14 +223,22 @@ snippet define } snippet service - service{ "${1:service}": - enable => ${2:true}, - ensure => ${0:running}, - hasstatus => true, + service { '${1:service}' : + ensure => running, + enable => true, + require => [ Package['${2:package}'], File['${3:file}'], ], + subscribe => [ File['${4:configfile1}'], File['${5:configfile2}'], Package['${6:package}'], ] } snippet file - file{ "${1:path}": - ${2} => ${0} + file { '${1:filename}' : + ensure => ${2:present}, + owner => '${3:root}', + group => '${4:root}', + mode => '${5:0644}', + source => 'puppet:///modules/${6:module}/${7:source}', + content => template('/etc/puppet/templates/${8:template}'), + alias => '${9:alias}', + require => [ Package['${10:package}'], File['${11:file}'], ], } diff --git a/sources_non_forked/vim-snippets/snippets/ruby.snippets b/sources_non_forked/vim-snippets/snippets/ruby.snippets index 278c3615..551b313f 100644 --- a/sources_non_forked/vim-snippets/snippets/ruby.snippets +++ b/sources_non_forked/vim-snippets/snippets/ruby.snippets @@ -174,7 +174,7 @@ snippet ana accepts_nested_attributes_for :${0:association} # ivc == instance variable cache snippet ivc - @${1:variable_name} ||= ${0:chached_value} + @${1:variable_name} ||= ${0:cached_value} # include Enumerable snippet Enum include Enumerable diff --git a/sources_non_forked/vim-snippets/snippets/slim.snippets b/sources_non_forked/vim-snippets/snippets/slim.snippets new file mode 100644 index 00000000..8eeb4a53 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/slim.snippets @@ -0,0 +1,64 @@ +# Some useful Unicode entities +# ============================ +# Non-Breaking Space +snippet nbs +   +# ← +snippet left + ← +# → +snippet right + → +# ↑ +snippet up + ↑ +# ↓ +snippet down + ↓ +# ↩ +snippet return + ↩ +# ⇤ +snippet backtab + ⇤ +# ⇥ +snippet tab + ⇥ +# ⇧ +snippet shift + ⇧ +# ⌃ +snippet ctrl + ⌃ +# ⌅ +snippet enter + ⌅ +# ⌘ +snippet cmd + ⌘ +# ⌥ +snippet option + ⌥ +# ⌦ +snippet delete + ⌦ +# ⌫ +snippet backspace + ⌫ +# ⎋ +snippet esc + ⎋ + +# Forms +# ===== +snippet fieldset + fieldset + legend ${1} + +# Assets +# ====== +snippet css + link rel="stylesheet" href="${1:style.css}" type="text/css" media="${2:all}" + +snippet script + script src="${1:script.js}" type="text/javascript" diff --git a/vimrcs/extended.vim b/vimrcs/extended.vim index 6373d424..026c399a 100644 --- a/vimrcs/extended.vim +++ b/vimrcs/extended.vim @@ -14,11 +14,11 @@ colorscheme peaksea " Set font according to system if has("mac") || has("macunix") - set gfn=Menlo:h15 + set gfn=Source\ Code\ Pro:h15,Menlo:h15 elseif has("win16") || has("win32") - set gfn=Bitstream\ Vera\ Sans\ Mono:h11 + set gfn=Source\ Code\ Pro:h12,Bitstream\ Vera\ Sans\ Mono:h11 elseif has("linux") - set gfn=Monospace\ 11 + set gfn=Source\ Code\ Pro:h12,Monospace\ 11 endif " Open MacVim in fullscreen mode diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index b9cd642f..98af813a 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -105,3 +105,8 @@ au FileType mako vmap Si S"i${ _(2f"a) } " => vim-airline config (force color) """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:airline_theme="luna" + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Vimroom +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +nnoremap vv :VimroomToggle From 6bce69df95036d799bbebeb62df0f1e11cd06639 Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 28 Dec 2013 21:17:09 +0000 Subject: [PATCH 04/37] Added vim-zenroom: Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room --- README.md | 4 + .../vim-zenroom/LICENSE.markdown | 12 + .../vim-zenroom/README.markdown | 20 + sources_non_forked/vim-zenroom/doc/tags | 12 + .../vim-zenroom/doc/vimroom.txt | 86 +++++ .../vim-zenroom/plugin/vimroom.vim | 355 ++++++++++++++++++ update_plugins.py | 1 + vimrcs/plugins_config.vim | 2 +- 8 files changed, 491 insertions(+), 1 deletion(-) create mode 100644 sources_non_forked/vim-zenroom/LICENSE.markdown create mode 100644 sources_non_forked/vim-zenroom/README.markdown create mode 100644 sources_non_forked/vim-zenroom/doc/tags create mode 100644 sources_non_forked/vim-zenroom/doc/vimroom.txt create mode 100644 sources_non_forked/vim-zenroom/plugin/vimroom.vim diff --git a/README.md b/README.md index 775bc586..8435ef0d 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,8 @@ I recommend reading the docs of these plugins to understand them better. Each of * [vim-expand-region](https://github.com/terryma/vim-expand-region): Allows you to visually select increasingly larger regions of text using the same key combination. * [vim-airline](https://github.com/bling/vim-airline): Lean & mean status/tabline for vim that's light as air (replacing powerline) * [vim-fugitive](https://github.com/tpope/vim-fugitive): A Git wrapper so awesome, it should be illegal +* [vim-zenroom](https://github.com/amix/vim-zenroom): +Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential) ## What color schemes are included? @@ -311,3 +313,5 @@ Vimscript mappings: * [Vim 7.3: Persistent undo and encryption!](http://amix.dk/blog/post/19548#Vim-7-3-Persistent-undo-and-encryption) * [Vim tips: Visual Search](http://amix.dk/blog/post/19334#Vim-tips-Visual-Search) * [Folding in Vim](http://amix.dk/blog/post/19132#Folding-in-Vim) +* [ +Zen room for Vim: Focsuing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential) diff --git a/sources_non_forked/vim-zenroom/LICENSE.markdown b/sources_non_forked/vim-zenroom/LICENSE.markdown new file mode 100644 index 00000000..36603def --- /dev/null +++ b/sources_non_forked/vim-zenroom/LICENSE.markdown @@ -0,0 +1,12 @@ +Copyright (c) 2010 Mike West, http://mikewest.org/ +All rights reserved. + +Redistribution and use 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 the software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +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 HOLDER 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. diff --git a/sources_non_forked/vim-zenroom/README.markdown b/sources_non_forked/vim-zenroom/README.markdown new file mode 100644 index 00000000..238f1c9d --- /dev/null +++ b/sources_non_forked/vim-zenroom/README.markdown @@ -0,0 +1,20 @@ +This is my fork of Vimroom which includes following: + +* A special mode for editing Markdown and reStructuredText. It's highly inspired by [iA Writer](http://writer.pro/) +* Optimizations for [my vimrc](https://github.com/amix/vimrc) + +Pelase read more here [ +zenroom for Vim: Focsuing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential). + + +## Editing code + +![Screenshot 1](http://amix.dk/uploads/zenroom_code.jpg) + +![Screenshot 2](http://amix.dk/uploads/zenroom_code_1.jpg) + +## Updating documentation + +![Screenshot 3](http://amix.dk/uploads/zenroom_documentation.jpg) + +![Screenshot 4](http://amix.dk/uploads/zenroom_documentation_1.jpg) diff --git a/sources_non_forked/vim-zenroom/doc/tags b/sources_non_forked/vim-zenroom/doc/tags new file mode 100644 index 00000000..1773f538 --- /dev/null +++ b/sources_non_forked/vim-zenroom/doc/tags @@ -0,0 +1,12 @@ +g:vimroom_background vimroom.txt /*g:vimroom_background* +g:vimroom_min_sidebar_width vimroom.txt /*g:vimroom_min_sidebar_width* +g:vimroom_navigational_keys vimroom.txt /*g:vimroom_navigational_keys* +g:vimroom_scrolloff vimroom.txt /*g:vimroom_scrolloff* +g:vimroom_sidebar_height vimroom.txt /*g:vimroom_sidebar_height* +g:vimroom_width vimroom.txt /*g:vimroom_width* +vimroom vimroom.txt /*vimroom* +vimroom-about vimroom.txt /*vimroom-about* +vimroom-configuration vimroom.txt /*vimroom-configuration* +vimroom-installation vimroom.txt /*vimroom-installation* +vimroom-toc vimroom.txt /*vimroom-toc* +vimroom.txt vimroom.txt /*vimroom.txt* diff --git a/sources_non_forked/vim-zenroom/doc/vimroom.txt b/sources_non_forked/vim-zenroom/doc/vimroom.txt new file mode 100644 index 00000000..0522ea75 --- /dev/null +++ b/sources_non_forked/vim-zenroom/doc/vimroom.txt @@ -0,0 +1,86 @@ +*vimroom.txt* + +============================================================================== +TABLE OF CONTENTS *vimroom* *vimroom-toc* + + 1. About |vimroom-about| + 2. Installation |vimroom-installation| + 3. Configuration |vimroom-configuration| + +============================================================================== +ABOUT *vimroom-about* + +I do most of my writing in Vim, because I’m a big nerd. It does most of what +I want a writing environment to do, but I miss some of the “distraction free" +features of the quite exceptional WriteRoom. Fullscreening Vim means that text +ends up flat up against the left side of my monitor, but I’d much prefer it to +be centered. I’d also like a little of the visual clutter to fade away. Some +of this is possible with MacVim, but I’d rather do as much as possible in +a platform-independent way. So, command-line Vim it is. + +For more visit: + http://projects.mikewest.org/vimroom/ + https://github.com/mikewest/vimroom + +============================================================================== +INSTALLATION *vimroom-installation* + +I think the best way to install Vim plugins is via Tim Pope’s Pathogen. Using +that plugin, you can simply clone the VimRoom repository into your bundles +directory, and you’re done. + +Without Pathogen, installation is almost as trivial: simply copy +./plugins/vimroom.vim from the repository into your plugins directory. That’s +it! + +============================================================================== +CONFIGURATION *vimroom-configuration* + +By default, VimRoom binds V to VimroomToggle, and sets up an 80 +column workspace with at least 5 columns of space on either side (it doesn’t +help at all to have single-column sidebars, you see), and 3 lines of space +above and below. It assumes a black background when hiding visual +distractions. As of v0.4, VimRoom also sets up a :VimroomToggle command that +has the same effect. + +Changing any of these assumptions is a simple matter of setting variables in +your .vimrc. + + *g:vimroom_background* +is the background color to be used for hiding elements. Set this to your +terminal’s background color (“white”, “black”, etc.) + + *g:vimroom_min_sidebar_width* +is the minimum sidebar width. This will automatically expand to take up all +the free space left after setting the main workspace window to g:vimroom_width +pcolumns. + + *g:vimroom_navigational_keys* +determines whether Vimroom will map keys like , , j, and k to +navigate over “display” lines, rather than “logical” lines. This defaults to +p1 (on), if you’d prefer the mapping not take place, set it to 0 (off). + + *g:vimroom_scrolloff* +specifies how many lines of text ought appear before and after the cursor. +pThis defaults to 999, which centers the cursor on the screen. + + *g:vimroom_sidebar_height* +sets the height of the upper and lower “sidebars.” If you don’t want vertical +padding, set this to 0. + + *g:vimroom_width* +is the width of your workspace. + + +You can bind the VimroomToggle function to any key combination you like +via the usual mechanisms. For example:: +> + nnoremap mz VimroomToggle +<> + +Would bind the function to mz. Trivial, right? + +And that’s it! + +============================================================================== +vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl: diff --git a/sources_non_forked/vim-zenroom/plugin/vimroom.vim b/sources_non_forked/vim-zenroom/plugin/vimroom.vim new file mode 100644 index 00000000..9993ed34 --- /dev/null +++ b/sources_non_forked/vim-zenroom/plugin/vimroom.vim @@ -0,0 +1,355 @@ +"============================================================================== +"File: vimroom.vim +"Description: Vaguely emulates a writeroom-like environment in Vim by +" splitting the current window in such a way as to center a column +" of user-specified width, wrap the text, and break lines. +"Maintainer: Mike West +"Version: 0.7 +"Last Change: 2010-10-31 +"License: BSD <../LICENSE.markdown> +"============================================================================== + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugin Configuration +" + +" The typical start to any vim plugin: If the plugin has already been loaded, +" exit as quickly as possible. +if exists( "g:loaded_vimroom_plugin" ) + finish +endif +let g:loaded_vimroom_plugin = 1 + +" The desired column width. Defaults to 100: +if !exists( "g:vimroom_width" ) + let g:vimroom_width = 100 +endif + +" The minimum sidebar size. Defaults to 5: +if !exists( "g:vimroom_min_sidebar_width" ) + let g:vimroom_min_sidebar_width = 5 +endif + +" The sidebar height. Defaults to 3: +if !exists( "g:vimroom_sidebar_height" ) + let g:vimroom_sidebar_height = 2 +endif + +" The GUI background color. Defaults to "black" +if !exists( "g:vimroom_guibackground" ) + let g:vimroom_guibackground = "#202020" +endif + +" The cterm background color. Defaults to "bg" +if !exists( "g:vimroom_ctermbackground" ) + let g:vimroom_ctermbackground = "bg" +endif + +" The "scrolloff" value: how many lines should be kept visible above and below +" the cursor at all times? Defaults to 999 (which centers your cursor in the +" active window). +if !exists( "g:vimroom_scrolloff" ) + let g:vimroom_scrolloff = 0 +endif + +" Should Vimroom map navigational keys (``, ``, `j`, `k`) to navigate +" "display" lines instead of "logical" lines (which makes it much simpler to deal +" with wrapped lines). Defaults to `1` (on). Set to `0` if you'd prefer not to +" run the mappings. +if !exists( "g:vimroom_navigation_keys" ) + let g:vimroom_navigation_keys = 1 +endif + +" Should Vimroom clear line numbers from the Vimroomed buffer? Defaults to `1` +" (on). Set to `0` if you'd prefer Vimroom to leave line numbers untouched. +" (Note that setting this to `0` will not turn line numbers on if they aren't +" on already). +if !exists( "g:vimroom_clear_line_numbers" ) + let g:vimroom_clear_line_numbers = 1 +endif + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugin Code +" + +" Given the desired column width, and minimum sidebar width, determine +" the minimum window width necessary for splitting to make sense +let s:minwidth = g:vimroom_width + ( g:vimroom_min_sidebar_width * 2 ) + +" Save the current color scheme for reset later +let s:scheme = "" +if exists( "g:colors_name" ) + let s:scheme = g:colors_name +endif +if exists( "&t_mr" ) + let s:save_t_mr = &t_mr +end + +" Save the current scrolloff value for reset later +let s:save_scrolloff = "" +if exists( "&scrolloff" ) + let s:save_scrolloff = &scrolloff +end + +" Save the current `laststatus` value for reset later +let s:save_laststatus = "" +if exists( "&laststatus" ) + let s:save_laststatus = &laststatus +endif + +" Save the current `background` value for reset later +let s:save_background = "" +if exists( "&background" ) + let s:save_background = &background +endif + +" Save the current `textwidth'` value for reset later +let s:save_textwidth' = "" +if exists( "&textwidth'" ) + let s:save_textwidth' = &textwidth' +endif + +" Save the current `showtabline` value for reset later +let s:save_showtabline = "" +if exists( "&showtabline" ) + let s:save_showtabline = &showtabline +endif + +" Save the current `textwidth` value for reset later +let s:save_textwidth = "" +if exists( "&textwidth" ) + let s:save_textwidth = &textwidth +endif + +" Save the current `number` and `relativenumber` values for reset later +let s:save_number = 0 +let s:save_relativenumber = 0 +if exists( "&number" ) + let s:save_number = &number +endif +if exists ( "&relativenumber" ) + let s:save_relativenumber = &relativenumber +endif + +" We're currently in nonvimroomized state +let s:active = 0 + +function! s:is_the_screen_wide_enough() + return winwidth( winnr() ) >= s:minwidth +endfunction + +function! s:sidebar_size() + return ( winwidth( winnr() ) - g:vimroom_width - 2 ) / 2 +endfunction + +function! s:markdown_room() + set background=light + set linespace=8 + set textwidth=80 + hi Normal guibg=gray95 + hi NonText guifg=gray95 + hi FoldColumn guibg=gray95 + hi CursorLine guibg=gray90 + hi Title gui=bold guifg=gray25 + hi MarkdownHeadingDelimiter gui=bold guifg=gray25 + hi htmlSpecialChar guifg=black + hi markdownError guifg=black + hi markdownBold gui=bold guifg=gray25 + hi markdownItalic guifg=gray25 gui=underline + hi markdownUrl guifg=#2fb3a6 + hi markdownAutomaticLink guifg=#2fb3a6 + hi markdownLinkText guifg=#317849 + hi markdownUrlTitle guifg=#317849 + hi markdownBlockquote guifg=#317849 gui=bold + hi markdownId guifg=#2fb3a6 + hi markdownIdDeclaration guifg=#317849 gui=bold + hi markdownListMarker guifg=#317849 + hi Cursor guibg=#15abdd + + if has('gui_running') + let l:highlightbgcolor = "guibg=#f2f2f2" + let l:highlightfgbgcolor = "guifg=#f2f2f2" . " " . l:highlightbgcolor + else + let l:highlightbgcolor = "ctermbg=" . g:vimroom_ctermbackground + let l:highlightfgbgcolor = "ctermfg=" . g:vimroom_ctermbackground . " " . l:highlightbgcolor + endif + + exec( "hi Normal " . l:highlightbgcolor ) + exec( "hi VertSplit " . l:highlightfgbgcolor ) + exec( "hi NonText " . l:highlightfgbgcolor ) + exec( "hi StatusLine " . l:highlightfgbgcolor ) + exec( "hi StatusLineNC " . l:highlightfgbgcolor ) +endfunction + +function! VimroomToggle() + if s:active == 1 + let s:active = 0 + " Close all other split windows + if g:vimroom_sidebar_height + wincmd j + close + wincmd k + close + endif + if g:vimroom_min_sidebar_width + wincmd l + close + wincmd h + close + endif + " Reset color scheme (or clear new colors, if no scheme is set) + if s:scheme != "" + exec( "colorscheme " . s:scheme ) + else + hi clear + endif + if s:save_t_mr != "" + exec( "set t_mr=" .s:save_t_mr ) + endif + " Reset `scrolloff` and `laststatus` + if s:save_scrolloff != "" + exec( "set scrolloff=" . s:save_scrolloff ) + endif + if s:save_laststatus != "" + exec( "set laststatus=" . s:save_laststatus ) + endif + if s:save_showtabline != "" + exec( "set showtabline=" . s:save_showtabline ) + endif + + exec( "set linespace=0" ) + + if s:save_background != "" + exec( "set background=" . s:save_background ) + endif + if s:save_textwidth != "" + exec( "set textwidth=" . s:save_textwidth ) + endif + if s:save_number != 0 + set number + endif + if s:save_relativenumber != 0 + set relativenumber + endif + " Remove wrapping and linebreaks + set nowrap + set nolinebreak + + " Enable AirLine + exec("silent AirlineToggle") + exec("silent AirlineRefresh") + else + if s:is_the_screen_wide_enough() + let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" + + if is_mark_or_rst + call s:markdown_room() + endif + + " Disable AirLine + exec("silent AirlineToggle") + + let s:active = 1 + let s:sidebar = s:sidebar_size() + + " Turn off status bar + if s:save_laststatus != "" + setlocal laststatus=0 + endif + " Turn off tabline + if s:save_showtabline != "" + setlocal showtabline=0 + endif + if g:vimroom_min_sidebar_width + " Create the left sidebar + exec( "silent leftabove " . s:sidebar . "vsplit new" ) + setlocal noma + setlocal nocursorline + setlocal nonumber + silent! setlocal norelativenumber + wincmd l + " Create the right sidebar + exec( "silent rightbelow " . s:sidebar . "vsplit new" ) + setlocal noma + setlocal nocursorline + setlocal nonumber + silent! setlocal norelativenumber + wincmd h + exec( "silent vertical resize " . g:vimroom_width ) + endif + if g:vimroom_sidebar_height + " Create the top sidebar + exec( "silent leftabove " . g:vimroom_sidebar_height . "split new" ) + setlocal noma + setlocal nocursorline + setlocal nonumber + silent! setlocal norelativenumber + wincmd j + " Create the bottom sidebar + exec( "silent rightbelow " . g:vimroom_sidebar_height . "split new" ) + setlocal noma + setlocal nocursorline + setlocal nonumber + silent! setlocal norelativenumber + wincmd k + endif + " Setup wrapping, line breaking, and push the cursor down + set wrap + set linebreak + if g:vimroom_clear_line_numbers + set nonumber + silent! set norelativenumber + endif + if s:save_textwidth != "" + exec( "set textwidth=".g:vimroom_width ) + endif + if s:save_scrolloff != "" + exec( "set scrolloff=".g:vimroom_scrolloff ) + endif + + " Setup navigation over "display lines", not "logical lines" if + " mappings for the navigation keys don't already exist. + if g:vimroom_navigation_keys + try + noremap g + noremap g + noremap k gk + noremap j gj + inoremap g + inoremap g + catch /E227:/ + echo "Navigational key mappings already exist." + endtry + endif + + " Hide distracting visual elements + if !is_mark_or_rst + if has('gui_running') + let l:highlightbgcolor = "guibg=" . g:vimroom_guibackground + let l:highlightfgbgcolor = "guifg=" . g:vimroom_guibackground . " " . l:highlightbgcolor + else + let l:highlightbgcolor = "ctermbg=" . g:vimroom_ctermbackground + let l:highlightfgbgcolor = "ctermfg=" . g:vimroom_ctermbackground . " " . l:highlightbgcolor + endif + exec( "hi Normal " . l:highlightbgcolor ) + exec( "hi VertSplit " . l:highlightfgbgcolor ) + exec( "hi NonText " . l:highlightfgbgcolor ) + exec( "hi StatusLine " . l:highlightfgbgcolor ) + exec( "hi StatusLineNC " . l:highlightfgbgcolor ) + endif + set t_mr="" + set fillchars+=vert:\ + endif + endif +endfunction + +" Create a mapping for the `VimroomToggle` function +noremap VimroomToggle :call VimroomToggle() + +" Create a `VimroomToggle` command: +command -nargs=0 VimroomToggle call VimroomToggle() + +" If no mapping exists, map it to `V`. +if !hasmapto( 'VimroomToggle' ) + nmap V VimroomToggle +endif diff --git a/update_plugins.py b/update_plugins.py index 9931b378..13a0ecb0 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -33,6 +33,7 @@ vim-expand-region https://github.com/terryma/vim-expand-region vim-multiple-cursors https://github.com/terryma/vim-multiple-cursors vim-fugitive https://github.com/tpope/vim-fugitive vim-airline https://github.com/bling/vim-airline +vim-zenroom https://github.com/amix/vim-zenroom """.strip() GITHUB_ZIP = '%s/archive/master.zip' diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index 98af813a..cd4a8d0c 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -109,4 +109,4 @@ let g:airline_theme="luna" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vimroom """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -nnoremap vv :VimroomToggle +nnoremap z :VimroomToggle From 07bb3859a034112db6e838667861fec32c73d09f Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 28 Dec 2013 21:20:33 +0000 Subject: [PATCH 05/37] Updated vim-zenroom --- sources_non_forked/vim-zenroom/plugin/vimroom.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources_non_forked/vim-zenroom/plugin/vimroom.vim b/sources_non_forked/vim-zenroom/plugin/vimroom.vim index 9993ed34..6f55d9f6 100644 --- a/sources_non_forked/vim-zenroom/plugin/vimroom.vim +++ b/sources_non_forked/vim-zenroom/plugin/vimroom.vim @@ -104,7 +104,7 @@ if exists( "&background" ) endif " Save the current `textwidth'` value for reset later -let s:save_textwidth' = "" +let s:save_textwidth = "" if exists( "&textwidth'" ) let s:save_textwidth' = &textwidth' endif From 206b1566045fd005a297311e3bb42292edcf2d89 Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 28 Dec 2013 21:29:23 +0000 Subject: [PATCH 06/37] Promote SOurce Code Pro --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 010ce827..54e9d7ef 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ The awesome version includes a lot of great plugins, configurations and color sc git clone git://github.com/amix/vimrc.git ~/.vim_runtime sh ~/.vim_runtime/install_awesome_vimrc.sh +I also recommend using [Source Code Pro font from Adobe](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960) (it's free and awesome font for writing and programming). ## How to install on Windows? From aff839450f5971d4f761dfa3e1c8a3b1fb0b013f Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 28 Dec 2013 21:30:06 +0000 Subject: [PATCH 07/37] . --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 54e9d7ef..24a00151 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The awesome version includes a lot of great plugins, configurations and color sc git clone git://github.com/amix/vimrc.git ~/.vim_runtime sh ~/.vim_runtime/install_awesome_vimrc.sh -I also recommend using [Source Code Pro font from Adobe](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960) (it's free and awesome font for writing and programming). +I also recommend using [Source Code Pro font from Adobe](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960) (it's free and awesome font for writing and programming). The Awesome vimrc is already setup to try to use it ## How to install on Windows? From 3985889bc649061d4adc83fd653407dce2826275 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 09:38:25 +0000 Subject: [PATCH 08/37] Fixed a typo. Added the shotcut for vim-zenroom. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 24a00151..b75a080d 100644 --- a/README.md +++ b/README.md @@ -304,6 +304,9 @@ Vimscript mappings: map n :cn map p :cp +### vim-zenroom +vim-zenroom (my fork of [vimroom](https://github.com/mikewest/vimroom)) lets you only focus on one thing at a time. It removes all the distractions and centers the content. You can open it by typing: +`z` ## Useful blog tips regarding my Vim setup @@ -315,4 +318,4 @@ Vimscript mappings: * [Vim tips: Visual Search](http://amix.dk/blog/post/19334#Vim-tips-Visual-Search) * [Folding in Vim](http://amix.dk/blog/post/19132#Folding-in-Vim) * [ -Zen room for Vim: Focsuing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential) +Zen room for Vim: Focusing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential) From c3fdf943a181f76144ff7d8aa086c92f897e38a8 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 09:42:02 +0000 Subject: [PATCH 09/37] Move into right section (documentation of zenroom) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b75a080d..b1725623 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,10 @@ Managing the [NERD Tree](https://github.com/scrooloose/nerdtree) plugin: map nb :NERDTreeFromBookmark map nf :NERDTreeFind +[vim-zenroom](https://github.com/mikewest/vimroom) (my fork of [vimroom](https://github.com/mikewest/vimroom)) lets you only focus on one thing at a time. It removes all the distractions and centers the content. It only has one mapping. + + map z :VimroomToggle + ### Normal mode mappings Fast saving of a buffer: @@ -304,10 +308,6 @@ Vimscript mappings: map n :cn map p :cp -### vim-zenroom -vim-zenroom (my fork of [vimroom](https://github.com/mikewest/vimroom)) lets you only focus on one thing at a time. It removes all the distractions and centers the content. You can open it by typing: -`z` - ## Useful blog tips regarding my Vim setup * [Vim: Annotate strings with gettext (the macro way)](http://amix.dk/blog/post/19678#Vim-Annotate-strings-with-gettext-the-macro-way) From 7654d5264cf7796b475dad506983d1709c6f5147 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 10:37:14 +0000 Subject: [PATCH 10/37] Added goyo.vim and vim-zenroom2 --- README.md | 8 +- sources_non_forked/bufexplorer/doc/tags | 24 -- sources_non_forked/goyo.vim | 1 + sources_non_forked/taglist.vim/doc/tags | 62 --- .../vim-airline/doc/airline.txt | 2 +- sources_non_forked/vim-expand-region/doc/tags | 10 - .../vim-multiple-cursors/doc/tags | 21 -- .../vim-zenroom/LICENSE.markdown | 12 - .../vim-zenroom/README.markdown | 20 - sources_non_forked/vim-zenroom/doc/tags | 12 - .../vim-zenroom/doc/vimroom.txt | 86 ----- .../vim-zenroom/plugin/vimroom.vim | 355 ------------------ .../vim-zenroom2/README.markdown | 20 + .../vim-zenroom2/plugin/zenroom2.vim | 95 +++++ update_plugins.py | 2 +- vimrcs/plugins_config.vim | 3 +- 16 files changed, 124 insertions(+), 609 deletions(-) delete mode 100644 sources_non_forked/bufexplorer/doc/tags create mode 160000 sources_non_forked/goyo.vim delete mode 100644 sources_non_forked/taglist.vim/doc/tags delete mode 100644 sources_non_forked/vim-expand-region/doc/tags delete mode 100644 sources_non_forked/vim-multiple-cursors/doc/tags delete mode 100644 sources_non_forked/vim-zenroom/LICENSE.markdown delete mode 100644 sources_non_forked/vim-zenroom/README.markdown delete mode 100644 sources_non_forked/vim-zenroom/doc/tags delete mode 100644 sources_non_forked/vim-zenroom/doc/vimroom.txt delete mode 100644 sources_non_forked/vim-zenroom/plugin/vimroom.vim create mode 100644 sources_non_forked/vim-zenroom2/README.markdown create mode 100644 sources_non_forked/vim-zenroom2/plugin/zenroom2.vim diff --git a/README.md b/README.md index b1725623..a8a8e143 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ I recommend reading the docs of these plugins to understand them better. Each of * [vim-expand-region](https://github.com/terryma/vim-expand-region): Allows you to visually select increasingly larger regions of text using the same key combination. * [vim-airline](https://github.com/bling/vim-airline): Lean & mean status/tabline for vim that's light as air (replacing powerline) * [vim-fugitive](https://github.com/tpope/vim-fugitive): A Git wrapper so awesome, it should be illegal -* [vim-zenroom](https://github.com/amix/vim-zenroom): -Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential) +* [goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2): +Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744) ## What color schemes are included? @@ -139,9 +139,9 @@ Managing the [NERD Tree](https://github.com/scrooloose/nerdtree) plugin: map nb :NERDTreeFromBookmark map nf :NERDTreeFind -[vim-zenroom](https://github.com/mikewest/vimroom) (my fork of [vimroom](https://github.com/mikewest/vimroom)) lets you only focus on one thing at a time. It removes all the distractions and centers the content. It only has one mapping. +[goyo.vim](https://github.com/junegunn/goyo.vim) and [vim-zenroom2](https://github.com/amix/vim-zenroom2) lets you only focus on one thing at a time. It removes all the distractions and centers the content. It has a special look when editing Markdown, reStructuredText and textfiles. It only has one mapping. - map z :VimroomToggle + map z :Goyo ### Normal mode mappings diff --git a/sources_non_forked/bufexplorer/doc/tags b/sources_non_forked/bufexplorer/doc/tags deleted file mode 100644 index 5432bc98..00000000 --- a/sources_non_forked/bufexplorer/doc/tags +++ /dev/null @@ -1,24 +0,0 @@ -bufexplorer bufexplorer.txt /*bufexplorer* -bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog* -bufexplorer-credits bufexplorer.txt /*bufexplorer-credits* -bufexplorer-customization bufexplorer.txt /*bufexplorer-customization* -bufexplorer-installation bufexplorer.txt /*bufexplorer-installation* -bufexplorer-todo bufexplorer.txt /*bufexplorer-todo* -bufexplorer-usage bufexplorer.txt /*bufexplorer-usage* -bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout* -bufexplorer.txt bufexplorer.txt /*bufexplorer.txt* -buffer-explorer bufexplorer.txt /*buffer-explorer* -g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin* -g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp* -g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp* -g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive* -g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef* -g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort* -g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories* -g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath* -g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer* -g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted* -g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy* -g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow* -g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName* -g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight* diff --git a/sources_non_forked/goyo.vim b/sources_non_forked/goyo.vim new file mode 160000 index 00000000..6011742c --- /dev/null +++ b/sources_non_forked/goyo.vim @@ -0,0 +1 @@ +Subproject commit 6011742c2993315b3489e20d89d730917b8e2548 diff --git a/sources_non_forked/taglist.vim/doc/tags b/sources_non_forked/taglist.vim/doc/tags deleted file mode 100644 index 83e80ba1..00000000 --- a/sources_non_forked/taglist.vim/doc/tags +++ /dev/null @@ -1,62 +0,0 @@ -'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'* -'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'* -'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'* -'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'* -'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'* -'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'* -'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'* -'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'* -'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'* -'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'* -'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'* -'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'* -'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'* -'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'* -'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'* -'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'* -'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'* -'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'* -'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'* -'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'* -'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'* -'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'* -'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'* -'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'* -'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'* -:TlistAddFiles taglist.txt /*:TlistAddFiles* -:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive* -:TlistClose taglist.txt /*:TlistClose* -:TlistDebug taglist.txt /*:TlistDebug* -:TlistHighlightTag taglist.txt /*:TlistHighlightTag* -:TlistLock taglist.txt /*:TlistLock* -:TlistMessages taglist.txt /*:TlistMessages* -:TlistOpen taglist.txt /*:TlistOpen* -:TlistSessionLoad taglist.txt /*:TlistSessionLoad* -:TlistSessionSave taglist.txt /*:TlistSessionSave* -:TlistShowPrototype taglist.txt /*:TlistShowPrototype* -:TlistShowTag taglist.txt /*:TlistShowTag* -:TlistToggle taglist.txt /*:TlistToggle* -:TlistUndebug taglist.txt /*:TlistUndebug* -:TlistUnlock taglist.txt /*:TlistUnlock* -:TlistUpdate taglist.txt /*:TlistUpdate* -Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()* -Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()* -Tlist_Set_App() taglist.txt /*Tlist_Set_App()* -Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()* -taglist-commands taglist.txt /*taglist-commands* -taglist-debug taglist.txt /*taglist-debug* -taglist-extend taglist.txt /*taglist-extend* -taglist-faq taglist.txt /*taglist-faq* -taglist-functions taglist.txt /*taglist-functions* -taglist-install taglist.txt /*taglist-install* -taglist-internet taglist.txt /*taglist-internet* -taglist-intro taglist.txt /*taglist-intro* -taglist-keys taglist.txt /*taglist-keys* -taglist-license taglist.txt /*taglist-license* -taglist-menu taglist.txt /*taglist-menu* -taglist-options taglist.txt /*taglist-options* -taglist-requirements taglist.txt /*taglist-requirements* -taglist-session taglist.txt /*taglist-session* -taglist-todo taglist.txt /*taglist-todo* -taglist-using taglist.txt /*taglist-using* -taglist.txt taglist.txt /*taglist.txt* diff --git a/sources_non_forked/vim-airline/doc/airline.txt b/sources_non_forked/vim-airline/doc/airline.txt index bfe7cb3f..8b8da8bd 100644 --- a/sources_non_forked/vim-airline/doc/airline.txt +++ b/sources_non_forked/vim-airline/doc/airline.txt @@ -283,7 +283,7 @@ syntastic let g:airline#extensions#syntastic#enabled = 1 < ------------------------------------- *airline-tagbar* -tagbar +tagbar * enable/disable tagbar integration > let g:airline#extensions#tagbar#enabled = 1 diff --git a/sources_non_forked/vim-expand-region/doc/tags b/sources_non_forked/vim-expand-region/doc/tags deleted file mode 100644 index 402a0c43..00000000 --- a/sources_non_forked/vim-expand-region/doc/tags +++ /dev/null @@ -1,10 +0,0 @@ -expand-region-about expand_region.txt /*expand-region-about* -expand-region-contents expand_region.txt /*expand-region-contents* -expand-region-global-options expand_region.txt /*expand-region-global-options* -expand-region-intro expand_region.txt /*expand-region-intro* -expand-region-mappings expand_region.txt /*expand-region-mappings* -expand-region-usage expand_region.txt /*expand-region-usage* -expand_region_text_objects expand_region.txt /*expand_region_text_objects* -expand_region_use_select_mode expand_region.txt /*expand_region_use_select_mode* -vim-expand-region.txt expand_region.txt /*vim-expand-region.txt* -vim-expand-regions expand_region.txt /*vim-expand-regions* diff --git a/sources_non_forked/vim-multiple-cursors/doc/tags b/sources_non_forked/vim-multiple-cursors/doc/tags deleted file mode 100644 index 5efd6085..00000000 --- a/sources_non_forked/vim-multiple-cursors/doc/tags +++ /dev/null @@ -1,21 +0,0 @@ -MultipleCursorsFind multiple_cursors.txt /*MultipleCursorsFind* -g:multi_cursor_exit_from_insert_mode multiple_cursors.txt /*g:multi_cursor_exit_from_insert_mode* -g:multi_cursor_exit_from_visual_mode multiple_cursors.txt /*g:multi_cursor_exit_from_visual_mode* -g:multi_cursor_next_key multiple_cursors.txt /*g:multi_cursor_next_key* -g:multi_cursor_prev_key multiple_cursors.txt /*g:multi_cursor_prev_key* -g:multi_cursor_quit_key multiple_cursors.txt /*g:multi_cursor_quit_key* -g:multi_cursor_skip_key multiple_cursors.txt /*g:multi_cursor_skip_key* -g:multi_cursor_start_key multiple_cursors.txt /*g:multi_cursor_start_key* -g:multi_cursor_use_default_mapping multiple_cursors.txt /*g:multi_cursor_use_default_mapping* -multiple-cursors-contents multiple_cursors.txt /*multiple-cursors-contents* -multiple-cursors-contributing multiple_cursors.txt /*multiple-cursors-contributing* -multiple-cursors-credit multiple_cursors.txt /*multiple-cursors-credit* -multiple-cursors-global-options multiple_cursors.txt /*multiple-cursors-global-options* -multiple-cursors-intro multiple_cursors.txt /*multiple-cursors-intro* -multiple-cursors-issues multiple_cursors.txt /*multiple-cursors-issues* -multiple-cursors-license multiple_cursors.txt /*multiple-cursors-license* -multiple-cursors-mappings multiple_cursors.txt /*multiple-cursors-mappings* -multiple-cursors-references multiple_cursors.txt /*multiple-cursors-references* -multiple-cursors-usage multiple_cursors.txt /*multiple-cursors-usage* -vim-multiple-cursors multiple_cursors.txt /*vim-multiple-cursors* -vim-multiple-cursors.txt multiple_cursors.txt /*vim-multiple-cursors.txt* diff --git a/sources_non_forked/vim-zenroom/LICENSE.markdown b/sources_non_forked/vim-zenroom/LICENSE.markdown deleted file mode 100644 index 36603def..00000000 --- a/sources_non_forked/vim-zenroom/LICENSE.markdown +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) 2010 Mike West, http://mikewest.org/ -All rights reserved. - -Redistribution and use 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 the software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -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 HOLDER 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. diff --git a/sources_non_forked/vim-zenroom/README.markdown b/sources_non_forked/vim-zenroom/README.markdown deleted file mode 100644 index 238f1c9d..00000000 --- a/sources_non_forked/vim-zenroom/README.markdown +++ /dev/null @@ -1,20 +0,0 @@ -This is my fork of Vimroom which includes following: - -* A special mode for editing Markdown and reStructuredText. It's highly inspired by [iA Writer](http://writer.pro/) -* Optimizations for [my vimrc](https://github.com/amix/vimrc) - -Pelase read more here [ -zenroom for Vim: Focsuing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential). - - -## Editing code - -![Screenshot 1](http://amix.dk/uploads/zenroom_code.jpg) - -![Screenshot 2](http://amix.dk/uploads/zenroom_code_1.jpg) - -## Updating documentation - -![Screenshot 3](http://amix.dk/uploads/zenroom_documentation.jpg) - -![Screenshot 4](http://amix.dk/uploads/zenroom_documentation_1.jpg) diff --git a/sources_non_forked/vim-zenroom/doc/tags b/sources_non_forked/vim-zenroom/doc/tags deleted file mode 100644 index 1773f538..00000000 --- a/sources_non_forked/vim-zenroom/doc/tags +++ /dev/null @@ -1,12 +0,0 @@ -g:vimroom_background vimroom.txt /*g:vimroom_background* -g:vimroom_min_sidebar_width vimroom.txt /*g:vimroom_min_sidebar_width* -g:vimroom_navigational_keys vimroom.txt /*g:vimroom_navigational_keys* -g:vimroom_scrolloff vimroom.txt /*g:vimroom_scrolloff* -g:vimroom_sidebar_height vimroom.txt /*g:vimroom_sidebar_height* -g:vimroom_width vimroom.txt /*g:vimroom_width* -vimroom vimroom.txt /*vimroom* -vimroom-about vimroom.txt /*vimroom-about* -vimroom-configuration vimroom.txt /*vimroom-configuration* -vimroom-installation vimroom.txt /*vimroom-installation* -vimroom-toc vimroom.txt /*vimroom-toc* -vimroom.txt vimroom.txt /*vimroom.txt* diff --git a/sources_non_forked/vim-zenroom/doc/vimroom.txt b/sources_non_forked/vim-zenroom/doc/vimroom.txt deleted file mode 100644 index 0522ea75..00000000 --- a/sources_non_forked/vim-zenroom/doc/vimroom.txt +++ /dev/null @@ -1,86 +0,0 @@ -*vimroom.txt* - -============================================================================== -TABLE OF CONTENTS *vimroom* *vimroom-toc* - - 1. About |vimroom-about| - 2. Installation |vimroom-installation| - 3. Configuration |vimroom-configuration| - -============================================================================== -ABOUT *vimroom-about* - -I do most of my writing in Vim, because I’m a big nerd. It does most of what -I want a writing environment to do, but I miss some of the “distraction free" -features of the quite exceptional WriteRoom. Fullscreening Vim means that text -ends up flat up against the left side of my monitor, but I’d much prefer it to -be centered. I’d also like a little of the visual clutter to fade away. Some -of this is possible with MacVim, but I’d rather do as much as possible in -a platform-independent way. So, command-line Vim it is. - -For more visit: - http://projects.mikewest.org/vimroom/ - https://github.com/mikewest/vimroom - -============================================================================== -INSTALLATION *vimroom-installation* - -I think the best way to install Vim plugins is via Tim Pope’s Pathogen. Using -that plugin, you can simply clone the VimRoom repository into your bundles -directory, and you’re done. - -Without Pathogen, installation is almost as trivial: simply copy -./plugins/vimroom.vim from the repository into your plugins directory. That’s -it! - -============================================================================== -CONFIGURATION *vimroom-configuration* - -By default, VimRoom binds V to VimroomToggle, and sets up an 80 -column workspace with at least 5 columns of space on either side (it doesn’t -help at all to have single-column sidebars, you see), and 3 lines of space -above and below. It assumes a black background when hiding visual -distractions. As of v0.4, VimRoom also sets up a :VimroomToggle command that -has the same effect. - -Changing any of these assumptions is a simple matter of setting variables in -your .vimrc. - - *g:vimroom_background* -is the background color to be used for hiding elements. Set this to your -terminal’s background color (“white”, “black”, etc.) - - *g:vimroom_min_sidebar_width* -is the minimum sidebar width. This will automatically expand to take up all -the free space left after setting the main workspace window to g:vimroom_width -pcolumns. - - *g:vimroom_navigational_keys* -determines whether Vimroom will map keys like , , j, and k to -navigate over “display” lines, rather than “logical” lines. This defaults to -p1 (on), if you’d prefer the mapping not take place, set it to 0 (off). - - *g:vimroom_scrolloff* -specifies how many lines of text ought appear before and after the cursor. -pThis defaults to 999, which centers the cursor on the screen. - - *g:vimroom_sidebar_height* -sets the height of the upper and lower “sidebars.” If you don’t want vertical -padding, set this to 0. - - *g:vimroom_width* -is the width of your workspace. - - -You can bind the VimroomToggle function to any key combination you like -via the usual mechanisms. For example:: -> - nnoremap mz VimroomToggle -<> - -Would bind the function to mz. Trivial, right? - -And that’s it! - -============================================================================== -vim:tw=78:ts=2:sw=2:expandtab:ft=help:norl: diff --git a/sources_non_forked/vim-zenroom/plugin/vimroom.vim b/sources_non_forked/vim-zenroom/plugin/vimroom.vim deleted file mode 100644 index 6f55d9f6..00000000 --- a/sources_non_forked/vim-zenroom/plugin/vimroom.vim +++ /dev/null @@ -1,355 +0,0 @@ -"============================================================================== -"File: vimroom.vim -"Description: Vaguely emulates a writeroom-like environment in Vim by -" splitting the current window in such a way as to center a column -" of user-specified width, wrap the text, and break lines. -"Maintainer: Mike West -"Version: 0.7 -"Last Change: 2010-10-31 -"License: BSD <../LICENSE.markdown> -"============================================================================== - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Plugin Configuration -" - -" The typical start to any vim plugin: If the plugin has already been loaded, -" exit as quickly as possible. -if exists( "g:loaded_vimroom_plugin" ) - finish -endif -let g:loaded_vimroom_plugin = 1 - -" The desired column width. Defaults to 100: -if !exists( "g:vimroom_width" ) - let g:vimroom_width = 100 -endif - -" The minimum sidebar size. Defaults to 5: -if !exists( "g:vimroom_min_sidebar_width" ) - let g:vimroom_min_sidebar_width = 5 -endif - -" The sidebar height. Defaults to 3: -if !exists( "g:vimroom_sidebar_height" ) - let g:vimroom_sidebar_height = 2 -endif - -" The GUI background color. Defaults to "black" -if !exists( "g:vimroom_guibackground" ) - let g:vimroom_guibackground = "#202020" -endif - -" The cterm background color. Defaults to "bg" -if !exists( "g:vimroom_ctermbackground" ) - let g:vimroom_ctermbackground = "bg" -endif - -" The "scrolloff" value: how many lines should be kept visible above and below -" the cursor at all times? Defaults to 999 (which centers your cursor in the -" active window). -if !exists( "g:vimroom_scrolloff" ) - let g:vimroom_scrolloff = 0 -endif - -" Should Vimroom map navigational keys (``, ``, `j`, `k`) to navigate -" "display" lines instead of "logical" lines (which makes it much simpler to deal -" with wrapped lines). Defaults to `1` (on). Set to `0` if you'd prefer not to -" run the mappings. -if !exists( "g:vimroom_navigation_keys" ) - let g:vimroom_navigation_keys = 1 -endif - -" Should Vimroom clear line numbers from the Vimroomed buffer? Defaults to `1` -" (on). Set to `0` if you'd prefer Vimroom to leave line numbers untouched. -" (Note that setting this to `0` will not turn line numbers on if they aren't -" on already). -if !exists( "g:vimroom_clear_line_numbers" ) - let g:vimroom_clear_line_numbers = 1 -endif - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Plugin Code -" - -" Given the desired column width, and minimum sidebar width, determine -" the minimum window width necessary for splitting to make sense -let s:minwidth = g:vimroom_width + ( g:vimroom_min_sidebar_width * 2 ) - -" Save the current color scheme for reset later -let s:scheme = "" -if exists( "g:colors_name" ) - let s:scheme = g:colors_name -endif -if exists( "&t_mr" ) - let s:save_t_mr = &t_mr -end - -" Save the current scrolloff value for reset later -let s:save_scrolloff = "" -if exists( "&scrolloff" ) - let s:save_scrolloff = &scrolloff -end - -" Save the current `laststatus` value for reset later -let s:save_laststatus = "" -if exists( "&laststatus" ) - let s:save_laststatus = &laststatus -endif - -" Save the current `background` value for reset later -let s:save_background = "" -if exists( "&background" ) - let s:save_background = &background -endif - -" Save the current `textwidth'` value for reset later -let s:save_textwidth = "" -if exists( "&textwidth'" ) - let s:save_textwidth' = &textwidth' -endif - -" Save the current `showtabline` value for reset later -let s:save_showtabline = "" -if exists( "&showtabline" ) - let s:save_showtabline = &showtabline -endif - -" Save the current `textwidth` value for reset later -let s:save_textwidth = "" -if exists( "&textwidth" ) - let s:save_textwidth = &textwidth -endif - -" Save the current `number` and `relativenumber` values for reset later -let s:save_number = 0 -let s:save_relativenumber = 0 -if exists( "&number" ) - let s:save_number = &number -endif -if exists ( "&relativenumber" ) - let s:save_relativenumber = &relativenumber -endif - -" We're currently in nonvimroomized state -let s:active = 0 - -function! s:is_the_screen_wide_enough() - return winwidth( winnr() ) >= s:minwidth -endfunction - -function! s:sidebar_size() - return ( winwidth( winnr() ) - g:vimroom_width - 2 ) / 2 -endfunction - -function! s:markdown_room() - set background=light - set linespace=8 - set textwidth=80 - hi Normal guibg=gray95 - hi NonText guifg=gray95 - hi FoldColumn guibg=gray95 - hi CursorLine guibg=gray90 - hi Title gui=bold guifg=gray25 - hi MarkdownHeadingDelimiter gui=bold guifg=gray25 - hi htmlSpecialChar guifg=black - hi markdownError guifg=black - hi markdownBold gui=bold guifg=gray25 - hi markdownItalic guifg=gray25 gui=underline - hi markdownUrl guifg=#2fb3a6 - hi markdownAutomaticLink guifg=#2fb3a6 - hi markdownLinkText guifg=#317849 - hi markdownUrlTitle guifg=#317849 - hi markdownBlockquote guifg=#317849 gui=bold - hi markdownId guifg=#2fb3a6 - hi markdownIdDeclaration guifg=#317849 gui=bold - hi markdownListMarker guifg=#317849 - hi Cursor guibg=#15abdd - - if has('gui_running') - let l:highlightbgcolor = "guibg=#f2f2f2" - let l:highlightfgbgcolor = "guifg=#f2f2f2" . " " . l:highlightbgcolor - else - let l:highlightbgcolor = "ctermbg=" . g:vimroom_ctermbackground - let l:highlightfgbgcolor = "ctermfg=" . g:vimroom_ctermbackground . " " . l:highlightbgcolor - endif - - exec( "hi Normal " . l:highlightbgcolor ) - exec( "hi VertSplit " . l:highlightfgbgcolor ) - exec( "hi NonText " . l:highlightfgbgcolor ) - exec( "hi StatusLine " . l:highlightfgbgcolor ) - exec( "hi StatusLineNC " . l:highlightfgbgcolor ) -endfunction - -function! VimroomToggle() - if s:active == 1 - let s:active = 0 - " Close all other split windows - if g:vimroom_sidebar_height - wincmd j - close - wincmd k - close - endif - if g:vimroom_min_sidebar_width - wincmd l - close - wincmd h - close - endif - " Reset color scheme (or clear new colors, if no scheme is set) - if s:scheme != "" - exec( "colorscheme " . s:scheme ) - else - hi clear - endif - if s:save_t_mr != "" - exec( "set t_mr=" .s:save_t_mr ) - endif - " Reset `scrolloff` and `laststatus` - if s:save_scrolloff != "" - exec( "set scrolloff=" . s:save_scrolloff ) - endif - if s:save_laststatus != "" - exec( "set laststatus=" . s:save_laststatus ) - endif - if s:save_showtabline != "" - exec( "set showtabline=" . s:save_showtabline ) - endif - - exec( "set linespace=0" ) - - if s:save_background != "" - exec( "set background=" . s:save_background ) - endif - if s:save_textwidth != "" - exec( "set textwidth=" . s:save_textwidth ) - endif - if s:save_number != 0 - set number - endif - if s:save_relativenumber != 0 - set relativenumber - endif - " Remove wrapping and linebreaks - set nowrap - set nolinebreak - - " Enable AirLine - exec("silent AirlineToggle") - exec("silent AirlineRefresh") - else - if s:is_the_screen_wide_enough() - let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" - - if is_mark_or_rst - call s:markdown_room() - endif - - " Disable AirLine - exec("silent AirlineToggle") - - let s:active = 1 - let s:sidebar = s:sidebar_size() - - " Turn off status bar - if s:save_laststatus != "" - setlocal laststatus=0 - endif - " Turn off tabline - if s:save_showtabline != "" - setlocal showtabline=0 - endif - if g:vimroom_min_sidebar_width - " Create the left sidebar - exec( "silent leftabove " . s:sidebar . "vsplit new" ) - setlocal noma - setlocal nocursorline - setlocal nonumber - silent! setlocal norelativenumber - wincmd l - " Create the right sidebar - exec( "silent rightbelow " . s:sidebar . "vsplit new" ) - setlocal noma - setlocal nocursorline - setlocal nonumber - silent! setlocal norelativenumber - wincmd h - exec( "silent vertical resize " . g:vimroom_width ) - endif - if g:vimroom_sidebar_height - " Create the top sidebar - exec( "silent leftabove " . g:vimroom_sidebar_height . "split new" ) - setlocal noma - setlocal nocursorline - setlocal nonumber - silent! setlocal norelativenumber - wincmd j - " Create the bottom sidebar - exec( "silent rightbelow " . g:vimroom_sidebar_height . "split new" ) - setlocal noma - setlocal nocursorline - setlocal nonumber - silent! setlocal norelativenumber - wincmd k - endif - " Setup wrapping, line breaking, and push the cursor down - set wrap - set linebreak - if g:vimroom_clear_line_numbers - set nonumber - silent! set norelativenumber - endif - if s:save_textwidth != "" - exec( "set textwidth=".g:vimroom_width ) - endif - if s:save_scrolloff != "" - exec( "set scrolloff=".g:vimroom_scrolloff ) - endif - - " Setup navigation over "display lines", not "logical lines" if - " mappings for the navigation keys don't already exist. - if g:vimroom_navigation_keys - try - noremap g - noremap g - noremap k gk - noremap j gj - inoremap g - inoremap g - catch /E227:/ - echo "Navigational key mappings already exist." - endtry - endif - - " Hide distracting visual elements - if !is_mark_or_rst - if has('gui_running') - let l:highlightbgcolor = "guibg=" . g:vimroom_guibackground - let l:highlightfgbgcolor = "guifg=" . g:vimroom_guibackground . " " . l:highlightbgcolor - else - let l:highlightbgcolor = "ctermbg=" . g:vimroom_ctermbackground - let l:highlightfgbgcolor = "ctermfg=" . g:vimroom_ctermbackground . " " . l:highlightbgcolor - endif - exec( "hi Normal " . l:highlightbgcolor ) - exec( "hi VertSplit " . l:highlightfgbgcolor ) - exec( "hi NonText " . l:highlightfgbgcolor ) - exec( "hi StatusLine " . l:highlightfgbgcolor ) - exec( "hi StatusLineNC " . l:highlightfgbgcolor ) - endif - set t_mr="" - set fillchars+=vert:\ - endif - endif -endfunction - -" Create a mapping for the `VimroomToggle` function -noremap VimroomToggle :call VimroomToggle() - -" Create a `VimroomToggle` command: -command -nargs=0 VimroomToggle call VimroomToggle() - -" If no mapping exists, map it to `V`. -if !hasmapto( 'VimroomToggle' ) - nmap V VimroomToggle -endif diff --git a/sources_non_forked/vim-zenroom2/README.markdown b/sources_non_forked/vim-zenroom2/README.markdown new file mode 100644 index 00000000..f7c0121d --- /dev/null +++ b/sources_non_forked/vim-zenroom2/README.markdown @@ -0,0 +1,20 @@ +This is a Vim extension that emulates iA Writer environment when editing Markdown, reStructuredText or text files. + +It requires [goyo.vim](https://github.com/junegunn/goyo.vim) and it works by setting global Goyo callbacks that triggers special setup for Markdown, reStructuredText and text files. + +This is an improvement of my initial version called [vim-zenroom](https://github.com/amix/vim-zenroom). Please read more here [ +zenroom for Vim: Focusing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential). + + +## Inspirations/Similar +* [lite-dfm](https://github.com/bilalq/lite-dfm) +* [vimroom](https://github.com/mikewest/vimroom) +* [vim-zenroom](https://github.com/amix/vim-zenroom) +* [Writing Markdown With Style in Vim](http://astrails.com/blog/2013/8/12/writing-markdown-with-style-in-vim) + + +## How it looks like in action + +![Screenshot 3](http://amix.dk/uploads/zenroom_documentation.jpg) + +![Screenshot 4](http://amix.dk/uploads/zenroom_documentation_1.jpg) diff --git a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim new file mode 100644 index 00000000..2ccfc52e --- /dev/null +++ b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim @@ -0,0 +1,95 @@ +"============================================================================== +"File: zenroom2.vim +"Description: Emulates iA Writer environment when editing Markdown, reStructuredText +" or text files. +"Maintainer: Amir Salihefendic +"Version: 0.1 +"Last Change: 2013-12-29 +"License: BSD +"============================================================================== + +if exists( "g:loaded_zenroom2_plugin" ) + finish +endif +let g:loaded_zenroom2_plugin = 1 + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Plugin Configuration +" +" Save the current `background` value for reset later +let s:save_background = "" +if exists( "&background" ) + let s:save_background = &background +endif + +" Save the current `textwidth'` value for reset later +let s:save_textwidth = "" +if exists( "&textwidth'" ) + let s:save_textwidth' = &textwidth' +endif + +function! s:markdown_room() + set background=light + set linespace=8 + set textwidth=80 + + hi Normal guibg=gray95 + hi NonText guifg=gray95 + hi FoldColumn guibg=gray95 + hi CursorLine guibg=gray90 + hi Title gui=bold guifg=gray25 + hi MarkdownHeadingDelimiter gui=bold guifg=gray25 + hi htmlSpecialChar guifg=black + hi markdownError guifg=black + hi markdownBold gui=bold guifg=gray25 + hi markdownItalic guifg=gray25 gui=underline + hi markdownUrl guifg=#2fb3a6 + hi markdownAutomaticLink guifg=#2fb3a6 + hi markdownLinkText guifg=#317849 + hi markdownUrlTitle guifg=#317849 + hi markdownBlockquote guifg=#317849 gui=bold + hi markdownId guifg=#2fb3a6 + hi markdownIdDeclaration guifg=#317849 gui=bold + hi markdownListMarker guifg=#317849 + hi Cursor guibg=#15abdd + + if has('gui_running') + let l:highlightbgcolor = "guibg=#f2f2f2" + let l:highlightfgbgcolor = "guifg=#f2f2f2" . " " . l:highlightbgcolor + else + let l:highlightbgcolor = "ctermbg=bg" + let l:highlightfgbgcolor = "ctermfg=bg" . " " . l:highlightbgcolor + endif + + exec( "hi Normal " . l:highlightbgcolor ) + exec( "hi VertSplit " . l:highlightfgbgcolor ) + exec( "hi NonText " . l:highlightfgbgcolor ) + exec( "hi StatusLine " . l:highlightfgbgcolor ) + exec( "hi StatusLineNC " . l:highlightfgbgcolor ) +endfunction + +function! s:goyo_before() + let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" + + if is_mark_or_rst + call s:markdown_room() + endif +endfunction + +function! s:goyo_after() + let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" + if is_mark_or_rst + set linespace=0 + + if s:save_textwidth != "" + exec( "set textwidth=" . s:save_textwidth ) + endif + + if s:save_background != "" + exec( "set background=" . s:save_background ) + endif + endif +endfunction + +let g:goyo_callbacks = [ function('s:goyo_before'), function('s:goyo_after') ] diff --git a/update_plugins.py b/update_plugins.py index 13a0ecb0..f6dcef11 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -33,7 +33,7 @@ vim-expand-region https://github.com/terryma/vim-expand-region vim-multiple-cursors https://github.com/terryma/vim-multiple-cursors vim-fugitive https://github.com/tpope/vim-fugitive vim-airline https://github.com/bling/vim-airline -vim-zenroom https://github.com/amix/vim-zenroom +vim-zenroom2 https://github.com/amix/vim-zenroom2 """.strip() GITHUB_ZIP = '%s/archive/master.zip' diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index cd4a8d0c..6d726e88 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -109,4 +109,5 @@ let g:airline_theme="luna" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Vimroom """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -nnoremap z :VimroomToggle +let g:goyo_width=100 +nnoremap z :Goyo From ba783e5fd90711a7e589495fb042a9184d648524 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 10:38:40 +0000 Subject: [PATCH 11/37] Added tags --- sources_non_forked/bufexplorer/doc/tags | 24 +++++++ sources_non_forked/taglist.vim/doc/tags | 62 +++++++++++++++++++ sources_non_forked/vim-expand-region/doc/tags | 10 +++ .../vim-multiple-cursors/doc/tags | 21 +++++++ 4 files changed, 117 insertions(+) create mode 100644 sources_non_forked/bufexplorer/doc/tags create mode 100644 sources_non_forked/taglist.vim/doc/tags create mode 100644 sources_non_forked/vim-expand-region/doc/tags create mode 100644 sources_non_forked/vim-multiple-cursors/doc/tags diff --git a/sources_non_forked/bufexplorer/doc/tags b/sources_non_forked/bufexplorer/doc/tags new file mode 100644 index 00000000..5432bc98 --- /dev/null +++ b/sources_non_forked/bufexplorer/doc/tags @@ -0,0 +1,24 @@ +bufexplorer bufexplorer.txt /*bufexplorer* +bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog* +bufexplorer-credits bufexplorer.txt /*bufexplorer-credits* +bufexplorer-customization bufexplorer.txt /*bufexplorer-customization* +bufexplorer-installation bufexplorer.txt /*bufexplorer-installation* +bufexplorer-todo bufexplorer.txt /*bufexplorer-todo* +bufexplorer-usage bufexplorer.txt /*bufexplorer-usage* +bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout* +bufexplorer.txt bufexplorer.txt /*bufexplorer.txt* +buffer-explorer bufexplorer.txt /*buffer-explorer* +g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin* +g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp* +g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp* +g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive* +g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef* +g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort* +g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories* +g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath* +g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer* +g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted* +g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy* +g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow* +g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName* +g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight* diff --git a/sources_non_forked/taglist.vim/doc/tags b/sources_non_forked/taglist.vim/doc/tags new file mode 100644 index 00000000..83e80ba1 --- /dev/null +++ b/sources_non_forked/taglist.vim/doc/tags @@ -0,0 +1,62 @@ +'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'* +'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'* +'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'* +'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'* +'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'* +'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'* +'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'* +'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'* +'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'* +'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'* +'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'* +'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'* +'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'* +'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'* +'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'* +'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'* +'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'* +'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'* +'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'* +'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'* +'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'* +'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'* +'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'* +'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'* +'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'* +:TlistAddFiles taglist.txt /*:TlistAddFiles* +:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive* +:TlistClose taglist.txt /*:TlistClose* +:TlistDebug taglist.txt /*:TlistDebug* +:TlistHighlightTag taglist.txt /*:TlistHighlightTag* +:TlistLock taglist.txt /*:TlistLock* +:TlistMessages taglist.txt /*:TlistMessages* +:TlistOpen taglist.txt /*:TlistOpen* +:TlistSessionLoad taglist.txt /*:TlistSessionLoad* +:TlistSessionSave taglist.txt /*:TlistSessionSave* +:TlistShowPrototype taglist.txt /*:TlistShowPrototype* +:TlistShowTag taglist.txt /*:TlistShowTag* +:TlistToggle taglist.txt /*:TlistToggle* +:TlistUndebug taglist.txt /*:TlistUndebug* +:TlistUnlock taglist.txt /*:TlistUnlock* +:TlistUpdate taglist.txt /*:TlistUpdate* +Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()* +Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()* +Tlist_Set_App() taglist.txt /*Tlist_Set_App()* +Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()* +taglist-commands taglist.txt /*taglist-commands* +taglist-debug taglist.txt /*taglist-debug* +taglist-extend taglist.txt /*taglist-extend* +taglist-faq taglist.txt /*taglist-faq* +taglist-functions taglist.txt /*taglist-functions* +taglist-install taglist.txt /*taglist-install* +taglist-internet taglist.txt /*taglist-internet* +taglist-intro taglist.txt /*taglist-intro* +taglist-keys taglist.txt /*taglist-keys* +taglist-license taglist.txt /*taglist-license* +taglist-menu taglist.txt /*taglist-menu* +taglist-options taglist.txt /*taglist-options* +taglist-requirements taglist.txt /*taglist-requirements* +taglist-session taglist.txt /*taglist-session* +taglist-todo taglist.txt /*taglist-todo* +taglist-using taglist.txt /*taglist-using* +taglist.txt taglist.txt /*taglist.txt* diff --git a/sources_non_forked/vim-expand-region/doc/tags b/sources_non_forked/vim-expand-region/doc/tags new file mode 100644 index 00000000..402a0c43 --- /dev/null +++ b/sources_non_forked/vim-expand-region/doc/tags @@ -0,0 +1,10 @@ +expand-region-about expand_region.txt /*expand-region-about* +expand-region-contents expand_region.txt /*expand-region-contents* +expand-region-global-options expand_region.txt /*expand-region-global-options* +expand-region-intro expand_region.txt /*expand-region-intro* +expand-region-mappings expand_region.txt /*expand-region-mappings* +expand-region-usage expand_region.txt /*expand-region-usage* +expand_region_text_objects expand_region.txt /*expand_region_text_objects* +expand_region_use_select_mode expand_region.txt /*expand_region_use_select_mode* +vim-expand-region.txt expand_region.txt /*vim-expand-region.txt* +vim-expand-regions expand_region.txt /*vim-expand-regions* diff --git a/sources_non_forked/vim-multiple-cursors/doc/tags b/sources_non_forked/vim-multiple-cursors/doc/tags new file mode 100644 index 00000000..5efd6085 --- /dev/null +++ b/sources_non_forked/vim-multiple-cursors/doc/tags @@ -0,0 +1,21 @@ +MultipleCursorsFind multiple_cursors.txt /*MultipleCursorsFind* +g:multi_cursor_exit_from_insert_mode multiple_cursors.txt /*g:multi_cursor_exit_from_insert_mode* +g:multi_cursor_exit_from_visual_mode multiple_cursors.txt /*g:multi_cursor_exit_from_visual_mode* +g:multi_cursor_next_key multiple_cursors.txt /*g:multi_cursor_next_key* +g:multi_cursor_prev_key multiple_cursors.txt /*g:multi_cursor_prev_key* +g:multi_cursor_quit_key multiple_cursors.txt /*g:multi_cursor_quit_key* +g:multi_cursor_skip_key multiple_cursors.txt /*g:multi_cursor_skip_key* +g:multi_cursor_start_key multiple_cursors.txt /*g:multi_cursor_start_key* +g:multi_cursor_use_default_mapping multiple_cursors.txt /*g:multi_cursor_use_default_mapping* +multiple-cursors-contents multiple_cursors.txt /*multiple-cursors-contents* +multiple-cursors-contributing multiple_cursors.txt /*multiple-cursors-contributing* +multiple-cursors-credit multiple_cursors.txt /*multiple-cursors-credit* +multiple-cursors-global-options multiple_cursors.txt /*multiple-cursors-global-options* +multiple-cursors-intro multiple_cursors.txt /*multiple-cursors-intro* +multiple-cursors-issues multiple_cursors.txt /*multiple-cursors-issues* +multiple-cursors-license multiple_cursors.txt /*multiple-cursors-license* +multiple-cursors-mappings multiple_cursors.txt /*multiple-cursors-mappings* +multiple-cursors-references multiple_cursors.txt /*multiple-cursors-references* +multiple-cursors-usage multiple_cursors.txt /*multiple-cursors-usage* +vim-multiple-cursors multiple_cursors.txt /*vim-multiple-cursors* +vim-multiple-cursors.txt multiple_cursors.txt /*vim-multiple-cursors.txt* From 5d177a21f689787ffd5de9134743877afed58119 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 11:31:16 +0000 Subject: [PATCH 12/37] Fixed some issues with terminal setup --- sources_forked/peaksea/colors/peaksea.vim | 2 +- vimrcs/extended.vim | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sources_forked/peaksea/colors/peaksea.vim b/sources_forked/peaksea/colors/peaksea.vim index f3eafe43..b679c23c 100644 --- a/sources_forked/peaksea/colors/peaksea.vim +++ b/sources_forked/peaksea/colors/peaksea.vim @@ -36,7 +36,7 @@ if exists("syntax_on") syntax reset endif -let g:colors_name = expand(":t:r") +let g:colors_name = "peaksea" " I don't want to abuse folding, but here folding is used to avoid confusion. if &background=='light' diff --git a/vimrcs/extended.vim b/vimrcs/extended.vim index 2787478f..255a31cf 100644 --- a/vimrcs/extended.vim +++ b/vimrcs/extended.vim @@ -8,10 +8,6 @@ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => GUI related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -set background=dark - -colorscheme peaksea - " Set font according to system if has("mac") || has("macunix") set gfn=Source\ Code\ Pro:h15,Menlo:h15 @@ -35,6 +31,15 @@ set guioptions-=R set guioptions-=l set guioptions-=L +" Colorscheme +if has("gui_running") + set background=dark + colorscheme peaksea +else + colorscheme desert + let g:colors_name="desert" +endif + """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Fast editing and reloading of vimrc configs From a340836c8ac740a9afb9c1ad90a2a5cd0fd4211a Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 11:33:00 +0000 Subject: [PATCH 13/37] . --- sources_non_forked/bufexplorer/doc/tags | 24 ------- sources_non_forked/taglist.vim/doc/tags | 62 ------------------- sources_non_forked/vim-expand-region/doc/tags | 10 --- .../vim-multiple-cursors/doc/tags | 21 ------- .../vim-zenroom2/plugin/zenroom2.vim | 39 +++++++----- 5 files changed, 24 insertions(+), 132 deletions(-) delete mode 100644 sources_non_forked/bufexplorer/doc/tags delete mode 100644 sources_non_forked/taglist.vim/doc/tags delete mode 100644 sources_non_forked/vim-expand-region/doc/tags delete mode 100644 sources_non_forked/vim-multiple-cursors/doc/tags diff --git a/sources_non_forked/bufexplorer/doc/tags b/sources_non_forked/bufexplorer/doc/tags deleted file mode 100644 index 5432bc98..00000000 --- a/sources_non_forked/bufexplorer/doc/tags +++ /dev/null @@ -1,24 +0,0 @@ -bufexplorer bufexplorer.txt /*bufexplorer* -bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog* -bufexplorer-credits bufexplorer.txt /*bufexplorer-credits* -bufexplorer-customization bufexplorer.txt /*bufexplorer-customization* -bufexplorer-installation bufexplorer.txt /*bufexplorer-installation* -bufexplorer-todo bufexplorer.txt /*bufexplorer-todo* -bufexplorer-usage bufexplorer.txt /*bufexplorer-usage* -bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout* -bufexplorer.txt bufexplorer.txt /*bufexplorer.txt* -buffer-explorer bufexplorer.txt /*buffer-explorer* -g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin* -g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp* -g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp* -g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive* -g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef* -g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort* -g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories* -g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath* -g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer* -g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted* -g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy* -g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow* -g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName* -g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight* diff --git a/sources_non_forked/taglist.vim/doc/tags b/sources_non_forked/taglist.vim/doc/tags deleted file mode 100644 index 83e80ba1..00000000 --- a/sources_non_forked/taglist.vim/doc/tags +++ /dev/null @@ -1,62 +0,0 @@ -'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'* -'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'* -'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'* -'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'* -'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'* -'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'* -'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'* -'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'* -'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'* -'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'* -'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'* -'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'* -'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'* -'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'* -'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'* -'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'* -'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'* -'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'* -'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'* -'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'* -'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'* -'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'* -'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'* -'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'* -'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'* -:TlistAddFiles taglist.txt /*:TlistAddFiles* -:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive* -:TlistClose taglist.txt /*:TlistClose* -:TlistDebug taglist.txt /*:TlistDebug* -:TlistHighlightTag taglist.txt /*:TlistHighlightTag* -:TlistLock taglist.txt /*:TlistLock* -:TlistMessages taglist.txt /*:TlistMessages* -:TlistOpen taglist.txt /*:TlistOpen* -:TlistSessionLoad taglist.txt /*:TlistSessionLoad* -:TlistSessionSave taglist.txt /*:TlistSessionSave* -:TlistShowPrototype taglist.txt /*:TlistShowPrototype* -:TlistShowTag taglist.txt /*:TlistShowTag* -:TlistToggle taglist.txt /*:TlistToggle* -:TlistUndebug taglist.txt /*:TlistUndebug* -:TlistUnlock taglist.txt /*:TlistUnlock* -:TlistUpdate taglist.txt /*:TlistUpdate* -Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()* -Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()* -Tlist_Set_App() taglist.txt /*Tlist_Set_App()* -Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()* -taglist-commands taglist.txt /*taglist-commands* -taglist-debug taglist.txt /*taglist-debug* -taglist-extend taglist.txt /*taglist-extend* -taglist-faq taglist.txt /*taglist-faq* -taglist-functions taglist.txt /*taglist-functions* -taglist-install taglist.txt /*taglist-install* -taglist-internet taglist.txt /*taglist-internet* -taglist-intro taglist.txt /*taglist-intro* -taglist-keys taglist.txt /*taglist-keys* -taglist-license taglist.txt /*taglist-license* -taglist-menu taglist.txt /*taglist-menu* -taglist-options taglist.txt /*taglist-options* -taglist-requirements taglist.txt /*taglist-requirements* -taglist-session taglist.txt /*taglist-session* -taglist-todo taglist.txt /*taglist-todo* -taglist-using taglist.txt /*taglist-using* -taglist.txt taglist.txt /*taglist.txt* diff --git a/sources_non_forked/vim-expand-region/doc/tags b/sources_non_forked/vim-expand-region/doc/tags deleted file mode 100644 index 402a0c43..00000000 --- a/sources_non_forked/vim-expand-region/doc/tags +++ /dev/null @@ -1,10 +0,0 @@ -expand-region-about expand_region.txt /*expand-region-about* -expand-region-contents expand_region.txt /*expand-region-contents* -expand-region-global-options expand_region.txt /*expand-region-global-options* -expand-region-intro expand_region.txt /*expand-region-intro* -expand-region-mappings expand_region.txt /*expand-region-mappings* -expand-region-usage expand_region.txt /*expand-region-usage* -expand_region_text_objects expand_region.txt /*expand_region_text_objects* -expand_region_use_select_mode expand_region.txt /*expand_region_use_select_mode* -vim-expand-region.txt expand_region.txt /*vim-expand-region.txt* -vim-expand-regions expand_region.txt /*vim-expand-regions* diff --git a/sources_non_forked/vim-multiple-cursors/doc/tags b/sources_non_forked/vim-multiple-cursors/doc/tags deleted file mode 100644 index 5efd6085..00000000 --- a/sources_non_forked/vim-multiple-cursors/doc/tags +++ /dev/null @@ -1,21 +0,0 @@ -MultipleCursorsFind multiple_cursors.txt /*MultipleCursorsFind* -g:multi_cursor_exit_from_insert_mode multiple_cursors.txt /*g:multi_cursor_exit_from_insert_mode* -g:multi_cursor_exit_from_visual_mode multiple_cursors.txt /*g:multi_cursor_exit_from_visual_mode* -g:multi_cursor_next_key multiple_cursors.txt /*g:multi_cursor_next_key* -g:multi_cursor_prev_key multiple_cursors.txt /*g:multi_cursor_prev_key* -g:multi_cursor_quit_key multiple_cursors.txt /*g:multi_cursor_quit_key* -g:multi_cursor_skip_key multiple_cursors.txt /*g:multi_cursor_skip_key* -g:multi_cursor_start_key multiple_cursors.txt /*g:multi_cursor_start_key* -g:multi_cursor_use_default_mapping multiple_cursors.txt /*g:multi_cursor_use_default_mapping* -multiple-cursors-contents multiple_cursors.txt /*multiple-cursors-contents* -multiple-cursors-contributing multiple_cursors.txt /*multiple-cursors-contributing* -multiple-cursors-credit multiple_cursors.txt /*multiple-cursors-credit* -multiple-cursors-global-options multiple_cursors.txt /*multiple-cursors-global-options* -multiple-cursors-intro multiple_cursors.txt /*multiple-cursors-intro* -multiple-cursors-issues multiple_cursors.txt /*multiple-cursors-issues* -multiple-cursors-license multiple_cursors.txt /*multiple-cursors-license* -multiple-cursors-mappings multiple_cursors.txt /*multiple-cursors-mappings* -multiple-cursors-references multiple_cursors.txt /*multiple-cursors-references* -multiple-cursors-usage multiple_cursors.txt /*multiple-cursors-usage* -vim-multiple-cursors multiple_cursors.txt /*vim-multiple-cursors* -vim-multiple-cursors.txt multiple_cursors.txt /*vim-multiple-cursors.txt* diff --git a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim index 2ccfc52e..3a1153ac 100644 --- a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim +++ b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim @@ -3,7 +3,7 @@ "Description: Emulates iA Writer environment when editing Markdown, reStructuredText " or text files. "Maintainer: Amir Salihefendic -"Version: 0.1 +"Version: 0.2 "Last Change: 2013-12-29 "License: BSD "============================================================================== @@ -19,24 +19,27 @@ let g:loaded_zenroom2_plugin = 1 " " Save the current `background` value for reset later let s:save_background = "" -if exists( "&background" ) - let s:save_background = &background -endif " Save the current `textwidth'` value for reset later let s:save_textwidth = "" -if exists( "&textwidth'" ) - let s:save_textwidth' = &textwidth' -endif function! s:markdown_room() + if exists( "&background" ) + let s:save_background = &background + endif + + if exists( "&textwidth'" ) + let s:save_textwidth' = &textwidth' + endif + set background=light + set linespace=8 set textwidth=80 hi Normal guibg=gray95 hi NonText guifg=gray95 - hi FoldColumn guibg=gray95 + hi FoldColumn guibg=gray95 ctermbg=bg hi CursorLine guibg=gray90 hi Title gui=bold guifg=gray25 hi MarkdownHeadingDelimiter gui=bold guifg=gray25 @@ -69,17 +72,22 @@ function! s:markdown_room() exec( "hi StatusLineNC " . l:highlightfgbgcolor ) endfunction -function! s:goyo_before() - let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" +function! g:zenroom_goyo_before() + if !has("gui_running") + return + endif - if is_mark_or_rst + if &filetype == "markdown" || &filetype == "rst" || &filetype == "text" call s:markdown_room() endif endfunction -function! s:goyo_after() - let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" - if is_mark_or_rst +function! g:zenroom_goyo_after() + if !has("gui_running") + return + endif + + if &filetype == "markdown" || &filetype == "rst" || &filetype == "text" set linespace=0 if s:save_textwidth != "" @@ -92,4 +100,5 @@ function! s:goyo_after() endif endfunction -let g:goyo_callbacks = [ function('s:goyo_before'), function('s:goyo_after') ] +let g:goyo_callbacks = [ function('g:zenroom_goyo_before'), function('g:zenroom_goyo_after') ] + From 5016954e3847aae5029b87d5e848659151871e35 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 11:36:43 +0000 Subject: [PATCH 14/37] Readded goyo.vim --- sources_non_forked/vim-zenroom2/README.markdown | 4 +++- update_plugins.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sources_non_forked/vim-zenroom2/README.markdown b/sources_non_forked/vim-zenroom2/README.markdown index f7c0121d..9cc13c8f 100644 --- a/sources_non_forked/vim-zenroom2/README.markdown +++ b/sources_non_forked/vim-zenroom2/README.markdown @@ -5,12 +5,14 @@ It requires [goyo.vim](https://github.com/junegunn/goyo.vim) and it works by set This is an improvement of my initial version called [vim-zenroom](https://github.com/amix/vim-zenroom). Please read more here [ zenroom for Vim: Focusing only on the essential](http://amix.dk/blog/post/19744#zenroom-for-Vim-Focsuing-only-on-the-essential). +Please note that this might not work perfectly with your colorscheme. Patches are welcome to fix this :-) + ## Inspirations/Similar +* [Writing Markdown With Style in Vim](http://astrails.com/blog/2013/8/12/writing-markdown-with-style-in-vim) * [lite-dfm](https://github.com/bilalq/lite-dfm) * [vimroom](https://github.com/mikewest/vimroom) * [vim-zenroom](https://github.com/amix/vim-zenroom) -* [Writing Markdown With Style in Vim](http://astrails.com/blog/2013/8/12/writing-markdown-with-style-in-vim) ## How it looks like in action diff --git a/update_plugins.py b/update_plugins.py index f6dcef11..946f0b74 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -33,6 +33,7 @@ vim-expand-region https://github.com/terryma/vim-expand-region vim-multiple-cursors https://github.com/terryma/vim-multiple-cursors vim-fugitive https://github.com/tpope/vim-fugitive vim-airline https://github.com/bling/vim-airline +goyo.vim https://github.com/junegunn/goyo.vim vim-zenroom2 https://github.com/amix/vim-zenroom2 """.strip() From ab44fd0780d84648732c20e0bd714c5f0a3f5061 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 11:37:12 +0000 Subject: [PATCH 15/37] . --- sources_non_forked/goyo.vim | 1 - 1 file changed, 1 deletion(-) delete mode 160000 sources_non_forked/goyo.vim diff --git a/sources_non_forked/goyo.vim b/sources_non_forked/goyo.vim deleted file mode 160000 index 6011742c..00000000 --- a/sources_non_forked/goyo.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6011742c2993315b3489e20d89d730917b8e2548 From 9e06b48f98118d2d7f30da1b888553d5229f706a Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 11:38:57 +0000 Subject: [PATCH 16/37] Readded goyo grr --- sources_non_forked/goyo.vim/plugin/goyo.vim | 288 ++++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources_non_forked/goyo.vim/plugin/goyo.vim diff --git a/sources_non_forked/goyo.vim/plugin/goyo.vim b/sources_non_forked/goyo.vim/plugin/goyo.vim new file mode 100644 index 00000000..56066f59 --- /dev/null +++ b/sources_non_forked/goyo.vim/plugin/goyo.vim @@ -0,0 +1,288 @@ +" Copyright (c) 2013 Junegunn Choi +" +" MIT License +" +" 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. + +let s:cpo_save = &cpo +set cpo&vim + +function! s:get_color(group, attr) + return synIDattr(synIDtrans(hlID(a:group)), a:attr) +endfunction + +function! s:set_color(group, attr, color) + let gui = has('gui_running') + execute printf("hi %s %s%s=%s", a:group, gui ? 'gui' : 'cterm', a:attr, a:color) +endfunction + +function! s:blank() + let main = bufwinnr(t:goyo_master) + if main != -1 + execute main . 'wincmd w' + else + call s:goyo_off() + endif +endfunction + +function! s:init_pad(command) + execute a:command + + setlocal buftype=nofile bufhidden=wipe nomodifiable nobuflisted noswapfile + \ nonu nocursorline winfixwidth winfixheight statusline=\ + if exists('&rnu') + setlocal nornu + endif + if exists('&colorcolumn') + setlocal colorcolumn= + endif + let bufnr = winbufnr(0) + + execute winnr('#') . 'wincmd w' + return bufnr +endfunction + +function! s:setup_pad(bufnr, vert, size) + let win = bufwinnr(a:bufnr) + execute win . 'wincmd w' + execute (a:vert ? 'vertical ' : '') . 'resize ' . max([0, a:size]) + augroup goyop + autocmd WinEnter call s:blank() + augroup END + + " To hide scrollbars of pad windows in GVim + let diff = winheight(0) - line('$') - (has('gui_running') ? 2 : 0) + if diff > 0 + setlocal modifiable + call append(0, map(range(1, diff), '""')) + normal! gg + setlocal nomodifiable + endif + execute winnr('#') . 'wincmd w' +endfunction + +function! s:hmargin() + let nwidth = max([len(string(line('$'))) + 1, &numberwidth]) + let width = t:goyo_width + (&number ? nwidth : 0) + return (&columns - width) +endfunction + +function! s:resize_pads() + let hmargin = s:hmargin() + let tmargin = get(g:, 'goyo_margin_top', 4) + let bmargin = get(g:, 'goyo_margin_bottom', 4) + + augroup goyop + autocmd! + augroup END + call s:setup_pad(t:goyo_pads.t, 0, tmargin - 1) + call s:setup_pad(t:goyo_pads.b, 0, bmargin - 2) + call s:setup_pad(t:goyo_pads.l, 1, hmargin / 2 - 1) + call s:setup_pad(t:goyo_pads.r, 1, hmargin / 2 - 1) +endfunction + +function! s:tranquilize() + let bg = s:get_color('Normal', 'bg') + for grp in ['NonText', 'FoldColumn', 'ColorColumn', 'VertSplit', + \ 'StatusLine', 'StatusLineNC', 'SignColumn'] + " -1 on Vim / '' on GVim + if bg == -1 || empty(bg) + call s:set_color(grp, '', 'NONE') + call s:set_color(grp, 'fg', get(g:, 'goyo_bg', 'black')) + call s:set_color(grp, 'bg', 'NONE') + else + call s:set_color(grp, 'fg', bg) + call s:set_color(grp, 'bg', bg) + endif + endfor +endfunction + +function! s:goyo_on(width) + " New tab + tab split + + let t:goyo_master = winbufnr(0) + let t:goyo_width = a:width + let t:goyo_pads = {} + let t:goyo_revert = + \ { 'laststatus': &laststatus, + \ 'showtabline': &showtabline, + \ 'fillchars': &fillchars, + \ 'winwidth': &winwidth, + \ 'winheight': &winheight, + \ 'statusline': &statusline, + \ 'ruler': &ruler, + \ 'sidescroll': &sidescroll, + \ 'sidescrolloff': &sidescrolloff + \ } + if has('gui_running') + let t:goyo_revert.guioptions = &guioptions + endif + + " vim-gitgutter + let t:goyo_disabled_gitgutter = get(g:, 'gitgutter_enabled', 0) + if t:goyo_disabled_gitgutter + GitGutterDisable + endif + + " vim-airline + let t:goyo_disabled_airline = exists("#airline") + if t:goyo_disabled_airline + AirlineToggle + endif + + " vim-powerline + let t:goyo_disabled_powerline = exists("#PowerlineMain") + if t:goyo_disabled_powerline + augroup PowerlineMain + autocmd! + augroup END + augroup! PowerlineMain + endif + + if !get(g:, 'goyo_linenr', 0) + setlocal nonu + if exists('&rnu') + setlocal nornu + endif + endif + if exists('&colorcolumn') + setlocal colorcolumn= + endif + + " Global options + set winwidth=1 + set winheight=1 + set laststatus=0 + set showtabline=0 + set noruler + set fillchars+=vert:\ + set fillchars+=stl:. + set fillchars+=stlnc:\ + set sidescroll=1 + set sidescrolloff=0 + + " Hide left-hand scrollbars + if has('gui_running') + set guioptions-=l + set guioptions-=L + endif + + let t:goyo_pads.l = s:init_pad('vertical new') + let t:goyo_pads.r = s:init_pad('vertical rightbelow new') + let t:goyo_pads.t = s:init_pad('topleft new') + let t:goyo_pads.b = s:init_pad('botright new') + + call s:resize_pads() + call s:tranquilize() + + let &statusline = repeat(' ', winwidth(0)) + + if exists('g:goyo_callbacks[0]') + call g:goyo_callbacks[0]() + endif + + augroup goyo + autocmd! + autocmd BufWinLeave call s:goyo_off() + autocmd TabLeave * call s:goyo_off() + autocmd VimResized * call s:resize_pads() + autocmd ColorScheme * call s:tranquilize() + augroup END +endfunction + +function! s:goyo_off() + if !exists('#goyo') + return + endif + + " Oops, not this tab + if !exists('t:goyo_revert') + return + endif + + " Clear auto commands + augroup goyo + autocmd! + augroup END + augroup! goyo + augroup goyop + autocmd! + augroup END + augroup! goyop + + let goyo_revert = t:goyo_revert + let goyo_disabled_gitgutter = t:goyo_disabled_gitgutter + let goyo_disabled_airline = t:goyo_disabled_airline + let goyo_disabled_powerline = t:goyo_disabled_powerline + + if tabpagenr() == 1 + tabnew + normal! gt + bd + endif + tabclose + + for [k, v] in items(goyo_revert) + execute printf("let &%s = %s", k, string(v)) + endfor + execute 'colo '. g:colors_name + + if goyo_disabled_gitgutter + GitGutterEnable + endif + + if goyo_disabled_airline && !exists("#airline") + AirlineToggle + AirlineRefresh + endif + + if goyo_disabled_powerline && !exists("#PowerlineMain") + doautocmd PowerlineStartup VimEnter + silent! PowerlineReloadColorscheme + endif + + if exists('#Powerline') + doautocmd Powerline ColorScheme + endif + + if exists('g:goyo_callbacks[1]') + call g:goyo_callbacks[1]() + endif +endfunction + +function! s:goyo(...) + let width = a:0 > 0 ? a:1 : get(g:, 'goyo_width', 80) + + if exists('#goyo') == 0 + call s:goyo_on(width) + elseif a:0 > 0 + let t:goyo_width = width + call s:resize_pads() + else + call s:goyo_off() + end +endfunction + +command! -nargs=? Goyo call s:goyo() + +let &cpo = s:cpo_save +unlet s:cpo_save + From 16b4c050e745914e85472b960e6f135be87e9924 Mon Sep 17 00:00:00 2001 From: Amir Salihefendic Date: Sun, 29 Dec 2013 13:20:35 +0000 Subject: [PATCH 17/37] Update README.md Added an extra screenshot. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a8a8e143..7af4a0c2 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,9 @@ Opening recently opened files [mru.vim](https://github.com/vim-scripts/mru.vim): This vimrc even works on Windows! ![Screenshot 4](http://files1.wedoist.com/4e85163d97b81422240c822c82022f2f/as/screenshot_4.png) +Distraction free mode (using goyo.vim and vim-zenroom2): +![Screenshot 5](https://d2dq6e731uoz0t.cloudfront.net/a5182977c3d6c2a6cd3f9e97398ca8ca/as/zen_mode.jpg) + ## What plugins are included? From b4846b63731fab1eaf6cafdf93596a0193f17468 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 13:25:09 +0000 Subject: [PATCH 18/37] Updated headings --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7af4a0c2..99d52832 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Distraction free mode (using goyo.vim and vim-zenroom2): ![Screenshot 5](https://d2dq6e731uoz0t.cloudfront.net/a5182977c3d6c2a6cd3f9e97398ca8ca/as/zen_mode.jpg) -## What plugins are included? +## Included Plugins I recommend reading the docs of these plugins to understand them better. Each of them provide a much better Vim experience! @@ -82,7 +82,7 @@ I recommend reading the docs of these plugins to understand them better. Each of Remove all clutter and focus only on the essential. Similar to iA Writer or Write Room [Read more here](http://amix.dk/blog/post/19744) -## What color schemes are included? +## Included color schemes * [peaksea](https://github.com/vim-scripts/peaksea): My favorite! * [vim-colors-solarized](https://github.com/altercation/vim-colors-solarized) @@ -91,7 +91,7 @@ Remove all clutter and focus only on the essential. Similar to iA Writer or Writ * [vim-pyte](https://github.com/therubymug/vim-pyte) -## What modes are included? +## Included modes * [vim-coffee-script](https://github.com/kchmck/vim-coffee-script) * [vim-less](https://github.com/groenewege/vim-less) From 86bf52e98ffb7beabfb74914a6bf7f7ac3c2b318 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 14:13:35 +0000 Subject: [PATCH 19/37] Updated gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8d66da36..6524f395 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ temp_dirs/yankring_history_v2.txt sources_forked/yankring/doc/tags sources_non_forked/tlib/doc/tags my_configs.vim +tags From 2a0e2ddc138c12fea19a86179298b4a6c7317496 Mon Sep 17 00:00:00 2001 From: amix Date: Sun, 29 Dec 2013 14:15:49 +0000 Subject: [PATCH 20/37] Updated zenroom --- .../vim-zenroom2/plugin/zenroom2.vim | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim index 3a1153ac..37204f8c 100644 --- a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim +++ b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim @@ -3,7 +3,7 @@ "Description: Emulates iA Writer environment when editing Markdown, reStructuredText " or text files. "Maintainer: Amir Salihefendic -"Version: 0.2 +"Version: 0.1 "Last Change: 2013-12-29 "License: BSD "============================================================================== @@ -19,27 +19,24 @@ let g:loaded_zenroom2_plugin = 1 " " Save the current `background` value for reset later let s:save_background = "" +if exists( "&background" ) + let s:save_background = &background +endif " Save the current `textwidth'` value for reset later let s:save_textwidth = "" +if exists( "&textwidth'" ) + let s:save_textwidth' = &textwidth' +endif function! s:markdown_room() - if exists( "&background" ) - let s:save_background = &background - endif - - if exists( "&textwidth'" ) - let s:save_textwidth' = &textwidth' - endif - set background=light - set linespace=8 set textwidth=80 hi Normal guibg=gray95 hi NonText guifg=gray95 - hi FoldColumn guibg=gray95 ctermbg=bg + hi FoldColumn guibg=gray95 hi CursorLine guibg=gray90 hi Title gui=bold guifg=gray25 hi MarkdownHeadingDelimiter gui=bold guifg=gray25 @@ -76,8 +73,9 @@ function! g:zenroom_goyo_before() if !has("gui_running") return endif + let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" - if &filetype == "markdown" || &filetype == "rst" || &filetype == "text" + if is_mark_or_rst call s:markdown_room() endif endfunction @@ -86,8 +84,8 @@ function! g:zenroom_goyo_after() if !has("gui_running") return endif - - if &filetype == "markdown" || &filetype == "rst" || &filetype == "text" + let is_mark_or_rst = &filetype == "markdown" || &filetype == "rst" || &filetype == "text" + if is_mark_or_rst set linespace=0 if s:save_textwidth != "" @@ -101,4 +99,3 @@ function! g:zenroom_goyo_after() endfunction let g:goyo_callbacks = [ function('g:zenroom_goyo_before'), function('g:zenroom_goyo_after') ] - From b03dc8e510b953f20400342ac79c492d25279b67 Mon Sep 17 00:00:00 2001 From: amix Date: Tue, 7 Jan 2014 00:25:41 +0000 Subject: [PATCH 21/37] Updated plugins --- sources_non_forked/goyo.vim/plugin/goyo.vim | 36 ++++++++++++++----- .../autoload/airline/extensions/tabline.vim | 11 ++++-- .../vim-fugitive/plugin/fugitive.vim | 11 +++--- .../vim-markdown/syntax/markdown.vim | 2 +- sources_non_forked/vim-snipmate/README.md | 12 +++++++ .../vim-snipmate/doc/snipMate.txt | 22 ++++++++++++ .../vim-snipmate/plugin/snipMate.vim | 4 +-- .../vim-snippets/snippets/coffee.snippets | 14 ++++++++ .../vim-zenroom2/README.markdown | 8 +++++ .../vim-zenroom2/plugin/zenroom2.vim | 11 ------ vimrcs/basic.vim | 5 ++- vimrcs/plugins_config.vim | 2 ++ 12 files changed, 107 insertions(+), 31 deletions(-) diff --git a/sources_non_forked/goyo.vim/plugin/goyo.vim b/sources_non_forked/goyo.vim/plugin/goyo.vim index 56066f59..a2beb4a3 100644 --- a/sources_non_forked/goyo.vim/plugin/goyo.vim +++ b/sources_non_forked/goyo.vim/plugin/goyo.vim @@ -126,6 +126,7 @@ function! s:goyo_on(width) \ 'showtabline': &showtabline, \ 'fillchars': &fillchars, \ 'winwidth': &winwidth, + \ 'winminheight': &winminheight, \ 'winheight': &winheight, \ 'statusline': &statusline, \ 'ruler': &ruler, @@ -139,7 +140,7 @@ function! s:goyo_on(width) " vim-gitgutter let t:goyo_disabled_gitgutter = get(g:, 'gitgutter_enabled', 0) if t:goyo_disabled_gitgutter - GitGutterDisable + silent! GitGutterDisable endif " vim-airline @@ -157,6 +158,12 @@ function! s:goyo_on(width) augroup! PowerlineMain endif + " lightline.vim + let t:goyo_disabled_lightline = exists('#LightLine') + if t:goyo_disabled_lightline + silent! call lightline#disable() + endif + if !get(g:, 'goyo_linenr', 0) setlocal nonu if exists('&rnu') @@ -169,6 +176,8 @@ function! s:goyo_on(width) " Global options set winwidth=1 + let &winheight = max([&winminheight, 1]) + set winminheight=1 set winheight=1 set laststatus=0 set showtabline=0 @@ -185,8 +194,8 @@ function! s:goyo_on(width) set guioptions-=L endif - let t:goyo_pads.l = s:init_pad('vertical new') - let t:goyo_pads.r = s:init_pad('vertical rightbelow new') + let t:goyo_pads.l = s:init_pad('vertical topleft new') + let t:goyo_pads.r = s:init_pad('vertical botright new') let t:goyo_pads.t = s:init_pad('topleft new') let t:goyo_pads.b = s:init_pad('botright new') @@ -195,10 +204,6 @@ function! s:goyo_on(width) let &statusline = repeat(' ', winwidth(0)) - if exists('g:goyo_callbacks[0]') - call g:goyo_callbacks[0]() - endif - augroup goyo autocmd! autocmd BufWinLeave call s:goyo_off() @@ -206,6 +211,10 @@ function! s:goyo_on(width) autocmd VimResized * call s:resize_pads() autocmd ColorScheme * call s:tranquilize() augroup END + + if exists('g:goyo_callbacks[0]') + call g:goyo_callbacks[0]() + endif endfunction function! s:goyo_off() @@ -232,6 +241,7 @@ function! s:goyo_off() let goyo_disabled_gitgutter = t:goyo_disabled_gitgutter let goyo_disabled_airline = t:goyo_disabled_airline let goyo_disabled_powerline = t:goyo_disabled_powerline + let goyo_disabled_lightline = t:goyo_disabled_lightline if tabpagenr() == 1 tabnew @@ -240,13 +250,19 @@ function! s:goyo_off() endif tabclose + let wmh = remove(goyo_revert, 'winminheight') + let wh = remove(goyo_revert, 'winheight') + let &winheight = max([wmh, 1]) + let &winminheight = wmh + let &winheight = wh + for [k, v] in items(goyo_revert) execute printf("let &%s = %s", k, string(v)) endfor execute 'colo '. g:colors_name if goyo_disabled_gitgutter - GitGutterEnable + silent! GitGutterEnable endif if goyo_disabled_airline && !exists("#airline") @@ -259,6 +275,10 @@ function! s:goyo_off() silent! PowerlineReloadColorscheme endif + if goyo_disabled_lightline + silent! call lightline#enable() + endif + if exists('#Powerline') doautocmd Powerline ColorScheme endif diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim index cf3d7df2..0bad224f 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim @@ -183,10 +183,13 @@ endfunction let s:current_bufnr = -1 let s:current_tabnr = -1 let s:current_tabline = '' +let s:current_modified = 0 function! s:get_buffers() let cur = bufnr('%') if cur == s:current_bufnr - return s:current_tabline + if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified + return s:current_tabline + endif endif let b = airline#builder#new(s:builder_context) @@ -202,6 +205,7 @@ function! s:get_buffers() else let group = 'airline_tabsel' endif + let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 else if index(tab_bufs, nr) > -1 let group = 'airline_tab' @@ -225,7 +229,9 @@ function! s:get_tabs() let curbuf = bufnr('%') let curtab = tabpagenr() if curbuf == s:current_bufnr && curtab == s:current_tabnr - return s:current_tabline + if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified + return s:current_tabline + endif endif let b = airline#builder#new(s:builder_context) @@ -239,6 +245,7 @@ function! s:get_tabs() endif endfor endif + let s:current_modified = (group == 'airline_tabmod') ? 1 : 0 else let group = 'airline_tab' endif diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index d81705e1..dbbc754d 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -1396,6 +1396,7 @@ function! s:diff_restore() let restore = 'setlocal nodiff noscrollbind' \ . ' scrollopt=' . &l:scrollopt \ . (&l:wrap ? ' wrap' : ' nowrap') + \ . ' foldlevel=999' \ . ' foldmethod=' . &l:foldmethod \ . ' foldcolumn=' . &l:foldcolumn \ . ' foldlevel=' . &l:foldlevel @@ -1499,14 +1500,14 @@ function! s:Diff(bang,...) try let spec = s:repo().translate(file) let commit = matchstr(spec,'\C[^:/]//\zs\x\+') + let restore = s:diff_restore() + let w:fugitive_diff_restore = restore if s:buffer().compare_age(commit) < 0 - execute 'rightbelow '.vert.'split '.s:fnameescape(spec) + execute 'rightbelow '.vert.'diffsplit '.s:fnameescape(spec) else - execute 'leftabove '.vert.'split '.s:fnameescape(spec) + execute 'leftabove '.vert.'diffsplit '.s:fnameescape(spec) endif - call s:diffthis() - wincmd p - call s:diffthis() + let w:fugitive_diff_restore = restore return '' catch /^fugitive:/ return 'echoerr v:errmsg' diff --git a/sources_non_forked/vim-markdown/syntax/markdown.vim b/sources_non_forked/vim-markdown/syntax/markdown.vim index 4ba02b26..ba0d5565 100644 --- a/sources_non_forked/vim-markdown/syntax/markdown.vim +++ b/sources_non_forked/vim-markdown/syntax/markdown.vim @@ -70,7 +70,7 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained -syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart +syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline diff --git a/sources_non_forked/vim-snipmate/README.md b/sources_non_forked/vim-snipmate/README.md index 02718478..5fdf73ac 100644 --- a/sources_non_forked/vim-snipmate/README.md +++ b/sources_non_forked/vim-snipmate/README.md @@ -44,6 +44,18 @@ looking at the [vim-snippets][vim-snippets] repository. " Optional: Bundle "honza/vim-snippets" +## Release Notes ## + +### 0.87 - 2014-01-04 ### + +* Stop indenting empty lines when expanding snippets +* Support extends keyword in .snippets files +* Fix visual placeholder support +* Add zero tabstop support +* Support negative 'softtabstop' +* Add g:snipMate_no_default_aliases option +* Add snipMateTrigger for triggering an expansion inside a snippet +* Add snipMate#CanBeTriggered() function [ultisnips]: https://github.com/sirver/ultisnips [msanders]: https://github.com/msanders diff --git a/sources_non_forked/vim-snipmate/doc/snipMate.txt b/sources_non_forked/vim-snipmate/doc/snipMate.txt index a0f052d3..e39517c6 100644 --- a/sources_non_forked/vim-snipmate/doc/snipMate.txt +++ b/sources_non_forked/vim-snipmate/doc/snipMate.txt @@ -404,6 +404,28 @@ Perhaps some of these features will be added in a later release. ============================================================================== CHANGELOG *SnipMate-changelog* +0.87 - 2014-01-04 +----------------- + +* Stop indenting empty lines when expanding snippets +* Support extends keyword in .snippets files +* Fix visual placeholder support +* Add zero tabstop support +* Support negative 'softtabstop' +* Add g:snipMate_no_default_aliases option +* Add snipMateTrigger for triggering an expansion inside a snippet +* Add snipMate#CanBeTriggered() function + +0.86 - 2013-06-15 +----------------- +* Use more idiomatic maps +* Remove most select mode mappings + +* Fix disappearing variables bug (hpesoj) +* Fix cursor position bug when a variable is on the same line as the stop +* Fix undo point creation causing problems with Supertab +* Fix bug where SnipMate would use a typed trigger as a regular expression + 0.85 - 2013-04-03 ----------------- diff --git a/sources_non_forked/vim-snipmate/plugin/snipMate.vim b/sources_non_forked/vim-snipmate/plugin/snipMate.vim index a4531b02..34d4ad28 100644 --- a/sources_non_forked/vim-snipmate/plugin/snipMate.vim +++ b/sources_non_forked/vim-snipmate/plugin/snipMate.vim @@ -1,13 +1,11 @@ " File: snipMate.vim -" Author: Michael Sanders -" Version: 0.86 " Description: snipMate.vim implements some of TextMate's snippets features in " Vim. A snippet is a piece of often-typed text that you can " insert into your document using a trigger word followed by a "". " " For more help see snipMate.txt; you can do this by using: " :helptags ~/.vim/doc -" :h snipMate.txt +" :h SnipMate if exists('loaded_snips') || &cp || version < 700 finish diff --git a/sources_non_forked/vim-snippets/snippets/coffee.snippets b/sources_non_forked/vim-snippets/snippets/coffee.snippets index aca6e81a..7ed1ebf4 100644 --- a/sources_non_forked/vim-snippets/snippets/coffee.snippets +++ b/sources_non_forked/vim-snippets/snippets/coffee.snippets @@ -93,3 +93,17 @@ snippet req # Export snippet exp ${0:root} = exports ? this + + +snippet ajax + $.ajax + url: "${1:mydomain.com/url}" + type: "${2:POST}" + dataType: "${3:xml/html/script/json}" + data: ${4:data} + complete: (jqXHR, textStatus) -> + ${5:// callback} + success: (data, textStatus, jqXHR) -> + ${6:// success callback} + error: (jqXHR, textStatus, errorThrown) -> + ${0:// error callback} diff --git a/sources_non_forked/vim-zenroom2/README.markdown b/sources_non_forked/vim-zenroom2/README.markdown index 9cc13c8f..e8607d37 100644 --- a/sources_non_forked/vim-zenroom2/README.markdown +++ b/sources_non_forked/vim-zenroom2/README.markdown @@ -7,6 +7,14 @@ zenroom for Vim: Focusing only on the essential](http://amix.dk/blog/post/19744# Please note that this might not work perfectly with your colorscheme. Patches are welcome to fix this :-) +## Installaion and usage + +* Install [goyo.vim](https://github.com/junegunn/goyo.vim) +* In command mode type :Goyo + +Additionally you may want to have a shortcut. Add this to your vimrc: + + nnoremap z :Goyo ## Inspirations/Similar * [Writing Markdown With Style in Vim](http://astrails.com/blog/2013/8/12/writing-markdown-with-style-in-vim) diff --git a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim index 37204f8c..a9781c74 100644 --- a/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim +++ b/sources_non_forked/vim-zenroom2/plugin/zenroom2.vim @@ -23,16 +23,9 @@ if exists( "&background" ) let s:save_background = &background endif -" Save the current `textwidth'` value for reset later -let s:save_textwidth = "" -if exists( "&textwidth'" ) - let s:save_textwidth' = &textwidth' -endif - function! s:markdown_room() set background=light set linespace=8 - set textwidth=80 hi Normal guibg=gray95 hi NonText guifg=gray95 @@ -88,10 +81,6 @@ function! g:zenroom_goyo_after() if is_mark_or_rst set linespace=0 - if s:save_textwidth != "" - exec( "set textwidth=" . s:save_textwidth ) - endif - if s:save_background != "" exec( "set background=" . s:save_background ) endif diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index 2e31754d..6cbbc3a2 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -343,9 +343,12 @@ map s? z= " Remove the Windows ^M - when the encodings gets messed up noremap m mmHmt:%s///ge'tzt'm -" Quickly open a buffer for scripbble +" Quickly open a buffer for scribble map q :e ~/buffer +" Quickly open a markdown buffer for scribble +map x :e ~/buffer.md + " Toggle paste mode on and off map pp :setlocal paste! diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index 6d726e88..92db3f18 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -110,4 +110,6 @@ let g:airline_theme="luna" " => Vimroom """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let g:goyo_width=100 +let g:goyo_margin_top = 2 +let g:goyo_margin_bottom = 2 nnoremap z :Goyo From f2d64022f58f6d0dcaba089204503791c0f93697 Mon Sep 17 00:00:00 2001 From: Karl Coelho Date: Thu, 6 Feb 2014 13:36:37 +0400 Subject: [PATCH 22/37] Fixed the pathogen error --- vimrcs/plugins_config.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index 92db3f18..a2a7e146 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -8,8 +8,8 @@ """""""""""""""""""""""""""""" " => Load pathogen paths """""""""""""""""""""""""""""" -call pathogen#infect('~/.vim_runtime/sources_forked') -call pathogen#infect('~/.vim_runtime/sources_non_forked') +call pathogen#infect('~/.vim_runtime/sources_forked/*') +call pathogen#infect('~/.vim_runtime/sources_non_forked/*') call pathogen#helptags() """""""""""""""""""""""""""""" From 8265dca5d5a7cb37a85dd82823dde2f9f69a3abe Mon Sep 17 00:00:00 2001 From: amix Date: Fri, 7 Feb 2014 10:41:15 +0000 Subject: [PATCH 23/37] Updated plugins. Switched to Ack as standard search tool (much better than grep/vimgrep) --- sources_non_forked/goyo.vim/plugin/goyo.vim | 4 +- .../pyflakes-pathogen/.gitignore | 1 + .../pyflakes-pathogen/README.rst | 11 + .../ftplugin/python/README.rst | 80 +++ .../ftplugin/python/pyflakes.vim | 325 +++++++++ .../ftplugin/python/pyflakes/LICENSE | 21 + .../ftplugin/python/pyflakes/NEWS.txt | 29 + .../ftplugin/python/pyflakes/README.rst | 36 + .../ftplugin/python/pyflakes/TODO | 11 + .../python/pyflakes/pyflakes/__init__.py | 2 + .../ftplugin/python/pyflakes/pyflakes/ast.py | 311 ++++++++ .../python/pyflakes/pyflakes/checker.py | 625 ++++++++++++++++ .../python/pyflakes/pyflakes/messages.py | 96 +++ .../pyflakes/pyflakes/scripts/__init__.py | 0 .../pyflakes/pyflakes/scripts/pyflakes.py | 90 +++ .../python/pyflakes/pyflakes/test/__init__.py | 0 .../python/pyflakes/pyflakes/test/harness.py | 27 + .../pyflakes/pyflakes/test/test_imports.py | 673 ++++++++++++++++++ .../pyflakes/pyflakes/test/test_other.py | 575 +++++++++++++++ .../pyflakes/pyflakes/test/test_script.py | 185 +++++ .../pyflakes/test/test_undefined_names.py | 265 +++++++ .../ftplugin/python/pyflakes/setup.py | 28 + .../ftplugin/python/quickfix.diff | 124 ++++ .../tlib/autoload/tlib/World.vim | 50 +- .../tlib/autoload/tlib/agent.vim | 5 +- .../tlib/autoload/tlib/file.vim | 6 +- .../tlib/autoload/tlib/scratch.vim | 10 +- sources_non_forked/tlib/doc/tlib.txt | 2 +- sources_non_forked/tlib/plugin/02tlib.vim | 4 +- sources_non_forked/vim-airline/LICENSE | 2 +- sources_non_forked/vim-airline/README.md | 8 +- .../vim-airline/autoload/airline.vim | 2 +- .../vim-airline/autoload/airline/builder.vim | 2 +- .../vim-airline/autoload/airline/debug.vim | 2 +- .../autoload/airline/deprecation.vim | 2 +- .../autoload/airline/extensions.vim | 11 +- .../autoload/airline/extensions/branch.vim | 13 +- .../airline/extensions/bufferline.vim | 2 +- .../autoload/airline/extensions/commandt.vim | 2 +- .../autoload/airline/extensions/csv.vim | 2 +- .../autoload/airline/extensions/ctrlp.vim | 2 +- .../autoload/airline/extensions/default.vim | 2 +- .../autoload/airline/extensions/eclim.vim | 2 +- .../autoload/airline/extensions/example.vim | 2 +- .../autoload/airline/extensions/hunks.vim | 2 +- .../autoload/airline/extensions/netrw.vim | 32 + .../airline/extensions/promptline.vim | 33 + .../autoload/airline/extensions/quickfix.vim | 2 +- .../autoload/airline/extensions/syntastic.vim | 2 +- .../autoload/airline/extensions/tabline.vim | 2 +- .../airline/extensions/tabline/default.vim | 2 +- .../extensions/tabline/unique_tail.vim | 2 +- .../tabline/unique_tail_improved.vim | 2 +- .../autoload/airline/extensions/tagbar.vim | 2 +- .../autoload/airline/extensions/tmuxline.vim | 2 +- .../autoload/airline/extensions/undotree.vim | 2 +- .../autoload/airline/extensions/unite.vim | 2 +- .../airline/extensions/virtualenv.vim | 2 +- .../airline/extensions/whitespace.vim | 2 +- .../autoload/airline/highlighter.vim | 2 +- .../vim-airline/autoload/airline/init.vim | 2 +- .../vim-airline/autoload/airline/parts.vim | 2 +- .../vim-airline/autoload/airline/section.vim | 2 +- .../vim-airline/autoload/airline/themes.vim | 2 +- .../autoload/airline/themes/kalisi.vim | 57 ++ .../vim-airline/autoload/airline/util.vim | 2 +- .../vim-airline/doc/airline.txt | 24 +- .../vim-airline/plugin/airline.vim | 2 +- .../vim-fugitive/plugin/fugitive.vim | 3 + .../vim-snipmate/Contributors.md | 1 + sources_non_forked/vim-snipmate/README.md | 11 +- .../vim-snipmate/autoload/snipMate.vim | 12 +- sources_non_forked/vim-snippets/README.md | 26 + .../vim-snippets/snippets/puppet.snippets | 90 +-- update_plugins.py | 1 + vimrcs/basic.vim | 16 +- 76 files changed, 3855 insertions(+), 143 deletions(-) create mode 100644 sources_non_forked/pyflakes-pathogen/.gitignore create mode 100644 sources_non_forked/pyflakes-pathogen/README.rst create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/__init__.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py create mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/netrw.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/promptline.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/themes/kalisi.vim diff --git a/sources_non_forked/goyo.vim/plugin/goyo.vim b/sources_non_forked/goyo.vim/plugin/goyo.vim index a2beb4a3..751162ce 100644 --- a/sources_non_forked/goyo.vim/plugin/goyo.vim +++ b/sources_non_forked/goyo.vim/plugin/goyo.vim @@ -259,7 +259,7 @@ function! s:goyo_off() for [k, v] in items(goyo_revert) execute printf("let &%s = %s", k, string(v)) endfor - execute 'colo '. g:colors_name + execute 'colo '. get(g:, 'colors_name', 'default') if goyo_disabled_gitgutter silent! GitGutterEnable @@ -267,7 +267,7 @@ function! s:goyo_off() if goyo_disabled_airline && !exists("#airline") AirlineToggle - AirlineRefresh + silent! AirlineRefresh endif if goyo_disabled_powerline && !exists("#PowerlineMain") diff --git a/sources_non_forked/pyflakes-pathogen/.gitignore b/sources_non_forked/pyflakes-pathogen/.gitignore new file mode 100644 index 00000000..0d20b648 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/sources_non_forked/pyflakes-pathogen/README.rst b/sources_non_forked/pyflakes-pathogen/README.rst new file mode 100644 index 00000000..b36ea388 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/README.rst @@ -0,0 +1,11 @@ +Pyflakes +========== + +This is just a manual dump of the vim pyflakes plugin from: +http://www.vim.org/scripts/script.php?script_id=2441 + +The purpose is to try to make this compatible with pathogen plugin. So creating +the dir structure and hopefully this means we can just keep the norm and git +clone the repo into the bundle directory and things will load up magically. + + diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst b/sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst new file mode 100644 index 00000000..124fc3ec --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst @@ -0,0 +1,80 @@ +pyflakes-vim +============ + +A Vim plugin for checking Python code on the fly. + +PyFlakes catches common Python errors like mistyping a variable name or +accessing a local before it is bound, and also gives warnings for things like +unused imports. + +pyflakes-vim uses the output from PyFlakes to highlight errors in your code. +To locate errors quickly, use quickfix_ commands like :cc. + +Make sure to check vim.org_ for the latest updates. + +.. _pyflakes.vim: http://www.vim.org/scripts/script.php?script_id=2441 +.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 +.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix + +Quick Installation +------------------ + +1. Make sure your ``.vimrc`` has:: + + filetype on " enables filetype detection + filetype plugin on " enables filetype specific plugins + +2. Download the latest release_. + +3. Unzip ``pyflakes.vim`` and the ``pyflakes`` directory into + ``~/.vim/ftplugin/python`` (or somewhere similar on your + `runtime path`_ that will be sourced for Python files). + +.. _release: http://www.vim.org/scripts/script.php?script_id=2441 +.. _runtime path: http://vimdoc.sourceforge.net/htmldoc/options.html#'runtimepath' + +Installation +------------ + +If you downloaded this from vim.org_, then just drop the contents of the zip +file into ``~/.vim/ftplugin/python``. + +Otherwise, if you're running "from source," you'll need PyFlakes on your +PYTHONPATH somewhere. I recommend getting my PyFlakes_ fork, which retains +column number information and has therfore has more specific error locations. + +.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 +.. _PyFlakes: http://github.com/kevinw/pyflakes + +Hacking +------- + +:: + + git clone git://github.com/kevinw/pyflakes-vim.git + cd pyflakes-vim + git clone git://github.com/kevinw/pyflakes.git + +Options +------- + +Set this option to you vimrc file to disable quickfix support:: + + let g:pyflakes_use_quickfix = 0 + +The value is set to 1 by default. + +TODO +---- + * signs_ support (show warning and error icons to left of the buffer area) + * configuration variables + * parse or intercept useful output from the warnings module + +.. _signs: http://www.vim.org/htmldoc/sign.html + +Changelog +--------- + +Please see http://www.vim.org/scripts/script.php?script_id=2441 for a history of +all changes. + diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim new file mode 100644 index 00000000..a6e84b6a --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim @@ -0,0 +1,325 @@ +" pyflakes.vim - A script to highlight Python code on the fly with warnings +" from Pyflakes, a Python lint tool. +" +" Place this script and the accompanying pyflakes directory in +" .vim/ftplugin/python. +" +" See README for additional installation and information. +" +" Thanks to matlib.vim for ideas/code on interactive linting. +" +" Maintainer: Kevin Watters +" Version: 0.1 +if !has('python') + " exit if python is not available. + finish +endif + +if exists("b:did_pyflakes_plugin") + finish " only load once +else + let b:did_pyflakes_plugin = 1 +endif + +if !exists('g:pyflakes_builtins') + let g:pyflakes_builtins = [] +endif + +if !exists("b:did_python_init") + let b:did_python_init = 0 + + if !has('python') + echoerr "Error: the pyflakes.vim plugin requires Vim to be compiled with +python" + finish + endif + +if !exists('g:pyflakes_use_quickfix') + let g:pyflakes_use_quickfix = 1 +endif + + + python << EOF +import vim +import os.path +import sys + +if sys.version_info[:2] < (2, 5): + raise AssertionError('Vim must be compiled with Python 2.5 or higher; you have ' + sys.version) + +# get the directory this script is in: the pyflakes python module should be installed there. +scriptdir = os.path.join(os.path.dirname(vim.eval('expand("")')), 'pyflakes') +sys.path.insert(0, scriptdir) + +import ast +from pyflakes import checker, messages +from operator import attrgetter +import re + +class loc(object): + def __init__(self, lineno, col=None): + self.lineno = lineno + self.col_offset = col + +class SyntaxError(messages.Message): + message = 'could not compile: %s' + def __init__(self, filename, lineno, col, message): + messages.Message.__init__(self, filename, loc(lineno, col)) + self.message_args = (message,) + +class blackhole(object): + write = flush = lambda *a, **k: None + +def check(buffer): + filename = buffer.name + contents = buffer[:] + + # shebang usually found at the top of the file, followed by source code encoding marker. + # assume everything else that follows is encoded in the encoding. + encoding_found = False + for n, line in enumerate(contents): + if n >= 2: + break + elif re.match(r'#.*coding[:=]\s*([-\w.]+)', line): + contents = ['']*(n+1) + contents[n+1:] + break + + contents = '\n'.join(contents) + '\n' + + vimenc = vim.eval('&encoding') + if vimenc: + contents = contents.decode(vimenc) + + builtins = set(['__file__']) + try: + builtins.update(set(eval(vim.eval('string(g:pyflakes_builtins)')))) + except Exception: + pass + + try: + # TODO: use warnings filters instead of ignoring stderr + old_stderr, sys.stderr = sys.stderr, blackhole() + try: + tree = ast.parse(contents, filename or '') + finally: + sys.stderr = old_stderr + except: + try: + value = sys.exc_info()[1] + lineno, offset, line = value[1][1:] + except IndexError: + lineno, offset, line = 1, 0, '' + if line and line.endswith("\n"): + line = line[:-1] + + return [SyntaxError(filename, lineno, offset, str(value))] + else: + # pyflakes looks to _MAGIC_GLOBALS in checker.py to see which + # UndefinedNames to ignore + old_globals = getattr(checker,' _MAGIC_GLOBALS', []) + checker._MAGIC_GLOBALS = set(old_globals) | builtins + + w = checker.Checker(tree, filename) + + checker._MAGIC_GLOBALS = old_globals + + w.messages.sort(key = attrgetter('lineno')) + return w.messages + + +def vim_quote(s): + return s.replace("'", "''") +EOF + let b:did_python_init = 1 +endif + +if !b:did_python_init + finish +endif + +au BufLeave call s:ClearPyflakes() + +au BufEnter call s:RunPyflakes() +au InsertLeave call s:RunPyflakes() +au InsertEnter call s:RunPyflakes() +au BufWritePost call s:RunPyflakes() + +au CursorHold call s:RunPyflakes() +au CursorHoldI call s:RunPyflakes() + +au CursorHold call s:GetPyflakesMessage() +au CursorMoved call s:GetPyflakesMessage() + +if !exists("*s:PyflakesUpdate") + function s:PyflakesUpdate() + silent call s:RunPyflakes() + call s:GetPyflakesMessage() + endfunction +endif + +" Call this function in your .vimrc to update PyFlakes +if !exists(":PyflakesUpdate") + command PyflakesUpdate :call s:PyflakesUpdate() +endif + +" Hook common text manipulation commands to update PyFlakes +" TODO: is there a more general "text op" autocommand we could register +" for here? +noremap dd dd:PyflakesUpdate +noremap dw dw:PyflakesUpdate +noremap u u:PyflakesUpdate +noremap :PyflakesUpdate + +" WideMsg() prints [long] message up to (&columns-1) length +" guaranteed without "Press Enter" prompt. +if !exists("*s:WideMsg") + function s:WideMsg(msg) + let x=&ruler | let y=&showcmd + set noruler noshowcmd + redraw + echo strpart(a:msg, 0, &columns-1) + let &ruler=x | let &showcmd=y + endfun +endif + +if !exists("*s:GetQuickFixStackCount") + function s:GetQuickFixStackCount() + let l:stack_count = 0 + try + silent colder 9 + catch /E380:/ + endtry + + try + for i in range(9) + silent cnewer + let l:stack_count = l:stack_count + 1 + endfor + catch /E381:/ + return l:stack_count + endtry + endfunction +endif + +if !exists("*s:ActivatePyflakesQuickFixWindow") + function s:ActivatePyflakesQuickFixWindow() + try + silent colder 9 " go to the bottom of quickfix stack + catch /E380:/ + endtry + + if s:pyflakes_qf > 0 + try + exe "silent cnewer " . s:pyflakes_qf + catch /E381:/ + echoerr "Could not activate Pyflakes Quickfix Window." + endtry + endif + endfunction +endif + +if !exists("*s:RunPyflakes") + function s:RunPyflakes() + highlight link PyFlakes SpellBad + + if exists("b:cleared") + if b:cleared == 0 + silent call s:ClearPyflakes() + let b:cleared = 1 + endif + else + let b:cleared = 1 + endif + + let b:matched = [] + let b:matchedlines = {} + + let b:qf_list = [] + let b:qf_window_count = -1 + + python << EOF +for w in check(vim.current.buffer): + vim.command('let s:matchDict = {}') + vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) + vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) + vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") + + vim.command("let l:qf_item = {}") + vim.command("let l:qf_item.bufnr = bufnr('%')") + vim.command("let l:qf_item.filename = expand('%')") + vim.command("let l:qf_item.lnum = %s" % str(w.lineno)) + vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args)) + vim.command("let l:qf_item.type = 'E'") + + if getattr(w, 'col', None) is None or isinstance(w, SyntaxError): + # without column information, just highlight the whole line + # (minus the newline) + vim.command(r"let s:mID = matchadd('PyFlakes', '\%" + str(w.lineno) + r"l\n\@!')") + else: + # with a column number, highlight the first keyword there + vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") + + vim.command("let l:qf_item.vcol = 1") + vim.command("let l:qf_item.col = %s" % str(w.col + 1)) + + vim.command("call add(b:matched, s:matchDict)") + vim.command("call add(b:qf_list, l:qf_item)") +EOF + if g:pyflakes_use_quickfix == 1 + if exists("s:pyflakes_qf") + " if pyflakes quickfix window is already created, reuse it + call s:ActivatePyflakesQuickFixWindow() + call setqflist(b:qf_list, 'r') + else + " one pyflakes quickfix window for all buffer + call setqflist(b:qf_list, '') + let s:pyflakes_qf = s:GetQuickFixStackCount() + endif + endif + + let b:cleared = 0 + endfunction +end + +" keep track of whether or not we are showing a message +let b:showing_message = 0 + +if !exists("*s:GetPyflakesMessage") + function s:GetPyflakesMessage() + let s:cursorPos = getpos(".") + + " Bail if RunPyflakes hasn't been called yet. + if !exists('b:matchedlines') + return + endif + + " if there's a message for the line the cursor is currently on, echo + " it to the console + if has_key(b:matchedlines, s:cursorPos[1]) + let s:pyflakesMatch = get(b:matchedlines, s:cursorPos[1]) + call s:WideMsg(s:pyflakesMatch['message']) + let b:showing_message = 1 + return + endif + + " otherwise, if we're showing a message, clear it + if b:showing_message == 1 + echo + let b:showing_message = 0 + endif + endfunction +endif + +if !exists('*s:ClearPyflakes') + function s:ClearPyflakes() + let s:matches = getmatches() + for s:matchId in s:matches + if s:matchId['group'] == 'PyFlakes' + call matchdelete(s:matchId['id']) + endif + endfor + let b:matched = [] + let b:matchedlines = {} + let b:cleared = 1 + endfunction +endif + diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE new file mode 100644 index 00000000..42b8cf3c --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) 2005 Divmod, Inc., http://www.divmod.com/ + +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. diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt new file mode 100644 index 00000000..2a3e3165 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt @@ -0,0 +1,29 @@ +0.4.0 (2009-11-25): + - Fix reporting for certain SyntaxErrors which lack line number + information. + - Check for syntax errors more rigorously. + - Support checking names used with the class decorator syntax in versions + of Python which have it. + - Detect local variables which are bound but never used. + - Handle permission errors when trying to read source files. + - Handle problems with the encoding of source files. + - Support importing dotted names so as not to incorrectly report them as + redefined unused names. + - Support all forms of the with statement. + - Consider static `__all__` definitions and avoid reporting unused names + if the names are listed there. + - Fix incorrect checking of class names with respect to the names of their + bases in the class statement. + - Support the `__path__` global in `__init__.py`. + +0.3.0 (2009-01-30): + - Display more informative SyntaxError messages. + - Don't hang flymake with unmatched triple quotes (only report a single + line of source for a multiline syntax error). + - Recognize __builtins__ as a defined name. + - Improve pyflakes support for python versions 2.3-2.5 + - Support for if-else expressions and with statements. + - Warn instead of error on non-existant file paths. + - Check for __future__ imports after other statements. + - Add reporting for some types of import shadowing. + - Improve reporting of unbound locals diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst new file mode 100644 index 00000000..9ac34fc0 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst @@ -0,0 +1,36 @@ +pyflakes +======== + +This version of PyFlakes_ has been improved to use Python's newer ``ast`` +module, instead of ``compiler``. So code checking happens faster, and will stay +up to date with new language changes. + +.. _PyFlakes: http://http://www.divmod.org/trac/wiki/DivmodPyflakes + +TODO +---- + +Importing several modules from the same package results in unnecessary warnings: + +:: + + import a.b + import a.c # Redefinition of unused "a" from line 1 + +The following construct for defining a function differently depending on some +condition results in a redefinition warning: + +:: + + if some_condition: + def foo(): do_foo() + else: + def foo(): do_bar() # redefinition of function 'foo' from line 2 + +IDE Integration +--------------- + +* vim: pyflakes-vim_ + +.. _pyflakes-vim: http://github.com/kevinw/pyflakes-vim + diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO new file mode 100644 index 00000000..69f3f12c --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO @@ -0,0 +1,11 @@ + - Check for methods that override other methods except that they vary by case. + - assign/increment + unbound local error not caught + def foo(): + bar = 5 + def meep(): + bar += 2 + meep() + print bar + + print foo() + diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py new file mode 100644 index 00000000..652a8f47 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py @@ -0,0 +1,2 @@ + +__version__ = '0.4.0' diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py new file mode 100644 index 00000000..d52025f4 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py @@ -0,0 +1,311 @@ +# -*- coding: utf-8 -*- +""" + ast + ~~~ + + The `ast` module helps Python applications to process trees of the Python + abstract syntax grammar. The abstract syntax itself might change with + each Python release; this module helps to find out programmatically what + the current grammar looks like and allows modifications of it. + + An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as + a flag to the `compile()` builtin function or by using the `parse()` + function from this module. The result will be a tree of objects whose + classes all inherit from `ast.AST`. + + A modified abstract syntax tree can be compiled into a Python code object + using the built-in `compile()` function. + + Additionally various helper functions are provided that make working with + the trees simpler. The main intention of the helper functions and this + module in general is to provide an easy to use interface for libraries + that work tightly with the python syntax (template engines for example). + + + :copyright: Copyright 2008 by Armin Ronacher. + :license: Python License. +""" +from _ast import * +from _ast import __version__ + + +def parse(expr, filename='', mode='exec'): + """ + Parse an expression into an AST node. + Equivalent to compile(expr, filename, mode, PyCF_ONLY_AST). + """ + return compile(expr, filename, mode, PyCF_ONLY_AST) + + +def literal_eval(node_or_string): + """ + Safely evaluate an expression node or a string containing a Python + expression. The string or node provided may only consist of the following + Python literal structures: strings, numbers, tuples, lists, dicts, booleans, + and None. + """ + _safe_names = {'None': None, 'True': True, 'False': False} + if isinstance(node_or_string, basestring): + node_or_string = parse(node_or_string, mode='eval') + if isinstance(node_or_string, Expression): + node_or_string = node_or_string.body + def _convert(node): + if isinstance(node, Str): + return node.s + elif isinstance(node, Num): + return node.n + elif isinstance(node, Tuple): + return tuple(map(_convert, node.elts)) + elif isinstance(node, List): + return list(map(_convert, node.elts)) + elif isinstance(node, Dict): + return dict((_convert(k), _convert(v)) for k, v + in zip(node.keys, node.values)) + elif isinstance(node, Name): + if node.id in _safe_names: + return _safe_names[node.id] + raise ValueError('malformed string') + return _convert(node_or_string) + + +def dump(node, annotate_fields=True, include_attributes=False): + """ + Return a formatted dump of the tree in *node*. This is mainly useful for + debugging purposes. The returned string will show the names and the values + for fields. This makes the code impossible to evaluate, so if evaluation is + wanted *annotate_fields* must be set to False. Attributes such as line + numbers and column offsets are not dumped by default. If this is wanted, + *include_attributes* can be set to True. + """ + def _format(node): + if isinstance(node, AST): + fields = [(a, _format(b)) for a, b in iter_fields(node)] + rv = '%s(%s' % (node.__class__.__name__, ', '.join( + ('%s=%s' % field for field in fields) + if annotate_fields else + (b for a, b in fields) + )) + if include_attributes and node._attributes: + rv += fields and ', ' or ' ' + rv += ', '.join('%s=%s' % (a, _format(getattr(node, a))) + for a in node._attributes) + return rv + ')' + elif isinstance(node, list): + return '[%s]' % ', '.join(_format(x) for x in node) + return repr(node) + if not isinstance(node, AST): + raise TypeError('expected AST, got %r' % node.__class__.__name__) + return _format(node) + + +def copy_location(new_node, old_node): + """ + Copy source location (`lineno` and `col_offset` attributes) from + *old_node* to *new_node* if possible, and return *new_node*. + """ + for attr in 'lineno', 'col_offset': + if attr in old_node._attributes and attr in new_node._attributes \ + and hasattr(old_node, attr): + setattr(new_node, attr, getattr(old_node, attr)) + return new_node + + +def fix_missing_locations(node): + """ + When you compile a node tree with compile(), the compiler expects lineno and + col_offset attributes for every node that supports them. This is rather + tedious to fill in for generated nodes, so this helper adds these attributes + recursively where not already set, by setting them to the values of the + parent node. It works recursively starting at *node*. + """ + def _fix(node, lineno, col_offset): + if 'lineno' in node._attributes: + if not hasattr(node, 'lineno'): + node.lineno = lineno + else: + lineno = node.lineno + if 'col_offset' in node._attributes: + if not hasattr(node, 'col_offset'): + node.col_offset = col_offset + else: + col_offset = node.col_offset + for child in iter_child_nodes(node): + _fix(child, lineno, col_offset) + _fix(node, 1, 0) + return node + +def add_col_end(node): + def _fix(node, next): + children = list(iter_child_nodes(node)) + for i, child in enumerate(children): + next_offset = children[i+1].col_offset if i < len(children) else next.col_offset + child.col_end = next_offset + + +def increment_lineno(node, n=1): + """ + Increment the line number of each node in the tree starting at *node* by *n*. + This is useful to "move code" to a different location in a file. + """ + if 'lineno' in node._attributes: + node.lineno = getattr(node, 'lineno', 0) + n + for child in walk(node): + if 'lineno' in child._attributes: + child.lineno = getattr(child, 'lineno', 0) + n + return node + + +def iter_fields(node): + """ + Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` + that is present on *node*. + """ + if node._fields is None: + return + + for field in node._fields: + try: + yield field, getattr(node, field) + except AttributeError: + pass + + +def iter_child_nodes(node): + """ + Yield all direct child nodes of *node*, that is, all fields that are nodes + and all items of fields that are lists of nodes. + """ + for name, field in iter_fields(node): + if isinstance(field, AST): + yield field + elif isinstance(field, list): + for item in field: + if isinstance(item, AST): + yield item + + +def get_docstring(node, clean=True): + """ + Return the docstring for the given node or None if no docstring can + be found. If the node provided does not have docstrings a TypeError + will be raised. + """ + if not isinstance(node, (FunctionDef, ClassDef, Module)): + raise TypeError("%r can't have docstrings" % node.__class__.__name__) + if node.body and isinstance(node.body[0], Expr) and \ + isinstance(node.body[0].value, Str): + if clean: + import inspect + return inspect.cleandoc(node.body[0].value.s) + return node.body[0].value.s + + +def walk(node): + """ + Recursively yield all child nodes of *node*, in no specified order. This is + useful if you only want to modify nodes in place and don't care about the + context. + """ + from collections import deque + todo = deque([node]) + while todo: + node = todo.popleft() + todo.extend(iter_child_nodes(node)) + yield node + + +class NodeVisitor(object): + """ + A node visitor base class that walks the abstract syntax tree and calls a + visitor function for every node found. This function may return a value + which is forwarded by the `visit` method. + + This class is meant to be subclassed, with the subclass adding visitor + methods. + + Per default the visitor functions for the nodes are ``'visit_'`` + + class name of the node. So a `TryFinally` node visit function would + be `visit_TryFinally`. This behavior can be changed by overriding + the `visit` method. If no visitor function exists for a node + (return value `None`) the `generic_visit` visitor is used instead. + + Don't use the `NodeVisitor` if you want to apply changes to nodes during + traversing. For this a special visitor exists (`NodeTransformer`) that + allows modifications. + """ + + def visit(self, node): + """Visit a node.""" + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + return visitor(node) + + def generic_visit(self, node): + """Called if no explicit visitor function exists for a node.""" + for field, value in iter_fields(node): + if isinstance(value, list): + for item in value: + if isinstance(item, AST): + self.visit(item) + elif isinstance(value, AST): + self.visit(value) + + +class NodeTransformer(NodeVisitor): + """ + A :class:`NodeVisitor` subclass that walks the abstract syntax tree and + allows modification of nodes. + + The `NodeTransformer` will walk the AST and use the return value of the + visitor methods to replace or remove the old node. If the return value of + the visitor method is ``None``, the node will be removed from its location, + otherwise it is replaced with the return value. The return value may be the + original node in which case no replacement takes place. + + Here is an example transformer that rewrites all occurrences of name lookups + (``foo``) to ``data['foo']``:: + + class RewriteName(NodeTransformer): + + def visit_Name(self, node): + return copy_location(Subscript( + value=Name(id='data', ctx=Load()), + slice=Index(value=Str(s=node.id)), + ctx=node.ctx + ), node) + + Keep in mind that if the node you're operating on has child nodes you must + either transform the child nodes yourself or call the :meth:`generic_visit` + method for the node first. + + For nodes that were part of a collection of statements (that applies to all + statement nodes), the visitor may also return a list of nodes rather than + just a single node. + + Usually you use the transformer like this:: + + node = YourTransformer().visit(node) + """ + + def generic_visit(self, node): + for field, old_value in iter_fields(node): + old_value = getattr(node, field, None) + if isinstance(old_value, list): + new_values = [] + for value in old_value: + if isinstance(value, AST): + value = self.visit(value) + if value is None: + continue + elif not isinstance(value, AST): + new_values.extend(value) + continue + new_values.append(value) + old_value[:] = new_values + elif isinstance(old_value, AST): + new_node = self.visit(old_value) + if new_node is None: + delattr(node, field) + else: + setattr(node, field, new_node) + return node diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py new file mode 100644 index 00000000..7c348b8d --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py @@ -0,0 +1,625 @@ +# -*- test-case-name: pyflakes -*- +# (c) 2005-2010 Divmod, Inc. +# See LICENSE file for details + +import __builtin__ +import os.path +import _ast + +from pyflakes import messages + + +# utility function to iterate over an AST node's children, adapted +# from Python 2.6's standard ast module +try: + import ast + iter_child_nodes = ast.iter_child_nodes +except (ImportError, AttributeError): + def iter_child_nodes(node, astcls=_ast.AST): + """ + Yield all direct child nodes of *node*, that is, all fields that are nodes + and all items of fields that are lists of nodes. + """ + for name in node._fields: + field = getattr(node, name, None) + if isinstance(field, astcls): + yield field + elif isinstance(field, list): + for item in field: + yield item + + +class Binding(object): + """ + Represents the binding of a value to a name. + + The checker uses this to keep track of which names have been bound and + which names have not. See L{Assignment} for a special type of binding that + is checked with stricter rules. + + @ivar used: pair of (L{Scope}, line-number) indicating the scope and + line number that this binding was last used + """ + + def __init__(self, name, source): + self.name = name + self.source = source + self.used = False + + + def __str__(self): + return self.name + + + def __repr__(self): + return '<%s object %r from line %r at 0x%x>' % (self.__class__.__name__, + self.name, + self.source.lineno, + id(self)) + + + +class UnBinding(Binding): + '''Created by the 'del' operator.''' + + + +class Importation(Binding): + """ + A binding created by an import statement. + + @ivar fullName: The complete name given to the import statement, + possibly including multiple dotted components. + @type fullName: C{str} + """ + def __init__(self, name, source): + self.fullName = name + name = name.split('.')[0] + super(Importation, self).__init__(name, source) + + + +class Argument(Binding): + """ + Represents binding a name as an argument. + """ + + + +class Assignment(Binding): + """ + Represents binding a name with an explicit assignment. + + The checker will raise warnings for any Assignment that isn't used. Also, + the checker does not consider assignments in tuple/list unpacking to be + Assignments, rather it treats them as simple Bindings. + """ + + + +class FunctionDefinition(Binding): + pass + + + +class ExportBinding(Binding): + """ + A binding created by an C{__all__} assignment. If the names in the list + can be determined statically, they will be treated as names for export and + additional checking applied to them. + + The only C{__all__} assignment that can be recognized is one which takes + the value of a literal list containing literal strings. For example:: + + __all__ = ["foo", "bar"] + + Names which are imported and not otherwise used but appear in the value of + C{__all__} will not have an unused import warning reported for them. + """ + def names(self): + """ + Return a list of the names referenced by this binding. + """ + names = [] + if isinstance(self.source, _ast.List): + for node in self.source.elts: + if isinstance(node, _ast.Str): + names.append(node.s) + return names + + + +class Scope(dict): + importStarred = False # set to True when import * is found + + + def __repr__(self): + return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), dict.__repr__(self)) + + + def __init__(self): + super(Scope, self).__init__() + + + +class ClassScope(Scope): + pass + + + +class FunctionScope(Scope): + """ + I represent a name scope for a function. + + @ivar globals: Names declared 'global' in this function. + """ + def __init__(self): + super(FunctionScope, self).__init__() + self.globals = {} + + + +class ModuleScope(Scope): + pass + + +# Globally defined names which are not attributes of the __builtin__ module. +_MAGIC_GLOBALS = ['__file__', '__builtins__'] + + + +class Checker(object): + """ + I check the cleanliness and sanity of Python code. + + @ivar _deferredFunctions: Tracking list used by L{deferFunction}. Elements + of the list are two-tuples. The first element is the callable passed + to L{deferFunction}. The second element is a copy of the scope stack + at the time L{deferFunction} was called. + + @ivar _deferredAssignments: Similar to C{_deferredFunctions}, but for + callables which are deferred assignment checks. + """ + + nodeDepth = 0 + traceTree = False + + def __init__(self, tree, filename='(none)'): + self._deferredFunctions = [] + self._deferredAssignments = [] + self.dead_scopes = [] + self.messages = [] + self.filename = filename + self.scopeStack = [ModuleScope()] + self.futuresAllowed = True + self.handleChildren(tree) + self._runDeferred(self._deferredFunctions) + # Set _deferredFunctions to None so that deferFunction will fail + # noisily if called after we've run through the deferred functions. + self._deferredFunctions = None + self._runDeferred(self._deferredAssignments) + # Set _deferredAssignments to None so that deferAssignment will fail + # noisly if called after we've run through the deferred assignments. + self._deferredAssignments = None + del self.scopeStack[1:] + self.popScope() + self.check_dead_scopes() + + + def deferFunction(self, callable): + ''' + Schedule a function handler to be called just before completion. + + This is used for handling function bodies, which must be deferred + because code later in the file might modify the global scope. When + `callable` is called, the scope at the time this is called will be + restored, however it will contain any new bindings added to it. + ''' + self._deferredFunctions.append((callable, self.scopeStack[:])) + + + def deferAssignment(self, callable): + """ + Schedule an assignment handler to be called just after deferred + function handlers. + """ + self._deferredAssignments.append((callable, self.scopeStack[:])) + + + def _runDeferred(self, deferred): + """ + Run the callables in C{deferred} using their associated scope stack. + """ + for handler, scope in deferred: + self.scopeStack = scope + handler() + + + def scope(self): + return self.scopeStack[-1] + scope = property(scope) + + def popScope(self): + self.dead_scopes.append(self.scopeStack.pop()) + + + def check_dead_scopes(self): + """ + Look at scopes which have been fully examined and report names in them + which were imported but unused. + """ + for scope in self.dead_scopes: + export = isinstance(scope.get('__all__'), ExportBinding) + if export: + all = scope['__all__'].names() + if os.path.split(self.filename)[1] != '__init__.py': + # Look for possible mistakes in the export list + undefined = set(all) - set(scope) + for name in undefined: + self.report( + messages.UndefinedExport, + scope['__all__'].source, + name) + else: + all = [] + + # Look for imported names that aren't used. + for importation in scope.itervalues(): + if isinstance(importation, Importation): + if not importation.used and importation.name not in all: + self.report( + messages.UnusedImport, + importation.source, + importation.name) + + + def pushFunctionScope(self): + self.scopeStack.append(FunctionScope()) + + def pushClassScope(self): + self.scopeStack.append(ClassScope()) + + def report(self, messageClass, *args, **kwargs): + self.messages.append(messageClass(self.filename, *args, **kwargs)) + + def handleChildren(self, tree): + for node in iter_child_nodes(tree): + self.handleNode(node, tree) + + def isDocstring(self, node): + """ + Determine if the given node is a docstring, as long as it is at the + correct place in the node tree. + """ + return isinstance(node, _ast.Str) or \ + (isinstance(node, _ast.Expr) and + isinstance(node.value, _ast.Str)) + + def handleNode(self, node, parent): + node.parent = parent + if self.traceTree: + print ' ' * self.nodeDepth + node.__class__.__name__ + self.nodeDepth += 1 + if self.futuresAllowed and not \ + (isinstance(node, _ast.ImportFrom) or self.isDocstring(node)): + self.futuresAllowed = False + nodeType = node.__class__.__name__.upper() + try: + handler = getattr(self, nodeType) + handler(node) + finally: + self.nodeDepth -= 1 + if self.traceTree: + print ' ' * self.nodeDepth + 'end ' + node.__class__.__name__ + + def ignore(self, node): + pass + + # "stmt" type nodes + RETURN = DELETE = PRINT = WHILE = IF = WITH = RAISE = TRYEXCEPT = \ + TRYFINALLY = ASSERT = EXEC = EXPR = handleChildren + + CONTINUE = BREAK = PASS = ignore + + # "expr" type nodes + BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = COMPARE = \ + CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = handleChildren + + NUM = STR = ELLIPSIS = ignore + + # "slice" type nodes + SLICE = EXTSLICE = INDEX = handleChildren + + # expression contexts are node instances too, though being constants + LOAD = STORE = DEL = AUGLOAD = AUGSTORE = PARAM = ignore + + # same for operators + AND = OR = ADD = SUB = MULT = DIV = MOD = POW = LSHIFT = RSHIFT = \ + BITOR = BITXOR = BITAND = FLOORDIV = INVERT = NOT = UADD = USUB = \ + EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore + + # additional node types + COMPREHENSION = EXCEPTHANDLER = KEYWORD = handleChildren + + def addBinding(self, loc, value, reportRedef=True): + '''Called when a binding is altered. + + - `loc` is the location (an object with lineno and optionally + col_offset attributes) of the statement responsible for the change + - `value` is the optional new value, a Binding instance, associated + with the binding; if None, the binding is deleted if it exists. + - if `reportRedef` is True (default), rebinding while unused will be + reported. + ''' + if (isinstance(self.scope.get(value.name), FunctionDefinition) + and isinstance(value, FunctionDefinition)): + self.report(messages.RedefinedFunction, + loc, value.name, self.scope[value.name].source) + + if not isinstance(self.scope, ClassScope): + for scope in self.scopeStack[::-1]: + existing = scope.get(value.name) + if (isinstance(existing, Importation) + and not existing.used + and (not isinstance(value, Importation) or value.fullName == existing.fullName) + and reportRedef): + + self.report(messages.RedefinedWhileUnused, + loc, value.name, scope[value.name].source) + + if isinstance(value, UnBinding): + try: + del self.scope[value.name] + except KeyError: + self.report(messages.UndefinedName, loc, value.name) + else: + self.scope[value.name] = value + + def GLOBAL(self, node): + """ + Keep track of globals declarations. + """ + if isinstance(self.scope, FunctionScope): + self.scope.globals.update(dict.fromkeys(node.names)) + + def LISTCOMP(self, node): + # handle generators before element + for gen in node.generators: + self.handleNode(gen, node) + self.handleNode(node.elt, node) + + GENERATOREXP = SETCOMP = LISTCOMP + + # dictionary comprehensions; introduced in Python 2.7 + def DICTCOMP(self, node): + for gen in node.generators: + self.handleNode(gen, node) + self.handleNode(node.key, node) + self.handleNode(node.value, node) + + def FOR(self, node): + """ + Process bindings for loop variables. + """ + vars = [] + def collectLoopVars(n): + if isinstance(n, _ast.Name): + vars.append(n.id) + elif isinstance(n, _ast.expr_context): + return + else: + for c in iter_child_nodes(n): + collectLoopVars(c) + + collectLoopVars(node.target) + for varn in vars: + if (isinstance(self.scope.get(varn), Importation) + # unused ones will get an unused import warning + and self.scope[varn].used): + self.report(messages.ImportShadowedByLoopVar, + node, varn, self.scope[varn].source) + + self.handleChildren(node) + + def NAME(self, node): + """ + Handle occurrence of Name (which can be a load/store/delete access.) + """ + # Locate the name in locals / function / globals scopes. + if isinstance(node.ctx, (_ast.Load, _ast.AugLoad)): + # try local scope + importStarred = self.scope.importStarred + try: + self.scope[node.id].used = (self.scope, node) + except KeyError: + pass + else: + return + + # try enclosing function scopes + + for scope in self.scopeStack[-2:0:-1]: + importStarred = importStarred or scope.importStarred + if not isinstance(scope, FunctionScope): + continue + try: + scope[node.id].used = (self.scope, node) + except KeyError: + pass + else: + return + + # try global scope + + importStarred = importStarred or self.scopeStack[0].importStarred + try: + self.scopeStack[0][node.id].used = (self.scope, node) + except KeyError: + if ((not hasattr(__builtin__, node.id)) + and node.id not in _MAGIC_GLOBALS + and not importStarred): + if (os.path.basename(self.filename) == '__init__.py' and + node.id == '__path__'): + # the special name __path__ is valid only in packages + pass + else: + self.report(messages.UndefinedName, node, node.id) + elif isinstance(node.ctx, (_ast.Store, _ast.AugStore)): + # if the name hasn't already been defined in the current scope + if isinstance(self.scope, FunctionScope) and node.id not in self.scope: + # for each function or module scope above us + for scope in self.scopeStack[:-1]: + if not isinstance(scope, (FunctionScope, ModuleScope)): + continue + # if the name was defined in that scope, and the name has + # been accessed already in the current scope, and hasn't + # been declared global + if (node.id in scope + and scope[node.id].used + and scope[node.id].used[0] is self.scope + and node.id not in self.scope.globals): + # then it's probably a mistake + self.report(messages.UndefinedLocal, + scope[node.id].used[1], + node.id, + scope[node.id].source) + break + + if isinstance(node.parent, + (_ast.For, _ast.comprehension, _ast.Tuple, _ast.List)): + binding = Binding(node.id, node) + elif (node.id == '__all__' and + isinstance(self.scope, ModuleScope)): + binding = ExportBinding(node.id, node.parent.value) + else: + binding = Assignment(node.id, node) + if node.id in self.scope: + binding.used = self.scope[node.id].used + self.addBinding(node, binding) + elif isinstance(node.ctx, _ast.Del): + if isinstance(self.scope, FunctionScope) and \ + node.id in self.scope.globals: + del self.scope.globals[node.id] + else: + self.addBinding(node, UnBinding(node.id, node)) + else: + # must be a Param context -- this only happens for names in function + # arguments, but these aren't dispatched through here + raise RuntimeError( + "Got impossible expression context: %r" % (node.ctx,)) + + + def FUNCTIONDEF(self, node): + # the decorators attribute is called decorator_list as of Python 2.6 + if hasattr(node, 'decorators'): + for deco in node.decorators: + self.handleNode(deco, node) + else: + for deco in node.decorator_list: + self.handleNode(deco, node) + self.addBinding(node, FunctionDefinition(node.name, node)) + self.LAMBDA(node) + + def LAMBDA(self, node): + for default in node.args.defaults: + self.handleNode(default, node) + + def runFunction(): + args = [] + + def addArgs(arglist): + for arg in arglist: + if isinstance(arg, _ast.Tuple): + addArgs(arg.elts) + else: + if arg.id in args: + self.report(messages.DuplicateArgument, + node, arg.id) + args.append(arg.id) + + self.pushFunctionScope() + addArgs(node.args.args) + # vararg/kwarg identifiers are not Name nodes + if node.args.vararg: + args.append(node.args.vararg) + if node.args.kwarg: + args.append(node.args.kwarg) + for name in args: + self.addBinding(node, Argument(name, node), reportRedef=False) + if isinstance(node.body, list): + # case for FunctionDefs + for stmt in node.body: + self.handleNode(stmt, node) + else: + # case for Lambdas + self.handleNode(node.body, node) + def checkUnusedAssignments(): + """ + Check to see if any assignments have not been used. + """ + for name, binding in self.scope.iteritems(): + if (not binding.used and not name in self.scope.globals + and isinstance(binding, Assignment)): + self.report(messages.UnusedVariable, + binding.source, name) + self.deferAssignment(checkUnusedAssignments) + self.popScope() + + self.deferFunction(runFunction) + + + def CLASSDEF(self, node): + """ + Check names used in a class definition, including its decorators, base + classes, and the body of its definition. Additionally, add its name to + the current scope. + """ + # decorator_list is present as of Python 2.6 + for deco in getattr(node, 'decorator_list', []): + self.handleNode(deco, node) + for baseNode in node.bases: + self.handleNode(baseNode, node) + self.pushClassScope() + for stmt in node.body: + self.handleNode(stmt, node) + self.popScope() + self.addBinding(node, Binding(node.name, node)) + + def ASSIGN(self, node): + self.handleNode(node.value, node) + for target in node.targets: + self.handleNode(target, node) + + def AUGASSIGN(self, node): + # AugAssign is awkward: must set the context explicitly and visit twice, + # once with AugLoad context, once with AugStore context + node.target.ctx = _ast.AugLoad() + self.handleNode(node.target, node) + self.handleNode(node.value, node) + node.target.ctx = _ast.AugStore() + self.handleNode(node.target, node) + + def IMPORT(self, node): + for alias in node.names: + name = alias.asname or alias.name + importation = Importation(name, node) + self.addBinding(node, importation) + + def IMPORTFROM(self, node): + if node.module == '__future__': + if not self.futuresAllowed: + self.report(messages.LateFutureImport, node, + [n.name for n in node.names]) + else: + self.futuresAllowed = False + + for alias in node.names: + if alias.name == '*': + self.scope.importStarred = True + self.report(messages.ImportStarUsed, node, node.module) + continue + name = alias.asname or alias.name + importation = Importation(name, node) + if node.module == '__future__': + importation.used = (self.scope, node) + self.addBinding(node, importation) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py new file mode 100644 index 00000000..73bf4cc3 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py @@ -0,0 +1,96 @@ +# (c) 2005 Divmod, Inc. See LICENSE file for details + +class Message(object): + message = '' + message_args = () + def __init__(self, filename, loc, use_column=True): + self.filename = filename + self.lineno = loc.lineno + self.col = getattr(loc, 'col_offset', None) if use_column else None + + def __str__(self): + return '%s:%s: %s' % (self.filename, self.lineno, self.message % self.message_args) + + +class UnusedImport(Message): + message = '%r imported but unused' + def __init__(self, filename, loc, name): + Message.__init__(self, filename, loc, use_column=False) + self.message_args = (name,) + + +class RedefinedWhileUnused(Message): + message = 'redefinition of unused %r from line %r' + def __init__(self, filename, loc, name, orig_loc): + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class ImportShadowedByLoopVar(Message): + message = 'import %r from line %r shadowed by loop variable' + def __init__(self, filename, loc, name, orig_loc): + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class ImportStarUsed(Message): + message = "'from %s import *' used; unable to detect undefined names" + def __init__(self, filename, loc, modname): + Message.__init__(self, filename, loc) + self.message_args = (modname,) + + +class UndefinedName(Message): + message = 'undefined name %r' + def __init__(self, filename, loc, name): + Message.__init__(self, filename, loc) + self.message_args = (name,) + + + +class UndefinedExport(Message): + message = 'undefined name %r in __all__' + def __init__(self, filename, loc, name): + Message.__init__(self, filename, loc) + self.message_args = (name,) + + + +class UndefinedLocal(Message): + message = "local variable %r (defined in enclosing scope on line %r) referenced before assignment" + def __init__(self, filename, loc, name, orig_loc): + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class DuplicateArgument(Message): + message = 'duplicate argument %r in function definition' + def __init__(self, filename, loc, name): + Message.__init__(self, filename, loc) + self.message_args = (name,) + + +class RedefinedFunction(Message): + message = 'redefinition of function %r from line %r' + def __init__(self, filename, loc, name, orig_loc): + Message.__init__(self, filename, loc) + self.message_args = (name, orig_loc.lineno) + + +class LateFutureImport(Message): + message = 'future import(s) %r after other statements' + def __init__(self, filename, loc, names): + Message.__init__(self, filename, loc) + self.message_args = (names,) + + +class UnusedVariable(Message): + """ + Indicates that a variable has been explicity assigned to but not actually + used. + """ + + message = 'local variable %r is assigned to but never used' + def __init__(self, filename, loc, names): + Message.__init__(self, filename, loc) + self.message_args = (names,) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py new file mode 100644 index 00000000..6b1dae22 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py @@ -0,0 +1,90 @@ + +""" +Implementation of the command-line I{pyflakes} tool. +""" + +import sys +import os +import _ast + +checker = __import__('pyflakes.checker').checker + +def check(codeString, filename): + """ + Check the Python source given by C{codeString} for flakes. + + @param codeString: The Python source to check. + @type codeString: C{str} + + @param filename: The name of the file the source came from, used to report + errors. + @type filename: C{str} + + @return: The number of warnings emitted. + @rtype: C{int} + """ + # First, compile into an AST and handle syntax errors. + try: + tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST) + except SyntaxError, value: + msg = value.args[0] + + (lineno, offset, text) = value.lineno, value.offset, value.text + + # If there's an encoding problem with the file, the text is None. + if text is None: + # Avoid using msg, since for the only known case, it contains a + # bogus message that claims the encoding the file declared was + # unknown. + print >> sys.stderr, "%s: problem decoding source" % (filename, ) + else: + line = text.splitlines()[-1] + + if offset is not None: + offset = offset - (len(text) - len(line)) + + print >> sys.stderr, '%s:%d: %s' % (filename, lineno, msg) + print >> sys.stderr, line + + if offset is not None: + print >> sys.stderr, " " * offset, "^" + + return 1 + else: + # Okay, it's syntactically valid. Now check it. + w = checker.Checker(tree, filename) + w.messages.sort(lambda a, b: cmp(a.lineno, b.lineno)) + for warning in w.messages: + print warning + return len(w.messages) + + +def checkPath(filename): + """ + Check the given path, printing out any warnings detected. + + @return: the number of warnings printed + """ + try: + return check(file(filename, 'U').read() + '\n', filename) + except IOError, msg: + print >> sys.stderr, "%s: %s" % (filename, msg.args[1]) + return 1 + + +def main(): + warnings = 0 + args = sys.argv[1:] + if args: + for arg in args: + if os.path.isdir(arg): + for dirpath, dirnames, filenames in os.walk(arg): + for filename in filenames: + if filename.endswith('.py'): + warnings += checkPath(os.path.join(dirpath, filename)) + else: + warnings += checkPath(arg) + else: + warnings += check(sys.stdin.read(), '') + + raise SystemExit(warnings > 0) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/__init__.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py new file mode 100644 index 00000000..7cd22772 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py @@ -0,0 +1,27 @@ + +import textwrap +import _ast + +from twisted.trial import unittest + +from pyflakes import checker + + +class Test(unittest.TestCase): + + def flakes(self, input, *expectedOutputs, **kw): + ast = compile(textwrap.dedent(input), "", "exec", + _ast.PyCF_ONLY_AST) + w = checker.Checker(ast, **kw) + outputs = [type(o) for o in w.messages] + expectedOutputs = list(expectedOutputs) + outputs.sort() + expectedOutputs.sort() + self.assert_(outputs == expectedOutputs, '''\ +for input: +%s +expected outputs: +%s +but got: +%s''' % (input, repr(expectedOutputs), '\n'.join([str(o) for o in w.messages]))) + return w diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py new file mode 100644 index 00000000..08e4580a --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py @@ -0,0 +1,673 @@ + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test import harness + +class Test(harness.Test): + + def test_unusedImport(self): + self.flakes('import fu, bar', m.UnusedImport, m.UnusedImport) + self.flakes('from baz import fu, bar', m.UnusedImport, m.UnusedImport) + + def test_aliasedImport(self): + self.flakes('import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) + self.flakes('from moo import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) + + def test_usedImport(self): + self.flakes('import fu; print fu') + self.flakes('from baz import fu; print fu') + + def test_redefinedWhileUnused(self): + self.flakes('import fu; fu = 3', m.RedefinedWhileUnused) + self.flakes('import fu; del fu', m.RedefinedWhileUnused) + self.flakes('import fu; fu, bar = 3', m.RedefinedWhileUnused) + self.flakes('import fu; [fu, bar] = 3', m.RedefinedWhileUnused) + + def test_redefinedByFunction(self): + self.flakes(''' + import fu + def fu(): + pass + ''', m.RedefinedWhileUnused) + + def test_redefinedInNestedFunction(self): + """ + Test that shadowing a global name with a nested function definition + generates a warning. + """ + self.flakes(''' + import fu + def bar(): + def baz(): + def fu(): + pass + ''', m.RedefinedWhileUnused, m.UnusedImport) + + def test_redefinedByClass(self): + self.flakes(''' + import fu + class fu: + pass + ''', m.RedefinedWhileUnused) + + + def test_redefinedBySubclass(self): + """ + If an imported name is redefined by a class statement which also uses + that name in the bases list, no warning is emitted. + """ + self.flakes(''' + from fu import bar + class bar(bar): + pass + ''') + + + def test_redefinedInClass(self): + """ + Test that shadowing a global with a class attribute does not produce a + warning. + """ + self.flakes(''' + import fu + class bar: + fu = 1 + print fu + ''') + + def test_usedInFunction(self): + self.flakes(''' + import fu + def fun(): + print fu + ''') + + def test_shadowedByParameter(self): + self.flakes(''' + import fu + def fun(fu): + print fu + ''', m.UnusedImport) + + self.flakes(''' + import fu + def fun(fu): + print fu + print fu + ''') + + def test_newAssignment(self): + self.flakes('fu = None') + + def test_usedInGetattr(self): + self.flakes('import fu; fu.bar.baz') + self.flakes('import fu; "bar".fu.baz', m.UnusedImport) + + def test_usedInSlice(self): + self.flakes('import fu; print fu.bar[1:]') + + def test_usedInIfBody(self): + self.flakes(''' + import fu + if True: print fu + ''') + + def test_usedInIfConditional(self): + self.flakes(''' + import fu + if fu: pass + ''') + + def test_usedInElifConditional(self): + self.flakes(''' + import fu + if False: pass + elif fu: pass + ''') + + def test_usedInElse(self): + self.flakes(''' + import fu + if False: pass + else: print fu + ''') + + def test_usedInCall(self): + self.flakes('import fu; fu.bar()') + + def test_usedInClass(self): + self.flakes(''' + import fu + class bar: + bar = fu + ''') + + def test_usedInClassBase(self): + self.flakes(''' + import fu + class bar(object, fu.baz): + pass + ''') + + def test_notUsedInNestedScope(self): + self.flakes(''' + import fu + def bleh(): + pass + print fu + ''') + + def test_usedInFor(self): + self.flakes(''' + import fu + for bar in range(9): + print fu + ''') + + def test_usedInForElse(self): + self.flakes(''' + import fu + for bar in range(10): + pass + else: + print fu + ''') + + def test_redefinedByFor(self): + self.flakes(''' + import fu + for fu in range(2): + pass + ''', m.RedefinedWhileUnused) + + def test_shadowedByFor(self): + """ + Test that shadowing a global name with a for loop variable generates a + warning. + """ + self.flakes(''' + import fu + fu.bar() + for fu in (): + pass + ''', m.ImportShadowedByLoopVar) + + def test_shadowedByForDeep(self): + """ + Test that shadowing a global name with a for loop variable nested in a + tuple unpack generates a warning. + """ + self.flakes(''' + import fu + fu.bar() + for (x, y, z, (a, b, c, (fu,))) in (): + pass + ''', m.ImportShadowedByLoopVar) + + def test_usedInReturn(self): + self.flakes(''' + import fu + def fun(): + return fu + ''') + + def test_usedInOperators(self): + self.flakes('import fu; 3 + fu.bar') + self.flakes('import fu; 3 % fu.bar') + self.flakes('import fu; 3 - fu.bar') + self.flakes('import fu; 3 * fu.bar') + self.flakes('import fu; 3 ** fu.bar') + self.flakes('import fu; 3 / fu.bar') + self.flakes('import fu; 3 // fu.bar') + self.flakes('import fu; -fu.bar') + self.flakes('import fu; ~fu.bar') + self.flakes('import fu; 1 == fu.bar') + self.flakes('import fu; 1 | fu.bar') + self.flakes('import fu; 1 & fu.bar') + self.flakes('import fu; 1 ^ fu.bar') + self.flakes('import fu; 1 >> fu.bar') + self.flakes('import fu; 1 << fu.bar') + + def test_usedInAssert(self): + self.flakes('import fu; assert fu.bar') + + def test_usedInSubscript(self): + self.flakes('import fu; fu.bar[1]') + + def test_usedInLogic(self): + self.flakes('import fu; fu and False') + self.flakes('import fu; fu or False') + self.flakes('import fu; not fu.bar') + + def test_usedInList(self): + self.flakes('import fu; [fu]') + + def test_usedInTuple(self): + self.flakes('import fu; (fu,)') + + def test_usedInTry(self): + self.flakes(''' + import fu + try: fu + except: pass + ''') + + def test_usedInExcept(self): + self.flakes(''' + import fu + try: fu + except: pass + ''') + + def test_redefinedByExcept(self): + self.flakes(''' + import fu + try: pass + except Exception, fu: pass + ''', m.RedefinedWhileUnused) + + def test_usedInRaise(self): + self.flakes(''' + import fu + raise fu.bar + ''') + + def test_usedInYield(self): + self.flakes(''' + import fu + def gen(): + yield fu + ''') + + def test_usedInDict(self): + self.flakes('import fu; {fu:None}') + self.flakes('import fu; {1:fu}') + + def test_usedInParameterDefault(self): + self.flakes(''' + import fu + def f(bar=fu): + pass + ''') + + def test_usedInAttributeAssign(self): + self.flakes('import fu; fu.bar = 1') + + def test_usedInKeywordArg(self): + self.flakes('import fu; fu.bar(stuff=fu)') + + def test_usedInAssignment(self): + self.flakes('import fu; bar=fu') + self.flakes('import fu; n=0; n+=fu') + + def test_usedInListComp(self): + self.flakes('import fu; [fu for _ in range(1)]') + self.flakes('import fu; [1 for _ in range(1) if fu]') + + def test_redefinedByListComp(self): + self.flakes('import fu; [1 for fu in range(1)]', m.RedefinedWhileUnused) + + + def test_usedInTryFinally(self): + self.flakes(''' + import fu + try: pass + finally: fu + ''') + + self.flakes(''' + import fu + try: fu + finally: pass + ''') + + def test_usedInWhile(self): + self.flakes(''' + import fu + while 0: + fu + ''') + + self.flakes(''' + import fu + while fu: pass + ''') + + def test_usedInGlobal(self): + self.flakes(''' + import fu + def f(): global fu + ''', m.UnusedImport) + + def test_usedInBackquote(self): + self.flakes('import fu; `fu`') + + def test_usedInExec(self): + self.flakes('import fu; exec "print 1" in fu.bar') + + def test_usedInLambda(self): + self.flakes('import fu; lambda: fu') + + def test_shadowedByLambda(self): + self.flakes('import fu; lambda fu: fu', m.UnusedImport) + + def test_usedInSliceObj(self): + self.flakes('import fu; "meow"[::fu]') + + def test_unusedInNestedScope(self): + self.flakes(''' + def bar(): + import fu + fu + ''', m.UnusedImport, m.UndefinedName) + + def test_methodsDontUseClassScope(self): + self.flakes(''' + class bar: + import fu + def fun(self): + fu + ''', m.UnusedImport, m.UndefinedName) + + def test_nestedFunctionsNestScope(self): + self.flakes(''' + def a(): + def b(): + fu + import fu + ''') + + def test_nestedClassAndFunctionScope(self): + self.flakes(''' + def a(): + import fu + class b: + def c(self): + print fu + ''') + + def test_importStar(self): + self.flakes('from fu import *', m.ImportStarUsed) + + + def test_packageImport(self): + """ + If a dotted name is imported and used, no warning is reported. + """ + self.flakes(''' + import fu.bar + fu.bar + ''') + + + def test_unusedPackageImport(self): + """ + If a dotted name is imported and not used, an unused import warning is + reported. + """ + self.flakes('import fu.bar', m.UnusedImport) + + + def test_duplicateSubmoduleImport(self): + """ + If a submodule of a package is imported twice, an unused import warning + and a redefined while unused warning are reported. + """ + self.flakes(''' + import fu.bar, fu.bar + fu.bar + ''', m.RedefinedWhileUnused) + self.flakes(''' + import fu.bar + import fu.bar + fu.bar + ''', m.RedefinedWhileUnused) + + + def test_differentSubmoduleImport(self): + """ + If two different submodules of a package are imported, no duplicate + import warning is reported for the package. + """ + self.flakes(''' + import fu.bar, fu.baz + fu.bar, fu.baz + ''') + self.flakes(''' + import fu.bar + import fu.baz + fu.bar, fu.baz + ''') + + def test_assignRHSFirst(self): + self.flakes('import fu; fu = fu') + self.flakes('import fu; fu, bar = fu') + self.flakes('import fu; [fu, bar] = fu') + self.flakes('import fu; fu += fu') + + def test_tryingMultipleImports(self): + self.flakes(''' + try: + import fu + except ImportError: + import bar as fu + ''') + test_tryingMultipleImports.todo = '' + + def test_nonGlobalDoesNotRedefine(self): + self.flakes(''' + import fu + def a(): + fu = 3 + return fu + fu + ''') + + def test_functionsRunLater(self): + self.flakes(''' + def a(): + fu + import fu + ''') + + def test_functionNamesAreBoundNow(self): + self.flakes(''' + import fu + def fu(): + fu + fu + ''', m.RedefinedWhileUnused) + + def test_ignoreNonImportRedefinitions(self): + self.flakes('a = 1; a = 2') + + def test_importingForImportError(self): + self.flakes(''' + try: + import fu + except ImportError: + pass + ''') + test_importingForImportError.todo = '' + + def test_importedInClass(self): + '''Imports in class scope can be used through self''' + self.flakes(''' + class c: + import i + def __init__(self): + self.i + ''') + test_importedInClass.todo = 'requires evaluating attribute access' + + def test_futureImport(self): + '''__future__ is special''' + self.flakes('from __future__ import division') + self.flakes(''' + "docstring is allowed before future import" + from __future__ import division + ''') + + def test_futureImportFirst(self): + """ + __future__ imports must come before anything else. + """ + self.flakes(''' + x = 5 + from __future__ import division + ''', m.LateFutureImport) + self.flakes(''' + from foo import bar + from __future__ import division + bar + ''', m.LateFutureImport) + + + +class TestSpecialAll(harness.Test): + """ + Tests for suppression of unused import warnings by C{__all__}. + """ + def test_ignoredInFunction(self): + """ + An C{__all__} definition does not suppress unused import warnings in a + function scope. + """ + self.flakes(''' + def foo(): + import bar + __all__ = ["bar"] + ''', m.UnusedImport, m.UnusedVariable) + + + def test_ignoredInClass(self): + """ + An C{__all__} definition does not suppress unused import warnings in a + class scope. + """ + self.flakes(''' + class foo: + import bar + __all__ = ["bar"] + ''', m.UnusedImport) + + + def test_warningSuppressed(self): + """ + If a name is imported and unused but is named in C{__all__}, no warning + is reported. + """ + self.flakes(''' + import foo + __all__ = ["foo"] + ''') + + + def test_unrecognizable(self): + """ + If C{__all__} is defined in a way that can't be recognized statically, + it is ignored. + """ + self.flakes(''' + import foo + __all__ = ["f" + "oo"] + ''', m.UnusedImport) + self.flakes(''' + import foo + __all__ = [] + ["foo"] + ''', m.UnusedImport) + + + def test_unboundExported(self): + """ + If C{__all__} includes a name which is not bound, a warning is emitted. + """ + self.flakes(''' + __all__ = ["foo"] + ''', m.UndefinedExport) + + # Skip this in __init__.py though, since the rules there are a little + # different. + for filename in ["foo/__init__.py", "__init__.py"]: + self.flakes(''' + __all__ = ["foo"] + ''', filename=filename) + + + def test_usedInGenExp(self): + """ + Using a global in a generator expression results in no warnings. + """ + self.flakes('import fu; (fu for _ in range(1))') + self.flakes('import fu; (1 for _ in range(1) if fu)') + + + def test_redefinedByGenExp(self): + """ + Re-using a global name as the loop variable for a generator + expression results in a redefinition warning. + """ + self.flakes('import fu; (1 for fu in range(1))', m.RedefinedWhileUnused) + + + def test_usedAsDecorator(self): + """ + Using a global name in a decorator statement results in no warnings, + but using an undefined name in a decorator statement results in an + undefined name warning. + """ + self.flakes(''' + from interior import decorate + @decorate + def f(): + return "hello" + ''') + + self.flakes(''' + from interior import decorate + @decorate('value') + def f(): + return "hello" + ''') + + self.flakes(''' + @decorate + def f(): + return "hello" + ''', m.UndefinedName) + + +class Python26Tests(harness.Test): + """ + Tests for checking of syntax which is valid in PYthon 2.6 and newer. + """ + if version_info < (2, 6): + skip = "Python 2.6 required for class decorator tests." + + + def test_usedAsClassDecorator(self): + """ + Using an imported name as a class decorator results in no warnings, + but using an undefined name as a class decorator results in an + undefined name warning. + """ + self.flakes(''' + from interior import decorate + @decorate + class foo: + pass + ''') + + self.flakes(''' + from interior import decorate + @decorate("foo") + class bar: + pass + ''') + + self.flakes(''' + @decorate + class foo: + pass + ''', m.UndefinedName) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py new file mode 100644 index 00000000..2b7723ce --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py @@ -0,0 +1,575 @@ +# (c) 2005-2010 Divmod, Inc. +# See LICENSE file for details + +""" +Tests for various Pyflakes behavior. +""" + +from sys import version_info + +from pyflakes import messages as m +from pyflakes.test import harness + + +class Test(harness.Test): + + def test_duplicateArgs(self): + self.flakes('def fu(bar, bar): pass', m.DuplicateArgument) + + def test_localReferencedBeforeAssignment(self): + self.flakes(''' + a = 1 + def f(): + a; a=1 + f() + ''', m.UndefinedName) + test_localReferencedBeforeAssignment.todo = 'this requires finding all assignments in the function body first' + + def test_redefinedFunction(self): + """ + Test that shadowing a function definition with another one raises a + warning. + """ + self.flakes(''' + def a(): pass + def a(): pass + ''', m.RedefinedFunction) + + def test_redefinedClassFunction(self): + """ + Test that shadowing a function definition in a class suite with another + one raises a warning. + """ + self.flakes(''' + class A: + def a(): pass + def a(): pass + ''', m.RedefinedFunction) + + def test_functionDecorator(self): + """ + Test that shadowing a function definition with a decorated version of + that function does not raise a warning. + """ + self.flakes(''' + from somewhere import somedecorator + + def a(): pass + a = somedecorator(a) + ''') + + def test_classFunctionDecorator(self): + """ + Test that shadowing a function definition in a class suite with a + decorated version of that function does not raise a warning. + """ + self.flakes(''' + class A: + def a(): pass + a = classmethod(a) + ''') + + def test_unaryPlus(self): + '''Don't die on unary +''' + self.flakes('+1') + + + def test_undefinedBaseClass(self): + """ + If a name in the base list of a class definition is undefined, a + warning is emitted. + """ + self.flakes(''' + class foo(foo): + pass + ''', m.UndefinedName) + + + def test_classNameUndefinedInClassBody(self): + """ + If a class name is used in the body of that class's definition and + the name is not already defined, a warning is emitted. + """ + self.flakes(''' + class foo: + foo + ''', m.UndefinedName) + + + def test_classNameDefinedPreviously(self): + """ + If a class name is used in the body of that class's definition and + the name was previously defined in some other way, no warning is + emitted. + """ + self.flakes(''' + foo = None + class foo: + foo + ''') + + + def test_comparison(self): + """ + If a defined name is used on either side of any of the six comparison + operators, no warning is emitted. + """ + self.flakes(''' + x = 10 + y = 20 + x < y + x <= y + x == y + x != y + x >= y + x > y + ''') + + + def test_identity(self): + """ + If a deefined name is used on either side of an identity test, no + warning is emitted. + """ + self.flakes(''' + x = 10 + y = 20 + x is y + x is not y + ''') + + + def test_containment(self): + """ + If a defined name is used on either side of a containment test, no + warning is emitted. + """ + self.flakes(''' + x = 10 + y = 20 + x in y + x not in y + ''') + + + def test_loopControl(self): + """ + break and continue statements are supported. + """ + self.flakes(''' + for x in [1, 2]: + break + ''') + self.flakes(''' + for x in [1, 2]: + continue + ''') + + + def test_ellipsis(self): + """ + Ellipsis in a slice is supported. + """ + self.flakes(''' + [1, 2][...] + ''') + + + def test_extendedSlice(self): + """ + Extended slices are supported. + """ + self.flakes(''' + x = 3 + [1, 2][x,:] + ''') + + + +class TestUnusedAssignment(harness.Test): + """ + Tests for warning about unused assignments. + """ + + def test_unusedVariable(self): + """ + Warn when a variable in a function is assigned a value that's never + used. + """ + self.flakes(''' + def a(): + b = 1 + ''', m.UnusedVariable) + + + def test_assignToGlobal(self): + """ + Assigning to a global and then not using that global is perfectly + acceptable. Do not mistake it for an unused local variable. + """ + self.flakes(''' + b = 0 + def a(): + global b + b = 1 + ''') + + + def test_assignToMember(self): + """ + Assigning to a member of another object and then not using that member + variable is perfectly acceptable. Do not mistake it for an unused + local variable. + """ + # XXX: Adding this test didn't generate a failure. Maybe not + # necessary? + self.flakes(''' + class b: + pass + def a(): + b.foo = 1 + ''') + + + def test_assignInForLoop(self): + """ + Don't warn when a variable in a for loop is assigned to but not used. + """ + self.flakes(''' + def f(): + for i in range(10): + pass + ''') + + + def test_assignInListComprehension(self): + """ + Don't warn when a variable in a list comprehension is assigned to but + not used. + """ + self.flakes(''' + def f(): + [None for i in range(10)] + ''') + + + def test_generatorExpression(self): + """ + Don't warn when a variable in a generator expression is assigned to but not used. + """ + self.flakes(''' + def f(): + (None for i in range(10)) + ''') + + + def test_assignmentInsideLoop(self): + """ + Don't warn when a variable assignment occurs lexically after its use. + """ + self.flakes(''' + def f(): + x = None + for i in range(10): + if i > 2: + return x + x = i * 2 + ''') + + + def test_tupleUnpacking(self): + """ + Don't warn when a variable included in tuple unpacking is unused. It's + very common for variables in a tuple unpacking assignment to be unused + in good Python code, so warning will only create false positives. + """ + self.flakes(''' + def f(): + (x, y) = 1, 2 + ''') + + + def test_listUnpacking(self): + """ + Don't warn when a variable included in list unpacking is unused. + """ + self.flakes(''' + def f(): + [x, y] = [1, 2] + ''') + + + def test_closedOver(self): + """ + Don't warn when the assignment is used in an inner function. + """ + self.flakes(''' + def barMaker(): + foo = 5 + def bar(): + return foo + return bar + ''') + + + def test_doubleClosedOver(self): + """ + Don't warn when the assignment is used in an inner function, even if + that inner function itself is in an inner function. + """ + self.flakes(''' + def barMaker(): + foo = 5 + def bar(): + def baz(): + return foo + return bar + ''') + + + +class Python25Test(harness.Test): + """ + Tests for checking of syntax only available in Python 2.5 and newer. + """ + if version_info < (2, 5): + skip = "Python 2.5 required for if-else and with tests" + + def test_ifexp(self): + """ + Test C{foo if bar else baz} statements. + """ + self.flakes("a = 'moo' if True else 'oink'") + self.flakes("a = foo if True else 'oink'", m.UndefinedName) + self.flakes("a = 'moo' if True else bar", m.UndefinedName) + + + def test_withStatementNoNames(self): + """ + No warnings are emitted for using inside or after a nameless C{with} + statement a name defined beforehand. + """ + self.flakes(''' + from __future__ import with_statement + bar = None + with open("foo"): + bar + bar + ''') + + def test_withStatementSingleName(self): + """ + No warnings are emitted for using a name defined by a C{with} statement + within the suite or afterwards. + """ + self.flakes(''' + from __future__ import with_statement + with open('foo') as bar: + bar + bar + ''') + + + def test_withStatementAttributeName(self): + """ + No warnings are emitted for using an attribute as the target of a + C{with} statement. + """ + self.flakes(''' + from __future__ import with_statement + import foo + with open('foo') as foo.bar: + pass + ''') + + + def test_withStatementSubscript(self): + """ + No warnings are emitted for using a subscript as the target of a + C{with} statement. + """ + self.flakes(''' + from __future__ import with_statement + import foo + with open('foo') as foo[0]: + pass + ''') + + + def test_withStatementSubscriptUndefined(self): + """ + An undefined name warning is emitted if the subscript used as the + target of a C{with} statement is not defined. + """ + self.flakes(''' + from __future__ import with_statement + import foo + with open('foo') as foo[bar]: + pass + ''', m.UndefinedName) + + + def test_withStatementTupleNames(self): + """ + No warnings are emitted for using any of the tuple of names defined by + a C{with} statement within the suite or afterwards. + """ + self.flakes(''' + from __future__ import with_statement + with open('foo') as (bar, baz): + bar, baz + bar, baz + ''') + + + def test_withStatementListNames(self): + """ + No warnings are emitted for using any of the list of names defined by a + C{with} statement within the suite or afterwards. + """ + self.flakes(''' + from __future__ import with_statement + with open('foo') as [bar, baz]: + bar, baz + bar, baz + ''') + + + def test_withStatementComplicatedTarget(self): + """ + If the target of a C{with} statement uses any or all of the valid forms + for that part of the grammar (See + U{http://docs.python.org/reference/compound_stmts.html#the-with-statement}), + the names involved are checked both for definedness and any bindings + created are respected in the suite of the statement and afterwards. + """ + self.flakes(''' + from __future__ import with_statement + c = d = e = g = h = i = None + with open('foo') as [(a, b), c[d], e.f, g[h:i]]: + a, b, c, d, e, g, h, i + a, b, c, d, e, g, h, i + ''') + + + def test_withStatementSingleNameUndefined(self): + """ + An undefined name warning is emitted if the name first defined by a + C{with} statement is used before the C{with} statement. + """ + self.flakes(''' + from __future__ import with_statement + bar + with open('foo') as bar: + pass + ''', m.UndefinedName) + + + def test_withStatementTupleNamesUndefined(self): + """ + An undefined name warning is emitted if a name first defined by a the + tuple-unpacking form of the C{with} statement is used before the + C{with} statement. + """ + self.flakes(''' + from __future__ import with_statement + baz + with open('foo') as (bar, baz): + pass + ''', m.UndefinedName) + + + def test_withStatementSingleNameRedefined(self): + """ + A redefined name warning is emitted if a name bound by an import is + rebound by the name defined by a C{with} statement. + """ + self.flakes(''' + from __future__ import with_statement + import bar + with open('foo') as bar: + pass + ''', m.RedefinedWhileUnused) + + + def test_withStatementTupleNamesRedefined(self): + """ + A redefined name warning is emitted if a name bound by an import is + rebound by one of the names defined by the tuple-unpacking form of a + C{with} statement. + """ + self.flakes(''' + from __future__ import with_statement + import bar + with open('foo') as (bar, baz): + pass + ''', m.RedefinedWhileUnused) + + + def test_withStatementUndefinedInside(self): + """ + An undefined name warning is emitted if a name is used inside the + body of a C{with} statement without first being bound. + """ + self.flakes(''' + from __future__ import with_statement + with open('foo') as bar: + baz + ''', m.UndefinedName) + + + def test_withStatementNameDefinedInBody(self): + """ + A name defined in the body of a C{with} statement can be used after + the body ends without warning. + """ + self.flakes(''' + from __future__ import with_statement + with open('foo') as bar: + baz = 10 + baz + ''') + + + def test_withStatementUndefinedInExpression(self): + """ + An undefined name warning is emitted if a name in the I{test} + expression of a C{with} statement is undefined. + """ + self.flakes(''' + from __future__ import with_statement + with bar as baz: + pass + ''', m.UndefinedName) + + self.flakes(''' + from __future__ import with_statement + with bar as bar: + pass + ''', m.UndefinedName) + + + +class Python27Test(harness.Test): + """ + Tests for checking of syntax only available in Python 2.7 and newer. + """ + if version_info < (2, 7): + skip = "Python 2.7 required for dict/set comprehension tests" + + def test_dictComprehension(self): + """ + Dict comprehensions are properly handled. + """ + self.flakes(''' + a = {1: x for x in range(10)} + ''') + + def test_setComprehensionAndLiteral(self): + """ + Set comprehensions are properly handled. + """ + self.flakes(''' + a = {1, 2, 3} + b = {x for x in range(10)} + ''') diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py new file mode 100644 index 00000000..233e59ed --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py @@ -0,0 +1,185 @@ + +""" +Tests for L{pyflakes.scripts.pyflakes}. +""" + +import sys +from StringIO import StringIO + +from twisted.python.filepath import FilePath +from twisted.trial.unittest import TestCase + +from pyflakes.scripts.pyflakes import checkPath + +def withStderrTo(stderr, f): + """ + Call C{f} with C{sys.stderr} redirected to C{stderr}. + """ + (outer, sys.stderr) = (sys.stderr, stderr) + try: + return f() + finally: + sys.stderr = outer + + + +class CheckTests(TestCase): + """ + Tests for L{check} and L{checkPath} which check a file for flakes. + """ + def test_missingTrailingNewline(self): + """ + Source which doesn't end with a newline shouldn't cause any + exception to be raised nor an error indicator to be returned by + L{check}. + """ + fName = self.mktemp() + FilePath(fName).setContent("def foo():\n\tpass\n\t") + self.assertFalse(checkPath(fName)) + + + def test_checkPathNonExisting(self): + """ + L{checkPath} handles non-existing files. + """ + err = StringIO() + count = withStderrTo(err, lambda: checkPath('extremo')) + self.assertEquals(err.getvalue(), 'extremo: No such file or directory\n') + self.assertEquals(count, 1) + + + def test_multilineSyntaxError(self): + """ + Source which includes a syntax error which results in the raised + L{SyntaxError.text} containing multiple lines of source are reported + with only the last line of that source. + """ + source = """\ +def foo(): + ''' + +def bar(): + pass + +def baz(): + '''quux''' +""" + + # Sanity check - SyntaxError.text should be multiple lines, if it + # isn't, something this test was unprepared for has happened. + def evaluate(source): + exec source + exc = self.assertRaises(SyntaxError, evaluate, source) + self.assertTrue(exc.text.count('\n') > 1) + + sourcePath = FilePath(self.mktemp()) + sourcePath.setContent(source) + err = StringIO() + count = withStderrTo(err, lambda: checkPath(sourcePath.path)) + self.assertEqual(count, 1) + + self.assertEqual( + err.getvalue(), + """\ +%s:8: invalid syntax + '''quux''' + ^ +""" % (sourcePath.path,)) + + + def test_eofSyntaxError(self): + """ + The error reported for source files which end prematurely causing a + syntax error reflects the cause for the syntax error. + """ + source = "def foo(" + sourcePath = FilePath(self.mktemp()) + sourcePath.setContent(source) + err = StringIO() + count = withStderrTo(err, lambda: checkPath(sourcePath.path)) + self.assertEqual(count, 1) + self.assertEqual( + err.getvalue(), + """\ +%s:1: unexpected EOF while parsing +def foo( + ^ +""" % (sourcePath.path,)) + + + def test_nonDefaultFollowsDefaultSyntaxError(self): + """ + Source which has a non-default argument following a default argument + should include the line number of the syntax error. However these + exceptions do not include an offset. + """ + source = """\ +def foo(bar=baz, bax): + pass +""" + sourcePath = FilePath(self.mktemp()) + sourcePath.setContent(source) + err = StringIO() + count = withStderrTo(err, lambda: checkPath(sourcePath.path)) + self.assertEqual(count, 1) + self.assertEqual( + err.getvalue(), + """\ +%s:1: non-default argument follows default argument +def foo(bar=baz, bax): +""" % (sourcePath.path,)) + + + def test_nonKeywordAfterKeywordSyntaxError(self): + """ + Source which has a non-keyword argument after a keyword argument should + include the line number of the syntax error. However these exceptions + do not include an offset. + """ + source = """\ +foo(bar=baz, bax) +""" + sourcePath = FilePath(self.mktemp()) + sourcePath.setContent(source) + err = StringIO() + count = withStderrTo(err, lambda: checkPath(sourcePath.path)) + self.assertEqual(count, 1) + self.assertEqual( + err.getvalue(), + """\ +%s:1: non-keyword arg after keyword arg +foo(bar=baz, bax) +""" % (sourcePath.path,)) + + + def test_permissionDenied(self): + """ + If the a source file is not readable, this is reported on standard + error. + """ + sourcePath = FilePath(self.mktemp()) + sourcePath.setContent('') + sourcePath.chmod(0) + err = StringIO() + count = withStderrTo(err, lambda: checkPath(sourcePath.path)) + self.assertEquals(count, 1) + self.assertEquals( + err.getvalue(), "%s: Permission denied\n" % (sourcePath.path,)) + + + def test_misencodedFile(self): + """ + If a source file contains bytes which cannot be decoded, this is + reported on stderr. + """ + source = u"""\ +# coding: ascii +x = "\N{SNOWMAN}" +""".encode('utf-8') + sourcePath = FilePath(self.mktemp()) + sourcePath.setContent(source) + err = StringIO() + count = withStderrTo(err, lambda: checkPath(sourcePath.path)) + self.assertEquals(count, 1) + self.assertEquals( + err.getvalue(), "%s: problem decoding source\n" % (sourcePath.path,)) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py new file mode 100644 index 00000000..309f0b9f --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py @@ -0,0 +1,265 @@ + +from _ast import PyCF_ONLY_AST + +from twisted.trial.unittest import TestCase + +from pyflakes import messages as m, checker +from pyflakes.test import harness + + +class Test(harness.Test): + def test_undefined(self): + self.flakes('bar', m.UndefinedName) + + def test_definedInListComp(self): + self.flakes('[a for a in range(10) if a]') + + + def test_functionsNeedGlobalScope(self): + self.flakes(''' + class a: + def b(): + fu + fu = 1 + ''') + + def test_builtins(self): + self.flakes('range(10)') + + + def test_magicGlobalsFile(self): + """ + Use of the C{__file__} magic global should not emit an undefined name + warning. + """ + self.flakes('__file__') + + + def test_magicGlobalsBuiltins(self): + """ + Use of the C{__builtins__} magic global should not emit an undefined + name warning. + """ + self.flakes('__builtins__') + + + def test_magicGlobalsName(self): + """ + Use of the C{__name__} magic global should not emit an undefined name + warning. + """ + self.flakes('__name__') + + + def test_magicGlobalsPath(self): + """ + Use of the C{__path__} magic global should not emit an undefined name + warning, if you refer to it from a file called __init__.py. + """ + self.flakes('__path__', m.UndefinedName) + self.flakes('__path__', filename='package/__init__.py') + + + def test_globalImportStar(self): + '''Can't find undefined names with import *''' + self.flakes('from fu import *; bar', m.ImportStarUsed) + + def test_localImportStar(self): + '''A local import * still allows undefined names to be found in upper scopes''' + self.flakes(''' + def a(): + from fu import * + bar + ''', m.ImportStarUsed, m.UndefinedName) + + def test_unpackedParameter(self): + '''Unpacked function parameters create bindings''' + self.flakes(''' + def a((bar, baz)): + bar; baz + ''') + + def test_definedByGlobal(self): + '''"global" can make an otherwise undefined name in another function defined''' + self.flakes(''' + def a(): global fu; fu = 1 + def b(): fu + ''') + test_definedByGlobal.todo = '' + + def test_globalInGlobalScope(self): + """ + A global statement in the global scope is ignored. + """ + self.flakes(''' + global x + def foo(): + print x + ''', m.UndefinedName) + + def test_del(self): + '''del deletes bindings''' + self.flakes('a = 1; del a; a', m.UndefinedName) + + def test_delGlobal(self): + '''del a global binding from a function''' + self.flakes(''' + a = 1 + def f(): + global a + del a + a + ''') + + def test_delUndefined(self): + '''del an undefined name''' + self.flakes('del a', m.UndefinedName) + + def test_globalFromNestedScope(self): + '''global names are available from nested scopes''' + self.flakes(''' + a = 1 + def b(): + def c(): + a + ''') + + def test_laterRedefinedGlobalFromNestedScope(self): + """ + Test that referencing a local name that shadows a global, before it is + defined, generates a warning. + """ + self.flakes(''' + a = 1 + def fun(): + a + a = 2 + return a + ''', m.UndefinedLocal) + + def test_laterRedefinedGlobalFromNestedScope2(self): + """ + Test that referencing a local name in a nested scope that shadows a + global declared in an enclosing scope, before it is defined, generates + a warning. + """ + self.flakes(''' + a = 1 + def fun(): + global a + def fun2(): + a + a = 2 + return a + ''', m.UndefinedLocal) + + + def test_intermediateClassScopeIgnored(self): + """ + If a name defined in an enclosing scope is shadowed by a local variable + and the name is used locally before it is bound, an unbound local + warning is emitted, even if there is a class scope between the enclosing + scope and the local scope. + """ + self.flakes(''' + def f(): + x = 1 + class g: + def h(self): + a = x + x = None + print x, a + print x + ''', m.UndefinedLocal) + + + def test_doubleNestingReportsClosestName(self): + """ + Test that referencing a local name in a nested scope that shadows a + variable declared in two different outer scopes before it is defined + in the innermost scope generates an UnboundLocal warning which + refers to the nearest shadowed name. + """ + exc = self.flakes(''' + def a(): + x = 1 + def b(): + x = 2 # line 5 + def c(): + x + x = 3 + return x + return x + return x + ''', m.UndefinedLocal).messages[0] + self.assertEqual(exc.message_args, ('x', 5)) + + + def test_laterRedefinedGlobalFromNestedScope3(self): + """ + Test that referencing a local name in a nested scope that shadows a + global, before it is defined, generates a warning. + """ + self.flakes(''' + def fun(): + a = 1 + def fun2(): + a + a = 1 + return a + return a + ''', m.UndefinedLocal) + + def test_nestedClass(self): + '''nested classes can access enclosing scope''' + self.flakes(''' + def f(foo): + class C: + bar = foo + def f(self): + return foo + return C() + + f(123).f() + ''') + + def test_badNestedClass(self): + '''free variables in nested classes must bind at class creation''' + self.flakes(''' + def f(): + class C: + bar = foo + foo = 456 + return foo + f() + ''', m.UndefinedName) + + def test_definedAsStarArgs(self): + '''star and double-star arg names are defined''' + self.flakes(''' + def f(a, *b, **c): + print a, b, c + ''') + + def test_definedInGenExp(self): + """ + Using the loop variable of a generator expression results in no + warnings. + """ + self.flakes('(a for a in xrange(10) if a)') + + + +class NameTests(TestCase): + """ + Tests for some extra cases of name handling. + """ + def test_impossibleContext(self): + """ + A Name node with an unrecognized context results in a RuntimeError being + raised. + """ + tree = compile("x = 10", "", "exec", PyCF_ONLY_AST) + # Make it into something unrecognizable. + tree.body[0].targets[0].ctx = object() + self.assertRaises(RuntimeError, checker.Checker, tree) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py new file mode 100644 index 00000000..85073371 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py @@ -0,0 +1,28 @@ +#!/usr/bin/python +# (c) 2005-2009 Divmod, Inc. See LICENSE file for details + +from distutils.core import setup + +setup( + name="pyflakes", + license="MIT", + version="0.4.0", + description="passive checker of Python programs", + author="Phil Frost", + maintainer="Moe Aboulkheir", + maintainer_email="moe@divmod.com", + url="http://www.divmod.org/trac/wiki/DivmodPyflakes", + packages=["pyflakes", "pyflakes.scripts", "pyflakes.test"], + scripts=["bin/pyflakes"], + long_description="""Pyflakes is program to analyze Python programs and detect various errors. It +works by parsing the source file, not importing it, so it is safe to use on +modules with side effects. It's also much faster.""", + classifiers=[ + "Development Status :: 6 - Mature", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Topic :: Software Development", + "Topic :: Utilities", + ]) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff b/sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff new file mode 100644 index 00000000..ce2471f0 --- /dev/null +++ b/sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff @@ -0,0 +1,124 @@ +diff --git a/README.rst b/README.rst +index 5f8467f..acff657 100644 +--- a/README.rst ++++ b/README.rst +@@ -8,11 +8,13 @@ accessing a local before it is bound, and also gives warnings for things like + unused imports. + + pyflakes-vim uses the output from PyFlakes to highlight errors in your code. ++To locate errors quickly, use quickfix_ commands: + + Make sure to check vim.org_ for the latest updates. + + .. _pyflakes.vim: http://www.vim.org/scripts/script.php?script_id=2441 + .. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 ++.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix + + Quick Installation + ------------------ +@@ -57,12 +59,10 @@ Hacking + TODO + ---- + * signs_ support (show warning and error icons to left of the buffer area) +- * quickfix_ support (allow jumping forward and back through the error list) + * configuration variables + * parse or intercept useful output from the warnings module + + .. _signs: http://www.vim.org/htmldoc/sign.html +-.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html + + Changelog + --------- +diff --git a/pyflakes.vim b/pyflakes.vim +index 8aa508b..d6699bc 100644 +--- a/pyflakes.vim ++++ b/pyflakes.vim +@@ -159,6 +159,42 @@ if !exists("*s:WideMsg") + endfun + endif + ++if !exists("*s:GetQuickFixStackCount") ++ function s:GetQuickFixStackCount() ++ let l:stack_count = 0 ++ try ++ silent colder 9 ++ catch /E380:/ ++ endtry ++ ++ try ++ for i in range(9) ++ silent cnewer ++ let l:stack_count = l:stack_count + 1 ++ endfor ++ catch /E381:/ ++ return l:stack_count ++ endtry ++ endfunction ++endif ++ ++if !exists("*s:ActivatePyflakesQuickFixWindow") ++ function s:ActivatePyflakesQuickFixWindow() ++ try ++ silent colder 9 " go to the bottom of quickfix stack ++ catch /E380:/ ++ endtry ++ ++ if s:pyflakes_qf > 0 ++ try ++ exe "silent cnewer " . s:pyflakes_qf ++ catch /E381:/ ++ echoerr "Could not activate Pyflakes Quickfix Window." ++ endtry ++ endif ++ endfunction ++endif ++ + if !exists("*s:RunPyflakes") + function s:RunPyflakes() + highlight link PyFlakes SpellBad +@@ -174,12 +210,23 @@ if !exists("*s:RunPyflakes") + + let b:matched = [] + let b:matchedlines = {} ++ ++ let b:qf_list = [] ++ let b:qf_window_count = -1 ++ + python << EOF + for w in check(vim.current.buffer): + vim.command('let s:matchDict = {}') + vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) + vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) + vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") ++ ++ vim.command("let l:qf_item = {}") ++ vim.command("let l:qf_item.bufnr = bufnr('%')") ++ vim.command("let l:qf_item.filename = expand('%')") ++ vim.command("let l:qf_item.lnum = %s" % str(w.lineno)) ++ vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args)) ++ vim.command("let l:qf_item.type = 'E'") + + if w.col is None or isinstance(w, SyntaxError): + # without column information, just highlight the whole line +@@ -189,8 +236,21 @@ for w in check(vim.current.buffer): + # with a column number, highlight the first keyword there + vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") + ++ vim.command("let l:qf_item.vcol = 1") ++ vim.command("let l:qf_item.col = %s" % str(w.col + 1)) ++ + vim.command("call add(b:matched, s:matchDict)") ++ vim.command("call add(b:qf_list, l:qf_item)") + EOF ++ if exists("s:pyflakes_qf") ++ " if pyflakes quickfix window is already created, reuse it ++ call s:ActivatePyflakesQuickFixWindow() ++ call setqflist(b:qf_list, 'r') ++ else ++ " one pyflakes quickfix window for all buffer ++ call setqflist(b:qf_list, '') ++ let s:pyflakes_qf = s:GetQuickFixStackCount() ++ endif + let b:cleared = 0 + endfunction + end diff --git a/sources_non_forked/tlib/autoload/tlib/World.vim b/sources_non_forked/tlib/autoload/tlib/World.vim index daedb559..1387a350 100644 --- a/sources_non_forked/tlib/autoload/tlib/World.vim +++ b/sources_non_forked/tlib/autoload/tlib/World.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-05-01. -" @Last Change: 2013-09-26. -" @Revision: 0.1.1297 +" @Last Change: 2013-12-03. +" @Revision: 0.1.1310 " :filedoc: " A prototype used by |tlib#input#List|. @@ -161,12 +161,14 @@ else let self.width_filename = min([ \ get(self, 'width_filename', &co), \ empty(g:tlib#input#filename_max_width) ? &co : eval(g:tlib#input#filename_max_width), - \ max(map(copy(self.base), 'strwidth(fnamemodify(v:val, ":t"))')) + \ max(map(copy(self.base), 'strwidth(matchstr(v:val, "[^\\/]*$"))')) \ ]) - " TLogVAR self.width_filename + " TLogVAR self.width_filename + exec 'syntax match TLibDir /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename' + exec 'syntax match TLibMarker /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \S.*$/ contains=TLibDir' + " exec 'syntax match TLibDir /\(|\|\[.\{-}\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename' + " exec 'syntax match TLibMarker /\(|\|\[.\{-}\]\) \S.*$/ contains=TLibDir' exec 'syntax match TLibFilename /[^\/]\+$/ contained containedin=TLibDir' - exec 'syntax match TLibDir /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \zs\(\(\a:\|\.\.\|\.\.\..\{-}\)\?[\/][^&<>*|]\{-}\)\?[^\/]\+$/ contained containedin=TLibMarker contains=TLibFilename' - exec 'syntax match TLibMarker /\%>'. (1 + self.width_filename) .'c \(|\|\[[^]]*\]\) \S.*$/ contains=TLibDir' hi def link TLibMarker Special hi def link TLibDir Directory hi def link TLibFilename NonText @@ -206,24 +208,26 @@ else " TLogVAR use_indicators if use_indicators call insert(marker, '[') - let bnr = bufnr(a:file) - " TLogVAR a:file, bnr, self.bufnr - if bnr != -1 - if bnr == self.bufnr - call add(marker, '%') - else - call add(marker, bnr) + if g:tlib_inputlist_filename_indicators + let bnr = bufnr(a:file) + TLogVAR a:file, bnr, self.bufnr + if bnr != -1 + if bnr == self.bufnr + call add(marker, '%') + else + call add(marker, bnr) + endif + if getbufvar(bnr, '&modified') + call add(marker, '+') + endif + if getbufvar(bnr, '&bufhidden') == 'hide' + call add(marker, 'h') + endif + " if !buflisted(bnr) + " call add(marker, 'u') + " endif + " echom "DBG" a:file string(get(self,'filename_indicators')) endif - if getbufvar(bnr, '&modified') - call add(marker, '+') - endif - if getbufvar(bnr, '&bufhidden') == 'hide' - call add(marker, 'h') - endif - " if !buflisted(bnr) - " call add(marker, 'u') - " endif - " echom "DBG" a:file string(get(self,'filename_indicators')) endif if has_key(self, 'filename_indicators') && has_key(self.filename_indicators, a:file) if len(marker) > 1 diff --git a/sources_non_forked/tlib/autoload/tlib/agent.vim b/sources_non_forked/tlib/autoload/tlib/agent.vim index c0d9566a..61109e7b 100644 --- a/sources_non_forked/tlib/autoload/tlib/agent.vim +++ b/sources_non_forked/tlib/autoload/tlib/agent.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-24. -" @Last Change: 2013-09-26. -" @Revision: 0.1.240 +" @Last Change: 2013-11-05. +" @Revision: 0.1.242 " :filedoc: @@ -444,6 +444,7 @@ endf function! tlib#agent#EditFileInTab(world, selected) "{{{3 + " TLogVAR a:selected call a:world.CloseScratch() call tlib#file#With('tabedit', 'tab sbuffer', a:selected, a:world) return tlib#agent#Exit(a:world, a:selected) diff --git a/sources_non_forked/tlib/autoload/tlib/file.vim b/sources_non_forked/tlib/autoload/tlib/file.vim index e7ea855a..85009e37 100644 --- a/sources_non_forked/tlib/autoload/tlib/file.vim +++ b/sources_non_forked/tlib/autoload/tlib/file.vim @@ -4,7 +4,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-30. " @Last Change: 2013-09-25. -" @Revision: 0.0.141 +" @Revision: 0.0.142 if &cp || exists("loaded_tlib_file_autoload") finish @@ -36,12 +36,12 @@ function! tlib#file#Split(filename) "{{{3 endf -" :display: tlib#file#Join(filename_parts, ?strip_slashes=0) +" :display: tlib#file#Join(filename_parts, ?strip_slashes=1) " EXAMPLES: > " tlib#file#Join(['foo', 'bar', 'filename.txt']) " => 'foo/bar/filename.txt' function! tlib#file#Join(filename_parts, ...) "{{{3 - TVarArg 'strip_slashes' + TVarArg ['strip_slashes', 1] " TLogVAR a:filename_parts, strip_slashes if strip_slashes " let rx = tlib#rx#Escape(g:tlib#dir#sep) .'$' diff --git a/sources_non_forked/tlib/autoload/tlib/scratch.vim b/sources_non_forked/tlib/autoload/tlib/scratch.vim index bb6e4be2..e043f050 100644 --- a/sources_non_forked/tlib/autoload/tlib/scratch.vim +++ b/sources_non_forked/tlib/autoload/tlib/scratch.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-07-18. -" @Last Change: 2013-10-16. -" @Revision: 0.0.242 +" @Last Change: 2013-11-11. +" @Revision: 0.0.251 if &cp || exists("loaded_tlib_scratch_autoload") finish @@ -65,7 +65,7 @@ function! tlib#scratch#UseScratch(...) "{{{3 else let cmd = 'buffer!' endif - " TLogVAR cmd + " TLogVAR cmd, bn silent exec 'noautocmd keepalt keepj' cmd bn endif else @@ -77,7 +77,7 @@ function! tlib#scratch#UseScratch(...) "{{{3 else let cmd = 'edit' endif - " TLogVAR cmd + " TLogVAR cmd, id silent exec 'noautocmd keepalt keepj' cmd escape(id, '%#\ ') " silent exec 'split '. id endif @@ -100,7 +100,7 @@ function! tlib#scratch#UseScratch(...) "{{{3 endif endif let keyargs.scratch = bufnr('%') - " TLogVAR 2, winnr(), bufnr('%'), bufname("%") + " TLogVAR 2, winnr(), bufnr('%'), bufname("%"), keyargs.scratch return keyargs.scratch endf diff --git a/sources_non_forked/tlib/doc/tlib.txt b/sources_non_forked/tlib/doc/tlib.txt index f12563aa..a295ce19 100644 --- a/sources_non_forked/tlib/doc/tlib.txt +++ b/sources_non_forked/tlib/doc/tlib.txt @@ -1495,7 +1495,7 @@ tlib#file#Split(filename) < *tlib#file#Join()* -tlib#file#Join(filename_parts, ?strip_slashes=0) +tlib#file#Join(filename_parts, ?strip_slashes=1) EXAMPLES: > tlib#file#Join(['foo', 'bar', 'filename.txt']) => 'foo/bar/filename.txt' diff --git a/sources_non_forked/tlib/plugin/02tlib.vim b/sources_non_forked/tlib/plugin/02tlib.vim index 2cfe155a..c60dfd3b 100644 --- a/sources_non_forked/tlib/plugin/02tlib.vim +++ b/sources_non_forked/tlib/plugin/02tlib.vim @@ -4,7 +4,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-04-10. " @Last Change: 2013-09-25. -" @Revision: 746 +" @Revision: 748 " GetLatestVimScripts: 1863 1 tlib.vim if &cp || exists("loaded_tlib") @@ -14,7 +14,7 @@ if v:version < 700 "{{{2 echoerr "tlib requires Vim >= 7" finish endif -let loaded_tlib = 106 +let loaded_tlib = 107 let s:save_cpo = &cpo set cpo&vim diff --git a/sources_non_forked/vim-airline/LICENSE b/sources_non_forked/vim-airline/LICENSE index 46977354..9a5a8b73 100644 --- a/sources_non_forked/vim-airline/LICENSE +++ b/sources_non_forked/vim-airline/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (C) 2013 Bailey Ling +Copyright (C) 2013-2014 Bailey Ling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/sources_non_forked/vim-airline/README.md b/sources_non_forked/vim-airline/README.md index 3ff5ac3a..22d06872 100644 --- a/sources_non_forked/vim-airline/README.md +++ b/sources_non_forked/vim-airline/README.md @@ -10,7 +10,7 @@ Lean & mean status/tabline for vim that's light as air. * Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [eclim][34], [lawrencium][21], [virtualenv][31], [tmuxline][35]. * Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols. * Optimized for speed; it loads in under a millisecond. -* Extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki. +* Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki. * Supports 7.2 as the minimum Vim version. * The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33]. * Unit testing suite. @@ -70,6 +70,9 @@ vim-airline integrates with a variety of plugins out of the box. These extensio #### [tmuxline][35] ![image](https://f.cloud.github.com/assets/1532071/1559276/4c28fbac-4fc7-11e3-90ef-7e833d980f98.gif) +#### [promptline][36] +![airline-promptline-sc](https://f.cloud.github.com/assets/1532071/1871900/7d4b28a0-789d-11e3-90e4-16f37269981b.gif) + ## Extras vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also: @@ -164,7 +167,7 @@ Contributions and pull requests are welcome. Please take note of the following # License -MIT License. Copyright (c) 2013 Bailey Ling. +MIT License. Copyright (c) 2013-2014 Bailey Ling. [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bling/vim-airline/trend.png)](https://bitdeli.com/free "Bitdeli Badge") @@ -204,3 +207,4 @@ MIT License. Copyright (c) 2013 Bailey Ling. [33]: https://github.com/bling/vim-airline/wiki/Test-Plan [34]: http://eclim.org [35]: https://github.com/edkolev/tmuxline.vim +[36]: https://github.com/edkolev/promptline.vim diff --git a/sources_non_forked/vim-airline/autoload/airline.vim b/sources_non_forked/vim-airline/autoload/airline.vim index 664c78e6..de66fbac 100644 --- a/sources_non_forked/vim-airline/autoload/airline.vim +++ b/sources_non_forked/vim-airline/autoload/airline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', []) diff --git a/sources_non_forked/vim-airline/autoload/airline/builder.vim b/sources_non_forked/vim-airline/autoload/airline/builder.vim index c1658974..d03af12e 100644 --- a/sources_non_forked/vim-airline/autoload/airline/builder.vim +++ b/sources_non_forked/vim-airline/autoload/airline/builder.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:prototype = {} diff --git a/sources_non_forked/vim-airline/autoload/airline/debug.vim b/sources_non_forked/vim-airline/autoload/airline/debug.vim index 04d7e59c..28424a65 100644 --- a/sources_non_forked/vim-airline/autoload/airline/debug.vim +++ b/sources_non_forked/vim-airline/autoload/airline/debug.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 function! airline#debug#profile1() diff --git a/sources_non_forked/vim-airline/autoload/airline/deprecation.vim b/sources_non_forked/vim-airline/autoload/airline/deprecation.vim index dd0567fc..cf7e7872 100644 --- a/sources_non_forked/vim-airline/autoload/airline/deprecation.vim +++ b/sources_non_forked/vim-airline/autoload/airline/deprecation.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 function! airline#deprecation#check() diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions.vim b/sources_non_forked/vim-airline/autoload/airline/extensions.vim index 790bfd1b..f32abd3c 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:ext = {} @@ -20,7 +20,6 @@ endfunction let s:script_path = tolower(resolve(expand(':p:h'))) let s:filetype_overrides = { - \ 'netrw': [ 'netrw', '%f' ], \ 'nerdtree': [ 'NERD', '' ], \ 'gundo': [ 'Gundo', '' ], \ 'diff': [ 'diff', '' ], @@ -128,6 +127,10 @@ function! airline#extensions#load() call airline#extensions#unite#init(s:ext) endif + if exists(':NetrwSettings') + call airline#extensions#netrw#init(s:ext) + endif + if get(g:, 'loaded_vimfiler', 0) let g:vimfiler_force_overwrite_statusline = 0 endif @@ -199,6 +202,10 @@ function! airline#extensions#load() call airline#extensions#tmuxline#init(s:ext) endif + if get(g:, 'airline#extensions#promptline#enabled', 1) && exists(':PromptlineSnapshot') && len(get(g:, 'airline#extensions#promptline#snapshot_file', '')) + call airline#extensions#promptline#init(s:ext) + endif + " load all other extensions not part of the default distribution for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") " we have to check both resolved and unresolved paths, since it's possible diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim index 2177f64c..82fd139f 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/branch.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:has_fugitive = exists('*fugitive#head') @@ -10,10 +10,6 @@ if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand finish endif -let s:empty_message = get(g:, 'airline#extensions#branch#empty_message', - \ get(g:, 'airline_branch_empty_message', '')) -let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) - function! airline#extensions#branch#head() let head = '' @@ -48,9 +44,12 @@ endfunction function! airline#extensions#branch#get_head() let head = airline#extensions#branch#head() + let empty_message = get(g:, 'airline#extensions#branch#empty_message', + \ get(g:, 'airline_branch_empty_message', '')) + let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) return empty(head) - \ ? s:empty_message - \ : printf('%s%s', empty(s:symbol) ? '' : s:symbol.(g:airline_symbols.space), head) + \ ? empty_message + \ : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head) endfunction function! s:check_in_path() diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/bufferline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/bufferline.vim index 0c6013ce..6dc97fe7 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/bufferline.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/bufferline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !exists('*bufferline#get_status_string') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/commandt.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/commandt.vim index 1353940b..e549f27b 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/commandt.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/commandt.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !get(g:, 'command_t_loaded', 0) diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/csv.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/csv.vim index d3a8cc84..2c296ab3 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/csv.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/csv.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !get(g:, 'loaded_csv', 0) && !exists(':Table') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/ctrlp.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/ctrlp.vim index 64e28854..11a89220 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/ctrlp.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/ctrlp.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !get(g:, 'loaded_ctrlp', 0) diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/default.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/default.vim index 5d21996f..d01349df 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/default.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/default.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', { diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim index 68360466..8a80813e 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/eclim.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !exists(':ProjectCreate') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/example.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/example.vim index 0c64f2c8..4a1932d8 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/example.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/example.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 " we don't actually want this loaded :P diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim index 084dd7b5..6827f5d7 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/hunks.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/netrw.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/netrw.vim new file mode 100644 index 00000000..debb0888 --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/netrw.vim @@ -0,0 +1,32 @@ +" MIT License. Copyright (c) 2013-2014 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +if !exists(':NetrwSettings') + finish +endif + +function! airline#extensions#netrw#apply(...) + if &ft == 'netrw' + let spc = g:airline_symbols.space + + call a:1.add_section('airline_a', spc.'netrw'.spc) + if exists('*airline#extensions#branch#get_head') + call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc) + endif + call a:1.add_section('airline_c', spc.'%f'.spc) + call a:1.split() + call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc) + return 1 + endif +endfunction + +function! airline#extensions#netrw#init(ext) + let g:netrw_force_overwrite_statusline = 0 + call a:ext.add_statusline_func('airline#extensions#netrw#apply') +endfunction + + +function! airline#extensions#netrw#sortstring() + let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-' + return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']' +endfunction diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/promptline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/promptline.vim new file mode 100644 index 00000000..50b9708f --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/promptline.vim @@ -0,0 +1,33 @@ +" MIT License. Copyright (c) 2013-2014 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +if !exists(':PromptlineSnapshot') + finish +endif + +if !exists('airline#extensions#promptline#snapshot_file') || !len('airline#extensions#promptline#snapshot_file') + finish +endif + +let s:prompt_snapshot_file = get(g:, 'airline#extensions#promptline#snapshot_file', '') +let s:color_template = get(g:, 'airline#extensions#promptline#color_template', 'normal') + +function! airline#extensions#promptline#init(ext) + call a:ext.add_theme_func('airline#extensions#promptline#set_prompt_colors') +endfunction + +function! airline#extensions#promptline#set_prompt_colors(palette) + let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal' + let mode_palette = a:palette[color_template] + + if !has_key(g:, 'promptline_symbols') + let g:promptline_symbols = { + \ 'left' : g:airline_left_sep, + \ 'right' : g:airline_right_sep, + \ 'left_alt' : g:airline_left_alt_sep, + \ 'right_alt' : g:airline_right_alt_sep} + endif + + let promptline_theme = promptline#api#create_theme_from_airline(mode_palette) + call promptline#api#create_snapshot_with_theme(s:prompt_snapshot_file, promptline_theme) +endfunction diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim index f000e027..8efc5275 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/quickfix.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let g:airline#extensions#quickfix#quickfix_text = 'Quickfix' diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/syntastic.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/syntastic.vim index 3ecc1eb1..f7179af8 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/syntastic.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/syntastic.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !exists(':SyntasticCheck') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim index 0bad224f..90aff5d8 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim index f1c87e4f..4f1ed40e 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/default.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim index eb622f5e..e4a790d9 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 function! airline#extensions#tabline#unique_tail#format(bufnr, buffers) diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim index 12b28ae6..1b4dfa3f 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:skip_symbol = '…' diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tagbar.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tagbar.vim index 061a47f2..eb158ac4 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tagbar.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tagbar.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !exists(':TagbarToggle') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim index 4bc0a5f9..363709bc 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tmuxline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !exists(':Tmuxline') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/undotree.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/undotree.vim index d897f041..f577ffd8 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/undotree.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/undotree.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !exists(':UndotreeToggle') diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/unite.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/unite.vim index 4db38584..d230b6fb 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/unite.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/unite.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !get(g:, 'loaded_unite', 0) diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/virtualenv.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/virtualenv.vim index c052282c..f070c472 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/virtualenv.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/virtualenv.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if !get(g:, 'virtualenv_loaded', 0) diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim index 002fba1d..ba98b71e 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 " http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html diff --git a/sources_non_forked/vim-airline/autoload/airline/highlighter.vim b/sources_non_forked/vim-airline/autoload/airline/highlighter.vim index f5e68465..65a95cc9 100644 --- a/sources_non_forked/vim-airline/autoload/airline/highlighter.vim +++ b/sources_non_forked/vim-airline/autoload/airline/highlighter.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') diff --git a/sources_non_forked/vim-airline/autoload/airline/init.vim b/sources_non_forked/vim-airline/autoload/airline/init.vim index 558b3f23..a60774d8 100644 --- a/sources_non_forked/vim-airline/autoload/airline/init.vim +++ b/sources_non_forked/vim-airline/autoload/airline/init.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 function! s:check_defined(variable, default) diff --git a/sources_non_forked/vim-airline/autoload/airline/parts.vim b/sources_non_forked/vim-airline/autoload/airline/parts.vim index bec4504f..b0356b1d 100644 --- a/sources_non_forked/vim-airline/autoload/airline/parts.vim +++ b/sources_non_forked/vim-airline/autoload/airline/parts.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 let s:parts = {} diff --git a/sources_non_forked/vim-airline/autoload/airline/section.vim b/sources_non_forked/vim-airline/autoload/airline/section.vim index 4562bacd..0baf0779 100644 --- a/sources_non_forked/vim-airline/autoload/airline/section.vim +++ b/sources_non_forked/vim-airline/autoload/airline/section.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 call airline#init#bootstrap() diff --git a/sources_non_forked/vim-airline/autoload/airline/themes.vim b/sources_non_forked/vim-airline/autoload/airline/themes.vim index 110a9dc3..07e03241 100644 --- a/sources_non_forked/vim-airline/autoload/airline/themes.vim +++ b/sources_non_forked/vim-airline/autoload/airline/themes.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 " generates a dictionary which defines the colors for each highlight group diff --git a/sources_non_forked/vim-airline/autoload/airline/themes/kalisi.vim b/sources_non_forked/vim-airline/autoload/airline/themes/kalisi.vim new file mode 100644 index 00000000..4ff94f57 --- /dev/null +++ b/sources_non_forked/vim-airline/autoload/airline/themes/kalisi.vim @@ -0,0 +1,57 @@ +" +" Colorscheme: Kalisi for airline. Inspired by powerline. +" 06.02.2014 Arthur Jaron +" hifreeo@gmail.com +" + +" Insert mode +let s:I1 = [ '#ffffff' , '#e80000' , 23 , 231 ] +let s:I2 = [ '#c5c5c5' , '#901010' , 74 , 31 ] +let s:I3 = [ '#c5c5c5' , '#500000' , 117 , 24 ] + +" Visual mode +let s:V1 = [ '#005f5f' , '#ffffff' , 23 , 231 ] +let s:V2 = [ '#5fafd7' , '#0087af' , 74 , 31 ] +let s:V3 = [ '#87d7ff' , '#005f87' , 117 , 24 ] + +" Replace mode +let s:R1 = [ '#8e00da' , '#ffffff' , 23 , 231 ] +let s:R2 = [ '#8e00da' , '#ce99ff' , 74 , 31 ] +let s:R3 = [ '#ce99ff' , '#8e00da' , 117 , 24 ] + +let g:airline#themes#kalisi#palette = {} + +function! airline#themes#kalisi#refresh() + + " Normal mode + let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ] + let s:N2 = [ '#afd700' , '#005f00' , 247 , 236 ] + let s:N3 = airline#themes#get_highlight('StatusLine') + + " Tabline Plugin + let g:airline#themes#kalisi#palette.tabline = { + \ 'airline_tab': ['#A6DB29', '#005f00', 231, 29, ''], + \ 'airline_tabsel': ['#404042', '#A6DB29', 231, 36, ''], + \ 'airline_tabtype': ['#afd700', '#005f00', 231, 36, ''], + \ 'airline_tabfill': ['#ffffff', '#000000', 231, 23, ''], + \ 'airline_tabhid': ['#c5c5c5', '#404042', 231, 88, ''], + \ 'airline_tabmod': ['#ffffff', '#F1266F', 231, 88, ''], + \ } + + let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) + let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) + let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) + + " Inactive Mode + " let s:IA = [ '#c5c5c5' , '#505052' , 239 , 234 , '' ] + let s:IA = airline#themes#get_highlight('StatusLineNC') + let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) + let g:airline#themes#kalisi#palette.inactive_modified = { + \ 'statusline': [ '#F1266F' , '' , '53' , '' , '' ] , + \ } + +endfunction + +call airline#themes#kalisi#refresh() + diff --git a/sources_non_forked/vim-airline/autoload/airline/util.vim b/sources_non_forked/vim-airline/autoload/airline/util.vim index b97c0866..a04bd0bf 100644 --- a/sources_non_forked/vim-airline/autoload/airline/util.vim +++ b/sources_non_forked/vim-airline/autoload/airline/util.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 call airline#init#bootstrap() diff --git a/sources_non_forked/vim-airline/doc/airline.txt b/sources_non_forked/vim-airline/doc/airline.txt index 8b8da8bd..d5407b91 100644 --- a/sources_non_forked/vim-airline/doc/airline.txt +++ b/sources_non_forked/vim-airline/doc/airline.txt @@ -433,7 +433,7 @@ eclim < Note: Enabling this extension will modify 'showtabline' and 'guioptions'. -------------------------------------- *airline-tmuxline* +------------------------------------- *airline-tmuxline* tmuxline * enable/disable tmuxline integration > @@ -450,6 +450,26 @@ tmuxline startup > airline#extensions#tmuxline#snapshot_file = "~/.tmux-statusline-colors.conf" < +------------------------------------- *airline-promptline* +promptline + +* configure the path to the snapshot .sh file. Mandatory option. The created + file should be sourced by the shell on login > + " in .vimrc + airline#extensions#promptline#snapshot_file = "~/.shell_prompt.sh" + + " in .bashrc/.zshrc + [ -f ~/.shell_prompt.sh ] && source ~/.shell_prompt.sh +< +* enable/disable promptline integration > + let g:airline#extensions#promptline#enabled = 0 +< +* configure which mode colors should be used in prompt > + let airline#extensions#promptline#color_template = 'normal' (default) + let airline#extensions#promptline#color_template = 'insert' + let airline#extensions#promptline#color_template = 'visual' + let airline#extensions#promptline#color_template = 'replace' +< ============================================================================== ADVANCED CUSTOMIZATION *airline-advanced-customization* @@ -699,7 +719,7 @@ Contributions and pull requests are welcome. ============================================================================== LICENSE *airline-license* -MIT License. Copyright © 2013 Bailey Ling. +MIT License. Copyright © 2013-2014 Bailey Ling. vim:tw=78:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-airline/plugin/airline.vim b/sources_non_forked/vim-airline/plugin/airline.vim index f1d3d386..e75535fe 100644 --- a/sources_non_forked/vim-airline/plugin/airline.vim +++ b/sources_non_forked/vim-airline/plugin/airline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013 Bailey Ling. +" MIT License. Copyright (c) 2013-2014 Bailey Ling. " vim: et ts=2 sts=2 sw=2 if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline) diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index dbbc754d..8ddb28da 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -136,6 +136,9 @@ function! fugitive#extract_git_dir(path) abort " checking for them since such checks are extremely slow. break endif + if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0 + break + endif let dir = s:sub(root, '[\/]$', '') . '/.git' let type = getftype(dir) if type ==# 'dir' && fugitive#is_git_dir(dir) diff --git a/sources_non_forked/vim-snipmate/Contributors.md b/sources_non_forked/vim-snipmate/Contributors.md index 117ea62b..6333cf57 100644 --- a/sources_non_forked/vim-snipmate/Contributors.md +++ b/sources_non_forked/vim-snipmate/Contributors.md @@ -14,6 +14,7 @@ additional contributions from: * [bpugh](https://github.com/bpugh) * [bruno-](https://github.com/bruno-) * [darkwise](https://github.com/darkwise) +* [fish-face](https://github.com/fish-face) * [henrik](https://github.com/henrik) * [holizz](https://github.com/holizz) * [honza](https://github.com/honza) diff --git a/sources_non_forked/vim-snipmate/README.md b/sources_non_forked/vim-snipmate/README.md index 5fdf73ac..4ddeecbe 100644 --- a/sources_non_forked/vim-snipmate/README.md +++ b/sources_non_forked/vim-snipmate/README.md @@ -22,6 +22,8 @@ dependencies. SnipMate depends on [vim-addon-mw-utils][mw-utils] and [tlib][tlib]. Since SnipMate does not ship with any snippets, we suggest looking at the [vim-snippets][vim-snippets] repository. +* Using [VAM][vam], add `vim-snippets` to the list of packages to be installed. + * Using [Pathogen][pathogen], run the following commands: % cd ~/.vim/bundle @@ -32,8 +34,6 @@ looking at the [vim-snippets][vim-snippets] repository. # Optional: % git clone https://github.com/honza/vim-snippets.git -* Using [VAM][vam], add `vim-snippets` to the list of packages to be installed. - * Using [Vundle][vundle], add the following to your `vimrc` then run `:BundleInstall` @@ -46,6 +46,11 @@ looking at the [vim-snippets][vim-snippets] repository. ## Release Notes ## +### Master ### + +* Fix bug with mirrors in the first column +* Fix bug with tabs in indents ([#143][143]) + ### 0.87 - 2014-01-04 ### * Stop indenting empty lines when expanding snippets @@ -68,3 +73,5 @@ looking at the [vim-snippets][vim-snippets] repository. [vam]: https://github.com/marcweber/vim-addon-manager [pathogen]: https://github.com/tpope/vim-pathogen [vundle]: https://github.com/gmarik/vundle + +[143]: https://github.com/garbas/vim-snipmate/issues/143 diff --git a/sources_non_forked/vim-snipmate/autoload/snipMate.vim b/sources_non_forked/vim-snipmate/autoload/snipMate.vim index 19304995..b4dc3949 100644 --- a/sources_non_forked/vim-snipmate/autoload/snipMate.vim +++ b/sources_non_forked/vim-snipmate/autoload/snipMate.vim @@ -79,7 +79,7 @@ fun! snipMate#expandSnip(snip, col) endif " Insert snippet with proper indentation - let indent = indent(lnum) + 1 + let indent = match(line, '\S\|$') + 1 call setline(lnum, line . snipLines[0]) call append(lnum, map(snipLines[1:], "empty(v:val) ? v:val : '" . strpart(line, 0, indent - 1) . "' . v:val")) @@ -375,10 +375,14 @@ function! s:state_proto.update_vars(change) let i += 1 endif + " Split the line into three parts: the mirror, what's before it, and + " what's after it. Then combine them using the new mirror string. + " Subtract one to go from column index to byte index let theline = getline(lnum) - " subtract -1 to go from column byte index to string byte index - " subtract another -1 to exclude the col'th element - call setline(lnum, theline[0:(col-2)] . newWord . theline[(col+self.end_col-self.start_col-a:change-1):]) + let update = strpart(theline, 0, col - 1) + let update .= newWord + let update .= strpart(theline, col + self.end_col - self.start_col - a:change - 1) + call setline(lnum, update) endfor " Reposition the cursor in case a var updates on the same line but before diff --git a/sources_non_forked/vim-snippets/README.md b/sources_non_forked/vim-snippets/README.md index 27592c73..da03e661 100644 --- a/sources_non_forked/vim-snippets/README.md +++ b/sources_non_forked/vim-snippets/README.md @@ -51,6 +51,32 @@ If you have VimL only (vim without python support) your best option is using garbas/vim-snipmate and cope with the minor bugs found in the engine. +Installation +============ +First be aware that there are many options, see "Snippet engines" above. +Second be aware than there are [tons of plugin managers](http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html) +which is why Marc Weber thinks that it doesn't make sense to repeat the same +repetitive information everywhere. + +*Recommended way:* +[vim-addon-manager](vim-addon-manager) (because Marc Weber wrote it for exactly +this reason, it supports simple dependency management). Eg you're done by this +line in your .vimrc: + +``` +" assuming you want to use snipmate snippet engine +ActivateAddons vim-snippets snipmate +``` + +[vim-pi](https://bitbucket.org/vimcommunity/vim-pi/issue/90/we-really-need-a-web-interface) +Is the place to discuss plugin managers and repository resources. + +About how to install snipate see [snipmate@garbas](https://github.com/garbas/vim-snipmate) + +(Bundle, Pathogen, git clone - keywords to make people find this link by ctrl-f search) +I know that I should be reading the docs of the snippet engine, just let me copy paste into my .vmirc: +(See this pull request)[https://github.com/honza/vim-snippets/pull/307/files]. + Policies / for contributors =========================== Some snippets are useful for almost all languages, so let's try to have the same diff --git a/sources_non_forked/vim-snippets/snippets/puppet.snippets b/sources_non_forked/vim-snippets/snippets/puppet.snippets index 2e451e41..a4fdf19f 100644 --- a/sources_non_forked/vim-snippets/snippets/puppet.snippets +++ b/sources_non_forked/vim-snippets/snippets/puppet.snippets @@ -90,7 +90,7 @@ snippet class ${0} } snippet node - node "${1:`vim_snippets#Filename('', 'fqdn')`}" { + node '${1:`vim_snippets#Filename('', 'fqdn')`}' { ${0} } snippet case @@ -122,99 +122,99 @@ snippet [ snippet > ${1} => ${0} snippet p: - "puppet://puppet/${1:module name}/${0:file name}" + 'puppet://puppet/${1:module name}/${0:file name}' # # Functions snippet alert - alert("${1:message}") + alert('${1:message}') snippet crit - crit("${1:message}") + crit('${1:message}') snippet debug - debug("${1:message}") + debug('${1:message}') snippet defined - defined(${1:Resource}["${2:name}"]) + defined(${1:Resource}['${2:name}']) snippet emerg - emerg("${1:message}") + emerg('${1:message}') snippet extlookup Simple extlookup - extlookup("${1:variable}") + extlookup('${1:variable}') snippet extlookup Extlookup with defaults - extlookup("${1:variable}", "${2:default}") + extlookup('${1:variable}', '${2:default}') snippet extlookup Extlookup with defaults and custom data file - extlookup("${1:variable}", "${2:default}", "${3:data source}") + extlookup('${1:variable}', '${2:default}', '${3:data source}') snippet fail - fail("${1:message}") + fail('${1:message}') snippet info - info("${1:message}") + info('${1:message}') snippet inline_template - inline_template("<%= ${1} %>") + inline_template('<%= ${1} %>') snippet notice - notice("${1:message}") + notice('${1:message}') snippet realize realize(${1:Resource}[${2:name}]) snippet regsubst - regsubst(${1:hay stack}, ${2:needle}, "${3:replacement}") + regsubst(${1:hay stack}, ${2:needle}, '${3:replacement}') snippet inc include ${1:classname} snippet split - split(${1:hay stack}, "${2:patten}") + split(${1:hay stack}, '${2:patten}') snippet versioncmp - versioncmp("${1:version}", "${2:version}") + versioncmp('${1:version}', '${2:version}') snippet warning - warning("${1:message}") + warning('${1:message}') # # Types snippet cron - cron{ "${1:name}": - command => "${2}", - user => "${3:root}", - ${4} => ${0} + cron { '${1:name}': + command => '${2}', + user => '${3:root}', + ${4} => ${0}, } snippet exec - exec{ "${1:name}": - command => "${2:$1}", - user => "${3:root}", - ${4} => ${0} + exec { '${1:name}': + command => '${2:$1}', + user => '${3:root}', + ${4} => ${0}, } snippet user - user{ "${1:user}": - comment => "${2:$1}", - ensure => present, - managehome => true, - home => "${0:/home/$1}" + user { '${1:user}': + ensure => present, + comment => '${2:$1}', + managehome => true, + home => '${0:/home/$1}', } snippet group - group{ "${1:group}": - ensure => ${0:present} + group { '${1:group}': + ensure => ${0:present}, } snippet host - host{ "${1:hostname}": - ip => ${0:127.0.0.1} + host { '${1:hostname}': + ip => ${0:127.0.0.1}, } snippet mailalias - mailalias{ "${1:localpart}": - recipient => "${0:recipient}" + mailalias { '${1:localpart}': + recipient => '${0:recipient}', } snippet mount - mount{ "${1:destination path}": + mount { '${1:destination path}': ensure => ${2:mounted}, - device => "${0:device name or path}" + device => '${0:device name or path}', } snippet package - package{ "${1:package name}": - ensure => ${0:present} + package { '${1:package name}': + ensure => ${0:present}, } snippet yumrepo - yumrepo{ "${1:repo name}": - descr => "${2:$1}", - enabled => ${0:1} + yumrepo { '${1:repo name}': + Descr => '${2:$1}', + enabled => ${0:1}, } snippet define @@ -227,7 +227,7 @@ snippet service ensure => running, enable => true, require => [ Package['${2:package}'], File['${3:file}'], ], - subscribe => [ File['${4:configfile1}'], File['${5:configfile2}'], Package['${6:package}'], ] + subscribe => [ File['${4:configfile1}'], File['${5:configfile2}'], Package['${6:package}'], ], } snippet file diff --git a/update_plugins.py b/update_plugins.py index 946f0b74..ad474860 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -35,6 +35,7 @@ vim-fugitive https://github.com/tpope/vim-fugitive vim-airline https://github.com/bling/vim-airline goyo.vim https://github.com/junegunn/goyo.vim vim-zenroom2 https://github.com/amix/vim-zenroom2 +pyflakes-pathogen https://github.com/mitechie/pyflakes-pathogen """.strip() GITHUB_ZIP = '%s/archive/master.zip' diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index 6cbbc3a2..68b79b82 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -293,23 +293,21 @@ autocmd BufWrite *.coffee :call DeleteTrailingWS() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => vimgrep searching and cope displaying +" => Ack searching and cope displaying +" requires ack.vim - it's much better than vimgrep/grep """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" When you press gv you vimgrep after the selected text +" When you press gv you Ack after the selected text vnoremap gv :call VisualSelection('gv', '') -" Open vimgrep and put the cursor in the right position -map g :vimgrep // **/*. - -" Vimgreps in the current file -map :vimgrep // % +" Open Ack and put the cursor in the right position +map g :Ack " When you press r you can search and replace the selected text vnoremap r :call VisualSelection('replace', '') " Do :help cope if you are unsure what cope is. It's super useful! " -" When you search with vimgrep, display your results in cope by doing: +" When you search with Ack, display your results in cope by doing: " cc " " To go to the next search result do: @@ -373,7 +371,7 @@ function! VisualSelection(direction, extra_filter) range if a:direction == 'b' execute "normal ?" . l:pattern . "^M" elseif a:direction == 'gv' - call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.' . a:extra_filter) + call CmdLine("Ack \"" . l:pattern . "\" " ) elseif a:direction == 'replace' call CmdLine("%s" . '/'. l:pattern . '/') elseif a:direction == 'f' From 497b5aa4fbe01fc415e53a9190677b02923cf90c Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 8 Feb 2014 10:05:16 +0000 Subject: [PATCH 24/37] Use syntastic instead of pyflakes (supports a ton of more languages) --- sources_forked/peaksea/colors/peaksea.vim | 2 +- .../pyflakes-pathogen/.gitignore | 1 - .../pyflakes-pathogen/README.rst | 11 - .../ftplugin/python/README.rst | 80 --- .../ftplugin/python/pyflakes.vim | 325 --------- .../ftplugin/python/pyflakes/LICENSE | 21 - .../ftplugin/python/pyflakes/NEWS.txt | 29 - .../ftplugin/python/pyflakes/README.rst | 36 - .../ftplugin/python/pyflakes/TODO | 11 - .../python/pyflakes/pyflakes/__init__.py | 2 - .../ftplugin/python/pyflakes/pyflakes/ast.py | 311 -------- .../python/pyflakes/pyflakes/checker.py | 625 ---------------- .../python/pyflakes/pyflakes/messages.py | 96 --- .../pyflakes/pyflakes/scripts/__init__.py | 0 .../pyflakes/pyflakes/scripts/pyflakes.py | 90 --- .../python/pyflakes/pyflakes/test/__init__.py | 0 .../python/pyflakes/pyflakes/test/harness.py | 27 - .../pyflakes/pyflakes/test/test_imports.py | 673 ------------------ .../pyflakes/pyflakes/test/test_other.py | 575 --------------- .../pyflakes/pyflakes/test/test_script.py | 185 ----- .../pyflakes/test/test_undefined_names.py | 265 ------- .../ftplugin/python/pyflakes/setup.py | 28 - .../ftplugin/python/quickfix.diff | 124 ---- sources_non_forked/syntastic/.gitignore | 4 + sources_non_forked/syntastic/CONTRIBUTING.md | 49 ++ sources_non_forked/syntastic/LICENCE | 13 + sources_non_forked/syntastic/README.markdown | 247 +++++++ .../syntastic/_assets/screenshot_1.png | Bin 0 -> 92425 bytes .../syntastic/autoload/syntastic/c.vim | 329 +++++++++ .../syntastic/autoload/syntastic/log.vim | 181 +++++ .../autoload/syntastic/postprocess.vim | 67 ++ .../syntastic/autoload/syntastic/util.vim | 244 +++++++ .../syntastic/doc/syntastic.txt | 656 +++++++++++++++++ .../syntastic/plugin/syntastic.vim | 521 ++++++++++++++ .../plugin/syntastic/autoloclist.vim | 40 ++ .../syntastic/plugin/syntastic/balloons.vim | 68 ++ .../syntastic/plugin/syntastic/checker.vim | 144 ++++ .../syntastic/plugin/syntastic/cursor.vim | 67 ++ .../plugin/syntastic/highlighting.vim | 95 +++ .../syntastic/plugin/syntastic/loclist.vim | 238 +++++++ .../syntastic/plugin/syntastic/modemap.vim | 75 ++ .../syntastic/plugin/syntastic/notifiers.vim | 57 ++ .../syntastic/plugin/syntastic/registry.vim | 282 ++++++++ .../syntastic/plugin/syntastic/signs.vim | 148 ++++ .../syntax_checkers/actionscript/mxmlc.vim | 71 ++ .../syntastic/syntax_checkers/ada/gcc.vim | 47 ++ .../applescript/osacompile.vim | 49 ++ .../syntax_checkers/asciidoc/asciidoc.vim | 47 ++ .../syntastic/syntax_checkers/asm/gcc.vim | 54 ++ .../syntax_checkers/bemhtml/bemhtmllint.vim | 34 + .../syntastic/syntax_checkers/c/avrgcc.vim | 55 ++ .../syntax_checkers/c/checkpatch.vim | 55 ++ .../syntastic/syntax_checkers/c/cppcheck.vim | 68 ++ .../syntastic/syntax_checkers/c/gcc.vim | 59 ++ .../syntastic/syntax_checkers/c/make.vim | 61 ++ .../syntastic/syntax_checkers/c/oclint.vim | 60 ++ .../syntastic/syntax_checkers/c/sparse.vim | 53 ++ .../syntastic/syntax_checkers/c/splint.vim | 59 ++ .../syntax_checkers/chef/foodcritic.vim | 39 + .../syntastic/syntax_checkers/co/coco.vim | 42 ++ .../syntastic/syntax_checkers/cobol/cobc.vim | 46 ++ .../syntax_checkers/coffee/coffee.vim | 56 ++ .../syntax_checkers/coffee/coffeelint.vim | 44 ++ .../syntastic/syntax_checkers/coq/coqtop.vim | 40 ++ .../syntax_checkers/cpp/cppcheck.vim | 68 ++ .../syntastic/syntax_checkers/cpp/cpplint.vim | 64 ++ .../syntastic/syntax_checkers/cpp/gcc.vim | 55 ++ .../syntastic/syntax_checkers/cpp/oclint.vim | 31 + .../syntastic/syntax_checkers/cs/mcs.vim | 39 + .../syntastic/syntax_checkers/css/csslint.vim | 56 ++ .../syntastic/syntax_checkers/css/phpcs.vim | 29 + .../syntax_checkers/css/prettycss.vim | 63 ++ .../syntax_checkers/cucumber/cucumber.vim | 42 ++ .../syntastic/syntax_checkers/cuda/nvcc.vim | 78 ++ .../syntastic/syntax_checkers/d/dmd.vim | 53 ++ .../syntax_checkers/dart/dartanalyzer.vim | 76 ++ .../syntax_checkers/docbk/xmllint.vim | 25 + .../syntax_checkers/dustjs/swiffer.vim | 38 + .../syntax_checkers/elixir/elixir.vim | 51 ++ .../erlang/erlang_check_file.erl | 63 ++ .../syntax_checkers/erlang/escript.vim | 61 ++ .../syntastic/syntax_checkers/eruby/ruby.vim | 73 ++ .../syntax_checkers/fortran/gfortran.vim | 51 ++ .../syntastic/syntax_checkers/glsl/cgc.vim | 77 ++ .../syntastic/syntax_checkers/go/go.vim | 83 +++ .../syntastic/syntax_checkers/go/gofmt.vim | 44 ++ .../syntastic/syntax_checkers/go/golint.vim | 39 + .../syntastic/syntax_checkers/go/gotype.vim | 48 ++ .../syntastic/syntax_checkers/go/govet.vim | 49 ++ .../syntastic/syntax_checkers/haml/haml.vim | 51 ++ .../syntax_checkers/haml/haml_lint.vim | 37 + .../syntax_checkers/handlebars/handlebars.vim | 42 ++ .../syntax_checkers/haskell/ghc-mod.vim | 72 ++ .../syntax_checkers/haskell/hdevtools.vim | 48 ++ .../syntax_checkers/haskell/hlint.vim | 37 + .../syntastic/syntax_checkers/haxe/haxe.vim | 61 ++ .../syntastic/syntax_checkers/hss/hss.vim | 38 + .../syntastic/syntax_checkers/html/jshint.vim | 55 ++ .../syntastic/syntax_checkers/html/tidy.vim | 209 ++++++ .../syntax_checkers/html/validator.vim | 102 +++ .../syntastic/syntax_checkers/html/w3.vim | 69 ++ .../syntax_checkers/java/checkstyle.vim | 88 +++ .../syntastic/syntax_checkers/java/javac.vim | 450 ++++++++++++ .../javascript/closurecompiler.vim | 76 ++ .../syntax_checkers/javascript/eslint.vim | 50 ++ .../syntax_checkers/javascript/gjslint.vim | 48 ++ .../syntax_checkers/javascript/jscs.vim | 42 ++ .../syntax_checkers/javascript/jshint.vim | 60 ++ .../syntax_checkers/javascript/jsl.vim | 50 ++ .../syntax_checkers/javascript/jslint.vim | 51 ++ .../syntax_checkers/json/jsonlint.vim | 43 ++ .../syntax_checkers/json/jsonval.vim | 41 ++ .../syntax_checkers/less/less-lint.coffee | 41 ++ .../syntax_checkers/less/less-lint.js | 57 ++ .../syntastic/syntax_checkers/less/lessc.vim | 71 ++ .../syntastic/syntax_checkers/lex/flex.vim | 50 ++ .../syntastic/syntax_checkers/limbo/limbo.vim | 46 ++ .../syntastic/syntax_checkers/lisp/clisp.vim | 48 ++ .../syntastic/syntax_checkers/llvm/llvm.vim | 39 + .../syntastic/syntax_checkers/lua/luac.vim | 65 ++ .../syntax_checkers/matlab/mlint.vim | 41 ++ .../syntastic/syntax_checkers/nasm/nasm.vim | 41 ++ .../syntax_checkers/nroff/mandoc.vim | 41 ++ .../syntastic/syntax_checkers/objc/gcc.vim | 59 ++ .../syntastic/syntax_checkers/objc/oclint.vim | 31 + .../syntastic/syntax_checkers/objcpp/gcc.vim | 59 ++ .../syntax_checkers/objcpp/oclint.vim | 31 + .../syntax_checkers/ocaml/camlp4o.vim | 156 ++++ .../syntastic/syntax_checkers/perl/perl.vim | 105 +++ .../syntax_checkers/perl/perlcritic.vim | 66 ++ .../syntax_checkers/perl/podchecker.vim | 25 + .../syntastic/syntax_checkers/php/php.vim | 51 ++ .../syntastic/syntax_checkers/php/phpcs.vim | 45 ++ .../syntastic/syntax_checkers/php/phpmd.vim | 78 ++ .../syntastic/syntax_checkers/po/msgfmt.vim | 50 ++ .../syntax_checkers/pod/podchecker.vim | 51 ++ .../syntax_checkers/puppet/puppet.vim | 50 ++ .../syntax_checkers/puppet/puppetlint.vim | 53 ++ .../syntax_checkers/python/compile.py | 13 + .../syntax_checkers/python/flake8.vim | 69 ++ .../syntax_checkers/python/frosted.vim | 60 ++ .../syntax_checkers/python/pep257.vim | 51 ++ .../syntastic/syntax_checkers/python/pep8.vim | 47 ++ .../syntax_checkers/python/py3kwarn.vim | 33 + .../syntax_checkers/python/pyflakes.vim | 70 ++ .../syntax_checkers/python/pylama.vim | 68 ++ .../syntax_checkers/python/pylint.vim | 83 +++ .../syntax_checkers/python/python.vim | 46 ++ .../syntax_checkers/racket/code-ayatollah.vim | 59 ++ .../syntax_checkers/racket/racket.vim | 50 ++ .../syntax_checkers/rst/rst2pseudoxml.vim | 62 ++ .../syntax_checkers/rst/rstcheck.vim | 50 ++ .../syntastic/syntax_checkers/ruby/jruby.vim | 56 ++ .../syntax_checkers/ruby/macruby.vim | 46 ++ .../syntastic/syntax_checkers/ruby/mri.vim | 80 +++ .../syntax_checkers/ruby/rubocop.vim | 59 ++ .../syntax_checkers/ruby/rubylint.vim | 40 ++ .../syntastic/syntax_checkers/rust/rustc.vim | 42 ++ .../syntastic/syntax_checkers/sass/sass.vim | 79 ++ .../syntastic/syntax_checkers/scala/fsc.vim | 51 ++ .../syntax_checkers/scala/scalac.vim | 47 ++ .../syntastic/syntax_checkers/scss/sass.vim | 26 + .../syntax_checkers/scss/scss_lint.vim | 37 + .../syntax_checkers/sh/checkbashisms.vim | 42 ++ .../syntastic/syntax_checkers/sh/sh.vim | 88 +++ .../syntax_checkers/sh/shellcheck.vim | 44 ++ .../syntastic/syntax_checkers/slim/slimrb.vim | 57 ++ .../syntax_checkers/tcl/nagelfar.vim | 43 ++ .../syntastic/syntax_checkers/tex/chktex.vim | 62 ++ .../syntastic/syntax_checkers/tex/lacheck.vim | 40 ++ .../syntax_checkers/texinfo/makeinfo.vim | 47 ++ .../syntax_checkers/text/atdtool.vim | 57 ++ .../syntax_checkers/text/language_check.vim | 37 + .../syntax_checkers/twig/twiglint.vim | 41 ++ .../syntax_checkers/typescript/tsc.vim | 40 ++ .../syntastic/syntax_checkers/vala/valac.vim | 97 +++ .../syntax_checkers/verilog/verilator.vim | 41 ++ .../syntastic/syntax_checkers/vhdl/ghdl.vim | 38 + .../syntastic/syntax_checkers/vim/vimlint.vim | 94 +++ .../syntax_checkers/xhtml/jshint.vim | 25 + .../syntastic/syntax_checkers/xhtml/tidy.vim | 89 +++ .../syntastic/syntax_checkers/xml/xmllint.vim | 52 ++ .../syntax_checkers/xslt/xmllint.vim | 25 + .../syntastic/syntax_checkers/yacc/bison.vim | 55 ++ .../syntastic/syntax_checkers/yaml/jsyaml.vim | 51 ++ .../syntastic/syntax_checkers/yaml/yamlxs.vim | 77 ++ .../syntax_checkers/z80/z80syntaxchecker.vim | 45 ++ .../syntastic/syntax_checkers/zpt/zptlint.vim | 51 ++ .../syntax_checkers/zsh/shellcheck.vim | 25 + .../syntastic/syntax_checkers/zsh/zsh.vim | 38 + sources_non_forked/vim-snippets/README.md | 31 +- update_plugins.py | 4 +- vimrcs/plugins_config.vim | 6 + 193 files changed, 11942 insertions(+), 3531 deletions(-) delete mode 100644 sources_non_forked/pyflakes-pathogen/.gitignore delete mode 100644 sources_non_forked/pyflakes-pathogen/README.rst delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/__init__.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py delete mode 100644 sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff create mode 100644 sources_non_forked/syntastic/.gitignore create mode 100644 sources_non_forked/syntastic/CONTRIBUTING.md create mode 100644 sources_non_forked/syntastic/LICENCE create mode 100644 sources_non_forked/syntastic/README.markdown create mode 100644 sources_non_forked/syntastic/_assets/screenshot_1.png create mode 100644 sources_non_forked/syntastic/autoload/syntastic/c.vim create mode 100644 sources_non_forked/syntastic/autoload/syntastic/log.vim create mode 100644 sources_non_forked/syntastic/autoload/syntastic/postprocess.vim create mode 100644 sources_non_forked/syntastic/autoload/syntastic/util.vim create mode 100644 sources_non_forked/syntastic/doc/syntastic.txt create mode 100644 sources_non_forked/syntastic/plugin/syntastic.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/autoloclist.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/balloons.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/checker.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/cursor.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/highlighting.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/loclist.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/modemap.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/notifiers.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/registry.vim create mode 100644 sources_non_forked/syntastic/plugin/syntastic/signs.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/actionscript/mxmlc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/applescript/osacompile.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/asciidoc/asciidoc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/asm/gcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/bemhtml/bemhtmllint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/avrgcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/checkpatch.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/cppcheck.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/gcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/make.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/oclint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/sparse.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/c/splint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/chef/foodcritic.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/co/coco.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cobol/cobc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/coffee/coffee.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/coffee/coffeelint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cpp/cppcheck.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/css/csslint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/css/phpcs.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cucumber/cucumber.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/cuda/nvcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/d/dmd.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/dart/dartanalyzer.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/docbk/xmllint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/dustjs/swiffer.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/elixir/elixir.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl create mode 100644 sources_non_forked/syntastic/syntax_checkers/erlang/escript.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/fortran/gfortran.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/glsl/cgc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/go/go.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/go/gofmt.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/go/golint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/go/gotype.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/go/govet.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haml/haml.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haml/haml_lint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/handlebars/handlebars.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haskell/ghc-mod.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haskell/hdevtools.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haskell/hlint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/hss/hss.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/html/jshint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/html/tidy.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/html/validator.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/html/w3.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/java/checkstyle.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/java/javac.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/closurecompiler.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/eslint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/gjslint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/jscs.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/jshint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/jsl.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/json/jsonlint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/json/jsonval.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/less/less-lint.coffee create mode 100644 sources_non_forked/syntastic/syntax_checkers/less/less-lint.js create mode 100644 sources_non_forked/syntastic/syntax_checkers/less/lessc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/lex/flex.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/limbo/limbo.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/llvm/llvm.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/lua/luac.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/matlab/mlint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/nasm/nasm.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/nroff/mandoc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/objc/gcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/objc/oclint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/objcpp/gcc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/objcpp/oclint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ocaml/camlp4o.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/perl/perl.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/perl/perlcritic.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/perl/podchecker.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/php/php.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/php/phpmd.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/po/msgfmt.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/pod/podchecker.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/puppet/puppet.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/puppet/puppetlint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/compile.py create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/flake8.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/frosted.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/pep257.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/pep8.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/py3kwarn.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/pyflakes.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/pylama.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/pylint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/python/python.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/racket/code-ayatollah.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/racket/racket.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/rst/rst2pseudoxml.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/rst/rstcheck.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ruby/macruby.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ruby/rubocop.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/ruby/rubylint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/rust/rustc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/sass/sass.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/scala/scalac.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/scss/sass.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/scss/scss_lint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/sh/checkbashisms.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/sh/sh.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/sh/shellcheck.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/slim/slimrb.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/tcl/nagelfar.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/tex/chktex.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/tex/lacheck.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/texinfo/makeinfo.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/text/language_check.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/twig/twiglint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/typescript/tsc.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/vala/valac.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/verilog/verilator.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/vhdl/ghdl.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/vim/vimlint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/xhtml/jshint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/xhtml/tidy.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/xml/xmllint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/xslt/xmllint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/yacc/bison.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/yaml/jsyaml.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/yaml/yamlxs.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/z80/z80syntaxchecker.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/zpt/zptlint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/zsh/shellcheck.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/zsh/zsh.vim diff --git a/sources_forked/peaksea/colors/peaksea.vim b/sources_forked/peaksea/colors/peaksea.vim index b679c23c..78481e0f 100644 --- a/sources_forked/peaksea/colors/peaksea.vim +++ b/sources_forked/peaksea/colors/peaksea.vim @@ -294,7 +294,7 @@ elseif &background=='dark' hi DiffChange guifg=NONE guibg=#800080 gui=NONE hi DiffDelete guifg=#6080f0 guibg=#202020 gui=NONE hi DiffText guifg=#000000 guibg=#c0e080 gui=NONE - hi SignColumn guifg=#e0e0e0 guibg=#008000 gui=NONE + hi SignColumn guifg=#e0e0e0 guibg=#202020 gui=NONE hi IncSearch guifg=White guibg=DarkRed gui=NONE hi StatusLineNC guifg=#000000 guibg=#c0c0c0 gui=NONE hi VertSplit guifg=#000000 guibg=#c0c0c0 gui=NONE diff --git a/sources_non_forked/pyflakes-pathogen/.gitignore b/sources_non_forked/pyflakes-pathogen/.gitignore deleted file mode 100644 index 0d20b648..00000000 --- a/sources_non_forked/pyflakes-pathogen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/sources_non_forked/pyflakes-pathogen/README.rst b/sources_non_forked/pyflakes-pathogen/README.rst deleted file mode 100644 index b36ea388..00000000 --- a/sources_non_forked/pyflakes-pathogen/README.rst +++ /dev/null @@ -1,11 +0,0 @@ -Pyflakes -========== - -This is just a manual dump of the vim pyflakes plugin from: -http://www.vim.org/scripts/script.php?script_id=2441 - -The purpose is to try to make this compatible with pathogen plugin. So creating -the dir structure and hopefully this means we can just keep the norm and git -clone the repo into the bundle directory and things will load up magically. - - diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst b/sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst deleted file mode 100644 index 124fc3ec..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/README.rst +++ /dev/null @@ -1,80 +0,0 @@ -pyflakes-vim -============ - -A Vim plugin for checking Python code on the fly. - -PyFlakes catches common Python errors like mistyping a variable name or -accessing a local before it is bound, and also gives warnings for things like -unused imports. - -pyflakes-vim uses the output from PyFlakes to highlight errors in your code. -To locate errors quickly, use quickfix_ commands like :cc. - -Make sure to check vim.org_ for the latest updates. - -.. _pyflakes.vim: http://www.vim.org/scripts/script.php?script_id=2441 -.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 -.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix - -Quick Installation ------------------- - -1. Make sure your ``.vimrc`` has:: - - filetype on " enables filetype detection - filetype plugin on " enables filetype specific plugins - -2. Download the latest release_. - -3. Unzip ``pyflakes.vim`` and the ``pyflakes`` directory into - ``~/.vim/ftplugin/python`` (or somewhere similar on your - `runtime path`_ that will be sourced for Python files). - -.. _release: http://www.vim.org/scripts/script.php?script_id=2441 -.. _runtime path: http://vimdoc.sourceforge.net/htmldoc/options.html#'runtimepath' - -Installation ------------- - -If you downloaded this from vim.org_, then just drop the contents of the zip -file into ``~/.vim/ftplugin/python``. - -Otherwise, if you're running "from source," you'll need PyFlakes on your -PYTHONPATH somewhere. I recommend getting my PyFlakes_ fork, which retains -column number information and has therfore has more specific error locations. - -.. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 -.. _PyFlakes: http://github.com/kevinw/pyflakes - -Hacking -------- - -:: - - git clone git://github.com/kevinw/pyflakes-vim.git - cd pyflakes-vim - git clone git://github.com/kevinw/pyflakes.git - -Options -------- - -Set this option to you vimrc file to disable quickfix support:: - - let g:pyflakes_use_quickfix = 0 - -The value is set to 1 by default. - -TODO ----- - * signs_ support (show warning and error icons to left of the buffer area) - * configuration variables - * parse or intercept useful output from the warnings module - -.. _signs: http://www.vim.org/htmldoc/sign.html - -Changelog ---------- - -Please see http://www.vim.org/scripts/script.php?script_id=2441 for a history of -all changes. - diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim deleted file mode 100644 index a6e84b6a..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes.vim +++ /dev/null @@ -1,325 +0,0 @@ -" pyflakes.vim - A script to highlight Python code on the fly with warnings -" from Pyflakes, a Python lint tool. -" -" Place this script and the accompanying pyflakes directory in -" .vim/ftplugin/python. -" -" See README for additional installation and information. -" -" Thanks to matlib.vim for ideas/code on interactive linting. -" -" Maintainer: Kevin Watters -" Version: 0.1 -if !has('python') - " exit if python is not available. - finish -endif - -if exists("b:did_pyflakes_plugin") - finish " only load once -else - let b:did_pyflakes_plugin = 1 -endif - -if !exists('g:pyflakes_builtins') - let g:pyflakes_builtins = [] -endif - -if !exists("b:did_python_init") - let b:did_python_init = 0 - - if !has('python') - echoerr "Error: the pyflakes.vim plugin requires Vim to be compiled with +python" - finish - endif - -if !exists('g:pyflakes_use_quickfix') - let g:pyflakes_use_quickfix = 1 -endif - - - python << EOF -import vim -import os.path -import sys - -if sys.version_info[:2] < (2, 5): - raise AssertionError('Vim must be compiled with Python 2.5 or higher; you have ' + sys.version) - -# get the directory this script is in: the pyflakes python module should be installed there. -scriptdir = os.path.join(os.path.dirname(vim.eval('expand("")')), 'pyflakes') -sys.path.insert(0, scriptdir) - -import ast -from pyflakes import checker, messages -from operator import attrgetter -import re - -class loc(object): - def __init__(self, lineno, col=None): - self.lineno = lineno - self.col_offset = col - -class SyntaxError(messages.Message): - message = 'could not compile: %s' - def __init__(self, filename, lineno, col, message): - messages.Message.__init__(self, filename, loc(lineno, col)) - self.message_args = (message,) - -class blackhole(object): - write = flush = lambda *a, **k: None - -def check(buffer): - filename = buffer.name - contents = buffer[:] - - # shebang usually found at the top of the file, followed by source code encoding marker. - # assume everything else that follows is encoded in the encoding. - encoding_found = False - for n, line in enumerate(contents): - if n >= 2: - break - elif re.match(r'#.*coding[:=]\s*([-\w.]+)', line): - contents = ['']*(n+1) + contents[n+1:] - break - - contents = '\n'.join(contents) + '\n' - - vimenc = vim.eval('&encoding') - if vimenc: - contents = contents.decode(vimenc) - - builtins = set(['__file__']) - try: - builtins.update(set(eval(vim.eval('string(g:pyflakes_builtins)')))) - except Exception: - pass - - try: - # TODO: use warnings filters instead of ignoring stderr - old_stderr, sys.stderr = sys.stderr, blackhole() - try: - tree = ast.parse(contents, filename or '') - finally: - sys.stderr = old_stderr - except: - try: - value = sys.exc_info()[1] - lineno, offset, line = value[1][1:] - except IndexError: - lineno, offset, line = 1, 0, '' - if line and line.endswith("\n"): - line = line[:-1] - - return [SyntaxError(filename, lineno, offset, str(value))] - else: - # pyflakes looks to _MAGIC_GLOBALS in checker.py to see which - # UndefinedNames to ignore - old_globals = getattr(checker,' _MAGIC_GLOBALS', []) - checker._MAGIC_GLOBALS = set(old_globals) | builtins - - w = checker.Checker(tree, filename) - - checker._MAGIC_GLOBALS = old_globals - - w.messages.sort(key = attrgetter('lineno')) - return w.messages - - -def vim_quote(s): - return s.replace("'", "''") -EOF - let b:did_python_init = 1 -endif - -if !b:did_python_init - finish -endif - -au BufLeave call s:ClearPyflakes() - -au BufEnter call s:RunPyflakes() -au InsertLeave call s:RunPyflakes() -au InsertEnter call s:RunPyflakes() -au BufWritePost call s:RunPyflakes() - -au CursorHold call s:RunPyflakes() -au CursorHoldI call s:RunPyflakes() - -au CursorHold call s:GetPyflakesMessage() -au CursorMoved call s:GetPyflakesMessage() - -if !exists("*s:PyflakesUpdate") - function s:PyflakesUpdate() - silent call s:RunPyflakes() - call s:GetPyflakesMessage() - endfunction -endif - -" Call this function in your .vimrc to update PyFlakes -if !exists(":PyflakesUpdate") - command PyflakesUpdate :call s:PyflakesUpdate() -endif - -" Hook common text manipulation commands to update PyFlakes -" TODO: is there a more general "text op" autocommand we could register -" for here? -noremap dd dd:PyflakesUpdate -noremap dw dw:PyflakesUpdate -noremap u u:PyflakesUpdate -noremap :PyflakesUpdate - -" WideMsg() prints [long] message up to (&columns-1) length -" guaranteed without "Press Enter" prompt. -if !exists("*s:WideMsg") - function s:WideMsg(msg) - let x=&ruler | let y=&showcmd - set noruler noshowcmd - redraw - echo strpart(a:msg, 0, &columns-1) - let &ruler=x | let &showcmd=y - endfun -endif - -if !exists("*s:GetQuickFixStackCount") - function s:GetQuickFixStackCount() - let l:stack_count = 0 - try - silent colder 9 - catch /E380:/ - endtry - - try - for i in range(9) - silent cnewer - let l:stack_count = l:stack_count + 1 - endfor - catch /E381:/ - return l:stack_count - endtry - endfunction -endif - -if !exists("*s:ActivatePyflakesQuickFixWindow") - function s:ActivatePyflakesQuickFixWindow() - try - silent colder 9 " go to the bottom of quickfix stack - catch /E380:/ - endtry - - if s:pyflakes_qf > 0 - try - exe "silent cnewer " . s:pyflakes_qf - catch /E381:/ - echoerr "Could not activate Pyflakes Quickfix Window." - endtry - endif - endfunction -endif - -if !exists("*s:RunPyflakes") - function s:RunPyflakes() - highlight link PyFlakes SpellBad - - if exists("b:cleared") - if b:cleared == 0 - silent call s:ClearPyflakes() - let b:cleared = 1 - endif - else - let b:cleared = 1 - endif - - let b:matched = [] - let b:matchedlines = {} - - let b:qf_list = [] - let b:qf_window_count = -1 - - python << EOF -for w in check(vim.current.buffer): - vim.command('let s:matchDict = {}') - vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) - vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) - vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") - - vim.command("let l:qf_item = {}") - vim.command("let l:qf_item.bufnr = bufnr('%')") - vim.command("let l:qf_item.filename = expand('%')") - vim.command("let l:qf_item.lnum = %s" % str(w.lineno)) - vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args)) - vim.command("let l:qf_item.type = 'E'") - - if getattr(w, 'col', None) is None or isinstance(w, SyntaxError): - # without column information, just highlight the whole line - # (minus the newline) - vim.command(r"let s:mID = matchadd('PyFlakes', '\%" + str(w.lineno) + r"l\n\@!')") - else: - # with a column number, highlight the first keyword there - vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") - - vim.command("let l:qf_item.vcol = 1") - vim.command("let l:qf_item.col = %s" % str(w.col + 1)) - - vim.command("call add(b:matched, s:matchDict)") - vim.command("call add(b:qf_list, l:qf_item)") -EOF - if g:pyflakes_use_quickfix == 1 - if exists("s:pyflakes_qf") - " if pyflakes quickfix window is already created, reuse it - call s:ActivatePyflakesQuickFixWindow() - call setqflist(b:qf_list, 'r') - else - " one pyflakes quickfix window for all buffer - call setqflist(b:qf_list, '') - let s:pyflakes_qf = s:GetQuickFixStackCount() - endif - endif - - let b:cleared = 0 - endfunction -end - -" keep track of whether or not we are showing a message -let b:showing_message = 0 - -if !exists("*s:GetPyflakesMessage") - function s:GetPyflakesMessage() - let s:cursorPos = getpos(".") - - " Bail if RunPyflakes hasn't been called yet. - if !exists('b:matchedlines') - return - endif - - " if there's a message for the line the cursor is currently on, echo - " it to the console - if has_key(b:matchedlines, s:cursorPos[1]) - let s:pyflakesMatch = get(b:matchedlines, s:cursorPos[1]) - call s:WideMsg(s:pyflakesMatch['message']) - let b:showing_message = 1 - return - endif - - " otherwise, if we're showing a message, clear it - if b:showing_message == 1 - echo - let b:showing_message = 0 - endif - endfunction -endif - -if !exists('*s:ClearPyflakes') - function s:ClearPyflakes() - let s:matches = getmatches() - for s:matchId in s:matches - if s:matchId['group'] == 'PyFlakes' - call matchdelete(s:matchId['id']) - endif - endfor - let b:matched = [] - let b:matchedlines = {} - let b:cleared = 1 - endfunction -endif - diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE deleted file mode 100644 index 42b8cf3c..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) 2005 Divmod, Inc., http://www.divmod.com/ - -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. diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt deleted file mode 100644 index 2a3e3165..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/NEWS.txt +++ /dev/null @@ -1,29 +0,0 @@ -0.4.0 (2009-11-25): - - Fix reporting for certain SyntaxErrors which lack line number - information. - - Check for syntax errors more rigorously. - - Support checking names used with the class decorator syntax in versions - of Python which have it. - - Detect local variables which are bound but never used. - - Handle permission errors when trying to read source files. - - Handle problems with the encoding of source files. - - Support importing dotted names so as not to incorrectly report them as - redefined unused names. - - Support all forms of the with statement. - - Consider static `__all__` definitions and avoid reporting unused names - if the names are listed there. - - Fix incorrect checking of class names with respect to the names of their - bases in the class statement. - - Support the `__path__` global in `__init__.py`. - -0.3.0 (2009-01-30): - - Display more informative SyntaxError messages. - - Don't hang flymake with unmatched triple quotes (only report a single - line of source for a multiline syntax error). - - Recognize __builtins__ as a defined name. - - Improve pyflakes support for python versions 2.3-2.5 - - Support for if-else expressions and with statements. - - Warn instead of error on non-existant file paths. - - Check for __future__ imports after other statements. - - Add reporting for some types of import shadowing. - - Improve reporting of unbound locals diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst deleted file mode 100644 index 9ac34fc0..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/README.rst +++ /dev/null @@ -1,36 +0,0 @@ -pyflakes -======== - -This version of PyFlakes_ has been improved to use Python's newer ``ast`` -module, instead of ``compiler``. So code checking happens faster, and will stay -up to date with new language changes. - -.. _PyFlakes: http://http://www.divmod.org/trac/wiki/DivmodPyflakes - -TODO ----- - -Importing several modules from the same package results in unnecessary warnings: - -:: - - import a.b - import a.c # Redefinition of unused "a" from line 1 - -The following construct for defining a function differently depending on some -condition results in a redefinition warning: - -:: - - if some_condition: - def foo(): do_foo() - else: - def foo(): do_bar() # redefinition of function 'foo' from line 2 - -IDE Integration ---------------- - -* vim: pyflakes-vim_ - -.. _pyflakes-vim: http://github.com/kevinw/pyflakes-vim - diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO deleted file mode 100644 index 69f3f12c..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/TODO +++ /dev/null @@ -1,11 +0,0 @@ - - Check for methods that override other methods except that they vary by case. - - assign/increment + unbound local error not caught - def foo(): - bar = 5 - def meep(): - bar += 2 - meep() - print bar - - print foo() - diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py deleted file mode 100644 index 652a8f47..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ - -__version__ = '0.4.0' diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py deleted file mode 100644 index d52025f4..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/ast.py +++ /dev/null @@ -1,311 +0,0 @@ -# -*- coding: utf-8 -*- -""" - ast - ~~~ - - The `ast` module helps Python applications to process trees of the Python - abstract syntax grammar. The abstract syntax itself might change with - each Python release; this module helps to find out programmatically what - the current grammar looks like and allows modifications of it. - - An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as - a flag to the `compile()` builtin function or by using the `parse()` - function from this module. The result will be a tree of objects whose - classes all inherit from `ast.AST`. - - A modified abstract syntax tree can be compiled into a Python code object - using the built-in `compile()` function. - - Additionally various helper functions are provided that make working with - the trees simpler. The main intention of the helper functions and this - module in general is to provide an easy to use interface for libraries - that work tightly with the python syntax (template engines for example). - - - :copyright: Copyright 2008 by Armin Ronacher. - :license: Python License. -""" -from _ast import * -from _ast import __version__ - - -def parse(expr, filename='', mode='exec'): - """ - Parse an expression into an AST node. - Equivalent to compile(expr, filename, mode, PyCF_ONLY_AST). - """ - return compile(expr, filename, mode, PyCF_ONLY_AST) - - -def literal_eval(node_or_string): - """ - Safely evaluate an expression node or a string containing a Python - expression. The string or node provided may only consist of the following - Python literal structures: strings, numbers, tuples, lists, dicts, booleans, - and None. - """ - _safe_names = {'None': None, 'True': True, 'False': False} - if isinstance(node_or_string, basestring): - node_or_string = parse(node_or_string, mode='eval') - if isinstance(node_or_string, Expression): - node_or_string = node_or_string.body - def _convert(node): - if isinstance(node, Str): - return node.s - elif isinstance(node, Num): - return node.n - elif isinstance(node, Tuple): - return tuple(map(_convert, node.elts)) - elif isinstance(node, List): - return list(map(_convert, node.elts)) - elif isinstance(node, Dict): - return dict((_convert(k), _convert(v)) for k, v - in zip(node.keys, node.values)) - elif isinstance(node, Name): - if node.id in _safe_names: - return _safe_names[node.id] - raise ValueError('malformed string') - return _convert(node_or_string) - - -def dump(node, annotate_fields=True, include_attributes=False): - """ - Return a formatted dump of the tree in *node*. This is mainly useful for - debugging purposes. The returned string will show the names and the values - for fields. This makes the code impossible to evaluate, so if evaluation is - wanted *annotate_fields* must be set to False. Attributes such as line - numbers and column offsets are not dumped by default. If this is wanted, - *include_attributes* can be set to True. - """ - def _format(node): - if isinstance(node, AST): - fields = [(a, _format(b)) for a, b in iter_fields(node)] - rv = '%s(%s' % (node.__class__.__name__, ', '.join( - ('%s=%s' % field for field in fields) - if annotate_fields else - (b for a, b in fields) - )) - if include_attributes and node._attributes: - rv += fields and ', ' or ' ' - rv += ', '.join('%s=%s' % (a, _format(getattr(node, a))) - for a in node._attributes) - return rv + ')' - elif isinstance(node, list): - return '[%s]' % ', '.join(_format(x) for x in node) - return repr(node) - if not isinstance(node, AST): - raise TypeError('expected AST, got %r' % node.__class__.__name__) - return _format(node) - - -def copy_location(new_node, old_node): - """ - Copy source location (`lineno` and `col_offset` attributes) from - *old_node* to *new_node* if possible, and return *new_node*. - """ - for attr in 'lineno', 'col_offset': - if attr in old_node._attributes and attr in new_node._attributes \ - and hasattr(old_node, attr): - setattr(new_node, attr, getattr(old_node, attr)) - return new_node - - -def fix_missing_locations(node): - """ - When you compile a node tree with compile(), the compiler expects lineno and - col_offset attributes for every node that supports them. This is rather - tedious to fill in for generated nodes, so this helper adds these attributes - recursively where not already set, by setting them to the values of the - parent node. It works recursively starting at *node*. - """ - def _fix(node, lineno, col_offset): - if 'lineno' in node._attributes: - if not hasattr(node, 'lineno'): - node.lineno = lineno - else: - lineno = node.lineno - if 'col_offset' in node._attributes: - if not hasattr(node, 'col_offset'): - node.col_offset = col_offset - else: - col_offset = node.col_offset - for child in iter_child_nodes(node): - _fix(child, lineno, col_offset) - _fix(node, 1, 0) - return node - -def add_col_end(node): - def _fix(node, next): - children = list(iter_child_nodes(node)) - for i, child in enumerate(children): - next_offset = children[i+1].col_offset if i < len(children) else next.col_offset - child.col_end = next_offset - - -def increment_lineno(node, n=1): - """ - Increment the line number of each node in the tree starting at *node* by *n*. - This is useful to "move code" to a different location in a file. - """ - if 'lineno' in node._attributes: - node.lineno = getattr(node, 'lineno', 0) + n - for child in walk(node): - if 'lineno' in child._attributes: - child.lineno = getattr(child, 'lineno', 0) + n - return node - - -def iter_fields(node): - """ - Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` - that is present on *node*. - """ - if node._fields is None: - return - - for field in node._fields: - try: - yield field, getattr(node, field) - except AttributeError: - pass - - -def iter_child_nodes(node): - """ - Yield all direct child nodes of *node*, that is, all fields that are nodes - and all items of fields that are lists of nodes. - """ - for name, field in iter_fields(node): - if isinstance(field, AST): - yield field - elif isinstance(field, list): - for item in field: - if isinstance(item, AST): - yield item - - -def get_docstring(node, clean=True): - """ - Return the docstring for the given node or None if no docstring can - be found. If the node provided does not have docstrings a TypeError - will be raised. - """ - if not isinstance(node, (FunctionDef, ClassDef, Module)): - raise TypeError("%r can't have docstrings" % node.__class__.__name__) - if node.body and isinstance(node.body[0], Expr) and \ - isinstance(node.body[0].value, Str): - if clean: - import inspect - return inspect.cleandoc(node.body[0].value.s) - return node.body[0].value.s - - -def walk(node): - """ - Recursively yield all child nodes of *node*, in no specified order. This is - useful if you only want to modify nodes in place and don't care about the - context. - """ - from collections import deque - todo = deque([node]) - while todo: - node = todo.popleft() - todo.extend(iter_child_nodes(node)) - yield node - - -class NodeVisitor(object): - """ - A node visitor base class that walks the abstract syntax tree and calls a - visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. - - This class is meant to be subclassed, with the subclass adding visitor - methods. - - Per default the visitor functions for the nodes are ``'visit_'`` + - class name of the node. So a `TryFinally` node visit function would - be `visit_TryFinally`. This behavior can be changed by overriding - the `visit` method. If no visitor function exists for a node - (return value `None`) the `generic_visit` visitor is used instead. - - Don't use the `NodeVisitor` if you want to apply changes to nodes during - traversing. For this a special visitor exists (`NodeTransformer`) that - allows modifications. - """ - - def visit(self, node): - """Visit a node.""" - method = 'visit_' + node.__class__.__name__ - visitor = getattr(self, method, self.generic_visit) - return visitor(node) - - def generic_visit(self, node): - """Called if no explicit visitor function exists for a node.""" - for field, value in iter_fields(node): - if isinstance(value, list): - for item in value: - if isinstance(item, AST): - self.visit(item) - elif isinstance(value, AST): - self.visit(value) - - -class NodeTransformer(NodeVisitor): - """ - A :class:`NodeVisitor` subclass that walks the abstract syntax tree and - allows modification of nodes. - - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. - - Here is an example transformer that rewrites all occurrences of name lookups - (``foo``) to ``data['foo']``:: - - class RewriteName(NodeTransformer): - - def visit_Name(self, node): - return copy_location(Subscript( - value=Name(id='data', ctx=Load()), - slice=Index(value=Str(s=node.id)), - ctx=node.ctx - ), node) - - Keep in mind that if the node you're operating on has child nodes you must - either transform the child nodes yourself or call the :meth:`generic_visit` - method for the node first. - - For nodes that were part of a collection of statements (that applies to all - statement nodes), the visitor may also return a list of nodes rather than - just a single node. - - Usually you use the transformer like this:: - - node = YourTransformer().visit(node) - """ - - def generic_visit(self, node): - for field, old_value in iter_fields(node): - old_value = getattr(node, field, None) - if isinstance(old_value, list): - new_values = [] - for value in old_value: - if isinstance(value, AST): - value = self.visit(value) - if value is None: - continue - elif not isinstance(value, AST): - new_values.extend(value) - continue - new_values.append(value) - old_value[:] = new_values - elif isinstance(old_value, AST): - new_node = self.visit(old_value) - if new_node is None: - delattr(node, field) - else: - setattr(node, field, new_node) - return node diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py deleted file mode 100644 index 7c348b8d..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/checker.py +++ /dev/null @@ -1,625 +0,0 @@ -# -*- test-case-name: pyflakes -*- -# (c) 2005-2010 Divmod, Inc. -# See LICENSE file for details - -import __builtin__ -import os.path -import _ast - -from pyflakes import messages - - -# utility function to iterate over an AST node's children, adapted -# from Python 2.6's standard ast module -try: - import ast - iter_child_nodes = ast.iter_child_nodes -except (ImportError, AttributeError): - def iter_child_nodes(node, astcls=_ast.AST): - """ - Yield all direct child nodes of *node*, that is, all fields that are nodes - and all items of fields that are lists of nodes. - """ - for name in node._fields: - field = getattr(node, name, None) - if isinstance(field, astcls): - yield field - elif isinstance(field, list): - for item in field: - yield item - - -class Binding(object): - """ - Represents the binding of a value to a name. - - The checker uses this to keep track of which names have been bound and - which names have not. See L{Assignment} for a special type of binding that - is checked with stricter rules. - - @ivar used: pair of (L{Scope}, line-number) indicating the scope and - line number that this binding was last used - """ - - def __init__(self, name, source): - self.name = name - self.source = source - self.used = False - - - def __str__(self): - return self.name - - - def __repr__(self): - return '<%s object %r from line %r at 0x%x>' % (self.__class__.__name__, - self.name, - self.source.lineno, - id(self)) - - - -class UnBinding(Binding): - '''Created by the 'del' operator.''' - - - -class Importation(Binding): - """ - A binding created by an import statement. - - @ivar fullName: The complete name given to the import statement, - possibly including multiple dotted components. - @type fullName: C{str} - """ - def __init__(self, name, source): - self.fullName = name - name = name.split('.')[0] - super(Importation, self).__init__(name, source) - - - -class Argument(Binding): - """ - Represents binding a name as an argument. - """ - - - -class Assignment(Binding): - """ - Represents binding a name with an explicit assignment. - - The checker will raise warnings for any Assignment that isn't used. Also, - the checker does not consider assignments in tuple/list unpacking to be - Assignments, rather it treats them as simple Bindings. - """ - - - -class FunctionDefinition(Binding): - pass - - - -class ExportBinding(Binding): - """ - A binding created by an C{__all__} assignment. If the names in the list - can be determined statically, they will be treated as names for export and - additional checking applied to them. - - The only C{__all__} assignment that can be recognized is one which takes - the value of a literal list containing literal strings. For example:: - - __all__ = ["foo", "bar"] - - Names which are imported and not otherwise used but appear in the value of - C{__all__} will not have an unused import warning reported for them. - """ - def names(self): - """ - Return a list of the names referenced by this binding. - """ - names = [] - if isinstance(self.source, _ast.List): - for node in self.source.elts: - if isinstance(node, _ast.Str): - names.append(node.s) - return names - - - -class Scope(dict): - importStarred = False # set to True when import * is found - - - def __repr__(self): - return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), dict.__repr__(self)) - - - def __init__(self): - super(Scope, self).__init__() - - - -class ClassScope(Scope): - pass - - - -class FunctionScope(Scope): - """ - I represent a name scope for a function. - - @ivar globals: Names declared 'global' in this function. - """ - def __init__(self): - super(FunctionScope, self).__init__() - self.globals = {} - - - -class ModuleScope(Scope): - pass - - -# Globally defined names which are not attributes of the __builtin__ module. -_MAGIC_GLOBALS = ['__file__', '__builtins__'] - - - -class Checker(object): - """ - I check the cleanliness and sanity of Python code. - - @ivar _deferredFunctions: Tracking list used by L{deferFunction}. Elements - of the list are two-tuples. The first element is the callable passed - to L{deferFunction}. The second element is a copy of the scope stack - at the time L{deferFunction} was called. - - @ivar _deferredAssignments: Similar to C{_deferredFunctions}, but for - callables which are deferred assignment checks. - """ - - nodeDepth = 0 - traceTree = False - - def __init__(self, tree, filename='(none)'): - self._deferredFunctions = [] - self._deferredAssignments = [] - self.dead_scopes = [] - self.messages = [] - self.filename = filename - self.scopeStack = [ModuleScope()] - self.futuresAllowed = True - self.handleChildren(tree) - self._runDeferred(self._deferredFunctions) - # Set _deferredFunctions to None so that deferFunction will fail - # noisily if called after we've run through the deferred functions. - self._deferredFunctions = None - self._runDeferred(self._deferredAssignments) - # Set _deferredAssignments to None so that deferAssignment will fail - # noisly if called after we've run through the deferred assignments. - self._deferredAssignments = None - del self.scopeStack[1:] - self.popScope() - self.check_dead_scopes() - - - def deferFunction(self, callable): - ''' - Schedule a function handler to be called just before completion. - - This is used for handling function bodies, which must be deferred - because code later in the file might modify the global scope. When - `callable` is called, the scope at the time this is called will be - restored, however it will contain any new bindings added to it. - ''' - self._deferredFunctions.append((callable, self.scopeStack[:])) - - - def deferAssignment(self, callable): - """ - Schedule an assignment handler to be called just after deferred - function handlers. - """ - self._deferredAssignments.append((callable, self.scopeStack[:])) - - - def _runDeferred(self, deferred): - """ - Run the callables in C{deferred} using their associated scope stack. - """ - for handler, scope in deferred: - self.scopeStack = scope - handler() - - - def scope(self): - return self.scopeStack[-1] - scope = property(scope) - - def popScope(self): - self.dead_scopes.append(self.scopeStack.pop()) - - - def check_dead_scopes(self): - """ - Look at scopes which have been fully examined and report names in them - which were imported but unused. - """ - for scope in self.dead_scopes: - export = isinstance(scope.get('__all__'), ExportBinding) - if export: - all = scope['__all__'].names() - if os.path.split(self.filename)[1] != '__init__.py': - # Look for possible mistakes in the export list - undefined = set(all) - set(scope) - for name in undefined: - self.report( - messages.UndefinedExport, - scope['__all__'].source, - name) - else: - all = [] - - # Look for imported names that aren't used. - for importation in scope.itervalues(): - if isinstance(importation, Importation): - if not importation.used and importation.name not in all: - self.report( - messages.UnusedImport, - importation.source, - importation.name) - - - def pushFunctionScope(self): - self.scopeStack.append(FunctionScope()) - - def pushClassScope(self): - self.scopeStack.append(ClassScope()) - - def report(self, messageClass, *args, **kwargs): - self.messages.append(messageClass(self.filename, *args, **kwargs)) - - def handleChildren(self, tree): - for node in iter_child_nodes(tree): - self.handleNode(node, tree) - - def isDocstring(self, node): - """ - Determine if the given node is a docstring, as long as it is at the - correct place in the node tree. - """ - return isinstance(node, _ast.Str) or \ - (isinstance(node, _ast.Expr) and - isinstance(node.value, _ast.Str)) - - def handleNode(self, node, parent): - node.parent = parent - if self.traceTree: - print ' ' * self.nodeDepth + node.__class__.__name__ - self.nodeDepth += 1 - if self.futuresAllowed and not \ - (isinstance(node, _ast.ImportFrom) or self.isDocstring(node)): - self.futuresAllowed = False - nodeType = node.__class__.__name__.upper() - try: - handler = getattr(self, nodeType) - handler(node) - finally: - self.nodeDepth -= 1 - if self.traceTree: - print ' ' * self.nodeDepth + 'end ' + node.__class__.__name__ - - def ignore(self, node): - pass - - # "stmt" type nodes - RETURN = DELETE = PRINT = WHILE = IF = WITH = RAISE = TRYEXCEPT = \ - TRYFINALLY = ASSERT = EXEC = EXPR = handleChildren - - CONTINUE = BREAK = PASS = ignore - - # "expr" type nodes - BOOLOP = BINOP = UNARYOP = IFEXP = DICT = SET = YIELD = COMPARE = \ - CALL = REPR = ATTRIBUTE = SUBSCRIPT = LIST = TUPLE = handleChildren - - NUM = STR = ELLIPSIS = ignore - - # "slice" type nodes - SLICE = EXTSLICE = INDEX = handleChildren - - # expression contexts are node instances too, though being constants - LOAD = STORE = DEL = AUGLOAD = AUGSTORE = PARAM = ignore - - # same for operators - AND = OR = ADD = SUB = MULT = DIV = MOD = POW = LSHIFT = RSHIFT = \ - BITOR = BITXOR = BITAND = FLOORDIV = INVERT = NOT = UADD = USUB = \ - EQ = NOTEQ = LT = LTE = GT = GTE = IS = ISNOT = IN = NOTIN = ignore - - # additional node types - COMPREHENSION = EXCEPTHANDLER = KEYWORD = handleChildren - - def addBinding(self, loc, value, reportRedef=True): - '''Called when a binding is altered. - - - `loc` is the location (an object with lineno and optionally - col_offset attributes) of the statement responsible for the change - - `value` is the optional new value, a Binding instance, associated - with the binding; if None, the binding is deleted if it exists. - - if `reportRedef` is True (default), rebinding while unused will be - reported. - ''' - if (isinstance(self.scope.get(value.name), FunctionDefinition) - and isinstance(value, FunctionDefinition)): - self.report(messages.RedefinedFunction, - loc, value.name, self.scope[value.name].source) - - if not isinstance(self.scope, ClassScope): - for scope in self.scopeStack[::-1]: - existing = scope.get(value.name) - if (isinstance(existing, Importation) - and not existing.used - and (not isinstance(value, Importation) or value.fullName == existing.fullName) - and reportRedef): - - self.report(messages.RedefinedWhileUnused, - loc, value.name, scope[value.name].source) - - if isinstance(value, UnBinding): - try: - del self.scope[value.name] - except KeyError: - self.report(messages.UndefinedName, loc, value.name) - else: - self.scope[value.name] = value - - def GLOBAL(self, node): - """ - Keep track of globals declarations. - """ - if isinstance(self.scope, FunctionScope): - self.scope.globals.update(dict.fromkeys(node.names)) - - def LISTCOMP(self, node): - # handle generators before element - for gen in node.generators: - self.handleNode(gen, node) - self.handleNode(node.elt, node) - - GENERATOREXP = SETCOMP = LISTCOMP - - # dictionary comprehensions; introduced in Python 2.7 - def DICTCOMP(self, node): - for gen in node.generators: - self.handleNode(gen, node) - self.handleNode(node.key, node) - self.handleNode(node.value, node) - - def FOR(self, node): - """ - Process bindings for loop variables. - """ - vars = [] - def collectLoopVars(n): - if isinstance(n, _ast.Name): - vars.append(n.id) - elif isinstance(n, _ast.expr_context): - return - else: - for c in iter_child_nodes(n): - collectLoopVars(c) - - collectLoopVars(node.target) - for varn in vars: - if (isinstance(self.scope.get(varn), Importation) - # unused ones will get an unused import warning - and self.scope[varn].used): - self.report(messages.ImportShadowedByLoopVar, - node, varn, self.scope[varn].source) - - self.handleChildren(node) - - def NAME(self, node): - """ - Handle occurrence of Name (which can be a load/store/delete access.) - """ - # Locate the name in locals / function / globals scopes. - if isinstance(node.ctx, (_ast.Load, _ast.AugLoad)): - # try local scope - importStarred = self.scope.importStarred - try: - self.scope[node.id].used = (self.scope, node) - except KeyError: - pass - else: - return - - # try enclosing function scopes - - for scope in self.scopeStack[-2:0:-1]: - importStarred = importStarred or scope.importStarred - if not isinstance(scope, FunctionScope): - continue - try: - scope[node.id].used = (self.scope, node) - except KeyError: - pass - else: - return - - # try global scope - - importStarred = importStarred or self.scopeStack[0].importStarred - try: - self.scopeStack[0][node.id].used = (self.scope, node) - except KeyError: - if ((not hasattr(__builtin__, node.id)) - and node.id not in _MAGIC_GLOBALS - and not importStarred): - if (os.path.basename(self.filename) == '__init__.py' and - node.id == '__path__'): - # the special name __path__ is valid only in packages - pass - else: - self.report(messages.UndefinedName, node, node.id) - elif isinstance(node.ctx, (_ast.Store, _ast.AugStore)): - # if the name hasn't already been defined in the current scope - if isinstance(self.scope, FunctionScope) and node.id not in self.scope: - # for each function or module scope above us - for scope in self.scopeStack[:-1]: - if not isinstance(scope, (FunctionScope, ModuleScope)): - continue - # if the name was defined in that scope, and the name has - # been accessed already in the current scope, and hasn't - # been declared global - if (node.id in scope - and scope[node.id].used - and scope[node.id].used[0] is self.scope - and node.id not in self.scope.globals): - # then it's probably a mistake - self.report(messages.UndefinedLocal, - scope[node.id].used[1], - node.id, - scope[node.id].source) - break - - if isinstance(node.parent, - (_ast.For, _ast.comprehension, _ast.Tuple, _ast.List)): - binding = Binding(node.id, node) - elif (node.id == '__all__' and - isinstance(self.scope, ModuleScope)): - binding = ExportBinding(node.id, node.parent.value) - else: - binding = Assignment(node.id, node) - if node.id in self.scope: - binding.used = self.scope[node.id].used - self.addBinding(node, binding) - elif isinstance(node.ctx, _ast.Del): - if isinstance(self.scope, FunctionScope) and \ - node.id in self.scope.globals: - del self.scope.globals[node.id] - else: - self.addBinding(node, UnBinding(node.id, node)) - else: - # must be a Param context -- this only happens for names in function - # arguments, but these aren't dispatched through here - raise RuntimeError( - "Got impossible expression context: %r" % (node.ctx,)) - - - def FUNCTIONDEF(self, node): - # the decorators attribute is called decorator_list as of Python 2.6 - if hasattr(node, 'decorators'): - for deco in node.decorators: - self.handleNode(deco, node) - else: - for deco in node.decorator_list: - self.handleNode(deco, node) - self.addBinding(node, FunctionDefinition(node.name, node)) - self.LAMBDA(node) - - def LAMBDA(self, node): - for default in node.args.defaults: - self.handleNode(default, node) - - def runFunction(): - args = [] - - def addArgs(arglist): - for arg in arglist: - if isinstance(arg, _ast.Tuple): - addArgs(arg.elts) - else: - if arg.id in args: - self.report(messages.DuplicateArgument, - node, arg.id) - args.append(arg.id) - - self.pushFunctionScope() - addArgs(node.args.args) - # vararg/kwarg identifiers are not Name nodes - if node.args.vararg: - args.append(node.args.vararg) - if node.args.kwarg: - args.append(node.args.kwarg) - for name in args: - self.addBinding(node, Argument(name, node), reportRedef=False) - if isinstance(node.body, list): - # case for FunctionDefs - for stmt in node.body: - self.handleNode(stmt, node) - else: - # case for Lambdas - self.handleNode(node.body, node) - def checkUnusedAssignments(): - """ - Check to see if any assignments have not been used. - """ - for name, binding in self.scope.iteritems(): - if (not binding.used and not name in self.scope.globals - and isinstance(binding, Assignment)): - self.report(messages.UnusedVariable, - binding.source, name) - self.deferAssignment(checkUnusedAssignments) - self.popScope() - - self.deferFunction(runFunction) - - - def CLASSDEF(self, node): - """ - Check names used in a class definition, including its decorators, base - classes, and the body of its definition. Additionally, add its name to - the current scope. - """ - # decorator_list is present as of Python 2.6 - for deco in getattr(node, 'decorator_list', []): - self.handleNode(deco, node) - for baseNode in node.bases: - self.handleNode(baseNode, node) - self.pushClassScope() - for stmt in node.body: - self.handleNode(stmt, node) - self.popScope() - self.addBinding(node, Binding(node.name, node)) - - def ASSIGN(self, node): - self.handleNode(node.value, node) - for target in node.targets: - self.handleNode(target, node) - - def AUGASSIGN(self, node): - # AugAssign is awkward: must set the context explicitly and visit twice, - # once with AugLoad context, once with AugStore context - node.target.ctx = _ast.AugLoad() - self.handleNode(node.target, node) - self.handleNode(node.value, node) - node.target.ctx = _ast.AugStore() - self.handleNode(node.target, node) - - def IMPORT(self, node): - for alias in node.names: - name = alias.asname or alias.name - importation = Importation(name, node) - self.addBinding(node, importation) - - def IMPORTFROM(self, node): - if node.module == '__future__': - if not self.futuresAllowed: - self.report(messages.LateFutureImport, node, - [n.name for n in node.names]) - else: - self.futuresAllowed = False - - for alias in node.names: - if alias.name == '*': - self.scope.importStarred = True - self.report(messages.ImportStarUsed, node, node.module) - continue - name = alias.asname or alias.name - importation = Importation(name, node) - if node.module == '__future__': - importation.used = (self.scope, node) - self.addBinding(node, importation) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py deleted file mode 100644 index 73bf4cc3..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/messages.py +++ /dev/null @@ -1,96 +0,0 @@ -# (c) 2005 Divmod, Inc. See LICENSE file for details - -class Message(object): - message = '' - message_args = () - def __init__(self, filename, loc, use_column=True): - self.filename = filename - self.lineno = loc.lineno - self.col = getattr(loc, 'col_offset', None) if use_column else None - - def __str__(self): - return '%s:%s: %s' % (self.filename, self.lineno, self.message % self.message_args) - - -class UnusedImport(Message): - message = '%r imported but unused' - def __init__(self, filename, loc, name): - Message.__init__(self, filename, loc, use_column=False) - self.message_args = (name,) - - -class RedefinedWhileUnused(Message): - message = 'redefinition of unused %r from line %r' - def __init__(self, filename, loc, name, orig_loc): - Message.__init__(self, filename, loc) - self.message_args = (name, orig_loc.lineno) - - -class ImportShadowedByLoopVar(Message): - message = 'import %r from line %r shadowed by loop variable' - def __init__(self, filename, loc, name, orig_loc): - Message.__init__(self, filename, loc) - self.message_args = (name, orig_loc.lineno) - - -class ImportStarUsed(Message): - message = "'from %s import *' used; unable to detect undefined names" - def __init__(self, filename, loc, modname): - Message.__init__(self, filename, loc) - self.message_args = (modname,) - - -class UndefinedName(Message): - message = 'undefined name %r' - def __init__(self, filename, loc, name): - Message.__init__(self, filename, loc) - self.message_args = (name,) - - - -class UndefinedExport(Message): - message = 'undefined name %r in __all__' - def __init__(self, filename, loc, name): - Message.__init__(self, filename, loc) - self.message_args = (name,) - - - -class UndefinedLocal(Message): - message = "local variable %r (defined in enclosing scope on line %r) referenced before assignment" - def __init__(self, filename, loc, name, orig_loc): - Message.__init__(self, filename, loc) - self.message_args = (name, orig_loc.lineno) - - -class DuplicateArgument(Message): - message = 'duplicate argument %r in function definition' - def __init__(self, filename, loc, name): - Message.__init__(self, filename, loc) - self.message_args = (name,) - - -class RedefinedFunction(Message): - message = 'redefinition of function %r from line %r' - def __init__(self, filename, loc, name, orig_loc): - Message.__init__(self, filename, loc) - self.message_args = (name, orig_loc.lineno) - - -class LateFutureImport(Message): - message = 'future import(s) %r after other statements' - def __init__(self, filename, loc, names): - Message.__init__(self, filename, loc) - self.message_args = (names,) - - -class UnusedVariable(Message): - """ - Indicates that a variable has been explicity assigned to but not actually - used. - """ - - message = 'local variable %r is assigned to but never used' - def __init__(self, filename, loc, names): - Message.__init__(self, filename, loc) - self.message_args = (names,) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py deleted file mode 100644 index 6b1dae22..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/scripts/pyflakes.py +++ /dev/null @@ -1,90 +0,0 @@ - -""" -Implementation of the command-line I{pyflakes} tool. -""" - -import sys -import os -import _ast - -checker = __import__('pyflakes.checker').checker - -def check(codeString, filename): - """ - Check the Python source given by C{codeString} for flakes. - - @param codeString: The Python source to check. - @type codeString: C{str} - - @param filename: The name of the file the source came from, used to report - errors. - @type filename: C{str} - - @return: The number of warnings emitted. - @rtype: C{int} - """ - # First, compile into an AST and handle syntax errors. - try: - tree = compile(codeString, filename, "exec", _ast.PyCF_ONLY_AST) - except SyntaxError, value: - msg = value.args[0] - - (lineno, offset, text) = value.lineno, value.offset, value.text - - # If there's an encoding problem with the file, the text is None. - if text is None: - # Avoid using msg, since for the only known case, it contains a - # bogus message that claims the encoding the file declared was - # unknown. - print >> sys.stderr, "%s: problem decoding source" % (filename, ) - else: - line = text.splitlines()[-1] - - if offset is not None: - offset = offset - (len(text) - len(line)) - - print >> sys.stderr, '%s:%d: %s' % (filename, lineno, msg) - print >> sys.stderr, line - - if offset is not None: - print >> sys.stderr, " " * offset, "^" - - return 1 - else: - # Okay, it's syntactically valid. Now check it. - w = checker.Checker(tree, filename) - w.messages.sort(lambda a, b: cmp(a.lineno, b.lineno)) - for warning in w.messages: - print warning - return len(w.messages) - - -def checkPath(filename): - """ - Check the given path, printing out any warnings detected. - - @return: the number of warnings printed - """ - try: - return check(file(filename, 'U').read() + '\n', filename) - except IOError, msg: - print >> sys.stderr, "%s: %s" % (filename, msg.args[1]) - return 1 - - -def main(): - warnings = 0 - args = sys.argv[1:] - if args: - for arg in args: - if os.path.isdir(arg): - for dirpath, dirnames, filenames in os.walk(arg): - for filename in filenames: - if filename.endswith('.py'): - warnings += checkPath(os.path.join(dirpath, filename)) - else: - warnings += checkPath(arg) - else: - warnings += check(sys.stdin.read(), '') - - raise SystemExit(warnings > 0) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/__init__.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py deleted file mode 100644 index 7cd22772..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/harness.py +++ /dev/null @@ -1,27 +0,0 @@ - -import textwrap -import _ast - -from twisted.trial import unittest - -from pyflakes import checker - - -class Test(unittest.TestCase): - - def flakes(self, input, *expectedOutputs, **kw): - ast = compile(textwrap.dedent(input), "", "exec", - _ast.PyCF_ONLY_AST) - w = checker.Checker(ast, **kw) - outputs = [type(o) for o in w.messages] - expectedOutputs = list(expectedOutputs) - outputs.sort() - expectedOutputs.sort() - self.assert_(outputs == expectedOutputs, '''\ -for input: -%s -expected outputs: -%s -but got: -%s''' % (input, repr(expectedOutputs), '\n'.join([str(o) for o in w.messages]))) - return w diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py deleted file mode 100644 index 08e4580a..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_imports.py +++ /dev/null @@ -1,673 +0,0 @@ - -from sys import version_info - -from pyflakes import messages as m -from pyflakes.test import harness - -class Test(harness.Test): - - def test_unusedImport(self): - self.flakes('import fu, bar', m.UnusedImport, m.UnusedImport) - self.flakes('from baz import fu, bar', m.UnusedImport, m.UnusedImport) - - def test_aliasedImport(self): - self.flakes('import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) - self.flakes('from moo import fu as FU, bar as FU', m.RedefinedWhileUnused, m.UnusedImport) - - def test_usedImport(self): - self.flakes('import fu; print fu') - self.flakes('from baz import fu; print fu') - - def test_redefinedWhileUnused(self): - self.flakes('import fu; fu = 3', m.RedefinedWhileUnused) - self.flakes('import fu; del fu', m.RedefinedWhileUnused) - self.flakes('import fu; fu, bar = 3', m.RedefinedWhileUnused) - self.flakes('import fu; [fu, bar] = 3', m.RedefinedWhileUnused) - - def test_redefinedByFunction(self): - self.flakes(''' - import fu - def fu(): - pass - ''', m.RedefinedWhileUnused) - - def test_redefinedInNestedFunction(self): - """ - Test that shadowing a global name with a nested function definition - generates a warning. - """ - self.flakes(''' - import fu - def bar(): - def baz(): - def fu(): - pass - ''', m.RedefinedWhileUnused, m.UnusedImport) - - def test_redefinedByClass(self): - self.flakes(''' - import fu - class fu: - pass - ''', m.RedefinedWhileUnused) - - - def test_redefinedBySubclass(self): - """ - If an imported name is redefined by a class statement which also uses - that name in the bases list, no warning is emitted. - """ - self.flakes(''' - from fu import bar - class bar(bar): - pass - ''') - - - def test_redefinedInClass(self): - """ - Test that shadowing a global with a class attribute does not produce a - warning. - """ - self.flakes(''' - import fu - class bar: - fu = 1 - print fu - ''') - - def test_usedInFunction(self): - self.flakes(''' - import fu - def fun(): - print fu - ''') - - def test_shadowedByParameter(self): - self.flakes(''' - import fu - def fun(fu): - print fu - ''', m.UnusedImport) - - self.flakes(''' - import fu - def fun(fu): - print fu - print fu - ''') - - def test_newAssignment(self): - self.flakes('fu = None') - - def test_usedInGetattr(self): - self.flakes('import fu; fu.bar.baz') - self.flakes('import fu; "bar".fu.baz', m.UnusedImport) - - def test_usedInSlice(self): - self.flakes('import fu; print fu.bar[1:]') - - def test_usedInIfBody(self): - self.flakes(''' - import fu - if True: print fu - ''') - - def test_usedInIfConditional(self): - self.flakes(''' - import fu - if fu: pass - ''') - - def test_usedInElifConditional(self): - self.flakes(''' - import fu - if False: pass - elif fu: pass - ''') - - def test_usedInElse(self): - self.flakes(''' - import fu - if False: pass - else: print fu - ''') - - def test_usedInCall(self): - self.flakes('import fu; fu.bar()') - - def test_usedInClass(self): - self.flakes(''' - import fu - class bar: - bar = fu - ''') - - def test_usedInClassBase(self): - self.flakes(''' - import fu - class bar(object, fu.baz): - pass - ''') - - def test_notUsedInNestedScope(self): - self.flakes(''' - import fu - def bleh(): - pass - print fu - ''') - - def test_usedInFor(self): - self.flakes(''' - import fu - for bar in range(9): - print fu - ''') - - def test_usedInForElse(self): - self.flakes(''' - import fu - for bar in range(10): - pass - else: - print fu - ''') - - def test_redefinedByFor(self): - self.flakes(''' - import fu - for fu in range(2): - pass - ''', m.RedefinedWhileUnused) - - def test_shadowedByFor(self): - """ - Test that shadowing a global name with a for loop variable generates a - warning. - """ - self.flakes(''' - import fu - fu.bar() - for fu in (): - pass - ''', m.ImportShadowedByLoopVar) - - def test_shadowedByForDeep(self): - """ - Test that shadowing a global name with a for loop variable nested in a - tuple unpack generates a warning. - """ - self.flakes(''' - import fu - fu.bar() - for (x, y, z, (a, b, c, (fu,))) in (): - pass - ''', m.ImportShadowedByLoopVar) - - def test_usedInReturn(self): - self.flakes(''' - import fu - def fun(): - return fu - ''') - - def test_usedInOperators(self): - self.flakes('import fu; 3 + fu.bar') - self.flakes('import fu; 3 % fu.bar') - self.flakes('import fu; 3 - fu.bar') - self.flakes('import fu; 3 * fu.bar') - self.flakes('import fu; 3 ** fu.bar') - self.flakes('import fu; 3 / fu.bar') - self.flakes('import fu; 3 // fu.bar') - self.flakes('import fu; -fu.bar') - self.flakes('import fu; ~fu.bar') - self.flakes('import fu; 1 == fu.bar') - self.flakes('import fu; 1 | fu.bar') - self.flakes('import fu; 1 & fu.bar') - self.flakes('import fu; 1 ^ fu.bar') - self.flakes('import fu; 1 >> fu.bar') - self.flakes('import fu; 1 << fu.bar') - - def test_usedInAssert(self): - self.flakes('import fu; assert fu.bar') - - def test_usedInSubscript(self): - self.flakes('import fu; fu.bar[1]') - - def test_usedInLogic(self): - self.flakes('import fu; fu and False') - self.flakes('import fu; fu or False') - self.flakes('import fu; not fu.bar') - - def test_usedInList(self): - self.flakes('import fu; [fu]') - - def test_usedInTuple(self): - self.flakes('import fu; (fu,)') - - def test_usedInTry(self): - self.flakes(''' - import fu - try: fu - except: pass - ''') - - def test_usedInExcept(self): - self.flakes(''' - import fu - try: fu - except: pass - ''') - - def test_redefinedByExcept(self): - self.flakes(''' - import fu - try: pass - except Exception, fu: pass - ''', m.RedefinedWhileUnused) - - def test_usedInRaise(self): - self.flakes(''' - import fu - raise fu.bar - ''') - - def test_usedInYield(self): - self.flakes(''' - import fu - def gen(): - yield fu - ''') - - def test_usedInDict(self): - self.flakes('import fu; {fu:None}') - self.flakes('import fu; {1:fu}') - - def test_usedInParameterDefault(self): - self.flakes(''' - import fu - def f(bar=fu): - pass - ''') - - def test_usedInAttributeAssign(self): - self.flakes('import fu; fu.bar = 1') - - def test_usedInKeywordArg(self): - self.flakes('import fu; fu.bar(stuff=fu)') - - def test_usedInAssignment(self): - self.flakes('import fu; bar=fu') - self.flakes('import fu; n=0; n+=fu') - - def test_usedInListComp(self): - self.flakes('import fu; [fu for _ in range(1)]') - self.flakes('import fu; [1 for _ in range(1) if fu]') - - def test_redefinedByListComp(self): - self.flakes('import fu; [1 for fu in range(1)]', m.RedefinedWhileUnused) - - - def test_usedInTryFinally(self): - self.flakes(''' - import fu - try: pass - finally: fu - ''') - - self.flakes(''' - import fu - try: fu - finally: pass - ''') - - def test_usedInWhile(self): - self.flakes(''' - import fu - while 0: - fu - ''') - - self.flakes(''' - import fu - while fu: pass - ''') - - def test_usedInGlobal(self): - self.flakes(''' - import fu - def f(): global fu - ''', m.UnusedImport) - - def test_usedInBackquote(self): - self.flakes('import fu; `fu`') - - def test_usedInExec(self): - self.flakes('import fu; exec "print 1" in fu.bar') - - def test_usedInLambda(self): - self.flakes('import fu; lambda: fu') - - def test_shadowedByLambda(self): - self.flakes('import fu; lambda fu: fu', m.UnusedImport) - - def test_usedInSliceObj(self): - self.flakes('import fu; "meow"[::fu]') - - def test_unusedInNestedScope(self): - self.flakes(''' - def bar(): - import fu - fu - ''', m.UnusedImport, m.UndefinedName) - - def test_methodsDontUseClassScope(self): - self.flakes(''' - class bar: - import fu - def fun(self): - fu - ''', m.UnusedImport, m.UndefinedName) - - def test_nestedFunctionsNestScope(self): - self.flakes(''' - def a(): - def b(): - fu - import fu - ''') - - def test_nestedClassAndFunctionScope(self): - self.flakes(''' - def a(): - import fu - class b: - def c(self): - print fu - ''') - - def test_importStar(self): - self.flakes('from fu import *', m.ImportStarUsed) - - - def test_packageImport(self): - """ - If a dotted name is imported and used, no warning is reported. - """ - self.flakes(''' - import fu.bar - fu.bar - ''') - - - def test_unusedPackageImport(self): - """ - If a dotted name is imported and not used, an unused import warning is - reported. - """ - self.flakes('import fu.bar', m.UnusedImport) - - - def test_duplicateSubmoduleImport(self): - """ - If a submodule of a package is imported twice, an unused import warning - and a redefined while unused warning are reported. - """ - self.flakes(''' - import fu.bar, fu.bar - fu.bar - ''', m.RedefinedWhileUnused) - self.flakes(''' - import fu.bar - import fu.bar - fu.bar - ''', m.RedefinedWhileUnused) - - - def test_differentSubmoduleImport(self): - """ - If two different submodules of a package are imported, no duplicate - import warning is reported for the package. - """ - self.flakes(''' - import fu.bar, fu.baz - fu.bar, fu.baz - ''') - self.flakes(''' - import fu.bar - import fu.baz - fu.bar, fu.baz - ''') - - def test_assignRHSFirst(self): - self.flakes('import fu; fu = fu') - self.flakes('import fu; fu, bar = fu') - self.flakes('import fu; [fu, bar] = fu') - self.flakes('import fu; fu += fu') - - def test_tryingMultipleImports(self): - self.flakes(''' - try: - import fu - except ImportError: - import bar as fu - ''') - test_tryingMultipleImports.todo = '' - - def test_nonGlobalDoesNotRedefine(self): - self.flakes(''' - import fu - def a(): - fu = 3 - return fu - fu - ''') - - def test_functionsRunLater(self): - self.flakes(''' - def a(): - fu - import fu - ''') - - def test_functionNamesAreBoundNow(self): - self.flakes(''' - import fu - def fu(): - fu - fu - ''', m.RedefinedWhileUnused) - - def test_ignoreNonImportRedefinitions(self): - self.flakes('a = 1; a = 2') - - def test_importingForImportError(self): - self.flakes(''' - try: - import fu - except ImportError: - pass - ''') - test_importingForImportError.todo = '' - - def test_importedInClass(self): - '''Imports in class scope can be used through self''' - self.flakes(''' - class c: - import i - def __init__(self): - self.i - ''') - test_importedInClass.todo = 'requires evaluating attribute access' - - def test_futureImport(self): - '''__future__ is special''' - self.flakes('from __future__ import division') - self.flakes(''' - "docstring is allowed before future import" - from __future__ import division - ''') - - def test_futureImportFirst(self): - """ - __future__ imports must come before anything else. - """ - self.flakes(''' - x = 5 - from __future__ import division - ''', m.LateFutureImport) - self.flakes(''' - from foo import bar - from __future__ import division - bar - ''', m.LateFutureImport) - - - -class TestSpecialAll(harness.Test): - """ - Tests for suppression of unused import warnings by C{__all__}. - """ - def test_ignoredInFunction(self): - """ - An C{__all__} definition does not suppress unused import warnings in a - function scope. - """ - self.flakes(''' - def foo(): - import bar - __all__ = ["bar"] - ''', m.UnusedImport, m.UnusedVariable) - - - def test_ignoredInClass(self): - """ - An C{__all__} definition does not suppress unused import warnings in a - class scope. - """ - self.flakes(''' - class foo: - import bar - __all__ = ["bar"] - ''', m.UnusedImport) - - - def test_warningSuppressed(self): - """ - If a name is imported and unused but is named in C{__all__}, no warning - is reported. - """ - self.flakes(''' - import foo - __all__ = ["foo"] - ''') - - - def test_unrecognizable(self): - """ - If C{__all__} is defined in a way that can't be recognized statically, - it is ignored. - """ - self.flakes(''' - import foo - __all__ = ["f" + "oo"] - ''', m.UnusedImport) - self.flakes(''' - import foo - __all__ = [] + ["foo"] - ''', m.UnusedImport) - - - def test_unboundExported(self): - """ - If C{__all__} includes a name which is not bound, a warning is emitted. - """ - self.flakes(''' - __all__ = ["foo"] - ''', m.UndefinedExport) - - # Skip this in __init__.py though, since the rules there are a little - # different. - for filename in ["foo/__init__.py", "__init__.py"]: - self.flakes(''' - __all__ = ["foo"] - ''', filename=filename) - - - def test_usedInGenExp(self): - """ - Using a global in a generator expression results in no warnings. - """ - self.flakes('import fu; (fu for _ in range(1))') - self.flakes('import fu; (1 for _ in range(1) if fu)') - - - def test_redefinedByGenExp(self): - """ - Re-using a global name as the loop variable for a generator - expression results in a redefinition warning. - """ - self.flakes('import fu; (1 for fu in range(1))', m.RedefinedWhileUnused) - - - def test_usedAsDecorator(self): - """ - Using a global name in a decorator statement results in no warnings, - but using an undefined name in a decorator statement results in an - undefined name warning. - """ - self.flakes(''' - from interior import decorate - @decorate - def f(): - return "hello" - ''') - - self.flakes(''' - from interior import decorate - @decorate('value') - def f(): - return "hello" - ''') - - self.flakes(''' - @decorate - def f(): - return "hello" - ''', m.UndefinedName) - - -class Python26Tests(harness.Test): - """ - Tests for checking of syntax which is valid in PYthon 2.6 and newer. - """ - if version_info < (2, 6): - skip = "Python 2.6 required for class decorator tests." - - - def test_usedAsClassDecorator(self): - """ - Using an imported name as a class decorator results in no warnings, - but using an undefined name as a class decorator results in an - undefined name warning. - """ - self.flakes(''' - from interior import decorate - @decorate - class foo: - pass - ''') - - self.flakes(''' - from interior import decorate - @decorate("foo") - class bar: - pass - ''') - - self.flakes(''' - @decorate - class foo: - pass - ''', m.UndefinedName) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py deleted file mode 100644 index 2b7723ce..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_other.py +++ /dev/null @@ -1,575 +0,0 @@ -# (c) 2005-2010 Divmod, Inc. -# See LICENSE file for details - -""" -Tests for various Pyflakes behavior. -""" - -from sys import version_info - -from pyflakes import messages as m -from pyflakes.test import harness - - -class Test(harness.Test): - - def test_duplicateArgs(self): - self.flakes('def fu(bar, bar): pass', m.DuplicateArgument) - - def test_localReferencedBeforeAssignment(self): - self.flakes(''' - a = 1 - def f(): - a; a=1 - f() - ''', m.UndefinedName) - test_localReferencedBeforeAssignment.todo = 'this requires finding all assignments in the function body first' - - def test_redefinedFunction(self): - """ - Test that shadowing a function definition with another one raises a - warning. - """ - self.flakes(''' - def a(): pass - def a(): pass - ''', m.RedefinedFunction) - - def test_redefinedClassFunction(self): - """ - Test that shadowing a function definition in a class suite with another - one raises a warning. - """ - self.flakes(''' - class A: - def a(): pass - def a(): pass - ''', m.RedefinedFunction) - - def test_functionDecorator(self): - """ - Test that shadowing a function definition with a decorated version of - that function does not raise a warning. - """ - self.flakes(''' - from somewhere import somedecorator - - def a(): pass - a = somedecorator(a) - ''') - - def test_classFunctionDecorator(self): - """ - Test that shadowing a function definition in a class suite with a - decorated version of that function does not raise a warning. - """ - self.flakes(''' - class A: - def a(): pass - a = classmethod(a) - ''') - - def test_unaryPlus(self): - '''Don't die on unary +''' - self.flakes('+1') - - - def test_undefinedBaseClass(self): - """ - If a name in the base list of a class definition is undefined, a - warning is emitted. - """ - self.flakes(''' - class foo(foo): - pass - ''', m.UndefinedName) - - - def test_classNameUndefinedInClassBody(self): - """ - If a class name is used in the body of that class's definition and - the name is not already defined, a warning is emitted. - """ - self.flakes(''' - class foo: - foo - ''', m.UndefinedName) - - - def test_classNameDefinedPreviously(self): - """ - If a class name is used in the body of that class's definition and - the name was previously defined in some other way, no warning is - emitted. - """ - self.flakes(''' - foo = None - class foo: - foo - ''') - - - def test_comparison(self): - """ - If a defined name is used on either side of any of the six comparison - operators, no warning is emitted. - """ - self.flakes(''' - x = 10 - y = 20 - x < y - x <= y - x == y - x != y - x >= y - x > y - ''') - - - def test_identity(self): - """ - If a deefined name is used on either side of an identity test, no - warning is emitted. - """ - self.flakes(''' - x = 10 - y = 20 - x is y - x is not y - ''') - - - def test_containment(self): - """ - If a defined name is used on either side of a containment test, no - warning is emitted. - """ - self.flakes(''' - x = 10 - y = 20 - x in y - x not in y - ''') - - - def test_loopControl(self): - """ - break and continue statements are supported. - """ - self.flakes(''' - for x in [1, 2]: - break - ''') - self.flakes(''' - for x in [1, 2]: - continue - ''') - - - def test_ellipsis(self): - """ - Ellipsis in a slice is supported. - """ - self.flakes(''' - [1, 2][...] - ''') - - - def test_extendedSlice(self): - """ - Extended slices are supported. - """ - self.flakes(''' - x = 3 - [1, 2][x,:] - ''') - - - -class TestUnusedAssignment(harness.Test): - """ - Tests for warning about unused assignments. - """ - - def test_unusedVariable(self): - """ - Warn when a variable in a function is assigned a value that's never - used. - """ - self.flakes(''' - def a(): - b = 1 - ''', m.UnusedVariable) - - - def test_assignToGlobal(self): - """ - Assigning to a global and then not using that global is perfectly - acceptable. Do not mistake it for an unused local variable. - """ - self.flakes(''' - b = 0 - def a(): - global b - b = 1 - ''') - - - def test_assignToMember(self): - """ - Assigning to a member of another object and then not using that member - variable is perfectly acceptable. Do not mistake it for an unused - local variable. - """ - # XXX: Adding this test didn't generate a failure. Maybe not - # necessary? - self.flakes(''' - class b: - pass - def a(): - b.foo = 1 - ''') - - - def test_assignInForLoop(self): - """ - Don't warn when a variable in a for loop is assigned to but not used. - """ - self.flakes(''' - def f(): - for i in range(10): - pass - ''') - - - def test_assignInListComprehension(self): - """ - Don't warn when a variable in a list comprehension is assigned to but - not used. - """ - self.flakes(''' - def f(): - [None for i in range(10)] - ''') - - - def test_generatorExpression(self): - """ - Don't warn when a variable in a generator expression is assigned to but not used. - """ - self.flakes(''' - def f(): - (None for i in range(10)) - ''') - - - def test_assignmentInsideLoop(self): - """ - Don't warn when a variable assignment occurs lexically after its use. - """ - self.flakes(''' - def f(): - x = None - for i in range(10): - if i > 2: - return x - x = i * 2 - ''') - - - def test_tupleUnpacking(self): - """ - Don't warn when a variable included in tuple unpacking is unused. It's - very common for variables in a tuple unpacking assignment to be unused - in good Python code, so warning will only create false positives. - """ - self.flakes(''' - def f(): - (x, y) = 1, 2 - ''') - - - def test_listUnpacking(self): - """ - Don't warn when a variable included in list unpacking is unused. - """ - self.flakes(''' - def f(): - [x, y] = [1, 2] - ''') - - - def test_closedOver(self): - """ - Don't warn when the assignment is used in an inner function. - """ - self.flakes(''' - def barMaker(): - foo = 5 - def bar(): - return foo - return bar - ''') - - - def test_doubleClosedOver(self): - """ - Don't warn when the assignment is used in an inner function, even if - that inner function itself is in an inner function. - """ - self.flakes(''' - def barMaker(): - foo = 5 - def bar(): - def baz(): - return foo - return bar - ''') - - - -class Python25Test(harness.Test): - """ - Tests for checking of syntax only available in Python 2.5 and newer. - """ - if version_info < (2, 5): - skip = "Python 2.5 required for if-else and with tests" - - def test_ifexp(self): - """ - Test C{foo if bar else baz} statements. - """ - self.flakes("a = 'moo' if True else 'oink'") - self.flakes("a = foo if True else 'oink'", m.UndefinedName) - self.flakes("a = 'moo' if True else bar", m.UndefinedName) - - - def test_withStatementNoNames(self): - """ - No warnings are emitted for using inside or after a nameless C{with} - statement a name defined beforehand. - """ - self.flakes(''' - from __future__ import with_statement - bar = None - with open("foo"): - bar - bar - ''') - - def test_withStatementSingleName(self): - """ - No warnings are emitted for using a name defined by a C{with} statement - within the suite or afterwards. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as bar: - bar - bar - ''') - - - def test_withStatementAttributeName(self): - """ - No warnings are emitted for using an attribute as the target of a - C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - import foo - with open('foo') as foo.bar: - pass - ''') - - - def test_withStatementSubscript(self): - """ - No warnings are emitted for using a subscript as the target of a - C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - import foo - with open('foo') as foo[0]: - pass - ''') - - - def test_withStatementSubscriptUndefined(self): - """ - An undefined name warning is emitted if the subscript used as the - target of a C{with} statement is not defined. - """ - self.flakes(''' - from __future__ import with_statement - import foo - with open('foo') as foo[bar]: - pass - ''', m.UndefinedName) - - - def test_withStatementTupleNames(self): - """ - No warnings are emitted for using any of the tuple of names defined by - a C{with} statement within the suite or afterwards. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as (bar, baz): - bar, baz - bar, baz - ''') - - - def test_withStatementListNames(self): - """ - No warnings are emitted for using any of the list of names defined by a - C{with} statement within the suite or afterwards. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as [bar, baz]: - bar, baz - bar, baz - ''') - - - def test_withStatementComplicatedTarget(self): - """ - If the target of a C{with} statement uses any or all of the valid forms - for that part of the grammar (See - U{http://docs.python.org/reference/compound_stmts.html#the-with-statement}), - the names involved are checked both for definedness and any bindings - created are respected in the suite of the statement and afterwards. - """ - self.flakes(''' - from __future__ import with_statement - c = d = e = g = h = i = None - with open('foo') as [(a, b), c[d], e.f, g[h:i]]: - a, b, c, d, e, g, h, i - a, b, c, d, e, g, h, i - ''') - - - def test_withStatementSingleNameUndefined(self): - """ - An undefined name warning is emitted if the name first defined by a - C{with} statement is used before the C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - bar - with open('foo') as bar: - pass - ''', m.UndefinedName) - - - def test_withStatementTupleNamesUndefined(self): - """ - An undefined name warning is emitted if a name first defined by a the - tuple-unpacking form of the C{with} statement is used before the - C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - baz - with open('foo') as (bar, baz): - pass - ''', m.UndefinedName) - - - def test_withStatementSingleNameRedefined(self): - """ - A redefined name warning is emitted if a name bound by an import is - rebound by the name defined by a C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - import bar - with open('foo') as bar: - pass - ''', m.RedefinedWhileUnused) - - - def test_withStatementTupleNamesRedefined(self): - """ - A redefined name warning is emitted if a name bound by an import is - rebound by one of the names defined by the tuple-unpacking form of a - C{with} statement. - """ - self.flakes(''' - from __future__ import with_statement - import bar - with open('foo') as (bar, baz): - pass - ''', m.RedefinedWhileUnused) - - - def test_withStatementUndefinedInside(self): - """ - An undefined name warning is emitted if a name is used inside the - body of a C{with} statement without first being bound. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as bar: - baz - ''', m.UndefinedName) - - - def test_withStatementNameDefinedInBody(self): - """ - A name defined in the body of a C{with} statement can be used after - the body ends without warning. - """ - self.flakes(''' - from __future__ import with_statement - with open('foo') as bar: - baz = 10 - baz - ''') - - - def test_withStatementUndefinedInExpression(self): - """ - An undefined name warning is emitted if a name in the I{test} - expression of a C{with} statement is undefined. - """ - self.flakes(''' - from __future__ import with_statement - with bar as baz: - pass - ''', m.UndefinedName) - - self.flakes(''' - from __future__ import with_statement - with bar as bar: - pass - ''', m.UndefinedName) - - - -class Python27Test(harness.Test): - """ - Tests for checking of syntax only available in Python 2.7 and newer. - """ - if version_info < (2, 7): - skip = "Python 2.7 required for dict/set comprehension tests" - - def test_dictComprehension(self): - """ - Dict comprehensions are properly handled. - """ - self.flakes(''' - a = {1: x for x in range(10)} - ''') - - def test_setComprehensionAndLiteral(self): - """ - Set comprehensions are properly handled. - """ - self.flakes(''' - a = {1, 2, 3} - b = {x for x in range(10)} - ''') diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py deleted file mode 100644 index 233e59ed..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_script.py +++ /dev/null @@ -1,185 +0,0 @@ - -""" -Tests for L{pyflakes.scripts.pyflakes}. -""" - -import sys -from StringIO import StringIO - -from twisted.python.filepath import FilePath -from twisted.trial.unittest import TestCase - -from pyflakes.scripts.pyflakes import checkPath - -def withStderrTo(stderr, f): - """ - Call C{f} with C{sys.stderr} redirected to C{stderr}. - """ - (outer, sys.stderr) = (sys.stderr, stderr) - try: - return f() - finally: - sys.stderr = outer - - - -class CheckTests(TestCase): - """ - Tests for L{check} and L{checkPath} which check a file for flakes. - """ - def test_missingTrailingNewline(self): - """ - Source which doesn't end with a newline shouldn't cause any - exception to be raised nor an error indicator to be returned by - L{check}. - """ - fName = self.mktemp() - FilePath(fName).setContent("def foo():\n\tpass\n\t") - self.assertFalse(checkPath(fName)) - - - def test_checkPathNonExisting(self): - """ - L{checkPath} handles non-existing files. - """ - err = StringIO() - count = withStderrTo(err, lambda: checkPath('extremo')) - self.assertEquals(err.getvalue(), 'extremo: No such file or directory\n') - self.assertEquals(count, 1) - - - def test_multilineSyntaxError(self): - """ - Source which includes a syntax error which results in the raised - L{SyntaxError.text} containing multiple lines of source are reported - with only the last line of that source. - """ - source = """\ -def foo(): - ''' - -def bar(): - pass - -def baz(): - '''quux''' -""" - - # Sanity check - SyntaxError.text should be multiple lines, if it - # isn't, something this test was unprepared for has happened. - def evaluate(source): - exec source - exc = self.assertRaises(SyntaxError, evaluate, source) - self.assertTrue(exc.text.count('\n') > 1) - - sourcePath = FilePath(self.mktemp()) - sourcePath.setContent(source) - err = StringIO() - count = withStderrTo(err, lambda: checkPath(sourcePath.path)) - self.assertEqual(count, 1) - - self.assertEqual( - err.getvalue(), - """\ -%s:8: invalid syntax - '''quux''' - ^ -""" % (sourcePath.path,)) - - - def test_eofSyntaxError(self): - """ - The error reported for source files which end prematurely causing a - syntax error reflects the cause for the syntax error. - """ - source = "def foo(" - sourcePath = FilePath(self.mktemp()) - sourcePath.setContent(source) - err = StringIO() - count = withStderrTo(err, lambda: checkPath(sourcePath.path)) - self.assertEqual(count, 1) - self.assertEqual( - err.getvalue(), - """\ -%s:1: unexpected EOF while parsing -def foo( - ^ -""" % (sourcePath.path,)) - - - def test_nonDefaultFollowsDefaultSyntaxError(self): - """ - Source which has a non-default argument following a default argument - should include the line number of the syntax error. However these - exceptions do not include an offset. - """ - source = """\ -def foo(bar=baz, bax): - pass -""" - sourcePath = FilePath(self.mktemp()) - sourcePath.setContent(source) - err = StringIO() - count = withStderrTo(err, lambda: checkPath(sourcePath.path)) - self.assertEqual(count, 1) - self.assertEqual( - err.getvalue(), - """\ -%s:1: non-default argument follows default argument -def foo(bar=baz, bax): -""" % (sourcePath.path,)) - - - def test_nonKeywordAfterKeywordSyntaxError(self): - """ - Source which has a non-keyword argument after a keyword argument should - include the line number of the syntax error. However these exceptions - do not include an offset. - """ - source = """\ -foo(bar=baz, bax) -""" - sourcePath = FilePath(self.mktemp()) - sourcePath.setContent(source) - err = StringIO() - count = withStderrTo(err, lambda: checkPath(sourcePath.path)) - self.assertEqual(count, 1) - self.assertEqual( - err.getvalue(), - """\ -%s:1: non-keyword arg after keyword arg -foo(bar=baz, bax) -""" % (sourcePath.path,)) - - - def test_permissionDenied(self): - """ - If the a source file is not readable, this is reported on standard - error. - """ - sourcePath = FilePath(self.mktemp()) - sourcePath.setContent('') - sourcePath.chmod(0) - err = StringIO() - count = withStderrTo(err, lambda: checkPath(sourcePath.path)) - self.assertEquals(count, 1) - self.assertEquals( - err.getvalue(), "%s: Permission denied\n" % (sourcePath.path,)) - - - def test_misencodedFile(self): - """ - If a source file contains bytes which cannot be decoded, this is - reported on stderr. - """ - source = u"""\ -# coding: ascii -x = "\N{SNOWMAN}" -""".encode('utf-8') - sourcePath = FilePath(self.mktemp()) - sourcePath.setContent(source) - err = StringIO() - count = withStderrTo(err, lambda: checkPath(sourcePath.path)) - self.assertEquals(count, 1) - self.assertEquals( - err.getvalue(), "%s: problem decoding source\n" % (sourcePath.path,)) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py deleted file mode 100644 index 309f0b9f..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/pyflakes/test/test_undefined_names.py +++ /dev/null @@ -1,265 +0,0 @@ - -from _ast import PyCF_ONLY_AST - -from twisted.trial.unittest import TestCase - -from pyflakes import messages as m, checker -from pyflakes.test import harness - - -class Test(harness.Test): - def test_undefined(self): - self.flakes('bar', m.UndefinedName) - - def test_definedInListComp(self): - self.flakes('[a for a in range(10) if a]') - - - def test_functionsNeedGlobalScope(self): - self.flakes(''' - class a: - def b(): - fu - fu = 1 - ''') - - def test_builtins(self): - self.flakes('range(10)') - - - def test_magicGlobalsFile(self): - """ - Use of the C{__file__} magic global should not emit an undefined name - warning. - """ - self.flakes('__file__') - - - def test_magicGlobalsBuiltins(self): - """ - Use of the C{__builtins__} magic global should not emit an undefined - name warning. - """ - self.flakes('__builtins__') - - - def test_magicGlobalsName(self): - """ - Use of the C{__name__} magic global should not emit an undefined name - warning. - """ - self.flakes('__name__') - - - def test_magicGlobalsPath(self): - """ - Use of the C{__path__} magic global should not emit an undefined name - warning, if you refer to it from a file called __init__.py. - """ - self.flakes('__path__', m.UndefinedName) - self.flakes('__path__', filename='package/__init__.py') - - - def test_globalImportStar(self): - '''Can't find undefined names with import *''' - self.flakes('from fu import *; bar', m.ImportStarUsed) - - def test_localImportStar(self): - '''A local import * still allows undefined names to be found in upper scopes''' - self.flakes(''' - def a(): - from fu import * - bar - ''', m.ImportStarUsed, m.UndefinedName) - - def test_unpackedParameter(self): - '''Unpacked function parameters create bindings''' - self.flakes(''' - def a((bar, baz)): - bar; baz - ''') - - def test_definedByGlobal(self): - '''"global" can make an otherwise undefined name in another function defined''' - self.flakes(''' - def a(): global fu; fu = 1 - def b(): fu - ''') - test_definedByGlobal.todo = '' - - def test_globalInGlobalScope(self): - """ - A global statement in the global scope is ignored. - """ - self.flakes(''' - global x - def foo(): - print x - ''', m.UndefinedName) - - def test_del(self): - '''del deletes bindings''' - self.flakes('a = 1; del a; a', m.UndefinedName) - - def test_delGlobal(self): - '''del a global binding from a function''' - self.flakes(''' - a = 1 - def f(): - global a - del a - a - ''') - - def test_delUndefined(self): - '''del an undefined name''' - self.flakes('del a', m.UndefinedName) - - def test_globalFromNestedScope(self): - '''global names are available from nested scopes''' - self.flakes(''' - a = 1 - def b(): - def c(): - a - ''') - - def test_laterRedefinedGlobalFromNestedScope(self): - """ - Test that referencing a local name that shadows a global, before it is - defined, generates a warning. - """ - self.flakes(''' - a = 1 - def fun(): - a - a = 2 - return a - ''', m.UndefinedLocal) - - def test_laterRedefinedGlobalFromNestedScope2(self): - """ - Test that referencing a local name in a nested scope that shadows a - global declared in an enclosing scope, before it is defined, generates - a warning. - """ - self.flakes(''' - a = 1 - def fun(): - global a - def fun2(): - a - a = 2 - return a - ''', m.UndefinedLocal) - - - def test_intermediateClassScopeIgnored(self): - """ - If a name defined in an enclosing scope is shadowed by a local variable - and the name is used locally before it is bound, an unbound local - warning is emitted, even if there is a class scope between the enclosing - scope and the local scope. - """ - self.flakes(''' - def f(): - x = 1 - class g: - def h(self): - a = x - x = None - print x, a - print x - ''', m.UndefinedLocal) - - - def test_doubleNestingReportsClosestName(self): - """ - Test that referencing a local name in a nested scope that shadows a - variable declared in two different outer scopes before it is defined - in the innermost scope generates an UnboundLocal warning which - refers to the nearest shadowed name. - """ - exc = self.flakes(''' - def a(): - x = 1 - def b(): - x = 2 # line 5 - def c(): - x - x = 3 - return x - return x - return x - ''', m.UndefinedLocal).messages[0] - self.assertEqual(exc.message_args, ('x', 5)) - - - def test_laterRedefinedGlobalFromNestedScope3(self): - """ - Test that referencing a local name in a nested scope that shadows a - global, before it is defined, generates a warning. - """ - self.flakes(''' - def fun(): - a = 1 - def fun2(): - a - a = 1 - return a - return a - ''', m.UndefinedLocal) - - def test_nestedClass(self): - '''nested classes can access enclosing scope''' - self.flakes(''' - def f(foo): - class C: - bar = foo - def f(self): - return foo - return C() - - f(123).f() - ''') - - def test_badNestedClass(self): - '''free variables in nested classes must bind at class creation''' - self.flakes(''' - def f(): - class C: - bar = foo - foo = 456 - return foo - f() - ''', m.UndefinedName) - - def test_definedAsStarArgs(self): - '''star and double-star arg names are defined''' - self.flakes(''' - def f(a, *b, **c): - print a, b, c - ''') - - def test_definedInGenExp(self): - """ - Using the loop variable of a generator expression results in no - warnings. - """ - self.flakes('(a for a in xrange(10) if a)') - - - -class NameTests(TestCase): - """ - Tests for some extra cases of name handling. - """ - def test_impossibleContext(self): - """ - A Name node with an unrecognized context results in a RuntimeError being - raised. - """ - tree = compile("x = 10", "", "exec", PyCF_ONLY_AST) - # Make it into something unrecognizable. - tree.body[0].targets[0].ctx = object() - self.assertRaises(RuntimeError, checker.Checker, tree) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py b/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py deleted file mode 100644 index 85073371..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/pyflakes/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/python -# (c) 2005-2009 Divmod, Inc. See LICENSE file for details - -from distutils.core import setup - -setup( - name="pyflakes", - license="MIT", - version="0.4.0", - description="passive checker of Python programs", - author="Phil Frost", - maintainer="Moe Aboulkheir", - maintainer_email="moe@divmod.com", - url="http://www.divmod.org/trac/wiki/DivmodPyflakes", - packages=["pyflakes", "pyflakes.scripts", "pyflakes.test"], - scripts=["bin/pyflakes"], - long_description="""Pyflakes is program to analyze Python programs and detect various errors. It -works by parsing the source file, not importing it, so it is safe to use on -modules with side effects. It's also much faster.""", - classifiers=[ - "Development Status :: 6 - Mature", - "Environment :: Console", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python", - "Topic :: Software Development", - "Topic :: Utilities", - ]) diff --git a/sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff b/sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff deleted file mode 100644 index ce2471f0..00000000 --- a/sources_non_forked/pyflakes-pathogen/ftplugin/python/quickfix.diff +++ /dev/null @@ -1,124 +0,0 @@ -diff --git a/README.rst b/README.rst -index 5f8467f..acff657 100644 ---- a/README.rst -+++ b/README.rst -@@ -8,11 +8,13 @@ accessing a local before it is bound, and also gives warnings for things like - unused imports. - - pyflakes-vim uses the output from PyFlakes to highlight errors in your code. -+To locate errors quickly, use quickfix_ commands: - - Make sure to check vim.org_ for the latest updates. - - .. _pyflakes.vim: http://www.vim.org/scripts/script.php?script_id=2441 - .. _vim.org: http://www.vim.org/scripts/script.php?script_id=2441 -+.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix - - Quick Installation - ------------------ -@@ -57,12 +59,10 @@ Hacking - TODO - ---- - * signs_ support (show warning and error icons to left of the buffer area) -- * quickfix_ support (allow jumping forward and back through the error list) - * configuration variables - * parse or intercept useful output from the warnings module - - .. _signs: http://www.vim.org/htmldoc/sign.html --.. _quickfix: http://vimdoc.sourceforge.net/htmldoc/quickfix.html - - Changelog - --------- -diff --git a/pyflakes.vim b/pyflakes.vim -index 8aa508b..d6699bc 100644 ---- a/pyflakes.vim -+++ b/pyflakes.vim -@@ -159,6 +159,42 @@ if !exists("*s:WideMsg") - endfun - endif - -+if !exists("*s:GetQuickFixStackCount") -+ function s:GetQuickFixStackCount() -+ let l:stack_count = 0 -+ try -+ silent colder 9 -+ catch /E380:/ -+ endtry -+ -+ try -+ for i in range(9) -+ silent cnewer -+ let l:stack_count = l:stack_count + 1 -+ endfor -+ catch /E381:/ -+ return l:stack_count -+ endtry -+ endfunction -+endif -+ -+if !exists("*s:ActivatePyflakesQuickFixWindow") -+ function s:ActivatePyflakesQuickFixWindow() -+ try -+ silent colder 9 " go to the bottom of quickfix stack -+ catch /E380:/ -+ endtry -+ -+ if s:pyflakes_qf > 0 -+ try -+ exe "silent cnewer " . s:pyflakes_qf -+ catch /E381:/ -+ echoerr "Could not activate Pyflakes Quickfix Window." -+ endtry -+ endif -+ endfunction -+endif -+ - if !exists("*s:RunPyflakes") - function s:RunPyflakes() - highlight link PyFlakes SpellBad -@@ -174,12 +210,23 @@ if !exists("*s:RunPyflakes") - - let b:matched = [] - let b:matchedlines = {} -+ -+ let b:qf_list = [] -+ let b:qf_window_count = -1 -+ - python << EOF - for w in check(vim.current.buffer): - vim.command('let s:matchDict = {}') - vim.command("let s:matchDict['lineNum'] = " + str(w.lineno)) - vim.command("let s:matchDict['message'] = '%s'" % vim_quote(w.message % w.message_args)) - vim.command("let b:matchedlines[" + str(w.lineno) + "] = s:matchDict") -+ -+ vim.command("let l:qf_item = {}") -+ vim.command("let l:qf_item.bufnr = bufnr('%')") -+ vim.command("let l:qf_item.filename = expand('%')") -+ vim.command("let l:qf_item.lnum = %s" % str(w.lineno)) -+ vim.command("let l:qf_item.text = '%s'" % vim_quote(w.message % w.message_args)) -+ vim.command("let l:qf_item.type = 'E'") - - if w.col is None or isinstance(w, SyntaxError): - # without column information, just highlight the whole line -@@ -189,8 +236,21 @@ for w in check(vim.current.buffer): - # with a column number, highlight the first keyword there - vim.command(r"let s:mID = matchadd('PyFlakes', '^\%" + str(w.lineno) + r"l\_.\{-}\zs\k\+\k\@!\%>" + str(w.col) + r"c')") - -+ vim.command("let l:qf_item.vcol = 1") -+ vim.command("let l:qf_item.col = %s" % str(w.col + 1)) -+ - vim.command("call add(b:matched, s:matchDict)") -+ vim.command("call add(b:qf_list, l:qf_item)") - EOF -+ if exists("s:pyflakes_qf") -+ " if pyflakes quickfix window is already created, reuse it -+ call s:ActivatePyflakesQuickFixWindow() -+ call setqflist(b:qf_list, 'r') -+ else -+ " one pyflakes quickfix window for all buffer -+ call setqflist(b:qf_list, '') -+ let s:pyflakes_qf = s:GetQuickFixStackCount() -+ endif - let b:cleared = 0 - endfunction - end diff --git a/sources_non_forked/syntastic/.gitignore b/sources_non_forked/syntastic/.gitignore new file mode 100644 index 00000000..cc07c931 --- /dev/null +++ b/sources_non_forked/syntastic/.gitignore @@ -0,0 +1,4 @@ +*~ +*.swp +tags +.DS_Store diff --git a/sources_non_forked/syntastic/CONTRIBUTING.md b/sources_non_forked/syntastic/CONTRIBUTING.md new file mode 100644 index 00000000..764ffffc --- /dev/null +++ b/sources_non_forked/syntastic/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Bug reports / Github issues + +When reporting a bug make sure you search the existing github issues for the +same/similar issues. If you find one, feel free to add a `+1` comment with any +additional information that may help us solve the issue. + +When creating a new issue be sure to state the following: + +* Steps to reproduce the bug. +* The version of vim you are using. +* The version of syntastic you are using. + +For syntax checker bugs also state the version of the checker executable that you are using. + +# Submitting a patch + +* Fork the repo on github +* Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking +* Submit a pull request based off your topic branch + +Small focused patches are preferred. + +Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say. + +# General style notes + +Following the coding conventions/styles used in the syntastic core: + +* Use 4 space indents. +* Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!). +* Don't use `l:` prefixes for variables unless actually required (i.e. almost never). +* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability. + +# Syntax checker style notes + +The preferred style for error format strings is one "clause" per line. E.g. +(from the coffeelint checker): + +```viml +let errorformat = '%E%f:%l:%c: %trror: %m,' . + \ '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,' . + \ '%W%f(%l): warning: %m,' . + \ '%E%f(%l): SyntaxError: %m,' . + \ '%-Z%p^,' . + \ '%-G%.%#' +``` diff --git a/sources_non_forked/syntastic/LICENCE b/sources_non_forked/syntastic/LICENCE new file mode 100644 index 00000000..8b1a9d81 --- /dev/null +++ b/sources_non_forked/syntastic/LICENCE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + +Copyright (C) 2004 Sam Hocevar + +Everyone is permitted to copy and distribute verbatim or modified +copies of this license document, and changing it is allowed as long +as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown new file mode 100644 index 00000000..04effa59 --- /dev/null +++ b/sources_non_forked/syntastic/README.markdown @@ -0,0 +1,247 @@ + , + / \,,_ .'| + ,{{| /}}}}/_.' _____________________________________________ + }}}}` '{{' '. / \ + {{{{{ _ ;, \ / Ladies and Gentlemen, \ + ,}}}}}} /o`\ ` ;) | | + {{{{{{ / ( | this is ... | + }}}}}} | \ | | + {{{{{{{{ \ \ | | + }}}}}}}}} '.__ _ | | _____ __ __ _ | + {{{{{{{{ /`._ (_\ / | / ___/__ ______ / /_____ ______/ /_(_)____ | + }}}}}}' | //___/ --=: \__ \/ / / / __ \/ __/ __ `/ ___/ __/ / ___/ | + jgs `{{{{` | '--' | ___/ / /_/ / / / / /_/ /_/ (__ ) /_/ / /__ | + }}}` | /____/\__, /_/ /_/\__/\__,_/____/\__/_/\___/ | + | /____/ | + | / + \_____________________________________________/ + + +- - - +1\. [Introduction](#introduction) +2\. [Installation](#installation) +3\. [FAQ](#faq) +4\. [Other resources](#otherresources) +- - - + + + +## 1\. Introduction + +Syntastic is a syntax checking plugin for Vim 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 ActionScript, +Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bourne shell, C, C++, C#, Chef, +CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir, +Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, +Handlebars, HSS, HTML, Java, JavaScript, JSON, LESS, Lex, Limbo, LISP, +LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++, +OCaml, Perl, Perl POD, PHP, gettext Portable Object, Puppet, Python, Racket, +reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, +TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope +page templates, zsh. + +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][0] + +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. + + + +## 2\. Installation + +Installing syntastic is easy but first you need to have the pathogen plugin installed. If you already +have pathogen working then skip Step 1 and go to Step 2. + + + +### 2.1\. Step 1: Install pathogen.vim + +First I'll show you how to install tpope's [pathogen.vim][1] so that it's +easy to install syntastic. Do this in your Terminal so that you get the +pathogen.vim file and the directories it needs: + + mkdir -p ~/.vim/autoload ~/.vim/bundle; \ + curl -so ~/.vim/autoload/pathogen.vim \ + https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim + +Next you *need to add this* to your ~/.vimrc: + + execute pathogen#infect() + + + +### 2.2\. Step 2: Install syntastic as a pathogen bundle + +You now have pathogen installed and can put syntastic into ~/.vim/bundle like this: + + + cd ~/.vim/bundle + git clone https://github.com/scrooloose/syntastic.git + +Quit vim and start it back up to reload it, then type: + + :Helptags + +If you get an error when you do this, then you probably didn't install pathogen right. Go back to +step 1 and make sure you did the following: + +1. Created both the ~/.vim/autoload and ~/.vim/bundle directories. +2. Added the "call pathogen#infect()" line to your ~/.vimrc file +3. Did the git clone of syntastic inside ~/.vim/bundle +4. Have permissions to access all of these directories. + + + + +## 3\. FAQ + +__Q. I installed syntastic but it isn't reporting any errors...__ + +A. The most likely reason is that none of the syntax checkers that it requires +is installed. For example: python requires either `flake8`, `pyflakes` +or `pylint` to be installed and in `$PATH`. To see which executables are +supported, just look in `syntax_checkers//*.vim`. Note that aliases +do not work; the actual executable must be available in your `$PATH`. Symbolic +links are okay. You can see syntastic's idea of available checkers by running +`:SyntasticInfo`. + +Another reason it could fail is that either the command line options or the +error output for a 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. + +__Q. Recently some of my syntax checker options have stopped working...__ + +A. The options are still there, they have just been renamed. Recently, +almost all syntax checkers were refactored to use the new `makeprgBuild()` +function. This made a lot of the old explicit options redundant - as they are +now implied. The new implied options usually have slightly different names to +the old options. + +e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use +`g:syntastic_php_phpcs_args`. This completely overrides the arguments of +the checker, including any defaults, so you may need to look up the default +arguments of the checker and add these in. + +See `:help syntastic-checker-options` for more information. + +__Q. I run a checker and the location list is not updated...__ + +A. By default, the location list is changed only when you run the `:Errors` +command, in order to minimise conflicts with other plugins. If you want the +location list to always be updated when you run the checkers, add this line to +your vimrc: +```vim +let g:syntastic_always_populate_loc_list=1 +``` + +__Q. How can I pass additional arguments to a checker?__ + +A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers +that do can be configured using global variables. The general form of the +global args variables are: +```vim +syntastic___args +``` + +So, If you wanted to pass "--my --args --here" to the ruby mri checker you +would add this line to your vimrc: +```vim +let g:syntastic_ruby_mri_args="--my --args --here" +``` + +See `:help syntastic-checker-options` for more information. + +__Q. Syntastic supports several checkers for my filetype - how do I tell it +which one(s) to use?__ + +A. Stick a line like this in your vimrc: +```vim +let g:syntastic__checkers=[''] +``` + +To see the list of checkers for your filetype, look in +`syntax_checkers//`. + +e.g. Python has the following checkers: `flake8`, `pyflakes`, `pylint` and a +native `python` checker. + +To tell syntastic to use `pylint`, you would use this setting: +```vim +let g:syntastic_python_checkers=['pylint'] +``` + +Some filetypes, like PHP, have style checkers as well as syntax checkers. These +can be chained together like this: +```vim +let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd'] +``` + +This is telling syntastic to run the `php` checker first, and if no errors are +found, run `phpcs`, and then `phpmd`. + +__Q. How can I jump between the different errors without using the location +list at the bottom of the window?__ + +A. Vim provides several built in commands for this. See `:help :lnext` and +`:help :lprev`. + +If you use these commands a lot then you may want to add shortcut mappings to +your vimrc, or install something like [unimpaired][2], which provides such +mappings (among other things). + +__Q. A syntax checker is giving me unwanted/strange style tips?__ + +A. Some filetypes (e.g. php) have style checkers as well as syntax +checkers. You can usually configure the options that are passed to the style +checkers, or just disable them. Take a look at the [wiki][3] to see what +options are available. + +__Q. The error window is closed automatically when I :quit the current buffer +but not when I :bdelete it?__ + +A. There is no safe way to handle that situation automatically, but you can +work around it: + +```vim +nnoremap :lclose:bdelete +cabbrev bd lclose\|bdelete +``` + + + + +## 4\. Other resources + +The preferred place for posting suggestions, reporting bugs, and general +discussions related to syntastic is the [issue tracker at GitHub][4]. There +are also a [google group][5], and a [syntastic tag at StackOverflow][6]. + +Syntastic aims to provide a common interface to syntax checkers for as many +languages as possible. For particular languages, there are, of course, other +plugins that provide more functionality than syntastic. You might want to take +a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. + +[0]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png +[1]: https://github.com/tpope/vim-pathogen +[2]: https://github.com/tpope/vim-unimpaired +[3]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers +[4]: https://github.com/scrooloose/syntastic/issues +[5]: https://groups.google.com/group/vim-syntastic +[6]: http://stackoverflow.com/questions/tagged/syntastic +[7]: https://github.com/davidhalter/jedi-vim +[8]: https://github.com/klen/python-mode +[9]: https://github.com/Valloric/YouCompleteMe diff --git a/sources_non_forked/syntastic/_assets/screenshot_1.png b/sources_non_forked/syntastic/_assets/screenshot_1.png new file mode 100644 index 0000000000000000000000000000000000000000..c1b69f4ba26a2092aa4e9d42d2fa3ee08c6ab28a GIT binary patch literal 92425 zcmcF~byQSc6fcT^l&GYnN_T@ah?Gb>fOL1m5E6r+(jcI8cXxLq9Rmz7bPe4M4e#pr zeeb=s-dpSa^%iSjxHIRTbN1cw`|Y!Lkg}o-E*2>k3JMCYoa{SQ6ckij6qE;3kI{iE zYX*iO;LihRRhhRaCBx)fz(43l@-pvG?*IIxHRnbHS1=u9KRKhIVB`OJJwQoFA^|R9 zxX39;VZd?7@G;q=YL>Q9P+p?Qy_5LpKD#^b=7oQD-*yDk9dFit&)8Vxhcn~J7--Wy zG*bNdbzmL8--@)#JG2)}C8fc>54lWAD*}G&na1wV=g95*K&mk15_7aA7Dsxi@htX_ z>l;VrX;aU=V;*jzP*PH!?#@ID?bo5Qv$Nx%qrQFo>g!YB*PW<(Az^f1*NE8t;MLg< zXW|fpFC`IC&re1*i^&4Qv9Ym>i;Fad;I+6v-v)-%IbNMw*4WLzKUipHX8q0;{~<}p zEu2~={BX{B#PI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andler('\m\" + echohl ErrorMsg + echomsg "syntastic: error: " . a:msg + echohl None +endfunction + +function! syntastic#log#deprecationWarn(msg) + if index(s:deprecation_notices_issued, a:msg) >= 0 + return + endif + + call add(s:deprecation_notices_issued, a:msg) + call syntastic#log#warn(a:msg) +endfunction + +function! syntastic#log#debug(level, msg, ...) + if !s:isDebugEnabled(a:level) + return + endif + + let leader = s:logTimestamp() + call s:logRedirect(1) + + if a:0 > 0 + " filter out dictionary functions + echomsg leader . a:msg . ' ' . + \ strtrans(string(type(a:1) == type({}) || type(a:1) == type([]) ? + \ filter(copy(a:1), 'type(v:val) != type(function("tr"))') : a:1)) + else + echomsg leader . a:msg + endif + + call s:logRedirect(0) +endfunction + +function! syntastic#log#debugShowOptions(level, names) + if !s:isDebugEnabled(a:level) + return + endif + + let leader = s:logTimestamp() + call s:logRedirect(1) + + let vlist = type(a:names) == type("") ? [a:names] : a:names + if !empty(vlist) + call map(vlist, "'&' . v:val . ' = ' . strtrans(string(eval('&' . v:val)))") + echomsg leader . join(vlist, ', ') + endif + call s:logRedirect(0) +endfunction + +function! syntastic#log#debugShowVariables(level, names) + if !s:isDebugEnabled(a:level) + return + endif + + let leader = s:logTimestamp() + call s:logRedirect(1) + + let vlist = type(a:names) == type("") ? [a:names] : a:names + for name in vlist + echomsg leader . s:formatVariable(name) + endfor + + call s:logRedirect(0) +endfunction + +function! syntastic#log#debugDump(level) + if !s:isDebugEnabled(a:level) + return + endif + + call syntastic#log#debugShowVariables(a:level, s:global_options) +endfunction + +" Private functions {{{1 + +function! s:isDebugEnabled_smart(level) + return and(g:syntastic_debug, a:level) +endfunction + +function! s:isDebugEnabled_dumb(level) + " poor man's bit test for bit N, assuming a:level == 2**N + return (g:syntastic_debug / a:level) % 2 +endfunction + +let s:isDebugEnabled = function(exists('*and') ? 's:isDebugEnabled_smart' : 's:isDebugEnabled_dumb') + +function! s:logRedirect(on) + if exists("g:syntastic_debug_file") + if a:on + try + execute 'redir >> ' . fnameescape(expand(g:syntastic_debug_file)) + catch /^Vim\%((\a\+)\)\=:/ + silent! redir END + unlet g:syntastic_debug_file + endtry + else + silent! redir END + endif + endif +endfunction + +function! s:logTimestamp_smart() + return 'syntastic: ' . split(reltimestr(reltime(g:syntastic_start)))[0] . ': ' +endfunction + +function! s:logTimestamp_dumb() + return 'syntastic: debug: ' +endfunction + +let s:logTimestamp = function(has('reltime') ? 's:logTimestamp_smart' : 's:logTimestamp_dumb') + +function! s:formatVariable(name) + let vals = [] + if exists('g:' . a:name) + call add(vals, 'g:' . a:name . ' = ' . strtrans(string(g:{a:name}))) + endif + if exists('b:' . a:name) + call add(vals, 'b:' . a:name . ' = ' . strtrans(string(b:{a:name}))) + endif + + return join(vals, ', ') +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo +" vim: set et sts=4 sw=4 fdm=marker: diff --git a/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim new file mode 100644 index 00000000..877bb507 --- /dev/null +++ b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim @@ -0,0 +1,67 @@ +if exists("g:loaded_syntastic_postprocess_autoload") + finish +endif +let g:loaded_syntastic_postprocess_autoload = 1 + +let s:save_cpo = &cpo +set cpo&vim + +function! s:compareErrorItems(a, b) + if a:a['bufnr'] != a:b['bufnr'] + " group by files + return a:a['bufnr'] - a:b['bufnr'] + elseif a:a['lnum'] != a:b['lnum'] + return a:a['lnum'] - a:b['lnum'] + elseif a:a['type'] !=? a:b['type'] + " errors take precedence over warnings + return a:a['type'] ==? 'e' ? -1 : 1 + else + return get(a:a, 'col', 0) - get(a:b, 'col', 0) + endif +endfunction + +" natural sort +function! syntastic#postprocess#sort(errors) + return sort(copy(a:errors), 's:compareErrorItems') +endfunction + +" merge consecutive blanks +function! syntastic#postprocess#compressWhitespace(errors) + for e in a:errors + let e['text'] = substitute(e['text'], "\001", '', 'g') + let e['text'] = substitute(e['text'], '\n', ' ', 'g') + let e['text'] = substitute(e['text'], '\m\s\{2,}', ' ', 'g') + endfor + + return a:errors +endfunction + +" remove spurious CR under Cygwin +function! syntastic#postprocess#cygwinRemoveCR(errors) + if has('win32unix') + for e in a:errors + let e['text'] = substitute(e['text'], '\r', '', 'g') + endfor + endif + + return a:errors +endfunction + +" decode XML entities +function! syntastic#postprocess#decodeXMLEntities(errors) + for e in a:errors + let e['text'] = syntastic#util#decodeXMLEntities(e['text']) + endfor + + return a:errors +endfunction + +" filter out errors referencing other files +function! syntastic#postprocess#filterForeignErrors(errors) + return filter(copy(a:errors), 'get(v:val, "bufnr") == ' . bufnr('')) +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sts=4 sw=4: diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim new file mode 100644 index 00000000..c4daf5c5 --- /dev/null +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -0,0 +1,244 @@ +if exists('g:loaded_syntastic_util_autoload') + finish +endif +let g:loaded_syntastic_util_autoload = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen() +" and hope for the best :) +let s:width = function(exists('*strwidth') ? 'strwidth' : 'strlen') + +" Public functions {{{1 + +function! syntastic#util#isRunningWindows() + return has('win16') || has('win32') || has('win64') +endfunction + +function! syntastic#util#DevNull() + if syntastic#util#isRunningWindows() + return 'NUL' + endif + return '/dev/null' +endfunction + +" Get directory separator +function! syntastic#util#Slash() abort + return (!exists("+shellslash") || &shellslash) ? '/' : '\' +endfunction + +"search the first 5 lines of the file for a magic number and return a map +"containing the args and the executable +" +"e.g. +" +"#!/usr/bin/perl -f -bar +" +"returns +" +"{'exe': '/usr/bin/perl', 'args': ['-f', '-bar']} +function! syntastic#util#parseShebang() + for lnum in range(1,5) + let line = getline(lnum) + + if line =~ '^#!' + let exe = matchstr(line, '\m^#!\s*\zs[^ \t]*') + let args = split(matchstr(line, '\m^#!\s*[^ \t]*\zs.*')) + return { 'exe': exe, 'args': args } + endif + endfor + + return { 'exe': '', 'args': [] } +endfunction + +" Parse a version string. Return an array of version components. +function! syntastic#util#parseVersion(version) + return split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.') +endfunction + +" Run 'command' in a shell and parse output as a version string. +" Returns an array of version components. +function! syntastic#util#getVersion(command) + return syntastic#util#parseVersion(system(a:command)) +endfunction + +" Verify that the 'installed' version is at least the 'required' version. +" +" 'installed' and 'required' must be arrays. If they have different lengths, +" the "missing" elements will be assumed to be 0 for the purposes of checking. +" +" See http://semver.org for info about version numbers. +function! syntastic#util#versionIsAtLeast(installed, required) + for idx in range(max([len(a:installed), len(a:required)])) + let installed_element = get(a:installed, idx, 0) + let required_element = get(a:required, idx, 0) + if installed_element != required_element + return installed_element > required_element + endif + endfor + " Everything matched, so it is at least the required version. + return 1 +endfunction + +"print as much of a:msg as possible without "Press Enter" prompt appearing +function! syntastic#util#wideMsg(msg) + let old_ruler = &ruler + let old_showcmd = &showcmd + + "This is here because it is possible for some error messages to + "begin with \n which will cause a "press enter" prompt. + let msg = substitute(a:msg, "\n", "", "g") + + "convert tabs to spaces so that the tabs count towards the window + "width as the proper amount of characters + let chunks = split(msg, "\t", 1) + let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - s:width(v:val) % &ts)'), '') . chunks[-1] + let msg = strpart(msg, 0, winwidth(0) - 1) + + set noruler noshowcmd + call syntastic#util#redraw(0) + + echo msg + + let &ruler = old_ruler + let &showcmd = old_showcmd +endfunction + +" Check whether a buffer is loaded, listed, and not hidden +function! syntastic#util#bufIsActive(buffer) + " convert to number, or hell breaks loose + let buf = str2nr(a:buffer) + + if !bufloaded(buf) || !buflisted(buf) + return 0 + endif + + " get rid of hidden buffers + for tab in range(1, tabpagenr('$')) + if index(tabpagebuflist(tab), buf) >= 0 + return 1 + endif + endfor + + return 0 +endfunction + +" start in directory a:where and walk up the parent folders until it +" finds a file matching a:what; return path to that file +function! syntastic#util#findInParent(what, where) + let here = fnamemodify(a:where, ':p') + + let root = syntastic#util#Slash() + if syntastic#util#isRunningWindows() && here[1] == ':' + " The drive letter is an ever-green source of fun. That's because + " we don't care about running syntastic on Amiga these days. ;) + let root = fnamemodify(root, ':p') + let root = here[0] . root[1:] + endif + + let old = '' + while here != '' + let p = split(globpath(here, a:what), '\n') + + if !empty(p) + return fnamemodify(p[0], ':p') + elseif here ==? root || here ==? old + break + endif + + let old = here + + " we use ':h:h' rather than ':h' since ':p' adds a trailing '/' + " if 'here' is a directory + let here = fnamemodify(here, ':p:h:h') + endwhile + + return '' +endfunction + +" Returns unique elements in a list +function! syntastic#util#unique(list) + let seen = {} + let uniques = [] + for e in a:list + if !has_key(seen, e) + let seen[e] = 1 + call add(uniques, e) + endif + endfor + return uniques +endfunction + +" A less noisy shellescape() +function! syntastic#util#shescape(string) + return a:string =~ '\m^[A-Za-z0-9_/.-]\+$' ? a:string : shellescape(a:string) +endfunction + +" A less noisy shellescape(expand()) +function! syntastic#util#shexpand(string) + return syntastic#util#shescape(expand(a:string)) +endfunction + +" decode XML entities +function! syntastic#util#decodeXMLEntities(string) + let str = a:string + let str = substitute(str, '\m<', '<', 'g') + let str = substitute(str, '\m>', '>', 'g') + let str = substitute(str, '\m"', '"', 'g') + let str = substitute(str, '\m'', "'", 'g') + let str = substitute(str, '\m&', '\&', 'g') + return str +endfunction + +function! syntastic#util#redraw(full) + if a:full + redraw! + else + redraw + endif +endfunction + +function! syntastic#util#dictFilter(errors, filter) + let rules = s:translateFilter(a:filter) + " call syntastic#log#debug(g:SyntasticDebugFilters, "applying filter:", rules) + try + call filter(a:errors, rules) + catch /\m^Vim\%((\a\+)\)\=:E/ + let msg = matchstr(v:exception, '\m^Vim\%((\a\+)\)\=:\zs.*') + call syntastic#log#error('quiet_messages: ' . msg) + endtry +endfunction + +" Private functions {{{1 + +function! s:translateFilter(filters) + let conditions = [] + for [k, v] in items(a:filters) + if type(v) == type([]) + call extend(conditions, map(copy(v), 's:translateElement(k, v:val)')) + else + call add(conditions, s:translateElement(k, v)) + endif + endfor + return len(conditions) == 1 ? conditions[0] : join(map(conditions, '"(" . v:val . ")"'), ' && ') +endfunction + +function! s:translateElement(key, term) + if a:key ==? 'level' + let ret = 'v:val["type"] !=? ' . string(a:term[0]) + elseif a:key ==? 'type' + let ret = a:term ==? 'style' ? 'get(v:val, "subtype", "") !=? "style"' : 'has_key(v:val, "subtype")' + elseif a:key ==? 'regex' + let ret = 'v:val["text"] !~? ' . string(a:term) + elseif a:key ==? 'file' + let ret = 'bufname(str2nr(v:val["bufnr"])) !~# ' . string(a:term) + else + let ret = "1" + endif + return ret +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo +" vim: set et sts=4 sw=4 fdm=marker: diff --git a/sources_non_forked/syntastic/doc/syntastic.txt b/sources_non_forked/syntastic/doc/syntastic.txt new file mode 100644 index 00000000..ac806605 --- /dev/null +++ b/sources_non_forked/syntastic/doc/syntastic.txt @@ -0,0 +1,656 @@ +*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| + 1.1.Quick start............................|syntastic-quickstart| + 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| + 2.4.Error highlighting.....................|syntastic-highlighting| + 2.5.Aggregating errors.....................|syntastic-aggregating-errors| + 2.6.Filtering errors.......................|syntastic-filtering-errors| + 3.Commands.....................................|syntastic-commands| + 4.Global Options...............................|syntastic-global-options| + 5.Checker Options..............................|syntastic-checker-options| + 5.1.Choosing which checkers to use.........|syntastic-filetype-checkers| + 5.2.Choosing the executable................|syntastic-config-exec| + 5.3.Configuring specific checkers..........|syntastic-config-makeprg| + 6.Notes........................................|syntastic-notes| + 6.1.Handling of composite filetypes........|syntastic-composite| + 6.2.Interaction with python-mode...........|syntastic-pymode| + 6.3.Interaction with the fish shell........|syntastic-fish| + 6.4.Using syntastic with the fizsh shell...|syntastic-fizsh| + 7.About........................................|syntastic-about| + 8.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. 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. + +Take a look at the wiki for a list of supported filetypes and checkers: + + https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers + +Note: This doc only deals with using syntastic. To learn how to write syntax +checker integrations, see the guide on the github wiki: + + https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide + +------------------------------------------------------------------------------ +1.1. Quick start *syntastic-quickstart* + +Syntastic comes preconfigured with a default list of enabled checkers per +filetype. This list is kept reasonably short to prevent slowing down Vim or +trying to use conflicting checkers. + +You can see the list checkers available for the current filetype with the +|:SyntasticInfo| command. + +If you want to override the configured list of checkers for a filetype then +see |syntastic-checker-options| for details. You can also change the arguments +passed to a specific checker as well. + +Use |:SyntasticCheck| to manually check right now. Use |:SyntasticToggleMode| +to switch between active (checking on writting the buffer) and passive (manual) +checking. + +============================================================================== +2. Functionality provided *syntastic-functionality* + +Syntax checking can be done automatically or on demand (see +|'syntastic_mode_map'| and |:SyntasticToggleMode| 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 statusline flag + * Signs beside lines with errors + * The |location-list| can be populated with the errors for the associated + buffer + * Erroneous parts of lines can be highlighted (this functionality is only + provided by some syntax checkers) + * Balloons (if the |+balloon_eval| feature is compiled in) can be used to + display error messages for erroneous lines when hovering the mouse over + them + * Error messages from multiple checkers can be aggregated in a single list + +------------------------------------------------------------------------------ +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. + +Signs are colored using the Error and Todo syntax highlight groups by default. +If you wish to customize the colors for the signs, you can use the following +groups: + SyntasticErrorSign - For syntax errors, links to 'error' by default + SyntasticWarningSign - For syntax warnings, links to 'todo' by default + SyntasticStyleErrorSign - For style errors, links to 'SyntasticErrorSign' + by default + SyntasticStyleWarningSign - For style warnings, links to + 'SyntasticWarningSign' by default + +Example: > + highlight SyntasticErrorSign guifg=white guibg=red +< +To set up highlighting for the line where a sign resides, you can use the +following highlight groups: + SyntasticErrorLine + SyntasticWarningLine + SyntasticStyleErrorLine - Links to 'SyntasticErrorLine' by default + SyntasticStyleWarningLine - Links to 'SyntasticWarningLine' by default + +Example: > + highlight SyntasticErrorLine guibg=#2f0000 +< +------------------------------------------------------------------------------ +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. + +------------------------------------------------------------------------------ +2.4. Error highlighting *syntastic-highlighting* + +Some checkers provide enough information for syntastic to be able to highlight +errors. By default the SpellBad syntax highlight group is used to color errors, +and the SpellCap group is used for warnings. If you wish to customize the +colors for highlighting you can use the following groups: + SyntasticError - Links to 'SpellBad' by default + SyntasticWarning - Links to 'SpellCap' by default + +Example: > + highlight SyntasticError guibg=#2f0000 +< +------------------------------------------------------------------------------ +2.5. Aggregating errors *syntastic-aggregating-errors* + +By default, namely if |'syntastic_aggregate_errors'| is unset, syntastic runs +in turn the checkers corresponding to the filetype of the current file (see +|syntastic-filetype-checkers|), and stops as soon as a checker reports any +errors. It then notifies you of the errors using the notification mechanisms +above. In this mode error lists are always produced by a single checker, and, +if you open the error window, the name of the checker that generated the errors +is shown on the statusline of the error window. + +If |'syntastic_aggregate_errors'| is set, syntastic runs all checkers that +apply (still cf. |syntastic-filetype-checkers|), then aggregates errors found +by all checkers in a single list, and notifies you. In this mode each error +message is labeled with the name of the checker that generated it, but you can +disable these labels by unsetting '|syntastic_id_checkers|'. + +------------------------------------------------------------------------------ +2.6 Filtering errors *syntastic-filtering-errors* + +You can selectively disable some of the errors found by checkers either +using |'syntastic_quiet_messages'|, or by specifying a list of patterns in +|'syntastic_ignore_files'|. + +See also: |'syntastic___quiet_messages'|. + +============================================================================== +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. By default the checkers in the +|'g:syntastic__checkers'| or |'b:syntastic_checkers'| lists are run, +cf. |syntastic-filetype-checkers|. If |syntastic_aggregate_errors| is unset +(which is the default), checking stops the first time a checker reports any +errors; if |syntastic_aggregate_errors| is set, all checkers that apply are run +in turn, and all errors found are aggregated in a single list. + +The command may be followed by a (space separated) list of checkers. In this +case |'g:syntastic__checkers'| and |'b:syntastic_checkers'| are +ignored, and the checkers named by the command's arguments are run instead, in +the order specified. The rules of |syntastic_aggregate_errors| still apply. + +Example: > + :SyntasticCheck flake8 pylint +< +:SyntasticInfo *:SyntasticInfo* + +The command takes an optional argument, and outputs information about the +checkers available for the filetype named by said argument, or for the current +filetype if no argument was provided. + +:SyntasticReset *:SyntasticReset* + +Resets the list of errors and turns off all error notifiers. + +:SyntasticSetLoclist *:SyntasticSetLoclist* + +If |'syntastic_always_populate_loc_list'| is not set, the |location-list| is +not filled in automatically with the list of errors detected by the checkers. +This is useful if you run syntastic along with other plugins that use location +lists. The |:SyntasticSetLoclist| command allows you to stick the errors into +the location list explicitly. + +============================================================================== +4. Global Options *syntastic-global-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_check_on_wq'* +Default: 1 +Normally syntastic runs syntax checks whenever buffers are written to disk. +If you want to skip these checks when you issue |:wq|, |:x|, and |:ZZ|, set this +variable to 0. > + let g:syntastic_check_on_wq = 0 +< + *'syntastic_aggregate_errors'* +Default: 0 +When enabled, syntastic runs all checkers that apply to the current filetype, +then aggregates errors found by all checkers and displays them. When disabled, +syntastic runs each checker in turn, and stops to display the results the first +time a checker finds any errors. > + let g:syntastic_aggregate_errors = 1 +< + *'syntastic_id_checkers'* +Default: 1 +When results from multiple checkers are aggregated in a single error list +(that is either when |syntastic_aggregate_errors| is enabled, or when checking +a file with a composite filetype), it might not be immediately obvious which +checker has produced a given error message. This variable instructs syntastic +to label error messages with the names of the checkers that created them. > + let g:syntastic_id_checkers = 0 +< + *'syntastic_echo_current_error'* +Default: 1 +If enabled, syntastic will echo the error 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_error_symbol'* *'syntastic_style_error_symbol'* + *'syntastic_warning_symbol'* *'syntastic_style_warning_symbol'* +Use this option to control what the syntastic |:sign| text contains. Several +error symbols can be customized: + syntastic_error_symbol - For syntax errors, defaults to '>>' + syntastic_style_error_symbol - For style errors, defaults to 'S>' + syntastic_warning_symbol - For syntax warnings, defaults to '>>' + syntastic_style_warning_symbol - For style warnings, defaults to 'S>' + +Example: > + let g:syntastic_error_symbol = '✗' + let g:syntastic_warning_symbol = '⚠' +< + *'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_always_populate_loc_list'* +Default: 0 +Enable this option to tell syntastic to always stick any detected errors into +the |location-list|: > + let g:syntastic_always_populate_loc_list = 1 +< + *'syntastic_auto_jump'* +Default: 0 +Enable this option if you want the cursor to jump to the first detected issue +when saving or opening a file. + +When set to 0 the cursor won't jump automatically. > + let g:syntastic_auto_jump = 0 +< +When set to 1 the cursor will always jump to the first issue detected. > + let g:syntastic_auto_jump = 1 +< +When set to 2 the cursor will jump to the first issue detected, but only if +this issue is an error. > + let g:syntastic_auto_jump = 2 +< + *'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_ignore_files'* +Default: [] +Use this option to specify files that syntastic should never check. It's a +list of |regular-expression| patterns. The full paths of files (see |::p|) are +matched against these patterns, and the matches are case sensitive. Use |\c| +to specify case insensitive patterns. Example: > + let g:syntastic_ignore_files = ['\m^/usr/include/', '\m\c\.h$'] +< + *'syntastic_filetype_map'* +Default: {} +Use this option to map non-standard filetypes to standard ones. Corresponding +checkers are mapped accordingly, which allows syntastic to check files with +non-standard filetypes: > + let g:syntastic_filetype_map = { 'latex': 'tex', + \ 'gentoo-metadata': 'xml' } +< +Composite filetypes can also be mapped to simple types, which disables the +default behaviour of running both checkers against the input file: > + let g:syntastic_filetype_map = { 'handlebars.html': 'handlebars' } +< + *'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_messages'* +Default: {} + +Use this option to filter out some of the messages produced by checkers. The +option should be set to something like: > + + let g:syntastic_quiet_messages = { "level": "warnings", + \ "type": "style", + \ "regex": '\m\[C03\d\d\]', + \ "file": ['\m^/usr/include/', '\m\c\.h$'] } +< + +Each element turns off messages matching the patterns specified by the +corresponding value. Values are lists, but if a list consist of a single +element you can omit adding the brackets (e.g. you can write "style" instead of +["style"]). + + "level" - takes one of two values, "warnings" or "errors" + "type" - can be either "syntax" or "style" + "regex" - is matched against the messages' text as a case insensitive + |regular-expression| + "file" - is matched against the filename the error refers to, as a case + sensitive |regular-expression|. + +There are also checker-specific variants of this option, providing finer +control. They are named |'syntastic___quiet_messages'|. + + *'syntastic_stl_format'* +Default: [Syntax: line:%F (%t)] +Use this option to control what the syntastic statusline text contains. Several +magic flags are available 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 can't 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] +< + *'syntastic_full_redraws'* +Default: 0 in GUI Vim and MacVim, 1 otherwise +Controls whether syntastic calls |:redraw| or |:redraw!| for screen redraws. +Changing it can in principle make screen redraws smoother, but it can also +cause screen to flicker, or cause ghost characters. Leaving it to the default +should be safe. + + *'syntastic_debug'* +Default: 0 +Set this to the sum of one or more of the following flags to enable +debugging: + + 1 - trace checker calls + 2 - dump location lists + 4 - trace notifiers + 8 - trace autocommands + 16 - dump options + +Example: > + let g:syntastic_debug = 1 +< +Syntastic will then add debugging messages to Vim's |message-history|. You can +examine these messages with |:mes|. + + *'syntastic_debug_file'* +Default: unset +When set, debugging messages are written to the file named by its value, in +addition to being added to Vim's |message-history|: > + let g:syntastic_debug_file = '~/syntastic.log' +< + +============================================================================== +5. Checker Options *syntastic-checker-options* + +------------------------------------------------------------------------------ +5.1 Choosing which checkers to use *syntastic-filetype-checkers* + + *'g:syntastic__checkers'* +You can tell syntastic which checkers to run for a given filetype by setting a +variable 'g:syntastic__checkers' to a list of checkers, e.g. > + let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd'] +< + *'b:syntastic_checkers'* +There is also a per-buffer version of this setting, 'b:syntastic_checkers'. +When set, it takes precedence over |'g:syntastic__checkers'|. You can +use this in an autocmd to configure specific checkers for particular paths: > + autocmd FileType python if stridx(expand('%:p'), '/some/path/') == 0 | + \ let b:syntastic_checkers = ['pylint'] | endif +< +If neither |'g:syntastic__checkers'| nor |'b:syntastic_checkers'| +is set, a default list of checker is used. Beware however that this list +deliberately kept minimal, for performance reasons. + +Take a look at the wiki to find out what checkers and filetypes are supported +by syntastic: + + https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers + +Use |:SyntasticInfo| to see which checkers are available for a given filetype. + +------------------------------------------------------------------------------ +5.2 Choosing the executable *syntastic-config-exec* + + *'syntastic___exec'* +The executable used by a checker is normally defined automatically, when the +checkers is registered. You can however override it by setting the variable +'g:syntastic___exec': > + let g:syntastic_ruby_mri_exec = '~/bin/ruby2' +< +------------------------------------------------------------------------------ +5.3 Configuring specific checkers *syntastic-config-makeprg* + +Most checkers use the 'makeprgBuild()' function and provide many options by +default - in fact you can customise every part of the command that gets called. + + *'syntastic___ ### 2.1\. Step 1: Install pathogen.vim -First I'll show you how to install tpope's [pathogen.vim][1] so that it's -easy to install syntastic. Do this in your Terminal so that you get the -pathogen.vim file and the directories it needs: - - mkdir -p ~/.vim/autoload ~/.vim/bundle; \ - curl -so ~/.vim/autoload/pathogen.vim \ - https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim - -Next you *need to add this* to your ~/.vimrc: - - execute pathogen#infect() +First I'll show you how to install Tim Pope's [pathogen][1] so that it's easy to +install syntastic. Do this in your terminal so that you get the `pathogen.vim` +file and the directories it needs: +```sh +mkdir -p ~/.vim/autoload ~/.vim/bundle; \ +curl -so ~/.vim/autoload/pathogen.vim \ + https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim +``` +Next you *need* to add this to your `~/.vimrc`: +```vim +execute pathogen#infect() +``` ### 2.2\. Step 2: Install syntastic as a pathogen bundle -You now have pathogen installed and can put syntastic into ~/.vim/bundle like this: - - - cd ~/.vim/bundle - git clone https://github.com/scrooloose/syntastic.git - +You now have pathogen installed and can put syntastic into `~/.vim/bundle` like +this: +```sh +cd ~/.vim/bundle +git clone https://github.com/scrooloose/syntastic.git +``` Quit vim and start it back up to reload it, then type: +```vim +:Helptags +``` +If you get an error when you do this, then you probably didn't install +[pathogen][1] right. Go back to [Step 1](#step1) and make sure you did the following: - :Helptags - -If you get an error when you do this, then you probably didn't install pathogen right. Go back to -step 1 and make sure you did the following: - -1. Created both the ~/.vim/autoload and ~/.vim/bundle directories. -2. Added the "call pathogen#infect()" line to your ~/.vimrc file -3. Did the git clone of syntastic inside ~/.vim/bundle +1. Created both the `~/.vim/autoload` and `~/.vim/bundle` directories. +2. Added the `call pathogen#infect()` line to your `~/.vimrc` file +3. Did the `git clone` of syntastic inside `~/.vim/bundle` 4. Have permissions to access all of these directories. @@ -111,56 +114,50 @@ step 1 and make sure you did the following: __Q. I installed syntastic but it isn't reporting any errors...__ A. The most likely reason is that none of the syntax checkers that it requires -is installed. For example: python requires either `flake8`, `pyflakes` -or `pylint` to be installed and in `$PATH`. To see which executables are -supported, just look in `syntax_checkers//*.vim`. Note that aliases -do not work; the actual executable must be available in your `$PATH`. Symbolic -links are okay. You can see syntastic's idea of available checkers by running -`:SyntasticInfo`. +is installed. For example: by default, python requires either `flake8` or +`pylint` to be installed and in your `$PATH`. To see which executables are +supported, look at the [wiki][3]. Note that aliases do not work; the actual +executables must be available in your `$PATH`. Symbolic links are okay though. +You can see syntastic's idea of available checkers by running `:SyntasticInfo`. Another reason it could fail is that either the command line options or the error output for a 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. -__Q. Recently some of my syntax checker options have stopped working...__ +__Q. The `perl` checker has stopped working...__ -A. The options are still there, they have just been renamed. Recently, -almost all syntax checkers were refactored to use the new `makeprgBuild()` -function. This made a lot of the old explicit options redundant - as they are -now implied. The new implied options usually have slightly different names to -the old options. - -e.g. Previously there was `g:syntastic_phpcs_conf`, now you must use -`g:syntastic_php_phpcs_args`. This completely overrides the arguments of -the checker, including any defaults, so you may need to look up the default -arguments of the checker and add these in. - -See `:help syntastic-checker-options` for more information. +A. The `perl` checker runs `perl -c` against your file, which in turn +__executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use` +statements in your file (cf. [perlrun][10]). This is probably fine if you +wrote the file yourself, but it's a security problem if you're checking third +party files. Since there is currently no way to disable this behaviour while +still producing useful results, the checker is now disabled by default. To +(re-)enable it, set `g:syntastic_enable_perl_checker` to 1 in your vimrc: +```vim +let g:syntastic_enable_perl_checker = 1 +``` __Q. I run a checker and the location list is not updated...__ -A. By default, the location list is changed only when you run the `:Errors` +A. By default the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the location list to always be updated when you run the checkers, add this line to your vimrc: ```vim -let g:syntastic_always_populate_loc_list=1 +let g:syntastic_always_populate_loc_list = 1 ``` __Q. How can I pass additional arguments to a checker?__ A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers that do can be configured using global variables. The general form of the -global args variables are: -```vim -syntastic___args -``` +global `args` variables is `syntastic___args`. So, If you wanted to pass "--my --args --here" to the ruby mri checker you would add this line to your vimrc: ```vim -let g:syntastic_ruby_mri_args="--my --args --here" +let g:syntastic_ruby_mri_args = "--my --args --here" ``` See `:help syntastic-checker-options` for more information. @@ -170,24 +167,24 @@ which one(s) to use?__ A. Stick a line like this in your vimrc: ```vim -let g:syntastic__checkers=[''] +let g:syntastic__checkers = [''] ``` -To see the list of checkers for your filetype, look in -`syntax_checkers//`. +To see the list of supported checkers for your filetype look at the +[wiki][3]. -e.g. Python has the following checkers: `flake8`, `pyflakes`, `pylint` and a -native `python` checker. +e.g. Python has the following checkers, among others: `flake8`, `pyflakes`, +`pylint` and a native `python` checker. To tell syntastic to use `pylint`, you would use this setting: ```vim -let g:syntastic_python_checkers=['pylint'] +let g:syntastic_python_checkers = ['pylint'] ``` Some filetypes, like PHP, have style checkers as well as syntax checkers. These can be chained together like this: ```vim -let g:syntastic_php_checkers=['php', 'phpcs', 'phpmd'] +let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd'] ``` This is telling syntastic to run the `php` checker first, and if no errors are @@ -210,6 +207,13 @@ checkers. You can usually configure the options that are passed to the style checkers, or just disable them. Take a look at the [wiki][3] to see what options are available. +Alternatively, you can use `g:syntastic_quiet_messages` to filter out the +messages you don't want to see. e.g. To turn off all style messages: +```vim +let g:syntastic_quiet_messages = { "type": "style" } +``` +See `:help syntastic_quiet_messages` for details. + __Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ @@ -245,3 +249,4 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. [7]: https://github.com/davidhalter/jedi-vim [8]: https://github.com/klen/python-mode [9]: https://github.com/Valloric/YouCompleteMe +[10]: http://perldoc.perl.org/perlrun.html#*-c* diff --git a/sources_non_forked/syntastic/plugin/syntastic.vim b/sources_non_forked/syntastic/plugin/syntastic.vim index c59e42db..28f26381 100644 --- a/sources_non_forked/syntastic/plugin/syntastic.vim +++ b/sources_non_forked/syntastic/plugin/syntastic.vim @@ -1,7 +1,6 @@ "============================================================================ "File: syntastic.vim "Description: Vim plugin for on the fly syntax checking. -"Version: 3.4.0-pre "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 @@ -19,6 +18,8 @@ if has('reltime') let g:syntastic_start = reltime() endif +let g:syntastic_version = '3.4.0' + " Sanity checks {{{1 for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands'] @@ -286,6 +287,7 @@ function! s:CacheErrors(checker_names) " {{{2 if !s:skipFile() " debug logging {{{3 + call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'version') call syntastic#log#debugShowOptions(g:SyntasticDebugTrace, s:debug_dump_options) call syntastic#log#debugDump(g:SyntasticDebugVariables) call syntastic#log#debugShowVariables(g:SyntasticDebugTrace, 'aggregate_errors') @@ -303,17 +305,16 @@ function! s:CacheErrors(checker_names) " {{{2 let names = [] for checker in clist - let type = checker.getFiletype() - let name = checker.getName() - call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . type . '/' . name) + let cname = checker.getFiletype() . '/' . checker.getName() + call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname) let loclist = checker.getLocList() if !loclist.isEmpty() if decorate_errors - call loclist.decorate(type, name) + call loclist.decorate(cname) endif - call add(names, [type, name]) + call add(names, cname) let newLoclist = newLoclist.extend(loclist) @@ -325,13 +326,13 @@ function! s:CacheErrors(checker_names) " {{{2 " set names {{{3 if !empty(names) - if len(syntastic#util#unique(map( copy(names), 'v:val[0]' ))) == 1 - let type = names[0][0] - let name = join(map(names, 'v:val[1]'), ', ') + if len(syntastic#util#unique(map( copy(names), 'substitute(v:val, "\\m/.*", "", "")' ))) == 1 + let type = substitute(names[0], '\m/.*', '', '') + let name = join(map( names, 'substitute(v:val, "\\m.\\{-}/", "", "")' ), ', ') call newLoclist.setName( name . ' ('. type . ')' ) else " checkers from mixed types - call newLoclist.setName(join(map(names, 'v:val[0] . "/" . v:val[1]'), ', ')) + call newLoclist.setName(join(names, ', ')) endif endif " }}}3 @@ -416,13 +417,16 @@ function! SyntasticMake(options) " {{{2 call syntastic#log#debug(g:SyntasticDebugLoclist, 'checker output:', err_lines) - if has_key(a:options, 'preprocess') + if has_key(a:options, 'Preprocess') + let err_lines = call(a:options['Preprocess'], [err_lines]) + call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess (external):', err_lines) + elseif has_key(a:options, 'preprocess') let err_lines = call('syntastic#preprocess#' . a:options['preprocess'], [err_lines]) call syntastic#log#debug(g:SyntasticDebugLoclist, 'preprocess:', err_lines) endif lgetexpr err_lines - let errors = copy(getloclist(0)) + let errors = deepcopy(getloclist(0)) if has_key(a:options, 'cwd') execute 'lcd ' . fnameescape(old_cwd) @@ -456,7 +460,12 @@ function! SyntasticMake(options) " {{{2 call s:addToErrors(errors, { 'subtype': a:options['subtype'] }) endif - if has_key(a:options, 'postprocess') && !empty(a:options['postprocess']) + if has_key(a:options, 'Postprocess') && !empty(a:options['Postprocess']) + for rule in a:options['Postprocess'] + let errors = call(rule, [errors]) + endfor + call syntastic#log#debug(g:SyntasticDebugLoclist, 'postprocess (external):', errors) + elseif has_key(a:options, 'postprocess') && !empty(a:options['postprocess']) for rule in a:options['postprocess'] let errors = call('syntastic#postprocess#' . rule, [errors]) endfor diff --git a/sources_non_forked/syntastic/plugin/syntastic/loclist.vim b/sources_non_forked/syntastic/plugin/syntastic/loclist.vim index f95173b5..3d3a649e 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/loclist.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/loclist.vim @@ -114,9 +114,9 @@ function! g:SyntasticLoclist.setName(name) " {{{2 let self._name = a:name endfunction " }}}2 -function! g:SyntasticLoclist.decorate(filetype, name) " {{{2 +function! g:SyntasticLoclist.decorate(tag) " {{{2 for e in self._rawLoclist - let e['text'] .= ' [' . a:filetype . '/' . a:name . ']' + let e['text'] .= ' [' . a:tag . ']' endfor endfunction " }}}2 diff --git a/sources_non_forked/syntastic/plugin/syntastic/registry.vim b/sources_non_forked/syntastic/plugin/syntastic/registry.vim index d731fff2..09ca4c90 100644 --- a/sources_non_forked/syntastic/plugin/syntastic/registry.vim +++ b/sources_non_forked/syntastic/plugin/syntastic/registry.vim @@ -20,7 +20,7 @@ let s:defaultCheckers = { \ 'coq': ['coqtop'], \ 'cpp': ['gcc'], \ 'cs': ['mcs'], - \ 'css': ['csslint', 'phpcs'], + \ 'css': ['csslint'], \ 'cucumber': ['cucumber'], \ 'cuda': ['nvcc'], \ 'd': ['dmd'], @@ -54,7 +54,7 @@ let s:defaultCheckers = { \ 'objc': ['gcc'], \ 'objcpp': ['gcc'], \ 'ocaml': ['camlp4o'], - \ 'perl': ['perl', 'perlcritic'], + \ 'perl': ['perlcritic'], \ 'php': ['php', 'phpcs', 'phpmd'], \ 'po': ['msgfmt'], \ 'pod': ['podchecker'], @@ -142,14 +142,14 @@ function! g:SyntasticRegistry.getCheckers(ftalias, list) " {{{2 let ft = s:normaliseFiletype(a:ftalias) call self._checkDeprecation(ft) - let ft_list = + let names = \ !empty(a:list) ? a:list : \ exists('b:syntastic_checkers') ? b:syntastic_checkers : \ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers : - \ get(s:defaultCheckers, ft, []) + \ get(s:defaultCheckers, ft, 0) - return !empty(ft_list) ? - \ self._filterCheckersByName(checkers_map, ft_list) : [checkers_map[keys(checkers_map)[0]]] + return type(names) == type([]) ? + \ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]] endfunction " }}}2 function! g:SyntasticRegistry.getKnownFiletypes() " {{{2 diff --git a/sources_non_forked/syntastic/syntax_checkers/actionscript/mxmlc.vim b/sources_non_forked/syntastic/syntax_checkers/actionscript/mxmlc.vim index 8cfdc347..e423aa0d 100644 --- a/sources_non_forked/syntastic/syntax_checkers/actionscript/mxmlc.vim +++ b/sources_non_forked/syntastic/syntax_checkers/actionscript/mxmlc.vim @@ -41,7 +41,7 @@ function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item) endif - return term != '' ? '\V\<' . term . '\>' : '' + return term != '' ? '\V\<' . escape(term, '\') . '\>' : '' endfunction function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict diff --git a/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim b/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim index 536568fa..10d6af3d 100644 --- a/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim +++ b/sources_non_forked/syntastic/syntax_checkers/css/prettycss.vim @@ -26,7 +26,7 @@ set cpo&vim function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item) let term = matchstr(a:item["text"], '\m (\zs[^)]\+\ze)$') if term != '' - let term = '\V' . term + let term = '\V' . escape(term, '\') endif return term endfunction diff --git a/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl index 01622d9e..bd94870b 100644 --- a/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl +++ b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl @@ -2,10 +2,11 @@ -export([main/1]). main([FileName]) -> - LibDirs = filelib:wildcard("{lib,deps}/*/ebin"), + LibDirs = (["ebin", "include", "src", "test"] ++ + filelib:wildcard("{apps,deps,lib}/*/{ebin,include}")), compile(FileName, LibDirs); -main([FileName | ["-rebar" | [Path | LibDirs]]]) -> +main([FileName, "-rebar", Path, LibDirs]) -> {ok, L} = file:consult(Path), P = dict:from_list(L), Root = filename:dirname(Path), @@ -31,23 +32,20 @@ main([FileName | ["-rebar" | [Path | LibDirs]]]) -> %io:format("~p~n", [LibDirs1]), compile(FileName, LibDirs1); -main([FileName | LibDirs]) -> +main([FileName, LibDirs]) -> compile(FileName, LibDirs). compile(FileName, LibDirs) -> Root = get_root(filename:dirname(FileName)), ok = code:add_pathsa(LibDirs), - compile:file(FileName, [warn_obsolete_guard, - warn_unused_import, - warn_shadow_vars, - warn_export_vars, - strong_validation, - report, - {i, filename:join(Root, "include")}, - {i, filename:join(Root, "deps")}, - {i, filename:join(Root, "apps")}, - {i, filename:join(Root, "lib")} - ]). + compile:file(FileName, + [warn_obsolete_guard, + warn_unused_import, + warn_shadow_vars, + warn_export_vars, + strong_validation, + report] ++ + [{i, filename:join(Root, I)} || I <- LibDirs]). get_root(Dir) -> Path = filename:split(filename:absname(Dir)), diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim index c233cf34..89d3a802 100644 --- a/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/jslint.vim @@ -22,7 +22,7 @@ set cpo&vim function! SyntaxCheckers_javascript_jslint_GetHighlightRegex(item) let term = matchstr(a:item['text'], '\mExpected .* and instead saw ''\zs.*\ze''') if term != '' - let term = '\V' . term + let term = '\V' . escape(term, '\') endif return term endfunction diff --git a/sources_non_forked/syntastic/syntax_checkers/lex/flex.vim b/sources_non_forked/syntastic/syntax_checkers/lex/flex.vim index c6e48340..b8bc6483 100644 --- a/sources_non_forked/syntastic/syntax_checkers/lex/flex.vim +++ b/sources_non_forked/syntastic/syntax_checkers/lex/flex.vim @@ -26,7 +26,7 @@ function! SyntaxCheckers_lex_flex_GetHighlightRegex(item) \ '\m^\(Definition value for\|undefined definition\) \zs{[^}]\+}\ze') endif - return term != '' ? '\V' . term : '' + return term != '' ? '\V' . escape(term, '\') : '' endfunction function! SyntaxCheckers_lex_flex_GetLocList() dict diff --git a/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim b/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim index b34778de..012f1490 100644 --- a/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim +++ b/sources_non_forked/syntastic/syntax_checkers/lua/luac.vim @@ -28,7 +28,7 @@ function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) let a:pos['col'] = p[2] let result = '\%' . p[2] . 'c' else - let result = '\V' . near + let result = '\V' . escape(near, '\') endif " XXX the following piece of code is evil, and is likely to break @@ -38,7 +38,7 @@ function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) "if open != '' " let line = str2nr(matchstr(a:pos['text'], '\m(to close ''[^'']\+'' at line \zs[0-9]\+\ze)')) " let group = a:pos['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning' - " call matchadd(group, '\%' . line . 'l\V' . open) + " call matchadd(group, '\%' . line . 'l\V' . escape(open, '\')) "endif endif return result diff --git a/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim b/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim index f928ae98..2ac6ec98 100644 --- a/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim +++ b/sources_non_forked/syntastic/syntax_checkers/perl/perl.vim @@ -11,6 +11,22 @@ " "============================================================================ " +" Security: +" +" This checker runs 'perl -c' against your file, which in turn executes +" any BEGIN, UNITCHECK, and CHECK blocks, and any use statements in +" your file. This is probably fine if you wrote the file yourself, +" but it can be a problem if you're trying to check third party files. +" If you are 100% willing to let Vim run the code in your file, set +" g:syntastic_enable_perl_checker to 1 in your vimrc to enable this +" checker: +" +" let g:syntastic_enable_perl_checker = 1 +" +" References: +" +" - http://perldoc.perl.org/perlrun.html#*-c* +" " Checker options: " " - g:syntastic_perl_interpreter (string; default: 'perl') @@ -24,11 +40,7 @@ if exists('g:loaded_syntastic_perl_perl_checker') finish endif -let g:loaded_syntastic_perl_perl_checker=1 - -if !exists('g:syntastic_perl_interpreter') - let g:syntastic_perl_interpreter = 'perl' -endif +let g:loaded_syntastic_perl_perl_checker = 1 if !exists('g:syntastic_perl_lib_path') let g:syntastic_perl_lib_path = [] @@ -38,6 +50,10 @@ let s:save_cpo = &cpo set cpo&vim function! SyntaxCheckers_perl_perl_IsAvailable() dict + if !exists('g:syntastic_perl_interpreter') + let g:syntastic_perl_interpreter = self.getExec() + endif + " don't call executable() here, to allow things like " let g:syntastic_perl_interpreter='/usr/bin/env perl' silent! call system(syntastic#util#shexpand(g:syntastic_perl_interpreter) . ' -e ' . syntastic#util#shescape('exit(0)')) @@ -45,6 +61,11 @@ function! SyntaxCheckers_perl_perl_IsAvailable() dict endfunction function! SyntaxCheckers_perl_perl_GetLocList() dict + if !exists('g:syntastic_enable_perl_checker') || !g:syntastic_enable_perl_checker + call syntastic#log#error('checker perl/perl: checks disabled for security reasons; set g:syntastic_enable_perl_checker to 1 to override') + return [] + endif + let exe = expand(g:syntastic_perl_interpreter) if type(g:syntastic_perl_lib_path) == type('') call syntastic#log#deprecationWarn('variable g:syntastic_perl_lib_path should be a list') diff --git a/sources_non_forked/syntastic/syntax_checkers/php/php.vim b/sources_non_forked/syntastic/syntax_checkers/php/php.vim index 3192d7dd..23c1db9e 100644 --- a/sources_non_forked/syntastic/syntax_checkers/php/php.vim +++ b/sources_non_forked/syntastic/syntax_checkers/php/php.vim @@ -20,7 +20,7 @@ set cpo&vim function! SyntaxCheckers_php_php_GetHighlightRegex(item) let term = matchstr(a:item['text'], "\\munexpected '\\zs[^']\\+\\ze'") - return term != '' ? '\V' . term : '' + return term != '' ? '\V' . escape(term, '\') : '' endfunction function! SyntaxCheckers_php_php_GetLocList() dict diff --git a/sources_non_forked/syntastic/syntax_checkers/po/msgfmt.vim b/sources_non_forked/syntastic/syntax_checkers/po/msgfmt.vim index 5b714de9..254aa91a 100644 --- a/sources_non_forked/syntastic/syntax_checkers/po/msgfmt.vim +++ b/sources_non_forked/syntastic/syntax_checkers/po/msgfmt.vim @@ -20,7 +20,7 @@ set cpo&vim function! SyntaxCheckers_po_msgfmt_GetHighlightRegex(item) let term = matchstr(a:item['text'], '\mkeyword "\zs[^"]\+\ze" unknown') - return term != '' ? '\V' . term : '' + return term != '' ? '\V' . escape(term, '\') : '' endfunction function! SyntaxCheckers_po_msgfmt_GetLocList() dict diff --git a/sources_non_forked/syntastic/syntax_checkers/python/frosted.vim b/sources_non_forked/syntastic/syntax_checkers/python/frosted.vim index 2b6119ce..5c47de5c 100644 --- a/sources_non_forked/syntastic/syntax_checkers/python/frosted.vim +++ b/sources_non_forked/syntastic/syntax_checkers/python/frosted.vim @@ -39,7 +39,7 @@ function! SyntaxCheckers_python_frosted_GetLocList() dict if len(parts) >= 4 let e["type"] = parts[1][0] let e["text"] = parts[3] . ' [' . parts[1] . ']' - let e["hl"] = '\V' . parts[2] + let e["hl"] = '\V' . escape(parts[2], '\') elseif e["text"] =~? '\v^I\d+:' let e["valid"] = 0 else diff --git a/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim b/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim index c0b0166d..aa7de267 100644 --- a/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim +++ b/sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim @@ -21,7 +21,7 @@ set cpo&vim function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i) if stridx(a:i['text'], 'assigned but unused variable') >= 0 let term = split(a:i['text'], ' - ')[1] - return '\V\<'.term.'\>' + return '\V\<' . escape(term, '\') . '\>' endif return '' diff --git a/sources_non_forked/syntastic/syntax_checkers/texinfo/makeinfo.vim b/sources_non_forked/syntastic/syntax_checkers/texinfo/makeinfo.vim index ccd3b2f2..63cae936 100644 --- a/sources_non_forked/syntastic/syntax_checkers/texinfo/makeinfo.vim +++ b/sources_non_forked/syntastic/syntax_checkers/texinfo/makeinfo.vim @@ -20,7 +20,7 @@ set cpo&vim function! SyntaxCheckers_texinfo_makeinfo_GetHighlightRegex(item) let term = matchstr(a:item['text'], "\\m`\\zs[^']\\+\\ze'") - return term != '' ? '\V' . term : '' + return term != '' ? '\V' . escape(term, '\') : '' endfunction function! SyntaxCheckers_texinfo_makeinfo_GetLocList() dict diff --git a/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim b/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim index 5a8ea0c7..b0f32c11 100644 --- a/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim +++ b/sources_non_forked/syntastic/syntax_checkers/text/atdtool.vim @@ -22,7 +22,7 @@ function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item) let term = matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)') if term != '' let col = get(a:item, 'col', 0) - let term = (col != 0 ? '\%' . col . 'c' : '') . '\V' . term + let term = (col != 0 ? '\%' . col . 'c' : '') . '\V' . escape(term, '\') endif return term endfunction diff --git a/sources_non_forked/syntastic/syntax_checkers/vim/vimlint.vim b/sources_non_forked/syntastic/syntax_checkers/vim/vimlint.vim index 7f380d7b..d0916dce 100644 --- a/sources_non_forked/syntastic/syntax_checkers/vim/vimlint.vim +++ b/sources_non_forked/syntastic/syntax_checkers/vim/vimlint.vim @@ -29,7 +29,7 @@ function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item) endif endif - return '\V' . (col ? '\%' . col . 'c' : '') . term + return '\V' . (col ? '\%' . col . 'c' : '') . escape(term, '\') endif return '' diff --git a/sources_non_forked/tlib/autoload/tlib/Filter_cnf.vim b/sources_non_forked/tlib/autoload/tlib/Filter_cnf.vim index 0093c8b0..beb04943 100644 --- a/sources_non_forked/tlib/autoload/tlib/Filter_cnf.vim +++ b/sources_non_forked/tlib/autoload/tlib/Filter_cnf.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2008-11-25. -" @Last Change: 2013-09-25. -" @Revision: 0.0.92 +" @Last Change: 2014-01-23. +" @Revision: 0.0.108 let s:prototype = tlib#Object#New({'_class': ['Filter_cnf'], 'name': 'cnf'}) "{{{2 let s:prototype.highlight = g:tlib#input#higroup @@ -147,7 +147,16 @@ endf " :nodoc: function! s:prototype.ReduceFrontFilter(world) dict "{{{3 - let a:world.filter[0][0] = a:world.filter[0][0][0:-2] + let filter = a:world.filter[0][0] + " TLogVAR filter + let str = matchstr(filter, '\(\\\(\.\\{-}\|[.?*+$^]\)\|\)$') + if empty(str) + let filter = filter[0 : -2] + else + let filter = strpart(filter, 0, len(filter) - len(str)) + endif + " TLogVAR str, filter + let a:world.filter[0][0] = filter endf diff --git a/sources_non_forked/tlib/autoload/tlib/Filter_cnfd.vim b/sources_non_forked/tlib/autoload/tlib/Filter_cnfd.vim index 0bac3c42..27f00fe1 100644 --- a/sources_non_forked/tlib/autoload/tlib/Filter_cnfd.vim +++ b/sources_non_forked/tlib/autoload/tlib/Filter_cnfd.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2008-11-25. -" @Last Change: 2013-09-25. -" @Revision: 0.0.51 +" @Last Change: 2014-01-23. +" @Revision: 0.0.57 let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_cnfd'], 'name': 'cnfd'}) "{{{2 let s:prototype.highlight = g:tlib#input#higroup @@ -29,11 +29,7 @@ let s:Help = s:prototype.Help " :nodoc: function! s:prototype.Help(world) dict "{{{3 call call(s:Help, [a:world], self) - if self.name == 'cnfx' - call a:world.PushHelp(g:tlib#Filter_cnfx#expander, 'Any characters') - else - call a:world.PushHelp('.', 'Any characters') - endif + call a:world.PushHelp('.', 'Any characters') endf @@ -50,16 +46,6 @@ function! s:prototype.PushFrontFilter(world, char) dict "{{{3 endf -" :nodoc: -function! s:prototype.ReduceFrontFilter(world) dict "{{{3 - let flt = a:world.filter[0][0] - if flt =~ '\\\.\\{-}$' - let a:world.filter[0][0] = flt[0:-7] - else - let a:world.filter[0][0] = flt[0:-2] - endif -endf - " :nodoc: function! s:prototype.CleanFilter(filter) dict "{{{3 return substitute(a:filter, '\\.\\{-}', '.', 'g') diff --git a/sources_non_forked/tlib/autoload/tlib/Filter_cnfx.vim b/sources_non_forked/tlib/autoload/tlib/Filter_cnfx.vim deleted file mode 100644 index 1f48c5f4..00000000 --- a/sources_non_forked/tlib/autoload/tlib/Filter_cnfx.vim +++ /dev/null @@ -1,42 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @Website: http://www.vim.org/account/profile.php?user_id=4037 -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Created: 2008-11-25. -" @Last Change: 2013-09-25. -" @Revision: 0.0.62 - -let s:prototype = tlib#Filter_cnfd#New({'_class': ['Filter_cnfx'], 'name': 'cnfx'}) "{{{2 -let s:prototype.highlight = g:tlib#input#higroup - - -" A character that should be expanded to '\.\{-}'. -TLet g:tlib#Filter_cnfx#expander = '+' - - -" The same as |tlib#Filter_cnfd#New()| but a a customizable character -" |see tlib#Filter_cnfx#expander| is expanded to '\.\{-}'. -" The pattern is a '/\V' very no-'/magic' regexp pattern. -function! tlib#Filter_cnfx#New(...) "{{{3 - let object = s:prototype.New(a:0 >= 1 ? a:1 : {}) - return object -endf - - -" :nodoc: -function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3 - let pattern = substitute(a:pattern, tlib#rx#Escape(g:tlib#Filter_cnfx#expander, 'V'), '\\.\\{-}', 'g') - let a:world.filter[0] = reverse(split(pattern, '\s*|\s*')) + a:world.filter[0][1 : -1] -endf - - -" :nodoc: -function! s:prototype.PushFrontFilter(world, char) dict "{{{3 - let a:world.filter[0][0] .= a:char == char2nr(g:tlib#Filter_cnfx#expander) ? '\.\{-}' : nr2char(a:char) -endf - - -" :nodoc: -function! s:prototype.CleanFilter(filter) dict "{{{3 - return substitute(a:filter, '\\.\\{-}', g:tlib#Filter_cnfx#expander, 'g') -endf - diff --git a/sources_non_forked/tlib/autoload/tlib/Filter_glob.vim b/sources_non_forked/tlib/autoload/tlib/Filter_glob.vim new file mode 100644 index 00000000..0ee55618 --- /dev/null +++ b/sources_non_forked/tlib/autoload/tlib/Filter_glob.vim @@ -0,0 +1,68 @@ +" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) +" @Website: http://www.vim.org/account/profile.php?user_id=4037 +" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) +" @Created: 2008-11-25. +" @Last Change: 2014-01-23. +" @Revision: 0.0.80 + +let s:prototype = tlib#Filter_cnf#New({'_class': ['Filter_glob'], 'name': 'glob'}) "{{{2 +let s:prototype.highlight = g:tlib#input#higroup + + +" A character that should be expanded to '\.\{-}'. +TLet g:tlib#Filter_glob#seq = '*' + + +" A character that should be expanded to '\.\?'. +TLet g:tlib#Filter_glob#char = '?' + + +" The same as |tlib#Filter_cnf#New()| but a a customizable character +" |see tlib#Filter_glob#seq| is expanded to '\.\{-}' and +" |g:tlib#Filter_glob#char| is expanded to '\.'. +" The pattern is a '/\V' very no-'/magic' regexp pattern. +function! tlib#Filter_glob#New(...) "{{{3 + let object = s:prototype.New(a:0 >= 1 ? a:1 : {}) + return object +endf + + +let s:Help = s:prototype.Help + +" :nodoc: +function! s:prototype.Help(world) dict "{{{3 + call call(s:Help, [a:world], self) + call a:world.PushHelp(g:tlib#Filter_glob#seq, 'Any characters') + call a:world.PushHelp(g:tlib#Filter_glob#char, 'Single characters') +endf + + +" :nodoc: +function! s:prototype.SetFrontFilter(world, pattern) dict "{{{3 + let pattern = substitute(a:pattern, tlib#rx#Escape(g:tlib#Filter_glob#seq, 'V'), '\\.\\{-}', 'g') + let pattern = substitute(a:pattern, tlib#rx#Escape(g:tlib#Filter_glob#char, 'V'), '\\.', 'g') + let a:world.filter[0] = reverse(split(pattern, '\s*|\s*')) + a:world.filter[0][1 : -1] +endf + + +" :nodoc: +function! s:prototype.PushFrontFilter(world, char) dict "{{{3 + " TLogVAR a:char, nr2char(a:char) + if a:char == char2nr(g:tlib#Filter_glob#seq) + let char = '\.\{-}' + elseif a:char == char2nr(g:tlib#Filter_glob#char) + let char = '\.' + else + let char = nr2char(a:char) + endif + let a:world.filter[0][0] .= char +endf + + +" :nodoc: +function! s:prototype.CleanFilter(filter) dict "{{{3 + let filter = substitute(a:filter, '\\.\\{-}', g:tlib#Filter_glob#seq, 'g') + let filter = substitute(filter, '\\.', g:tlib#Filter_glob#char, 'g') + return filter +endf + diff --git a/sources_non_forked/tlib/autoload/tlib/World.vim b/sources_non_forked/tlib/autoload/tlib/World.vim index 1387a350..584b6701 100644 --- a/sources_non_forked/tlib/autoload/tlib/World.vim +++ b/sources_non_forked/tlib/autoload/tlib/World.vim @@ -1,10 +1,7 @@ -" World.vim -- The World prototype for tlib#input#List() " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Created: 2007-05-01. -" @Last Change: 2013-12-03. -" @Revision: 0.1.1310 +" @Revision: 1389 " :filedoc: " A prototype used by |tlib#input#List|. @@ -75,6 +72,7 @@ let s:prototype = tlib#Object#New({ \ 'resize_vertical': 0, \ 'restore_from_cache': [], \ 'filtered_items': [], + \ 'resume_state': '', \ 'retrieve_eval': '', \ 'return_agent': '', \ 'rv': '', @@ -92,6 +90,7 @@ let s:prototype = tlib#Object#New({ \ 'temp_prompt': [], \ 'timeout': 0, \ 'timeout_resolution': 2, + \ 'tabpagenr': -1, \ 'type': '', \ 'win_wnr': -1, \ 'win_height': -1, @@ -119,6 +118,22 @@ function! s:prototype.Set_display_format(value) dict "{{{3 endf +" :nodoc: +function! s:prototype.DisplayFormat(list) dict "{{{3 + let display_format = self.display_format + if !empty(display_format) + if has_key(self, 'InitFormatName') + call self.InitFormatName() + endif + let cache = self.fmt_display + " TLogVAR display_format, fmt_entries + return map(copy(a:list), 'self.FormatName(cache, display_format, v:val)') + else + return a:list + endif +endf + + " :nodoc: function! s:prototype.Set_highlight_filename() dict "{{{3 let self.tlib_UseInputListScratch = 'call world.Highlight_filename()' @@ -180,6 +195,32 @@ else endf + " :nodoc: + function! s:prototype.UseFilenameIndicators() dict "{{{3 + return g:tlib_inputlist_filename_indicators || has_key(self, 'filename_indicators') + endf + + + " :nodoc: + function! s:prototype.InitFormatName() dict "{{{3 + if self.UseFilenameIndicators() + let self._buffers = {} + for bufnr in range(1, bufnr('$')) + let filename = fnamemodify(bufname(bufnr), ':p') + " TLogVAR filename + let bufdef = { + \ 'bufnr': bufnr, + \ } + " '&buflisted' + for opt in ['&modified', '&bufhidden'] + let bufdef[opt] = getbufvar(bufnr, opt) + endfor + let self._buffers[filename] = bufdef + endfor + endif + endf + + " :nodoc: function! s:prototype.FormatFilename(file) dict "{{{3 " TLogVAR a:file @@ -196,34 +237,30 @@ else if strwidth(fname) > width let fname = strpart(fname, 0, width - 3) .'...' endif - let dnmax = &co - max([width, strwidth(fname)]) - 10 - self.index_width - &fdc - if g:tlib_inputlist_filename_indicators - let dnmax -= 2 - endif - if strwidth(dname) > dnmax - let dname = '...'. strpart(dname, len(dname) - dnmax) - endif - let marker = [] - let use_indicators = g:tlib_inputlist_filename_indicators || has_key(self, 'filename_indicators') + let dnmax = &co - max([width, strwidth(fname)]) - 8 - self.index_width - &fdc + let use_indicators = self.UseFilenameIndicators() " TLogVAR use_indicators + let marker = [] if use_indicators call insert(marker, '[') if g:tlib_inputlist_filename_indicators - let bnr = bufnr(a:file) - TLogVAR a:file, bnr, self.bufnr + let bufdef = get(self._buffers, a:file, {}) + " let bnr = bufnr(a:file) + let bnr = get(bufdef, 'bufnr', -1) + " TLogVAR a:file, bnr, self.bufnr if bnr != -1 if bnr == self.bufnr call add(marker, '%') else call add(marker, bnr) endif - if getbufvar(bnr, '&modified') + if get(bufdef, '&modified', 0) call add(marker, '+') endif - if getbufvar(bnr, '&bufhidden') == 'hide' + if get(bufdef, '&bufhidden', '') == 'hide' call add(marker, 'h') endif - " if !buflisted(bnr) + " if !get(bufdef, '&buflisted', 1) " call add(marker, 'u') " endif " echom "DBG" a:file string(get(self,'filename_indicators')) @@ -242,9 +279,16 @@ else else call add(marker, '|') endif + let markers = join(marker, '') + if !empty(markers) + let dnmax -= len(markers) + endif + if strwidth(dname) > dnmax + let dname = '...'. strpart(dname, len(dname) - dnmax) + endif return printf("%-*s %s %s", \ self.width_filename + len(fname) - strwidth(fname), - \ fname, join(marker, ''), dname) + \ fname, markers, dname) endf endif @@ -764,6 +808,7 @@ function! s:prototype.UseInputListScratch() dict "{{{3 if !exists('b:tlib_list_init') call tlib#autocmdgroup#Init() autocmd TLib VimResized call feedkeys("\", 't') + " autocmd TLib WinLeave let b:tlib_world_event = 'WinLeave' | call feedkeys("\", 't') let b:tlib_list_init = 1 endif if !exists('w:tlib_list_init') @@ -923,16 +968,17 @@ function! s:prototype.DisplayHelp() dict "{{{3 let self.temp_lines = self.InitHelp() call self.PushHelp('', self.key_mode == 'default' ? 'Abort' : 'Reset keymap') call self.PushHelp('Enter, ', 'Pick the current item') - call self.PushHelp('', 'Pick an item') call self.PushHelp('Mouse', 'L: Pick item, R: Show menu') + call self.PushHelp('', 'Select an item') call self.PushHelp(', ', 'Reduce filter') call self.PushHelp(', ', 'Enter command') if self.key_mode == 'default' - call self.PushHelp('', 'Reset the display') + call self.PushHelp('', 'Reset the display') call self.PushHelp('Up/Down', 'Next/previous item') - call self.PushHelp('', 'Edit top filter string') + call self.PushHelp('', 'Edit top filter string') call self.PushHelp('Page Up/Down', 'Scroll') + call self.PushHelp('', 'Enter * Wildcard') if self.allow_suspend call self.PushHelp('', 'Suspend/Resume') call self.PushHelp('', 'Switch to origin') @@ -1164,7 +1210,7 @@ function! s:prototype.Query() dict "{{{3 if g:tlib_inputlist_shortmessage let query = 'Filter: '. self.DisplayFilter() else - let query = self.query .' (filter: '. self.DisplayFilter() .'; press "?" for help)' + let query = self.query .' (filter: '. self.DisplayFilter() .'; press for help)' endif return query endf @@ -1236,6 +1282,9 @@ endf " :nodoc: function! s:prototype.SwitchWindow(where) dict "{{{3 " TLogDBG string(tlib#win#List()) + if self.tabpagenr != tabpagenr() + call tlib#tab#Set(self.tabpagenr) + endif let wnr = get(self, a:where.'_wnr') " TLogVAR self, wnr return tlib#win#Set(wnr) @@ -1312,3 +1361,8 @@ function! s:prototype.RestoreOrigin(...) dict "{{{3 " TLogDBG "RestoreOrigin1 ". string(tlib#win#List()) endf + +function! s:prototype.Suspend() dict "{{{3 + call tlib#agent#Suspend(self, self.rv) +endf + diff --git a/sources_non_forked/tlib/autoload/tlib/agent.vim b/sources_non_forked/tlib/autoload/tlib/agent.vim index 61109e7b..766c5b33 100644 --- a/sources_non_forked/tlib/autoload/tlib/agent.vim +++ b/sources_non_forked/tlib/autoload/tlib/agent.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-24. -" @Last Change: 2013-11-05. -" @Revision: 0.1.242 +" @Last Change: 2014-02-06. +" @Revision: 0.1.251 " :filedoc: @@ -55,6 +55,20 @@ function! tlib#agent#PageDown(world, selected) "{{{3 endf +function! tlib#agent#Home(world, selected) "{{{3 + let a:world.prefidx = 1 + let a:world.state = 'redisplay' + return a:world +endf + + +function! tlib#agent#End(world, selected) "{{{3 + let a:world.prefidx = len(a:world.list) + let a:world.state = 'redisplay' + return a:world +endf + + function! tlib#agent#Up(world, selected, ...) "{{{3 TVarArg ['lines', 1] let a:world.idx = '' @@ -463,7 +477,7 @@ function! tlib#agent#ShowInfo(world, selected) for f in a:selected if filereadable(f) let desc = [getfperm(f), strftime('%c', getftime(f)), getfsize(f) .' bytes', getftype(f)] - call add(lines, fnamemodify(f, ':t') .':') + call add(lines, fnamemodify(f, ':p')) call add(lines, ' '. join(desc, '; ')) endif endfor @@ -561,7 +575,7 @@ endf function! tlib#agent#ExecAgentByName(world, selected) "{{{3 let s:agent_names_world = a:world - let agent_names = {} + let agent_names = {'Help': 'tlib#agent#Help'} for def in values(a:world.key_map[a:world.key_mode]) if has_key(def, 'help') && !empty(def.help) && has_key(def, 'agent') && !empty(def.agent) let agent_names[def.help] = def.agent diff --git a/sources_non_forked/tlib/autoload/tlib/cache.vim b/sources_non_forked/tlib/autoload/tlib/cache.vim index 7380d6dd..0c2c7017 100644 --- a/sources_non_forked/tlib/autoload/tlib/cache.vim +++ b/sources_non_forked/tlib/autoload/tlib/cache.vim @@ -4,7 +4,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-30. " @Last Change: 2013-09-25. -" @Revision: 0.1.220 +" @Revision: 0.1.230 " The cache directory. If empty, use |tlib#dir#MyRuntime|.'/cache'. @@ -109,13 +109,20 @@ endf function! tlib#cache#Save(cfile, dictionary) "{{{3 + " TLogVAR a:cfile, a:dictionary call tlib#persistent#Save(a:cfile, a:dictionary) endf -function! tlib#cache#Get(cfile) "{{{3 +function! tlib#cache#Get(cfile, ...) "{{{3 call tlib#cache#MaybePurge() - return tlib#persistent#Get(a:cfile) + if !empty(a:cfile) && filereadable(a:cfile) + let val = readfile(a:cfile, 'b') + return eval(join(val, "\n")) + else + let default = a:0 >= 1 ? a:1 : {} + return default + endif endf @@ -123,10 +130,18 @@ endf " or does not exist, create it calling a generator function. function! tlib#cache#Value(cfile, generator, ftime, ...) "{{{3 if !filereadable(a:cfile) || (a:ftime != 0 && getftime(a:cfile) < a:ftime) - let args = a:0 >= 1 ? a:1 : [] - let val = call(a:generator, args) - " TLogVAR a:generator, args, val - call tlib#cache#Save(a:cfile, {'val': val}) + if empty(a:generator) && a:0 >= 1 + " TLogVAR a:1 + let val = a:1 + else + let args = a:0 >= 1 ? a:1 : [] + " TLogVAR a:generator, args + let val = call(a:generator, args) + endif + " TLogVAR val + let cval = {'val': val} + " TLogVAR cval + call tlib#cache#Save(a:cfile, cval) return val else let val = tlib#cache#Get(a:cfile) diff --git a/sources_non_forked/tlib/autoload/tlib/char.vim b/sources_non_forked/tlib/autoload/tlib/char.vim index 2efb47bb..277716d3 100644 --- a/sources_non_forked/tlib/autoload/tlib/char.vim +++ b/sources_non_forked/tlib/autoload/tlib/char.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-06-30. -" @Last Change: 2009-02-15. -" @Revision: 0.0.30 +" @Last Change: 2014-01-20. +" @Revision: 0.0.37 if &cp || exists("loaded_tlib_char_autoload") finish @@ -19,13 +19,22 @@ let loaded_tlib_char_autoload = 1 " echo tlib#char#Get() " echo tlib#char#Get(5) function! tlib#char#Get(...) "{{{3 - TVarArg ['timeout', 0], ['resolution', 0] + TVarArg ['timeout', 0], ['resolution', 0], ['getmod', 0] + let char = -1 + let mode = 0 if timeout == 0 || !has('reltime') - return getchar() + let char = getchar() else - return tlib#char#GetWithTimeout(timeout, resolution) + let char = tlib#char#GetWithTimeout(timeout, resolution) + endif + if getmod + if char != -1 + let mode = getcharmod() + endif + return [char, mode] + else + return char endif - return -1 endf diff --git a/sources_non_forked/tlib/autoload/tlib/cmd.vim b/sources_non_forked/tlib/autoload/tlib/cmd.vim index e6ab3e88..01975b60 100644 --- a/sources_non_forked/tlib/autoload/tlib/cmd.vim +++ b/sources_non_forked/tlib/autoload/tlib/cmd.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-08-23. -" @Last Change: 2013-05-14. -" @Revision: 0.0.46 +" @Last Change: 2014-02-05. +" @Revision: 0.0.53 if &cp || exists("loaded_tlib_cmd_autoload") finish @@ -58,10 +58,12 @@ endf " call tlib#cmd#BrowseOutputWithCallback('tlib#cmd#ParseScriptname', 'scriptnames') function! tlib#cmd#BrowseOutputWithCallback(callback, command) "{{{3 let list = tlib#cmd#OutputAsList(a:command) - let cmd = tlib#input#List('s', 'Output of: '. a:command, list) - if !empty(cmd) - let Callback = function(a:callback) - call call(Callback, [cmd]) + let cmds = tlib#input#List('m', 'Output of: '. a:command, list) + if !empty(cmds) + for cmd in cmds + let Callback = function(a:callback) + call call(Callback, [cmd]) + endfor endif endf @@ -70,8 +72,9 @@ function! tlib#cmd#DefaultBrowseOutput(cmd) "{{{3 endf function! tlib#cmd#ParseScriptname(line) "{{{3 - let parsedValue = substitute(a:line, '^.\{-}\/', '/', '') - exe ':e '. parsedValue + " let parsedValue = substitute(a:line, '^.\{-}\/', '/', '') + let parsedValue = matchstr(a:line, '^\s*\d\+:\s*\zs.*$') + exe 'drop '. fnameescape(parsedValue) endf " :def: function! tlib#cmd#UseVertical(?rx='') diff --git a/sources_non_forked/tlib/autoload/tlib/input.vim b/sources_non_forked/tlib/autoload/tlib/input.vim index b756f783..9805b305 100644 --- a/sources_non_forked/tlib/autoload/tlib/input.vim +++ b/sources_non_forked/tlib/autoload/tlib/input.vim @@ -1,10 +1,7 @@ -" input.vim " @Author: Tom Link (micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Created: 2007-06-30. -" @Last Change: 2013-09-30. -" @Revision: 0.0.1262 +" @Revision: 1315 " :filedoc: @@ -23,16 +20,15 @@ TLet g:tlib#input#livesearch_threshold = 1000 " Determine how |tlib#input#List()| and related functions work. -" Can be "cnf", "cnfd", "cnfx", "seq", or "fuzzy". See: -" cnfx ... Like cnfd but |g:tlib#Filter_cnfx#expander| is interpreted -" as a wildcard (this is the default method) -" - A plus character ("+") acts as a wildcard as if ".\{-}" (see -" |/\{-|) were entered. +" Can be "glob", "cnf", "cnfd", "seq", or "fuzzy". See: +" glob ... Like cnf but "*" and "?" (see |g:tlib#Filter_glob#seq|, +" |g:tlib#Filter_glob#char|) are interpreted as glob-like +" |wildcards| (this is the default method) " - Examples: -" - "f+o" matches "fo", "fxo", and "fxxxoo", but doesn't match +" - "f*o" matches "fo", "fxo", and "fxxxoo", but doesn't match " "far". " - Otherwise it is a derivate of the cnf method (see below). -" - See also |tlib#Filter_cnfx#New()|. +" - See also |tlib#Filter_glob#New()|. " cnfd ... Like cnf but "." is interpreted as a wildcard, i.e. it is " expanded to "\.\{-}" " - A period character (".") acts as a wildcard as if ".\{-}" (see @@ -60,7 +56,7 @@ TLet g:tlib#input#livesearch_threshold = 1000 " - |tlib#Filter_seq#New()| " fuzzy .. Match fuzzy character sequences " - |tlib#Filter_fuzzy#New()| -TLet g:tlib#input#filter_mode = 'cnfx' +TLet g:tlib#input#filter_mode = 'glob' " The highlight group to use for showing matches in the input list @@ -126,6 +122,8 @@ TLet g:tlib#input#numeric_chars = { TLet g:tlib#input#keyagents_InputList_s = { \ "\": 'tlib#agent#PageUp', \ "\": 'tlib#agent#PageDown', + \ "\": 'tlib#agent#Home', + \ "\": 'tlib#agent#End', \ "\": 'tlib#agent#Up', \ "\": 'tlib#agent#Down', \ "\": 'tlib#agent#UpN', @@ -140,7 +138,6 @@ TLet g:tlib#input#keyagents_InputList_s = { \ 26: 'tlib#agent#Suspend', \ 250: 'tlib#agent#Suspend', \ 15: 'tlib#agent#SuspendToParentWindow', - \ 63: 'tlib#agent#Help', \ "\": 'tlib#agent#Help', \ "\": 'tlib#agent#ExecAgentByName', \ "\": 'tlib#agent#ExecAgentByName', @@ -155,6 +152,7 @@ TLet g:tlib#input#keyagents_InputList_s = { \ char2nr(g:tlib#input#or): 'tlib#agent#OR', \ char2nr(g:tlib#input#and): 'tlib#agent#AND', \ } + " \ 63: 'tlib#agent#Help', " :nodefault: @@ -345,6 +343,16 @@ function! tlib#input#ListW(world, ...) "{{{3 try call s:RunStateHandlers(world) + " if exists('b:tlib_world_event') + " let event = b:tlib_world_event + " unlet! b:tlib_world_event + " if event == 'WinLeave' + " " let world.resume_state = world.state + " let world = tlib#agent#Suspend(world, world.rv) + " break + " endif + " endif + " let time02 = str2float(reltimestr(reltime())) " DBG " TLogVAR time02, time02 - time0 if world.state =~ '\' @@ -443,14 +451,7 @@ function! tlib#input#ListW(world, ...) "{{{3 " TLogDBG 5 " TLogDBG len(world.list) " TLogVAR world.list - let dlist = copy(world.list) - " TLogVAR world.display_format - if !empty(world.display_format) - let display_format = world.display_format - let cache = world.fmt_display - " TLogVAR display_format, fmt_entries - call map(dlist, 'world.FormatName(cache, display_format, v:val)') - endif + let dlist = world.DisplayFormat(world.list) " TLogVAR world.prefidx " TLogDBG 6 " let time6 = str2float(reltimestr(reltime())) " DBG @@ -545,20 +546,15 @@ function! tlib#input#ListW(world, ...) "{{{3 exec exec_cmd endif elseif has('gui_gtk') || has('gui_gtk2') - let c = getchar() - let cmod = getcharmod() - " TLogVAR c, cmod - if c !~ '\D' && c > 0 && cmod != 0 - let c = printf("<%s-%s>", cmod, c) - endif + let c = s:GetModdedChar(world) + " TLogVAR c endif else " TLogVAR world.timeout - let c = tlib#char#Get(world.timeout, world.timeout_resolution) + let c = s:GetModdedChar(world) " TLogVAR c, has_key(world.key_map[world.key_mode],c) - let cmod = getcharmod() endif - " TLogVAR c, cmod + " TLogVAR c " TLogDBG string(sort(keys(world.key_map[world.key_mode]))) " TLogVAR world.next_agent, world.next_eval @@ -602,7 +598,7 @@ function! tlib#input#ListW(world, ...) "{{{3 " let world.offset = world.prefidx if empty(world.prefidx) " call feedkeys(c, 't') - let c = tlib#char#Get(world.timeout) + let c = s:GetModdedChar(world) let world.state = 'help' continue endif @@ -829,6 +825,16 @@ function! tlib#input#ListW(world, ...) "{{{3 endf +function! s:GetModdedChar(world) "{{{3 + let [char, mode] = tlib#char#Get(a:world.timeout, a:world.timeout_resolution, 1) + if char !~ '\D' && char > 0 && mode != 0 + return printf("<%s-%s>", mode, char) + else + return char + endif +endf + + function! s:Init(world, cmd) "{{{3 " TLogVAR a:cmd let a:world.initial_display = 1 @@ -844,6 +850,9 @@ function! s:Init(world, cmd) "{{{3 else call a:world.Retrieve(1) endif + " if !empty(a:world.resume_state) + " let a:world.state = a:world.resume_state + " endif elseif !a:world.initialized " TLogVAR a:world.initialized, a:world.win_wnr, a:world.bufnr let a:world.filetype = &filetype diff --git a/sources_non_forked/tlib/autoload/tlib/persistent.vim b/sources_non_forked/tlib/autoload/tlib/persistent.vim index b5791744..26232d59 100644 --- a/sources_non_forked/tlib/autoload/tlib/persistent.vim +++ b/sources_non_forked/tlib/autoload/tlib/persistent.vim @@ -3,7 +3,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2012-05-11. " @Last Change: 2012-05-11. -" @Revision: 7 +" @Revision: 9 " The directory for persistent data files. If empty, use " |tlib#dir#MyRuntime|.'/share'. @@ -29,13 +29,8 @@ function! tlib#persistent#Filename(type, ...) "{{{3 return tlib#cache#Filename(a:type, file, mkdir, tlib#persistent#Dir()) endf -function! tlib#persistent#Get(cfile) "{{{3 - if !empty(a:cfile) && filereadable(a:cfile) - let val = readfile(a:cfile, 'b') - return eval(join(val, "\n")) - else - return {} - endif +function! tlib#persistent#Get(...) "{{{3 + return call('tlib#cache#Get', a:000) endf function! tlib#persistent#Value(...) "{{{3 diff --git a/sources_non_forked/tlib/autoload/tlib/progressbar.vim b/sources_non_forked/tlib/autoload/tlib/progressbar.vim index 6ff5a77f..6ca0ce9b 100644 --- a/sources_non_forked/tlib/autoload/tlib/progressbar.vim +++ b/sources_non_forked/tlib/autoload/tlib/progressbar.vim @@ -4,7 +4,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-09-30. " @Last Change: 2010-01-07. -" @Revision: 0.0.66 +" @Revision: 0.0.69 if &cp || exists("loaded_tlib_progressbar_autoload") finish @@ -57,6 +57,7 @@ function! tlib#progressbar#Display(value, ...) "{{{3 let pbr = repeat('.', s:width[0] - val) let txt = printf(s:format[0], '['.pbl.pbr.']') . extra let &l:statusline = txt + " TLogDBG txt redrawstatus " redraw " call tlib#notify#Echo(txt) diff --git a/sources_non_forked/tlib/autoload/tlib/scratch.vim b/sources_non_forked/tlib/autoload/tlib/scratch.vim index e043f050..e64eb9e6 100644 --- a/sources_non_forked/tlib/autoload/tlib/scratch.vim +++ b/sources_non_forked/tlib/autoload/tlib/scratch.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-07-18. -" @Last Change: 2013-11-11. -" @Revision: 0.0.251 +" @Last Change: 2014-02-06. +" @Revision: 0.0.252 if &cp || exists("loaded_tlib_scratch_autoload") finish @@ -100,6 +100,8 @@ function! tlib#scratch#UseScratch(...) "{{{3 endif endif let keyargs.scratch = bufnr('%') + let keyargs.scratch_tabpagenr = tabpagenr() + let keyargs.scratch_winnr = winnr() " TLogVAR 2, winnr(), bufnr('%'), bufname("%"), keyargs.scratch return keyargs.scratch endf diff --git a/sources_non_forked/tlib/autoload/tlib/tab.vim b/sources_non_forked/tlib/autoload/tlib/tab.vim index c6159586..6fc3bd46 100644 --- a/sources_non_forked/tlib/autoload/tlib/tab.vim +++ b/sources_non_forked/tlib/autoload/tlib/tab.vim @@ -3,8 +3,8 @@ " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-08-27. -" @Last Change: 2009-02-15. -" @Revision: 0.0.29 +" @Last Change: 2014-02-06. +" @Revision: 0.0.30 if &cp || exists("loaded_tlib_tab_autoload") finish @@ -50,6 +50,8 @@ endf function! tlib#tab#Set(tabnr) "{{{3 - exec a:tabnr .'tabnext' + if a:tabnr > 0 + exec a:tabnr .'tabnext' + endif endf diff --git a/sources_non_forked/tlib/autoload/tlib/vim.vim b/sources_non_forked/tlib/autoload/tlib/vim.vim index 150c4161..7154aeb1 100644 --- a/sources_non_forked/tlib/autoload/tlib/vim.vim +++ b/sources_non_forked/tlib/autoload/tlib/vim.vim @@ -4,7 +4,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2010-07-19. " @Last Change: 2012-06-08. -" @Revision: 35 +" @Revision: 37 let s:restoreframecmd = '' @@ -120,3 +120,33 @@ function! s:RestoreFrameParams() "{{{3 endif endf + +" :display: tlib#vim##CopyFunction(old, new, overwrite=0) +function! tlib#vim#CopyFunction(old, new, ...) "{{{3 + let overwrite = a:0 >= 1 ? a:1 : 0 + redir => oldfn + exec 'silent function' a:old + redir END + if exists('*'. a:new) + if overwrite > 0 + exec 'delfunction' a:new + elseif overwrite < 0 + throw 'tlib#vim##CopyFunction: Function already exists: '. a:old .' -> '. a:new + else + return + endif + endif + let fn = split(oldfn, '\n') + let fn = map(fn, 'substitute(v:val, ''^\d\+'', "", "")') + let fn[0] = substitute(fn[0], '\V\^\s\*fu\%[nction]!\?\s\+\zs'. a:old, a:new, '') + let t = @t + try + let @t = join(fn, "\n") + redir => out + @t + redir END + finally + let @t = t + endtry +endf + diff --git a/sources_non_forked/tlib/doc/tlib.txt b/sources_non_forked/tlib/doc/tlib.txt index a295ce19..816524b9 100644 --- a/sources_non_forked/tlib/doc/tlib.txt +++ b/sources_non_forked/tlib/doc/tlib.txt @@ -38,6 +38,13 @@ Contents~ :TBrowseOutput ......................... |:TBrowseOutput| :TBrowseScriptnames .................... |:TBrowseScriptnames| :TTimeCommand .......................... |:TTimeCommand| + Add .................................... |Add()| + TestGetArg ............................. |TestGetArg()| + TestGetArg1 ............................ |TestGetArg1()| + TestArgs ............................... |TestArgs()| + TestArgs1 .............................. |TestArgs1()| + TestArgs2 .............................. |TestArgs2()| + TestArgs3 .............................. |TestArgs3()| g:tlib#debug ........................... |g:tlib#debug| tlib#notify#Echo ....................... |tlib#notify#Echo()| tlib#notify#TrimMessage ................ |tlib#notify#TrimMessage()| @@ -53,6 +60,7 @@ Contents~ tlib#vim#Maximize ...................... |tlib#vim#Maximize()| tlib#vim#RestoreWindow ................. |tlib#vim#RestoreWindow()| g:tlib#vim#use_wmctrl .................. |g:tlib#vim#use_wmctrl| + tlib#vim#CopyFunction .................. |tlib#vim#CopyFunction()| tlib#progressbar#Init .................. |tlib#progressbar#Init()| tlib#progressbar#Display ............... |tlib#progressbar#Display()| tlib#progressbar#Restore ............... |tlib#progressbar#Restore()| @@ -89,6 +97,9 @@ Contents~ tlib#char#Get .......................... |tlib#char#Get()| tlib#char#IsAvailable .................. |tlib#char#IsAvailable()| tlib#char#GetWithTimeout ............... |tlib#char#GetWithTimeout()| + g:tlib#Filter_glob#seq ................. |g:tlib#Filter_glob#seq| + g:tlib#Filter_glob#char ................ |g:tlib#Filter_glob#char| + tlib#Filter_glob#New ................... |tlib#Filter_glob#New()| g:tlib_scratch_pos ..................... |g:tlib_scratch_pos| g:tlib#scratch#hidden .................. |g:tlib#scratch#hidden| tlib#scratch#UseScratch ................ |tlib#scratch#UseScratch()| @@ -124,6 +135,8 @@ Contents~ tlib#agent#CopyItems ................... |tlib#agent#CopyItems()| tlib#agent#PageUp ...................... |tlib#agent#PageUp()| tlib#agent#PageDown .................... |tlib#agent#PageDown()| + tlib#agent#Home ........................ |tlib#agent#Home()| + tlib#agent#End ......................... |tlib#agent#End()| tlib#agent#Up .......................... |tlib#agent#Up()| tlib#agent#Down ........................ |tlib#agent#Down()| tlib#agent#UpN ......................... |tlib#agent#UpN()| @@ -178,8 +191,6 @@ Contents~ tlib#bitwise#ShiftLeft ................. |tlib#bitwise#ShiftLeft()| tlib#bitwise#Add ....................... |tlib#bitwise#Add()| tlib#bitwise#Sub ....................... |tlib#bitwise#Sub()| - g:tlib#Filter_cnfx#expander ............ |g:tlib#Filter_cnfx#expander| - tlib#Filter_cnfx#New ................... |tlib#Filter_cnfx#New()| tlib#url#Decode ........................ |tlib#url#Decode()| tlib#url#DecodeChar .................... |tlib#url#DecodeChar()| tlib#url#EncodeChar .................... |tlib#url#EncodeChar()| @@ -235,6 +246,7 @@ Contents~ g:tlib_inputlist_shortmessage .......... |g:tlib_inputlist_shortmessage| tlib#World#New ......................... |tlib#World#New()| prototype.PrintLines + prototype.Suspend tlib#tab#BufMap ........................ |tlib#tab#BufMap()| tlib#tab#TabWinNr ...................... |tlib#tab#TabWinNr()| tlib#tab#Set ........................... |tlib#tab#Set()| @@ -409,6 +421,33 @@ plugin/02tlib.vim~ Time the execution time of CMD. +======================================================================== +test/tlib.vim~ + + *Add()* +Add(a,b) + List + + *TestGetArg()* +TestGetArg(...) + Optional arguments + + *TestGetArg1()* +TestGetArg1(...) + + *TestArgs()* +TestArgs(...) + + *TestArgs1()* +TestArgs1(...) + + *TestArgs2()* +TestArgs2(...) + + *TestArgs3()* +TestArgs3(...) + + ======================================================================== autoload/tlib.vim~ @@ -451,7 +490,7 @@ tlib#persistent#Dir(?mode = 'bg') tlib#persistent#Filename(type, ?file=%, ?mkdir=0) *tlib#persistent#Get()* -tlib#persistent#Get(cfile) +tlib#persistent#Get(...) *tlib#persistent#Value()* tlib#persistent#Value(...) @@ -500,6 +539,9 @@ g:tlib#vim#use_wmctrl (default: executable('wmctrl')) default method of setting 'lines' and 'columns' to a large value. + *tlib#vim#CopyFunction()* +tlib#vim##CopyFunction(old, new, overwrite=0) + ======================================================================== autoload/tlib/progressbar.vim~ @@ -731,6 +773,25 @@ tlib#char#IsAvailable() tlib#char#GetWithTimeout(timeout, ...) +======================================================================== +autoload/tlib/Filter_glob.vim~ + + *g:tlib#Filter_glob#seq* +g:tlib#Filter_glob#seq (default: '*') + A character that should be expanded to '\.\{-}'. + + *g:tlib#Filter_glob#char* +g:tlib#Filter_glob#char (default: '?') + A character that should be expanded to '\.\?'. + + *tlib#Filter_glob#New()* +tlib#Filter_glob#New(...) + The same as |tlib#Filter_cnf#New()| but a a customizable character + |see tlib#Filter_glob#seq| is expanded to '\.\{-}' and + |g:tlib#Filter_glob#char| is expanded to '\.'. + The pattern is a '/\V' very no-'/magic' regexp pattern. + + ======================================================================== autoload/tlib/scratch.vim~ @@ -829,7 +890,7 @@ tlib#cache#Filename(type, ?file=%, ?mkdir=0, ?dir='') tlib#cache#Save(cfile, dictionary) *tlib#cache#Get()* -tlib#cache#Get(cfile) +tlib#cache#Get(cfile, ...) *tlib#cache#Value()* tlib#cache#Value(cfile, generator, ftime, ...) @@ -939,6 +1000,12 @@ tlib#agent#PageUp(world, selected) *tlib#agent#PageDown()* tlib#agent#PageDown(world, selected) + *tlib#agent#Home()* +tlib#agent#Home(world, selected) + + *tlib#agent#End()* +tlib#agent#End(world, selected) + *tlib#agent#Up()* tlib#agent#Up(world, selected, ...) @@ -1116,20 +1183,6 @@ tlib#bitwise#Add(num1, num2, ...) tlib#bitwise#Sub(num1, num2, ...) -======================================================================== -autoload/tlib/Filter_cnfx.vim~ - - *g:tlib#Filter_cnfx#expander* -g:tlib#Filter_cnfx#expander (default: '+') - A character that should be expanded to '\.\{-}'. - - *tlib#Filter_cnfx#New()* -tlib#Filter_cnfx#New(...) - The same as |tlib#Filter_cnfd#New()| but a a customizable character - |see tlib#Filter_cnfx#expander| is expanded to '\.\{-}'. - The pattern is a '/\V' very no-'/magic' regexp pattern. - - ======================================================================== autoload/tlib/url.vim~ @@ -1274,18 +1327,17 @@ g:tlib#input#livesearch_threshold (default: 1000) filter. This is useful on slower machines or with very long lists. *g:tlib#input#filter_mode* -g:tlib#input#filter_mode (default: 'cnfx') +g:tlib#input#filter_mode (default: 'glob') Determine how |tlib#input#List()| and related functions work. - Can be "cnf", "cnfd", "cnfx", "seq", or "fuzzy". See: - cnfx ... Like cnfd but |g:tlib#Filter_cnfx#expander| is interpreted - as a wildcard (this is the default method) - - A plus character ("+") acts as a wildcard as if ".\{-}" (see - |/\{-|) were entered. + Can be "glob", "cnf", "cnfd", "seq", or "fuzzy". See: + glob ... Like cnf but "*" and "?" (see |g:tlib#Filter_glob#seq|, + |g:tlib#Filter_glob#char|) are interpreted as glob-like + |wildcards| (this is the default method) - Examples: - - "f+o" matches "fo", "fxo", and "fxxxoo", but doesn't match + - "f*o" matches "fo", "fxo", and "fxxxoo", but doesn't match "far". - Otherwise it is a derivate of the cnf method (see below). - - See also |tlib#Filter_cnfx#New()|. + - See also |tlib#Filter_glob#New()|. cnfd ... Like cnf but "." is interpreted as a wildcard, i.e. it is expanded to "\.\{-}" - A period character (".") acts as a wildcard as if ".\{-}" (see @@ -1568,6 +1620,8 @@ tlib#World#New(...) prototype.PrintLines +prototype.Suspend + ======================================================================== autoload/tlib/tab.vim~ diff --git a/sources_non_forked/tlib/plugin/02tlib.vim b/sources_non_forked/tlib/plugin/02tlib.vim index c60dfd3b..6cbab75d 100644 --- a/sources_non_forked/tlib/plugin/02tlib.vim +++ b/sources_non_forked/tlib/plugin/02tlib.vim @@ -4,7 +4,7 @@ " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-04-10. " @Last Change: 2013-09-25. -" @Revision: 748 +" @Revision: 749 " GetLatestVimScripts: 1863 1 tlib.vim if &cp || exists("loaded_tlib") @@ -14,7 +14,7 @@ if v:version < 700 "{{{2 echoerr "tlib requires Vim >= 7" finish endif -let loaded_tlib = 107 +let loaded_tlib = 108 let s:save_cpo = &cpo set cpo&vim diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim index 1b4dfa3f..6b13dcf0 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/unique_tail_improved.vim @@ -19,6 +19,7 @@ function! airline#extensions#tabline#unique_tail_improved#format(bufnr, buffers) let tokens = reverse(split(substitute(fnamemodify(name, ':p:.:h'), '\\', '/', 'g'), '/')) let token_index = 0 for token in tokens + if token == '' | continue | endif if token == '.' | break | endif if !has_key(path_tokens, token_index) let path_tokens[token_index] = {} diff --git a/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim b/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim index ba98b71e..e4e1b202 100644 --- a/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim +++ b/sources_non_forked/vim-airline/autoload/airline/extensions/whitespace.vim @@ -36,19 +36,17 @@ function! airline#extensions#whitespace#check() let mixed = 0 if index(checks, 'indent') > -1 - let indents = [search('^ \{2,}', 'nb'), search('^ \{2,}', 'n'), search('^\t', 'nb'), search('^\t', 'n')] - let mixed = indents[0] != 0 && indents[1] != 0 && indents[2] != 0 && indents[3] != 0 + let mixed = search('\v(^\t+ +)|(^ +\t+)', 'nw') endif - if trailing != 0 || mixed + if trailing != 0 || mixed != 0 let b:airline_whitespace_check = s:symbol if s:show_message if trailing != 0 let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing) endif - if mixed - let mixnr = indents[0] == indents[1] ? indents[0] : indents[2] - let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixnr) + if mixed != 0 + let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixed) endif endif endif diff --git a/sources_non_forked/vim-commentary/CONTRIBUTING.markdown b/sources_non_forked/vim-commentary/CONTRIBUTING.markdown new file mode 100644 index 00000000..b3f00951 --- /dev/null +++ b/sources_non_forked/vim-commentary/CONTRIBUTING.markdown @@ -0,0 +1 @@ +See the [contribution guidelines for pathogen.vim](https://github.com/tpope/vim-pathogen/blob/master/CONTRIBUTING.markdown). diff --git a/sources_non_forked/vim-commentary/README.markdown b/sources_non_forked/vim-commentary/README.markdown index 4db3ed99..0b60009a 100644 --- a/sources_non_forked/vim-commentary/README.markdown +++ b/sources_non_forked/vim-commentary/README.markdown @@ -1,5 +1,4 @@ -commentary.vim -============== +# commentary.vim Comment stuff out. Use `gcc` to comment out a line (takes a count), `gc` to comment out the target of a motion (for example, `gcap` to @@ -15,10 +14,9 @@ minimalism, it weighs in at under 100 lines of code. Oh, and it uncomments, too. The above maps actually toggle, and `gcu` uncomments a set of adjacent commented lines. Install [repeat.vim](https://github.com/tpope/vim-repeat) to enable -repeating `gcu` with `.` (the other maps are repeatable without it). +repeating `gcu` with `.`. (The other maps are repeatable without it.) -Installation ------------- +## Installation If you don't have a preferred installation method, I recommend installing [pathogen.vim](https://github.com/tpope/vim-pathogen), and @@ -30,8 +28,7 @@ then simply copy and paste: Once help tags have been generated, you can view the manual with `:help commentary`. -FAQ ---- +## FAQ > My favorite file type isn't supported! @@ -39,14 +36,7 @@ Relax! You just have to adjust `'commentstring'`: autocmd FileType apache set commentstring=#\ %s -Contributing ------------- - -See the contribution guidelines for -[pathogen.vim](https://github.com/tpope/vim-pathogen#readme). - -Self-Promotion --------------- +## Self-Promotion Like commentary.vim? Follow the repository on [GitHub](https://github.com/tpope/vim-commentary) and vote for it on @@ -55,8 +45,7 @@ you're feeling especially charitable, follow [tpope](http://tpo.pe/) on [Twitter](http://twitter.com/tpope) and [GitHub](https://github.com/tpope). -License -------- +## License Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. See `:help license`. diff --git a/sources_non_forked/vim-commentary/doc/commentary.txt b/sources_non_forked/vim-commentary/doc/commentary.txt index 63dbe267..e8c81ea4 100644 --- a/sources_non_forked/vim-commentary/doc/commentary.txt +++ b/sources_non_forked/vim-commentary/doc/commentary.txt @@ -4,7 +4,7 @@ Author: Tim Pope License: Same terms as Vim itself (see |license|) Comment stuff out. Then uncomment it later. Relies on 'commentstring' to be -correctly set. +correctly set, or uses b:commentary_format if it is set. The gc mappings are preferred, while the \\ mappings are provided for backwards compatibility. @@ -25,4 +25,7 @@ gcc Comment or uncomment [count] lines. gcu Uncomment the current and adjacent commented lines. \\u +The |User| CommentaryPost autocommand fires after a successful operation and +can be used for advanced customization. + vim:tw=78:et:ft=help:norl: diff --git a/sources_non_forked/vim-commentary/plugin/commentary.vim b/sources_non_forked/vim-commentary/plugin/commentary.vim index cc6f14b2..d7272d5b 100644 --- a/sources_non_forked/vim-commentary/plugin/commentary.vim +++ b/sources_non_forked/vim-commentary/plugin/commentary.vim @@ -1,6 +1,6 @@ " commentary.vim - Comment stuff out " Maintainer: Tim Pope -" Version: 1.1 +" Version: 1.2 " GetLatestVimScripts: 3695 1 :AutoInstall: commentary.vim if exists("g:loaded_commentary") || &cp || v:version < 700 @@ -8,6 +8,12 @@ if exists("g:loaded_commentary") || &cp || v:version < 700 endif let g:loaded_commentary = 1 +function! s:surroundings() abort + return split(substitute(substitute( + \ get(b:, 'commentary_format', &commentstring) + \ ,'\S\zs%s',' %s','') ,'%s\ze\S', '%s ', ''), '%s', 1) +endfunction + function! s:go(type,...) abort if a:0 let [lnum1, lnum2] = [a:type, a:1] @@ -15,7 +21,7 @@ function! s:go(type,...) abort let [lnum1, lnum2] = [line("'["), line("']")] endif - let [l, r] = split(substitute(substitute(&commentstring,'\S\zs%s',' %s',''),'%s\ze\S','%s ',''),'%s',1) + let [l, r] = s:surroundings() let uncomment = 2 for lnum in range(lnum1,lnum2) let line = matchstr(getline(lnum),'\S.*\s\@Commentary') || maparg('gc','n') ==# '' nmap gcu CommentaryUndo endif -if maparg('\\','n') ==# '' && maparg('\','n') ==# '' +if maparg('\\','n') ==# '' && maparg('\','n') ==# '' && get(g:, 'commentary_map_backslash', 1) xmap \\ Commentary nmap \\ Commentary nmap \\\ CommentaryLine diff --git a/sources_non_forked/vim-fugitive/CONTRIBUTING.markdown b/sources_non_forked/vim-fugitive/CONTRIBUTING.markdown index 8583e1e4..e651dcae 100644 --- a/sources_non_forked/vim-fugitive/CONTRIBUTING.markdown +++ b/sources_non_forked/vim-fugitive/CONTRIBUTING.markdown @@ -3,13 +3,13 @@ and removing other plugins. The sad truth about VimScript is that it is fraught with incompatibilities waiting to happen. I'm happy to work around them where I can, but it's up to you to isolate the conflict. -If your [commit message sucks](http://stopwritingramblingcommitmessages.com/), -I'm not going to accept your pull request. I've explained very politely -dozens of times that -[my general guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) -are absolute rules on my own repositories, so I may lack the energy to explain -it to you yet another time. And please, if I ask you to change something, -`git commit --amend`. +Fugitive is particularly prone to regressions due to Git version issues, +platform issues, and interactions with other plugins. I end up bisecting a +lot more than other projects, and thus I'm especially meticulous here about +maintaining a clean, readable, history. Squash and force push any requested +changes to a pull request. And if your [commit message +sucks](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), +I'm not going to accept it. Period. Beyond that, don't be shy about asking before patching. What takes you hours might take me minutes simply because I have both domain knowledge and a diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index 8ddb28da..80020dc6 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -139,6 +139,9 @@ function! fugitive#extract_git_dir(path) abort if index(split($GIT_CEILING_DIRECTORIES, ':'), root) >= 0 break endif + if root ==# $GIT_WORK_TREE && fugitive#is_git_dir($GIT_DIR) + return $GIT_DIR + endif let dir = s:sub(root, '[\/]$', '') . '/.git' let type = getftype(dir) if type ==# 'dir' && fugitive#is_git_dir(dir) @@ -736,14 +739,16 @@ function! s:stage_info(lnum) abort endwhile if !lnum return ['', ''] - elseif getline(lnum+1) =~# '^# .*\:p')) | - \ let b:git_dir = s:temp_files[expand(':p')] | + \ let b:git_dir = s:temp_files[expand(':p')].dir | \ let b:git_type = 'temp' | + \ let b:git_args = s:temp_files[expand(':p')].args | \ call fugitive#detect(expand(':p')) | \ setlocal bufhidden=delete | \ nnoremap q :bdelete| diff --git a/sources_non_forked/vim-golang/autoload/go/complete.vim b/sources_non_forked/vim-golang/autoload/go/complete.vim new file mode 100644 index 00000000..8dd43de4 --- /dev/null +++ b/sources_non_forked/vim-golang/autoload/go/complete.vim @@ -0,0 +1,103 @@ +" Copyright 2011 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" This file provides a utility function that performs auto-completion of +" package names, for use by other commands. + +let s:goos = $GOOS +let s:goarch = $GOARCH + +if len(s:goos) == 0 + if exists('g:golang_goos') + let s:goos = g:golang_goos + elseif has('win32') || has('win64') + let s:goos = 'windows' + elseif has('macunix') + let s:goos = 'darwin' + else + let s:goos = '*' + endif +endif + +if len(s:goarch) == 0 + if exists('g:golang_goarch') + let s:goarch = g:golang_goarch + else + let s:goarch = '*' + endif +endif + +function! go#complete#PackageMembers(package, member) + silent! let content = system('godoc ' . a:package) + if v:shell_error || !len(content) + return [] + endif + let lines = filter(split(content, "\n"),"v:val !~ '^\\s\\+$'") + try + let mx1 = '^\s\+\(\S+\)\s\+=\s\+.*' + let mx2 = '^\%(const\|var\|type\|func\) \([A-Z][^ (]\+\).*' + let candidates = + \ map(filter(copy(lines), 'v:val =~ mx1'), 'substitute(v:val, mx1, "\\1", "")') + \ + map(filter(copy(lines), 'v:val =~ mx2'), 'substitute(v:val, mx2, "\\1", "")') + return filter(candidates, '!stridx(v:val, a:member)') + catch + return [] + endtry +endfunction + +function! go#complete#Package(ArgLead, CmdLine, CursorPos) + let dirs = [] + + let words = split(a:CmdLine, '\s\+', 1) + if len(words) > 2 + " Complete package members + return go#complete#PackageMembers(words[1], words[2]) + endif + + if executable('go') + let goroot = substitute(system('go env GOROOT'), '\n', '', 'g') + if v:shell_error + echomsg '\'go env GOROOT\' failed' + endif + else + let goroot = $GOROOT + endif + + if len(goroot) != 0 && isdirectory(goroot) + let dirs += [goroot] + endif + + let pathsep = ':' + if s:goos == 'windows' + let pathsep = ';' + endif + let workspaces = split($GOPATH, pathsep) + if workspaces != [] + let dirs += workspaces + endif + + if len(dirs) == 0 + " should not happen + return [] + endif + + let ret = {} + for dir in dirs + " this may expand to multiple lines + let root = split(expand(dir . '/pkg/' . s:goos . '_' . s:goarch), "\n") + call add(root, expand(dir . '/src')) + for r in root + for i in split(globpath(r, a:ArgLead.'*'), "\n") + if isdirectory(i) + let i .= '/' + elseif i !~ '\.a$' + continue + endif + let i = substitute(substitute(i[len(r)+1:], '[\\]', '/', 'g'), '\.a$', '', 'g') + let ret[i] = i + endfor + endfor + endfor + return sort(keys(ret)) +endfunction diff --git a/sources_non_forked/vim-golang/compiler/go.vim b/sources_non_forked/vim-golang/compiler/go.vim new file mode 100644 index 00000000..2c8cce49 --- /dev/null +++ b/sources_non_forked/vim-golang/compiler/go.vim @@ -0,0 +1,30 @@ +" Copyright 2013 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" compiler/go.vim: Vim compiler file for Go. + +if exists("current_compiler") + finish +endif +let current_compiler = "go" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +let s:save_cpo = &cpo +set cpo-=C + +CompilerSet makeprg=go\ build +CompilerSet errorformat= + \%-G#\ %.%#, + \%A%f:%l:%c:\ %m, + \%A%f:%l:\ %m, + \%C%*\\s%m, + \%-G%.%# + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim:ts=4:sw=4:et diff --git a/sources_non_forked/vim-golang/ftdetect/gofiletype.vim b/sources_non_forked/vim-golang/ftdetect/gofiletype.vim new file mode 100644 index 00000000..b658f6b0 --- /dev/null +++ b/sources_non_forked/vim-golang/ftdetect/gofiletype.vim @@ -0,0 +1,23 @@ +" We take care to preserve the user's fileencodings and fileformats, +" because those settings are global (not buffer local), yet we want +" to override them for loading Go files, which are defined to be UTF-8. +let s:current_fileformats = '' +let s:current_fileencodings = '' + +" define fileencodings to open as utf-8 encoding even if it's ascii. +function! s:gofiletype_pre() + let s:current_fileformats = &g:fileformats + let s:current_fileencodings = &g:fileencodings + set fileencodings=utf-8 fileformats=unix + setlocal filetype=go +endfunction + +" restore fileencodings as others +function! s:gofiletype_post() + let &g:fileformats = s:current_fileformats + let &g:fileencodings = s:current_fileencodings +endfunction + +au BufNewFile *.go setlocal filetype=go fileencoding=utf-8 fileformat=unix +au BufRead *.go call s:gofiletype_pre() +au BufReadPost *.go call s:gofiletype_post() diff --git a/sources_non_forked/vim-golang/ftplugin/go.vim b/sources_non_forked/vim-golang/ftplugin/go.vim new file mode 100644 index 00000000..8066733c --- /dev/null +++ b/sources_non_forked/vim-golang/ftplugin/go.vim @@ -0,0 +1,17 @@ +" Copyright 2013 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" go.vim: Vim filetype plugin for Go. + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setl com< cms<" + +" vim:ts=4:sw=4:et diff --git a/sources_non_forked/vim-golang/ftplugin/go/fmt.vim b/sources_non_forked/vim-golang/ftplugin/go/fmt.vim new file mode 100644 index 00000000..359545bd --- /dev/null +++ b/sources_non_forked/vim-golang/ftplugin/go/fmt.vim @@ -0,0 +1,69 @@ +" Copyright 2011 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" fmt.vim: Vim command to format Go files with gofmt. +" +" This filetype plugin add a new commands for go buffers: +" +" :Fmt +" +" Filter the current Go buffer through gofmt. +" It tries to preserve cursor position and avoids +" replacing the buffer with stderr output. +" +" Options: +" +" g:go_fmt_commands [default=1] +" +" Flag to indicate whether to enable the commands listed above. +" +" g:gofmt_command [default="gofmt"] +" +" Flag naming the gofmt executable to use. +" +if exists("b:did_ftplugin_go_fmt") + finish +endif + +if !exists("g:go_fmt_commands") + let g:go_fmt_commands = 1 +endif + +if !exists("g:gofmt_command") + let g:gofmt_command = "gofmt" +endif + +if g:go_fmt_commands + command! -buffer Fmt call s:GoFormat() +endif + +function! s:GoFormat() + let view = winsaveview() + silent execute "%!" . g:gofmt_command + if v:shell_error + let errors = [] + for line in getline(1, line('$')) + let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)') + if !empty(tokens) + call add(errors, {"filename": @%, + \"lnum": tokens[2], + \"col": tokens[3], + \"text": tokens[4]}) + endif + endfor + if empty(errors) + % | " Couldn't detect gofmt error format, output errors + endif + undo + if !empty(errors) + call setqflist(errors, 'r') + endif + echohl Error | echomsg "Gofmt returned error" | echohl None + endif + call winrestview(view) +endfunction + +let b:did_ftplugin_go_fmt = 1 + +" vim:ts=4:sw=4:et diff --git a/sources_non_forked/vim-golang/ftplugin/go/import.vim b/sources_non_forked/vim-golang/ftplugin/go/import.vim new file mode 100644 index 00000000..91c8697a --- /dev/null +++ b/sources_non_forked/vim-golang/ftplugin/go/import.vim @@ -0,0 +1,250 @@ +" Copyright 2011 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" import.vim: Vim commands to import/drop Go packages. +" +" This filetype plugin adds three new commands for go buffers: +" +" :Import {path} +" +" Import ensures that the provided package {path} is imported +" in the current Go buffer, using proper style and ordering. +" If {path} is already being imported, an error will be +" displayed and the buffer will be untouched. +" +" :ImportAs {localname} {path} +" +" Same as Import, but uses a custom local name for the package. +" +" :Drop {path} +" +" Remove the import line for the provided package {path}, if +" present in the current Go buffer. If {path} is not being +" imported, an error will be displayed and the buffer will be +" untouched. +" +" If you would like to add shortcuts, you can do so by doing the following: +" +" Import fmt +" au Filetype go nnoremap f :Import fmt +" +" Drop fmt +" au Filetype go nnoremap F :Drop fmt +" +" Import the word under your cursor +" au Filetype go nnoremap k +" \ :exe 'Import ' . expand('') +" +" The backslash '\' is the default maplocalleader, so it is possible that +" your vim is set to use a different character (:help maplocalleader). +" +" Options: +" +" g:go_import_commands [default=1] +" +" Flag to indicate whether to enable the commands listed above. +" +if exists("b:did_ftplugin_go_import") + finish +endif + +if !exists("g:go_import_commands") + let g:go_import_commands = 1 +endif + +if g:go_import_commands + command! -buffer -nargs=? -complete=customlist,go#complete#Package Drop call s:SwitchImport(0, '', ) + command! -buffer -nargs=1 -complete=customlist,go#complete#Package Import call s:SwitchImport(1, '', ) + command! -buffer -nargs=* -complete=customlist,go#complete#Package ImportAs call s:SwitchImport(1, ) +endif + +function! s:SwitchImport(enabled, localname, path) + let view = winsaveview() + let path = a:path + + " Quotes are not necessary, so remove them if provided. + if path[0] == '"' + let path = strpart(path, 1) + endif + if path[len(path)-1] == '"' + let path = strpart(path, 0, len(path) - 1) + endif + if path == '' + call s:Error('Import path not provided') + return + endif + + " Extract any site prefix (e.g. github.com/). + " If other imports with the same prefix are grouped separately, + " we will add this new import with them. + " Only up to and including the first slash is used. + let siteprefix = matchstr(path, "^[^/]*/") + + let qpath = '"' . path . '"' + if a:localname != '' + let qlocalpath = a:localname . ' ' . qpath + else + let qlocalpath = qpath + endif + let indentstr = 0 + let packageline = -1 " Position of package name statement + let appendline = -1 " Position to introduce new import + let deleteline = -1 " Position of line with existing import + let linesdelta = 0 " Lines added/removed + + " Find proper place to add/remove import. + let line = 0 + while line <= line('$') + let linestr = getline(line) + + if linestr =~# '^package\s' + let packageline = line + let appendline = line + + elseif linestr =~# '^import\s\+(' + let appendstr = qlocalpath + let indentstr = 1 + let appendline = line + let firstblank = -1 + let lastprefix = "" + while line <= line("$") + let line = line + 1 + let linestr = getline(line) + let m = matchlist(getline(line), '^\()\|\(\s\+\)\(\S*\s*\)"\(.\+\)"\)') + if empty(m) + if siteprefix == "" && a:enabled + " must be in the first group + break + endif + " record this position, but keep looking + if firstblank < 0 + let firstblank = line + endif + continue + endif + if m[1] == ')' + " if there's no match, add it to the first group + if appendline < 0 && firstblank >= 0 + let appendline = firstblank + endif + break + endif + let lastprefix = matchstr(m[4], "^[^/]*/") + if a:localname != '' && m[3] != '' + let qlocalpath = printf('%-' . (len(m[3])-1) . 's %s', a:localname, qpath) + endif + let appendstr = m[2] . qlocalpath + let indentstr = 0 + if m[4] == path + let appendline = -1 + let deleteline = line + break + elseif m[4] < path + " don't set candidate position if we have a site prefix, + " we've passed a blank line, and this doesn't share the same + " site prefix. + if siteprefix == "" || firstblank < 0 || match(m[4], "^" . siteprefix) >= 0 + let appendline = line + endif + elseif siteprefix != "" && match(m[4], "^" . siteprefix) >= 0 + " first entry of site group + let appendline = line - 1 + break + endif + endwhile + break + + elseif linestr =~# '^import ' + if appendline == packageline + let appendstr = 'import ' . qlocalpath + let appendline = line - 1 + endif + let m = matchlist(linestr, '^import\(\s\+\)\(\S*\s*\)"\(.\+\)"') + if !empty(m) + if m[3] == path + let appendline = -1 + let deleteline = line + break + endif + if m[3] < path + let appendline = line + endif + if a:localname != '' && m[2] != '' + let qlocalpath = printf("%s %" . len(m[2])-1 . "s", a:localname, qpath) + endif + let appendstr = 'import' . m[1] . qlocalpath + endif + + elseif linestr =~# '^\(var\|const\|type\|func\)\>' + break + + endif + let line = line + 1 + endwhile + + " Append or remove the package import, as requested. + if a:enabled + if deleteline != -1 + call s:Error(qpath . ' already being imported') + elseif appendline == -1 + call s:Error('No package line found') + else + if appendline == packageline + call append(appendline + 0, '') + call append(appendline + 1, 'import (') + call append(appendline + 2, ')') + let appendline += 2 + let linesdelta += 3 + let appendstr = qlocalpath + let indentstr = 1 + endif + call append(appendline, appendstr) + execute appendline + 1 + if indentstr + execute 'normal >>' + endif + let linesdelta += 1 + endif + else + if deleteline == -1 + call s:Error(qpath . ' not being imported') + else + execute deleteline . 'd' + let linesdelta -= 1 + + if getline(deleteline-1) =~# '^import\s\+(' && getline(deleteline) =~# '^)' + " Delete empty import block + let deleteline -= 1 + execute deleteline . "d" + execute deleteline . "d" + let linesdelta -= 2 + endif + + if getline(deleteline) == '' && getline(deleteline - 1) == '' + " Delete spacing for removed line too. + execute deleteline . "d" + let linesdelta -= 1 + endif + endif + endif + + " Adjust view for any changes. + let view.lnum += linesdelta + let view.topline += linesdelta + if view.topline < 0 + let view.topline = 0 + endif + + " Put buffer back where it was. + call winrestview(view) + +endfunction + +function! s:Error(s) + echohl Error | echo a:s | echohl None +endfunction + +let b:did_ftplugin_go_import = 1 + +" vim:ts=4:sw=4:et diff --git a/sources_non_forked/vim-golang/ftplugin/go/test.sh b/sources_non_forked/vim-golang/ftplugin/go/test.sh new file mode 100644 index 00000000..d8a5b895 --- /dev/null +++ b/sources_non_forked/vim-golang/ftplugin/go/test.sh @@ -0,0 +1,78 @@ +#!/bin/bash -e +# +# Copyright 2012 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +# Tests for import.vim. + +cd $(dirname $0) + +cat > base.go <&1 -n "$1: " + vim -e -s -u /dev/null -U /dev/null --noplugin -c "source import.vim" \ + -c "$1" -c 'wq! test.go' base.go + # ensure blank lines are treated correctly + if ! gofmt test.go | cmp test.go -; then + echo 2>&1 "gofmt conflict" + gofmt test.go | diff -u test.go - | sed "s/^/ /" 2>&1 + fail=1 + return + fi + if ! [[ $(cat test.go) =~ $2 ]]; then + echo 2>&1 "$2 did not match" + cat test.go | sed "s/^/ /" 2>&1 + fail=1 + return + fi + echo 2>&1 "ok" +} + +# Tests for Import + +test_one "Import baz" '"baz".*"bytes"' +test_one "Import io/ioutil" '"io".*"io/ioutil".*"net"' +test_one "Import myc" '"io".*"myc".*"net"' # prefix of a site prefix +test_one "Import nat" '"io".*"nat".*"net"' +test_one "Import net/http" '"net".*"net/http".*"mycorp/foo"' +test_one "Import zoo" '"net".*"zoo".*"mycorp/foo"' +test_one "Import mycorp/bar" '"net".*"mycorp/bar".*"mycorp/foo"' +test_one "Import mycorp/goo" '"net".*"mycorp/foo".*"mycorp/goo"' + +# Tests for Drop + +cat > base.go <&1 "FAIL" + exit 1 +fi +echo 2>&1 "PASS" diff --git a/sources_non_forked/vim-golang/indent/go.vim b/sources_non_forked/vim-golang/indent/go.vim new file mode 100644 index 00000000..faf4d79e --- /dev/null +++ b/sources_non_forked/vim-golang/indent/go.vim @@ -0,0 +1,65 @@ +" Copyright 2011 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" indent/go.vim: Vim indent file for Go. +" +" TODO: +" - function invocations split across lines +" - general line splits (line ends in an operator) + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +" C indentation is too far off useful, mainly due to Go's := operator. +" Let's just define our own. +setlocal nolisp +setlocal autoindent +setlocal indentexpr=GoIndent(v:lnum) +setlocal indentkeys+=<:>,0=},0=) + +if exists("*GoIndent") + finish +endif + +function! GoIndent(lnum) + let prevlnum = prevnonblank(a:lnum-1) + if prevlnum == 0 + " top of file + return 0 + endif + + " grab the previous and current line, stripping comments. + let prevl = substitute(getline(prevlnum), '//.*$', '', '') + let thisl = substitute(getline(a:lnum), '//.*$', '', '') + let previ = indent(prevlnum) + + let ind = previ + + if prevl =~ '[({]\s*$' + " previous line opened a block + let ind += &sw + endif + if prevl =~# '^\s*\(case .*\|default\):$' + " previous line is part of a switch statement + let ind += &sw + endif + " TODO: handle if the previous line is a label. + + if thisl =~ '^\s*[)}]' + " this line closed a block + let ind -= &sw + endif + + " Colons are tricky. + " We want to outdent if it's part of a switch ("case foo:" or "default:"). + " We ignore trying to deal with jump labels because (a) they're rare, and + " (b) they're hard to disambiguate from a composite literal key. + if thisl =~# '^\s*\(case .*\|default\):$' + let ind -= &sw + endif + + return ind +endfunction diff --git a/sources_non_forked/vim-golang/mirror.txt b/sources_non_forked/vim-golang/mirror.txt new file mode 100644 index 00000000..7fc4f60f --- /dev/null +++ b/sources_non_forked/vim-golang/mirror.txt @@ -0,0 +1,6 @@ +This is a mirror of the misc/vim portion of the official Go repository. It is +automatically updated. + +Any contributions or issues should be made to the official repository. + +http://golang.org/doc/contribute.html diff --git a/sources_non_forked/vim-golang/plugin/godoc.vim b/sources_non_forked/vim-golang/plugin/godoc.vim new file mode 100644 index 00000000..a145d313 --- /dev/null +++ b/sources_non_forked/vim-golang/plugin/godoc.vim @@ -0,0 +1,130 @@ +" Copyright 2011 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" godoc.vim: Vim command to see godoc. +" +" +" Commands: +" +" :Godoc +" +" Open the relevant Godoc for either the word[s] passed to the command or +" the, by default, the word under the cursor. +" +" Options: +" +" g:go_godoc_commands [default=1] +" +" Flag to indicate whether to enable the commands listed above. + +if exists("g:loaded_godoc") + finish +endif +let g:loaded_godoc = 1 + +let s:buf_nr = -1 +let s:last_word = '' + +if !exists('g:go_godoc_commands') + let g:go_godoc_commands = 1 +endif + +if g:go_godoc_commands + command! -nargs=* -range -complete=customlist,go#complete#Package Godoc :call s:Godoc() +endif + +nnoremap (godoc-keyword) :call Godoc('') + +function! s:GodocView() + if !bufexists(s:buf_nr) + leftabove new + file `="[Godoc]"` + let s:buf_nr = bufnr('%') + elseif bufwinnr(s:buf_nr) == -1 + leftabove split + execute s:buf_nr . 'buffer' + delete _ + elseif bufwinnr(s:buf_nr) != bufwinnr('%') + execute bufwinnr(s:buf_nr) . 'wincmd w' + endif + + setlocal filetype=godoc + setlocal bufhidden=delete + setlocal buftype=nofile + setlocal noswapfile + setlocal nobuflisted + setlocal modifiable + setlocal nocursorline + setlocal nocursorcolumn + setlocal iskeyword+=: + setlocal iskeyword-=- + + nnoremap K :Godoc + + au BufHidden call let buf_nr = -1 +endfunction + +function! s:GodocWord(word) + if !executable('godoc') + echohl WarningMsg + echo "godoc command not found." + echo " install with: go get code.google.com/p/go.tools/cmd/godoc" + echohl None + return 0 + endif + let word = a:word + silent! let content = system('godoc ' . word) + if v:shell_error || !len(content) + if len(s:last_word) + silent! let content = system('godoc ' . s:last_word.'/'.word) + if v:shell_error || !len(content) + echo 'No documentation found for "' . word . '".' + return 0 + endif + let word = s:last_word.'/'.word + else + echo 'No documentation found for "' . word . '".' + return 0 + endif + endif + let s:last_word = word + silent! call s:GodocView() + setlocal modifiable + silent! %d _ + silent! put! =content + silent! normal gg + setlocal nomodifiable + setfiletype godoc + return 1 +endfunction + +function! s:Godoc(...) + if !len(a:000) + let oldiskeyword = &iskeyword + setlocal iskeyword+=. + let word = expand('') + let &iskeyword = oldiskeyword + let word = substitute(word, '[^a-zA-Z0-9\\/._~-]', '', 'g') + let words = split(word, '\.\ze[^./]\+$') + else + let words = a:000 + endif + if !len(words) + return + endif + if s:GodocWord(words[0]) + if len(words) > 1 + if search('^\%(const\|var\|type\|\s\+\) ' . words[1] . '\s\+=\s') + return + endif + if search('^func ' . words[1] . '(') + silent! normal zt + return + endif + echo 'No documentation found for "' . words[1] . '".' + endif + endif +endfunction + +" vim:ts=4:sw=4:et diff --git a/sources_non_forked/vim-golang/readme.txt b/sources_non_forked/vim-golang/readme.txt new file mode 100644 index 00000000..b8469f92 --- /dev/null +++ b/sources_non_forked/vim-golang/readme.txt @@ -0,0 +1,101 @@ +Vim plugins for Go (http://golang.org) +====================================== + +To use all the Vim plugins, add these lines to your $HOME/.vimrc. + + " Some Linux distributions set filetype in /etc/vimrc. + " Clear filetype flags before changing runtimepath to force Vim to reload them. + filetype off + filetype plugin indent off + set runtimepath+=$GOROOT/misc/vim + filetype plugin indent on + syntax on + +If you want to select fewer plugins, use the instructions in the rest of +this file. + +A popular configuration is to gofmt Go source files when they are saved. +To do that, add this line to the end of your $HOME/.vimrc. + + autocmd FileType go autocmd BufWritePre Fmt + + +Vim syntax highlighting +----------------------- + +To install automatic syntax highlighting for GO programs: + + 1. Copy or link the filetype detection script to the ftdetect directory + underneath your vim runtime directory (normally $HOME/.vim/ftdetect) + 2. Copy or link syntax/go.vim to the syntax directory underneath your vim + runtime directory (normally $HOME/.vim/syntax). Linking this file rather + than just copying it will ensure any changes are automatically reflected + in your syntax highlighting. + 3. Add the following line to your .vimrc file (normally $HOME/.vimrc): + + syntax on + +In a typical unix environment you might accomplish this using the following +commands: + + mkdir -p $HOME/.vim/ftdetect + mkdir -p $HOME/.vim/syntax + mkdir -p $HOME/.vim/autoload/go + ln -s $GOROOT/misc/vim/ftdetect/gofiletype.vim $HOME/.vim/ftdetect/ + ln -s $GOROOT/misc/vim/syntax/go.vim $HOME/.vim/syntax + ln -s $GOROOT/misc/vim/autoload/go/complete.vim $HOME/.vim/autoload/go + echo "syntax on" >> $HOME/.vimrc + + +Vim filetype plugins +-------------------- + +To install one of the available filetype plugins: + + 1. Same as 1 above. + 2. Copy or link ftplugin/go.vim to the ftplugin directory underneath your vim + runtime directory (normally $HOME/.vim/ftplugin). Copy or link one or more + additional plugins from ftplugin/go/*.vim to the Go-specific subdirectory + in the same place ($HOME/.vim/ftplugin/go/*.vim). + 3. Add the following line to your .vimrc file (normally $HOME/.vimrc): + + filetype plugin on + + +Vim indentation plugin +---------------------- + +To install automatic indentation: + + 1. Same as 1 above. + 2. Copy or link indent/go.vim to the indent directory underneath your vim + runtime directory (normally $HOME/.vim/indent). + 3. Add the following line to your .vimrc file (normally $HOME/.vimrc): + + filetype indent on + + +Vim compiler plugin +------------------- + +To install the compiler plugin: + + 1. Same as 1 above. + 2. Copy or link compiler/go.vim to the compiler directory underneath your vim + runtime directory (normally $HOME/.vim/compiler). + 3. Activate the compiler plugin with ":compiler go". To always enable the + compiler plugin in Go source files add an autocommand to your .vimrc file + (normally $HOME/.vimrc): + + autocmd FileType go compiler go + + +Godoc plugin +------------ + +To install godoc plugin: + + 1. Same as 1 above. + 2. Copy or link plugin/godoc.vim to $HOME/.vim/plugin/godoc, + syntax/godoc.vim to $HOME/.vim/syntax/godoc.vim, + and autoload/go/complete.vim to $HOME/.vim/autoload/go/complete.vim. diff --git a/sources_non_forked/vim-golang/syntax/go.vim b/sources_non_forked/vim-golang/syntax/go.vim new file mode 100644 index 00000000..1ce6cb27 --- /dev/null +++ b/sources_non_forked/vim-golang/syntax/go.vim @@ -0,0 +1,207 @@ +" Copyright 2009 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. +" +" go.vim: Vim syntax file for Go. +" +" Options: +" There are some options for customizing the highlighting; the recommended +" settings are the default values, but you can write: +" let OPTION_NAME = 0 +" in your ~/.vimrc file to disable particular options. You can also write: +" let OPTION_NAME = 1 +" to enable particular options. At present, all options default to on. +" +" - go_highlight_array_whitespace_error +" Highlights white space after "[]". +" - go_highlight_chan_whitespace_error +" Highlights white space around the communications operator that don't follow +" the standard style. +" - go_highlight_extra_types +" Highlights commonly used library types (io.Reader, etc.). +" - go_highlight_space_tab_error +" Highlights instances of tabs following spaces. +" - go_highlight_trailing_whitespace_error +" Highlights trailing white space. + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +if !exists("go_highlight_array_whitespace_error") + let go_highlight_array_whitespace_error = 1 +endif +if !exists("go_highlight_chan_whitespace_error") + let go_highlight_chan_whitespace_error = 1 +endif +if !exists("go_highlight_extra_types") + let go_highlight_extra_types = 1 +endif +if !exists("go_highlight_space_tab_error") + let go_highlight_space_tab_error = 1 +endif +if !exists("go_highlight_trailing_whitespace_error") + let go_highlight_trailing_whitespace_error = 1 +endif + +syn case match + +syn keyword goDirective package import +syn keyword goDeclaration var const type +syn keyword goDeclType struct interface + +hi def link goDirective Statement +hi def link goDeclaration Keyword +hi def link goDeclType Keyword + +" Keywords within functions +syn keyword goStatement defer go goto return break continue fallthrough +syn keyword goConditional if else switch select +syn keyword goLabel case default +syn keyword goRepeat for range + +hi def link goStatement Statement +hi def link goConditional Conditional +hi def link goLabel Label +hi def link goRepeat Repeat + +" Predefined types +syn keyword goType chan map bool string error +syn keyword goSignedInts int int8 int16 int32 int64 rune +syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr +syn keyword goFloats float32 float64 +syn keyword goComplexes complex64 complex128 + +hi def link goType Type +hi def link goSignedInts Type +hi def link goUnsignedInts Type +hi def link goFloats Type +hi def link goComplexes Type + +" Treat func specially: it's a declaration at the start of a line, but a type +" elsewhere. Order matters here. +syn match goType /\/ +syn match goDeclaration /^func\>/ + +" Predefined functions and values +syn keyword goBuiltins append cap close complex copy delete imag len +syn keyword goBuiltins make new panic print println real recover +syn keyword goConstants iota true false nil + +hi def link goBuiltins Keyword +hi def link goConstants Keyword + +" Comments; their contents +syn keyword goTodo contained TODO FIXME XXX BUG +syn cluster goCommentGroup contains=goTodo +syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell +syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell + +hi def link goComment Comment +hi def link goTodo Todo + +" Go escapes +syn match goEscapeOctal display contained "\\[0-7]\{3}" +syn match goEscapeC display contained +\\[abfnrtv\\'"]+ +syn match goEscapeX display contained "\\x\x\{2}" +syn match goEscapeU display contained "\\u\x\{4}" +syn match goEscapeBigU display contained "\\U\x\{8}" +syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+ + +hi def link goEscapeOctal goSpecialString +hi def link goEscapeC goSpecialString +hi def link goEscapeX goSpecialString +hi def link goEscapeU goSpecialString +hi def link goEscapeBigU goSpecialString +hi def link goSpecialString Special +hi def link goEscapeError Error + +" Strings and their contents +syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError +syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup +syn region goRawString start=+`+ end=+`+ + +hi def link goString String +hi def link goRawString String + +" Characters; their contents +syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU +syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup + +hi def link goCharacter Character + +" Regions +syn region goBlock start="{" end="}" transparent fold +syn region goParen start='(' end=')' transparent + +" Integers +syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>" +syn match goHexadecimalInt "\<0x\x\+\>" +syn match goOctalInt "\<0\o\+\>" +syn match goOctalError "\<0\o*[89]\d*\>" + +hi def link goDecimalInt Integer +hi def link goHexadecimalInt Integer +hi def link goOctalInt Integer +hi def link Integer Number + +" Floating point +syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>" +syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>" +syn match goFloat "\<\d\+[Ee][-+]\d\+\>" + +hi def link goFloat Float + +" Imaginary literals +syn match goImaginary "\<\d\+i\>" +syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>" +syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>" +syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>" + +hi def link goImaginary Number + +" Spaces after "[]" +if go_highlight_array_whitespace_error != 0 + syn match goSpaceError display "\(\[\]\)\@<=\s\+" +endif + +" Spacing errors around the 'chan' keyword +if go_highlight_chan_whitespace_error != 0 + " receive-only annotation on chan type + syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@=" + " send-only annotation on chan type + syn match goSpaceError display "\(\/ + syn match goExtraType /\/ + syn match goExtraType /\/ + syn match goExtraType /\/ +endif + +" Space-tab error +if go_highlight_space_tab_error != 0 + syn match goSpaceError display " \+\t"me=e-1 +endif + +" Trailing white space error +if go_highlight_trailing_whitespace_error != 0 + syn match goSpaceError display excludenl "\s\+$" +endif + +hi def link goExtraType Type +hi def link goSpaceError Error + +" Search backwards for a global declaration to start processing the syntax. +"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/ + +" There's a bug in the implementation of grouphere. For now, use the +" following as a more expensive/less precise workaround. +syn sync minlines=500 + +let b:current_syntax = "go" diff --git a/sources_non_forked/vim-golang/syntax/godoc.vim b/sources_non_forked/vim-golang/syntax/godoc.vim new file mode 100644 index 00000000..bd4443f7 --- /dev/null +++ b/sources_non_forked/vim-golang/syntax/godoc.vim @@ -0,0 +1,20 @@ +" Copyright 2011 The Go Authors. All rights reserved. +" Use of this source code is governed by a BSD-style +" license that can be found in the LICENSE file. + +if exists("b:current_syntax") + finish +endif + +syn case match +syn match godocTitle "^\([A-Z][A-Z ]*\)$" + +command -nargs=+ HiLink hi def link + +HiLink godocTitle Title + +delcommand HiLink + +let b:current_syntax = "godoc" + +" vim:ts=4 sts=2 sw=2: diff --git a/sources_non_forked/vim-snipmate/autoload/snipMate.vim b/sources_non_forked/vim-snipmate/autoload/snipMate.vim index 42a5f82e..4e16a923 100644 --- a/sources_non_forked/vim-snipmate/autoload/snipMate.vim +++ b/sources_non_forked/vim-snipmate/autoload/snipMate.vim @@ -640,27 +640,30 @@ fun! snipMate#ScopesByFile() endf " used by both: completion and insert snippet -fun! snipMate#GetSnippetsForWordBelowCursor(word, suffix, break_on_first_match) +fun! snipMate#GetSnippetsForWordBelowCursor(word, exact) " Setup lookups: '1.2.3' becomes [1.2.3] + [3, 2.3] let parts = split(a:word, '\W\zs') if len(parts) > 2 let parts = parts[-2:] " max 2 additional items, this might become a setting endif - let lookups = [a:word.a:suffix] + let lookups = [a:word] let lookup = '' for w in reverse(parts) let lookup = w . lookup if index(lookups, lookup) == -1 - call add(lookups, lookup.a:suffix) + call add(lookups, lookup) endif endfor " allow matching '.' if a:word =~ '\.$' - call add(lookups, '.'.a:suffix) + call add(lookups, '.') endif - call filter(lookups, 'v:val != ""') + " Remove empty lookup entries, but only if there are other nonempty lookups + if len(lookups) > 1 + call filter(lookups, 'v:val != ""') + endif let matching_snippets = [] let snippet = '' @@ -668,12 +671,14 @@ fun! snipMate#GetSnippetsForWordBelowCursor(word, suffix, break_on_first_match) for word in lookups let s:c.word = word for [k,snippetD] in items(funcref#Call(s:c['get_snippets'], [snipMate#ScopesByFile(), word])) - if a:suffix == '' - " hack: require exact match - if k !=# word | continue | endif + " hack: require exact match + if a:exact && k !=# word + continue endif call add(matching_snippets, [k, snippetD]) - if a:break_on_first_match | break| endif + if a:exact + break + endif endfor endfor return matching_snippets @@ -708,7 +713,7 @@ fun! snipMate#WordBelowCursor() endf fun! snipMate#GetSnippetsForWordBelowCursorForComplete(word) - let snippets = map(snipMate#GetSnippetsForWordBelowCursor(a:word, '*', 0), 'v:val[0]') + let snippets = map(snipMate#GetSnippetsForWordBelowCursor(a:word, 0), 'v:val[0]') return filter(snippets, 'v:val =~# "\\V\\^' . escape(a:word, '"\') . '"') endf @@ -769,7 +774,7 @@ function! snipMate#TriggerSnippet(...) endif let word = matchstr(getline('.'), '\S\+\%'.col('.').'c') - let list = snipMate#GetSnippetsForWordBelowCursor(word, '', 1) + let list = snipMate#GetSnippetsForWordBelowCursor(word, 1) if empty(list) let snippet = '' else diff --git a/sources_non_forked/vim-snippets/AUTHORS b/sources_non_forked/vim-snippets/AUTHORS deleted file mode 100644 index c5c68c6a..00000000 --- a/sources_non_forked/vim-snippets/AUTHORS +++ /dev/null @@ -1,45 +0,0 @@ -Aaron Broder -Adam Folmert -Alberto Pose -Angel Alonso -Ben Orenstein -Bill Casarin -Christopher Joslyn -Daniel Hahler -Elliot Murphy -Eustaquio Rangel -Henrik Nyh -Honza Pokorny -Iuri Fernandes Queiroz -Jakub Nawalaniec -James F. Herdman -Jon Bernard -Kozo NISHIDA -Leandro Pincini -Marc Weber -Marcin Kulik -Marjan.Hratson -Micah Elliott -Michael Sanders -Naveed Massjouni -Rob Hudson -Rok Garbas -Sebastian Schulze -Srushti Ambekallu -Stephen Tudor -Steven Oliver -Stuart Colville -Tom Adams -Zied ABID -fo60213 -marutanm -msanders -Povilas Balzaravičius Pawka -Dmitry Dementev -Travis Holton -Chrisyue -Erik Westrup -Matt Deacalion Stevens - -TODO: add contributors from github.com/SirVer/Ultisnip having contributed to -github.com/SirVer/Ultisnip/UltiSnips/* files diff --git a/sources_non_forked/vim-snippets/README.md b/sources_non_forked/vim-snippets/README.md index 64733ebc..7a94766f 100644 --- a/sources_non_forked/vim-snippets/README.md +++ b/sources_non_forked/vim-snippets/README.md @@ -1,5 +1,3 @@ -IMPORTANT: comment on: [What about merging with Ultisnip using its engine](https://github.com/garbas/vim-snipmate/issues/114) - Snipmate & UltiSnip Snippets ============================ @@ -9,51 +7,48 @@ It is community-maintained and many people have contributed snippet files and other improvements already. Contents -======== +-------- - snippets/*: snippets using snipmate format - UltiSnips/*: snippets using UltiSnips format +- `snippets/*`: snippets using snipmate format +- `UltiSnips/*`: snippets using UltiSnips format Snippet engines supporting vim-snippets -======================================== +---------------------------------------- There are different forks of snippet engines which allow the user to insert snippets by typing the name of a snippet hitting the expansion mapping. - github.com/garbas/vim-snipmate: - VimL, snipmate-snippets, engine sometimes behaves strange, supports - rewriting snippets on the fly (eg adding a second version with folding - markers) +- [github.com/SirVer/ultisnips](https://github.com/SirVer/ultisnips): + python, supports all snippets in this repo. +- [github.com/garbas/vim-snipmate](https://github.com/garbas/vim-snipmate): + VimL, snipmate-snippets, engine sometimes behaves strange. Supports + snippets/* +- [github.com/Shougo/neosnippet](https://github.com/Shougo/neosnippet.vim): + VimL, supports snippets/* with some configuration. +- [github.com/drmingdrmer/xptemplate](https://github.com/drmingdrmer/xptemplate): + Totally different syntax, does not read snippets contained in this file, but + it is also very powerful. It does not support vim-snippets (just listing it + here for completness) + +There tries to be a more comprehensive list (which still is incomplete) here: +http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html - github.com/MarcWeber/UltiSnips: - python, snipmate-snippets and UltiSnips-snippets +UltiSnips has additional features such as high speed, nesting snippets, +expanding snippets in snippets and offers powerful transformations on text in +snippets (like visual selections or placeholder texts). - github.com/SirVer/ultisnips: - python, UltiSnips-snippets - - github.com/Shougo/neosnippet: - viml, has a compatible mode allowing to reuse most snipmate snippets ? - - github.com/drmingdrmer/xptemplate: - Totally different syntax, does not read snippets contained in this file, - but it is also very powerful. It does not support vim-snippets (just - listing it here for completness) - - This tries to be a more comprehensive list (which still is incomplete) - http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html - -UltiSnips engine has additional features such as "nested snippets". - -Which one to use? If you have python give MarcWeber/UltiSnips a try because its -fast and supports all important features. You can prefer the UltiSnip versions -of the snippets by setting the "always_use_first_snippet" option to 1. +Which one to use? If you have python give +[SirVer/ultisnips](https://github.com/SirVer/ultisnips) a try because its fast +and has the most features. If you have VimL only (vim without python support) your best option is using -garbas/vim-snipmate and cope with the minor bugs found in the engine. +[garbas/vim-snipmate](https://github.com/garbas/vim-snipmate) and cope with the +minor bugs found in the engine. Installation -============ +------------ + First be aware that there are many options, see "Snippet engines" above. Second be aware than there are [tons of plugin managers](http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html) which is why Marc Weber thinks that it doesn't make sense to repeat the same @@ -84,7 +79,8 @@ If you still have trouble getting this to work create a github ticket, ask on irc or the mailinglist. Policies / for contributors -=========================== +--------------------------- + Some snippets are useful for almost all languages, so let's try to have the same triggers for them: @@ -96,11 +92,7 @@ el : else .. wh : while (cond) ... ``` -If you're not satisfied with these defaults, open a ticket that we implement -aliasing. Then you can remap "else" to "el" or the like. - - -Don't add stupid placeholder default texts like +Don't add useless placeholder default texts like ``` if (${1:condition}){ ${2:some code here} @@ -127,7 +119,7 @@ Discuss at: https://github.com/honza/vim-snippets/issues/230 Related repositories -==================== +-------------------- We also encourage people to maintain sets of snippets for particular use cases so that all users can benefit from them. People can list their snippet repositories here: @@ -138,15 +130,15 @@ so that all users can benefit from them. People can list their snippet reposito Installation using VAM: "github:rbonvall/snipmate-snippets-bib" - Future - ideas - examples -========================= +------------------------- + [overview snippet engines](http://vim-wiki.mawercer.de/wiki/topic/text-snippets-skeletons-templates.html) If you have ideas you can add them to that list of "snippet engine features by example". Historical notes -================ +---------------- [vim-snipmate][1] was originally started by [Michael Sanders][2] who has now unfortunately abandoned the project. [Rok Garbas][3] is now maintaining a @@ -170,17 +162,6 @@ let g:snipMate.scope_aliases = {} let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9' ``` -or github.com/MarcWeber/UltiSnips this way: - - -```vim -let g:UltiSnips = {} - -let g:UltiSnips.snipmate_ft_filter = { - \ 'default' : {'filetypes': ["FILETYPE"] }, - \ 'ruby' : {'filetypes': ["ruby", "ruby-rails", "ruby-1.9"] }, -``` - If it happens that you work on a project requiring ruby-1.8 snippets instead, consider using vim-addon-local-vimrc and override the filetypes. @@ -192,16 +173,15 @@ ruby-library-version triplet. Sometimes postfixing a name such as will do it then if syntax has changed. + Language maintainers -------------------- No one can really be proficient in all programming languages. If you would like to maintain snippets for a language, please get in touch. -Notes: People are interested in snippets - and their interest may stop again -at will. So its ok if people maintain a language only for a short period of -time - or jump in and get things done - don't let the flow stop :) -vim-snippets is not like the "linux kernel". +Notes: People are interested in snippets - and their interest may wane again. +This list is kept up-to-date on a best effort basis. * Python - [honza](http://github.com/honza) * Javascript - [honza](http://github.com/honza) @@ -220,18 +200,13 @@ Until further work is done on `vim-snipmate`, please don't add folding markers into snippets. `vim-snipmate` has some comments about how to patch all snippets on the fly adding those. -Because MarcWeber/UltiSnips [6] supports also snipmate-snippets there is no -need to duplicate all snippets - only those snippets who use advanced UltiSnips -features should be duplicated in UltiSnips (?) +Because UltiSnips reads snipmate-snippets too there is no need to duplicate all +snippets - only those snippets who use advanced UltiSnips features should be +duplicated in UltiSnips. Currently all snippets from UltiSnips have been put into UltiSnips - some work on merging should be done (dropping duplicates etc) -Authors -------- - -For a list of authors, please see the `AUTHORS` files. - License ------- @@ -243,5 +218,4 @@ terms of the MIT license. [2]: http://github.com/msanders [3]: http://github.com/garbas [4]: http://github.com/garbas/vim-snipmate -[6]: http://github.com/MarcWeber/UltiSnips [7]: http://github.com/SirVer/ultisnips diff --git a/sources_non_forked/vim-snippets/UltiSnips/README b/sources_non_forked/vim-snippets/UltiSnips/README index eafd0866..41d85923 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/README +++ b/sources_non_forked/vim-snippets/UltiSnips/README @@ -1,4 +1,5 @@ -This directory contains the main scripts that come bundled with UltiSnips. +This directory contains the snippets for UltiSnips. +https://github.com/sirver/ultisnips Standing On The Shoulders of Giants =================================== @@ -10,12 +11,7 @@ two projects: TextMate: http://svn.textmate.org/trunk/Bundles/ SnipMate: http://code.google.com/p/snipmate/ -All snippets from those sources were copied and cleaned up, so that they are - - not using shell script, only python (so they are cross platform compatible) - - not using any feature that UltiSnips doesn't offer - -UltiSnips has seen contributions by various individuals. Those contributions -have been merged into this collection seamlessly and without further comments. +UltiSnips has seen contributions by many individuals. Those contributions have +been merged into this collection seamlessly and without further comments. -- vim:ft=rst:nospell: - diff --git a/sources_non_forked/vim-snippets/UltiSnips/all.snippets b/sources_non_forked/vim-snippets/UltiSnips/all.snippets index 8844e281..532010e7 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/all.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/all.snippets @@ -1,6 +1,11 @@ # This file contains snippets that are always defined. I personally # have snippets for signatures and often needed texts +# sligthly lower priority than everything else since specialized versions +# should overwrite. The user needs to adjust her priority in her snippets to +# ~-55 so that other filetypes will still overwrite. +priority -60 + ############## # NICE BOXES # ############## @@ -12,71 +17,62 @@ Automatically filled during usage""" _commentDict = { } def _parse_comments(s): - """ Parses vim's comments option to extract comment format """ - i = iter(s.split(",")) + """ Parses vim's comments option to extract comment format """ + i = iter(s.split(",")) - rv = [] - try: - while True: - # get the flags and text of a comment part - flags,text = i.next().split(':', 1) + rv = [] + try: + while True: + # get the flags and text of a comment part + flags, text = next(i).split(':', 1) - if len(flags) == 0: - if len(text) == 1: - rv.append((text,text,text, "")) - # parse 3-part comment, but ignore those with O flag - elif flags[0] == 's' and 'O' not in flags: - ctriple = [] - indent = "" + if len(flags) == 0: + rv.append((text, text, text, "")) + # parse 3-part comment, but ignore those with O flag + elif flags[0] == 's' and 'O' not in flags: + ctriple = [] + indent = "" - if flags[-1] in string.digits: - indent = " " * int(flags[-1]) - ctriple.append(text) + if flags[-1] in string.digits: + indent = " " * int(flags[-1]) + ctriple.append(text) - flags,text = i.next().split(':', 1) - assert(flags[0] == 'm') - ctriple.append(text) + flags,text = next(i).split(':', 1) + assert(flags[0] == 'm') + ctriple.append(text) - flags,text = i.next().split(':', 1) - assert(flags[0] == 'e') - ctriple.append(text) - ctriple.append(indent) + flags,text = next(i).split(':', 1) + assert(flags[0] == 'e') + ctriple.append(text) + ctriple.append(indent) - rv.append(ctriple) - - elif flags[0] == 'b': - if len(text) == 1: - rv.insert(0, (text,text,text, "")) - - except StopIteration: - return rv + rv.append(ctriple) + elif flags[0] == 'b': + if len(text) == 1: + rv.insert(0, (text,text,text, "")) + except StopIteration: + return rv def _get_comment_format(): - """ Returns a 4-element tuple representing the comment format for - the current file. """ - - ft = vim.eval("&filetype") - # check if the comment dict has the format for the current file - if _commentDict.has_key(ft): - return _commentDict[ft] - - # otherwise parse vim's comments and add it for later use - commentformat = _parse_comments(vim.eval("&comments"))[0] - _commentDict[ft] = commentformat - - return commentformat + """ Returns a 4-element tuple representing the comment format for + the current file. """ + return _parse_comments(vim.eval("&comments"))[0] -def make_box(twidth, bwidth = None): - if bwidth is None: - bwidth = twidth + 2 - b,m,e,i = _get_comment_format() - sline = b + m + bwidth*m + 2*m - nspaces = (bwidth - twidth)//2 - mlines = i + m + " " + " "*nspaces - mlinee = " " + " "*(bwidth-twidth-nspaces) + m - eline = i + 2*m + bwidth*m + m + e - return sline, mlines, mlinee, eline +def make_box(twidth, bwidth=None): + b, m, e, i = _get_comment_format() + bwidth_inner = bwidth - 3 - max(len(b), len(i + e)) if bwidth else twidth + 2 + sline = b + m + bwidth_inner * m[0] + 2 * m[0] + nspaces = (bwidth_inner - twidth) // 2 + mlines = i + m + " " + " " * nspaces + mlinee = " " + " "*(bwidth_inner - twidth - nspaces) + m + eline = i + m + bwidth_inner * m[0] + 2 * m[0] + e + return sline, mlines, mlinee, eline + +def foldmarker(): + "Return a tuple of (open fold marker, close fold marker)" + return vim.eval("&foldmarker").split(",") + endglobal snippet box "A nice box with the current comment symbol" b @@ -91,14 +87,29 @@ endsnippet snippet bbox "A nice box over the full width" b `!p -box = make_box(len(t[1]), 71) +width = int(vim.eval("&textwidth")) or 71 +box = make_box(len(t[1]), width) snip.rv = box[0] + '\n' + box[1] `${1:content}`!p -box = make_box(len(t[1]), 71) +box = make_box(len(t[1]), width) snip.rv = box[2] + '\n' + box[3]` $0 endsnippet +snippet fold "Insert a vim fold marker" b +`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = _get_comment_format()[2]` +endsnippet + +snippet foldc "Insert a vim fold close marker" b +`!p snip.rv = _get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = _get_comment_format()[2]` +endsnippet + +snippet foldp "Insert a vim fold marker pair" b +`!p snip.rv = _get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = _get_comment_format()[2]` +${2:${VISUAL:Content}} +`!p snip.rv = _get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = _get_comment_format()[2]` +endsnippet + ########################## # LOREM IPSUM GENERATORS # ########################## diff --git a/sources_non_forked/vim-snippets/UltiSnips/bib.snippets b/sources_non_forked/vim-snippets/UltiSnips/bib.snippets new file mode 100644 index 00000000..c9b8df5c --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/bib.snippets @@ -0,0 +1,52 @@ +priority -50 + +snippet online "Online resource" b +@online{${1:name}, + author={${2:author}}, + title={${3:title}}, + date={${4:date}}, + url={${5:url}} +} +$0 +endsnippet + +snippet article "Article reference" b +@article{${1:name}, + author={${2:author}}, + title={${3:title}}, + journaltitle={${4:journal}}, + volume={${5:NN}}, + number={${6:NN}}, + year={${7:YYYY}}, + pages={${8:NN}--${9:NN}} +} +$0 +endsnippet + +snippet book "Book reference" b +@book{${1:name}, + author={${2:author}}, + title={${3:title}}, + subtitle={${4:subtitle}}, + year={${5:YYYY}}, + location={${6:somewhere}}, + publisher={${7:publisher}}, + pages={${8:NN}--${9:NN}} +} +$0 +endsnippet + +snippet inb "In Book reference" b +@inbook{${1:name}, + author={${2:author}}, + title={${3:title}}, + subtitle={${4:subtitle}}, + booktitle={${5:book}}, + editor={${6:editor}}, + year={${7:YYYY}}, + location={${8:somewhere}}, + publisher={${9:publisher}}, + pages={${10:NN}--${11:NN}} +} +$0 +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/bindzone.snippets b/sources_non_forked/vim-snippets/UltiSnips/bindzone.snippets index 034ccdec..b8ab0dfd 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/bindzone.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/bindzone.snippets @@ -1,27 +1,29 @@ +priority -50 + global !p def newsoa(): - import datetime - now = datetime.datetime.now() - # return standard SOA formatted serial for today - return now.strftime("%Y%m%d00") + import datetime + now = datetime.datetime.now() + # return standard SOA formatted serial for today + return now.strftime("%Y%m%d00") endglobal snippet zone "Bootstrap a new Bind zonefile" b $TTL 86400 -@ IN SOA ${1:example.net}. ${2:hostmaster.$1}.( - `!p snip.rv = newsoa()`; serial - 21600; refresh every 6 hours - 3600; retry after one hour - 604800; expire after a week - 86400 ); minimum TTL of 1 day +@ IN SOA ${1:example.net}. ${2:hostmaster.$1}.( + `!p snip.rv = newsoa()`; serial + 21600; refresh every 6 hours + 3600; retry after one hour + 604800; expire after a week + 86400 ); minimum TTL of 1 day - IN NS ns01.$1. - IN MX 10 mail.$1. + IN NS ns01.$1. + IN MX 10 mail.$1. -ns01.$1 IN A -mail.$1 IN A +ns01.$1 IN A +mail.$1 IN A endsnippet snippet A "Insert A Record" b -${1:hostname} IN A ${2:ip} +${1:hostname} IN A ${2:ip} endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/c.snippets b/sources_non_forked/vim-snippets/UltiSnips/c.snippets index 062a36ae..5b8eae84 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/c.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/c.snippets @@ -2,6 +2,8 @@ # TextMate Snippets # ########################################################################### +priority -50 + snippet def "#define ..." #define ${1} endsnippet @@ -12,9 +14,9 @@ snippet ifndef "#ifndef ... #define ... #endif" #endif endsnippet -snippet #if "#if #endif" !b +snippet #if "#if #endif" b #if ${1:0} -${VISUAL:code}$0 +${VISUAL}${0:${VISUAL/(.*)/(?1::code)/}} #endif endsnippet @@ -36,17 +38,24 @@ $0 endsnippet snippet main "main() (main)" -int main(int argc, char const *argv[]) +int main(int argc, char *argv[]) { - ${0:/* code */} + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} return 0; } endsnippet -snippet for "for int loop (fori)" -for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) +snippet for "for loop (for)" +for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) { - ${0:/* code */} + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} +} +endsnippet + +snippet fori "for int loop (fori)" +for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) +{ + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} } endsnippet @@ -62,7 +71,7 @@ if not snip.c: rand = ''.join(random.sample(string.ascii_letters+string.digits, 8)) snip.rv = ('%s_%s' % (name,rand)).upper() else: - snip.rv = snip.c`} + snip.rv = snip.c`} #define $1 ${0} @@ -75,9 +84,15 @@ snippet td "Typedef" typedef ${1:int} ${2:MyCustomType}; endsnippet +snippet wh "while loop" +while(${1:/* condition */}) { + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} +} +endsnippet + snippet do "do...while loop (do)" do { - ${0:/* code */} + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} } while(${1:/* condition */}); endsnippet @@ -88,18 +103,30 @@ endsnippet snippet if "if .. (if)" if (${1:/* condition */}) { - ${0:/* code */} + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} +} +endsnippet + +snippet el "else .. (else)" +else { + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} +} +endsnippet + +snippet eli "else if .. (eli)" +else if (${1:/* condition */}) { + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} } endsnippet snippet ife "if .. else (ife)" if (${1:/* condition */}) { - ${2:/* code */} + ${2:/* code */} } else { - ${3:/* else */} + ${3:/* else */} } endsnippet @@ -114,4 +141,15 @@ struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} }; endsnippet +snippet fun "function" b +${1:void} ${2:function_name}(${3}) +{ + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} +} +endsnippet + +snippet fund "function declaration" b +${1:void} ${2:function_name}(${3}); +endsnippet + # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/coffee.snippets b/sources_non_forked/vim-snippets/UltiSnips/coffee.snippets index 68d40349..467b2b57 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/coffee.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/coffee.snippets @@ -1,5 +1,4 @@ -# From the TextMate bundle -# with some modification +priority -50 snippet fun "Function" b ${1:name} = `!p snip.rv = "(" if t[2] else ""`${2:args}`!p snip.rv = ") " if t[2] else ""`-> @@ -10,52 +9,52 @@ snippet bfun "Function (bound)" i `!p snip.rv = "(" if t[1] else ""`${1:args}`!p snip.rv = ") " if t[1] else ""`=>`!p snip.rv = " " if t[2] and not t[2].startswith("\n") else ""`${2:expr} endsnippet -snippet if "If" +snippet if "If" b if ${1:condition} ${0:# body...} endsnippet -snippet ife "If .. Else" +snippet ife "If .. Else" b if ${1:condition} ${2:# body...} else ${3:# body...} endsnippet -snippet eif "Else if" b +snippet elif "Else if" b else if ${1:condition} ${0:# body...} endsnippet -snippet ifte "Ternary if" +snippet ifte "Ternary if" b if ${1:condition} then ${2:value} else ${3:other} endsnippet -snippet unl "Unless" +snippet unl "Unless" b ${1:action} unless ${2:condition} endsnippet -snippet fora "Array Comprehension" +snippet fora "Array Comprehension" b for ${1:name} in ${2:array} ${0:# body...} endsnippet -snippet foro "Object Comprehension" +snippet foro "Object Comprehension" b for ${1:key}, ${2:value} of ${3:Object} ${0:# body...} endsnippet -snippet forr "Range Comprehension (inclusive)" +snippet forr "Range Comprehension (inclusive)" b for ${1:name} in [${2:start}..${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step} ${0:# body...} endsnippet -snippet forrex "Range Comprehension (exclusive)" +snippet forrex "Range Comprehension (exclusive)" b for ${1:name} in [${2:start}...${3:finish}]`!p snip.rv = " by " if t[4] else ""`${4:step} ${0:# body...} endsnippet -snippet swi "Switch" +snippet swi "Switch" b switch ${1:object} when ${2:value} ${3:# body...} @@ -63,7 +62,7 @@ switch ${1:object} $0 endsnippet -snippet swit "Switch when .. then" +snippet swit "Switch when .. then" b switch ${1:object} when ${2:condition}`!p snip.rv = " then " if t[3] else ""`${3:value} else`!p snip.rv = " " if t[4] and not t[4].startswith("\n") else ""`${4:value} @@ -77,7 +76,7 @@ class ${1:ClassName}`!p snip.rv = " extends " if t[2] else ""`${2:Ancestor} $0 endsnippet -snippet try "Try .. Catch" +snippet try "Try .. Catch" b try $1 catch ${2:error} @@ -95,4 +94,3 @@ endsnippet snippet log "Log" b console.log ${1:"${2:msg}"} endsnippet - diff --git a/sources_non_forked/vim-snippets/UltiSnips/coffee_jasmine.snippets b/sources_non_forked/vim-snippets/UltiSnips/coffee_jasmine.snippets index 47d1e6b5..0dd35cd6 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/coffee_jasmine.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/coffee_jasmine.snippets @@ -2,8 +2,12 @@ # CoffeeScript versions -- adapted from the JS TextMate bundle + additions # for some jasmine-jquery matchers # +priority -50 + extends coffee +priority -49 + snippet des "Describe (coffee)" b describe '${1:description}', -> $0 @@ -160,4 +164,3 @@ endsnippet snippet noscw "expect was not called with (coffee)" b expect(${1:target}).wasNotCalledWith(${2:arguments}) endsnippet - diff --git a/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets b/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets index 6999c1f9..3d79a64e 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets @@ -1,3 +1,10 @@ +priority -50 + +extends c + +# We want to overwrite everything in parent ft. +priority -49 + ########################################################################### # TextMate Snippets # ########################################################################### @@ -20,7 +27,7 @@ endsnippet snippet ns "namespace .. (namespace)" namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`} { - $0 + ${VISUAL}${0:${VISUAL/(.*)/(?1::\/* code *\/)/}} }${1/.+/ \/* /m}$1${1/.+/ *\/ /m} endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/cs.snippets b/sources_non_forked/vim-snippets/UltiSnips/cs.snippets new file mode 100644 index 00000000..aca245e5 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/cs.snippets @@ -0,0 +1,328 @@ +####################################################################### +# C# Snippets for UltiSnips # +####################################################################### + +priority -50 + +######################### +# classes and structs # +######################### + +snippet namespace "namespace" b +namespace ${1:MyNamespace} +{ + ${VISUAL}$0 +} +endsnippet + +snippet class "class" w +class ${1:MyClass} +{ + $0 +} +endsnippet + +snippet struct "struct" w +struct ${1:MyStruct} +{ + $0 +} +endsnippet + +snippet interface "interface" w +interface I${1:Interface} +{ + $0 +} +endsnippet + +snippet enum "enumeration" b +enum ${1:MyEnum} { ${2:Item} }; +endsnippet + + +############ +# Main() # +############ + +snippet sim "static int main" b +static int Main(string[] args) +{ + $0 +} +endsnippet + +snippet svm "static void main" b +static void Main(string[] args) +{ + $0 +} +endsnippet + + +################ +# properties # +################ + +snippet prop "Simple property declaration" b +public ${1:int} ${2:MyProperty} { get; set; } +endsnippet + +snippet propfull "Full property declaration" b +private ${1:int} ${2:_myProperty}; + +public $1 ${3:MyProperty} +{ + get { return $2; } + set { $2 = value; } +} +endsnippet + +snippet propg "Property with a private setter" b +public ${1:int} ${2:MyProperty} { get; private set; } +endsnippet + + +############ +# blocks # +############ + +snippet #if "#if #endif" b +#if ${1:DEBUG} +${VISUAL}$0 +#endif +endsnippet + +snippet #region "#region #endregion" b +#region ${1:Region} +${VISUAL}$0 +#endregion +endsnippet + + +########### +# loops # +########### + +snippet for "for loop" b +for (int ${1:i} = 0; $1 < ${2:10}; $1++) +{ + ${VISUAL}$0 +} +endsnippet + +snippet forr "for loop (reverse)" b +for (int ${1:i} = ${2:10}; $1 >= 0; $1--) +{ + ${VISUAL}$0 +} +endsnippet + +snippet foreach "foreach loop" b +foreach (${3:var} ${2:item} in ${1:items}) +{ + ${VISUAL}$0 +} +endsnippet + +snippet while "while loop" b +while (${1:true}) +{ + ${VISUAL}$0 +} +endsnippet + +snippet do "do loop" b +do +{ + ${VISUAL}$0 +} while (${1:true}); +endsnippet + + +############### +# branching # +############### + +snippet if "if statement" b +if ($1) +{ + ${VISUAL}$0 +} +endsnippet + +snippet ife "if else statement" b +if ($1) +{ + ${VISUAL}$0 +} +else +{ +} +endsnippet + +snippet elif "else if" b +else if ($1) +{ + $0 +} +endsnippet + +snippet elseif "else if" b +else if ($1) +{ + $0 +} +endsnippet + +snippet ifnn "if not null" b +if ($1 != null) +{ + ${VISUAL}$0 +} +endsnippet + +snippet switch "switch statement" b +switch (${1:statement}) +{ + case ${2:value}: + break; + + default: + $0break; +} +endsnippet + +snippet case "case" b +case ${1:value}: + $2 + break; +endsnippet + + +############## +# wrappers # +############## + +snippet using "using statement" b +using (${1:resource}) +{ + ${VISUAL}$0 +} +endsnippet + +snippet unchecked "unchecked block" b +unchecked +{ + ${VISUAL}$0 +} +endsnippet + +snippet checked "checked block" b +checked +{ + ${VISUAL}$0 +} +endsnippet + +snippet unsafe "unsafe" b +unsafe +{ + ${VISUAL}$0 +} +endsnippet + + +######################## +# exception handling # +######################## + +snippet try "try catch block" b +try +{ + ${VISUAL}$0 +} +catch (${1:Exception} ${2:e}) +{ + throw; +} +endsnippet + +snippet tryf "try finally block" b +try +{ + ${VISUAL}$0 +} +finally +{ +} +endsnippet + +snippet throw "throw" +throw new ${1}Exception("${2}"); +endsnippet + + +########## +# LINQ # +########## + +snippet from "LINQ syntax" b +var ${1:seq} = + from ${2:item1} in ${3:items1} + join ${4:item2} in ${5:items2} on $2.${6:prop1} equals $4.${7:prop2} + select ${8:$2.prop3} + where ${9:clause} +endsnippet + + +############################ +# feedback and debugging # +############################ + +snippet da "Debug.Assert" b +Debug.Assert(${1:true}); +endsnippet + +snippet cw "Console.WriteLine" b +Console.WriteLine("$1"); +endsnippet + +# as you first type comma-separated parameters on the right, {n} values appear in the format string +snippet cwp "Console.WriteLine with parameters" b +Console.WriteLine("${2:`!p +snip.rv = ' '.join(['{' + str(i) + '}' for i in range(t[1].count(','))]) +`}"${1:, something}); +endsnippet + +snippet mbox "Message box" b +MessageBox.Show("${1:message}"); +endsnippet + + +################## +# full methods # +################## + +snippet equals "Equals method" b +public override bool Equals(object obj) +{ + if (obj == null || GetType() != obj.GetType()) + { + return false; + } + $0 + return base.Equals(obj); +} +endsnippet + + +############## +# comments # +############## + +snippet /// "XML comment" b +/// +/// $1 +/// +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/css.snippets b/sources_non_forked/vim-snippets/UltiSnips/css.snippets index d14d51c0..32c3f217 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/css.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/css.snippets @@ -2,6 +2,8 @@ # Most of these came from TextMate # ########################################################################### +priority -50 + snippet ! "!important CSS (!)" ${1:!important} endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/d.snippets b/sources_non_forked/vim-snippets/UltiSnips/d.snippets index 7f38c6d8..99da292e 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/d.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/d.snippets @@ -1,5 +1,7 @@ # Simple shortcuts +priority -50 + snippet imp "import (imp)" b import ${1:std.stdio}; endsnippet @@ -42,22 +44,22 @@ endsnippet snippet pub "public (pub)" b public: - ${1:/*members*/} + ${1:/*members*/} endsnippet snippet priv "private (priv)" b private: - ${1:/*members*/} + ${1:/*members*/} endsnippet snippet prot "protected (prot)" b protected: - ${1:/*members*/} + ${1:/*members*/} endsnippet snippet pack "package (pack)" b package: - ${1:/*members*/} + ${1:/*members*/} endsnippet snippet ret "return (ret)" @@ -96,7 +98,7 @@ endsnippet snippet enf "enforce (enf)" b enforce(${1:/*condition*/}, - new ${2}Exception(${3:/*args*/})); + new ${2}Exception(${3:/*args*/})); endsnippet # Branches @@ -104,67 +106,67 @@ endsnippet snippet if "if .. (if)" if(${1:/*condition*/}) { - ${VISUAL}${0:/*code*/} + ${VISUAL}${0:/*code*/} } endsnippet snippet ife "if .. else (ife)" b if(${1:/*condition*/}) { - ${2:/*code*/} + ${2:/*code*/} } else { - ${3:/*else*/} + ${3:/*else*/} } endsnippet snippet el "else (el)" b else { - ${VISUAL}${1:/*code*/} + ${VISUAL}${1:/*code*/} } endsnippet -snippet eif "else if (elif)" b +snippet elif "else if (elif)" b else if(${1:/*condition*/}) { - ${VISUAL}${0:/*code*/} + ${VISUAL}${0:/*code*/} } endsnippet snippet sw "switch (sw)" switch(${1:/*var*/}) { - case ${2:/*value*/}: - ${3:/*code*/} - break; - case ${4:/*value*/}: - ${5:/*code*/} - break; - ${7:/*more cases*/} - default: - ${6:assert(false);} + case ${2:/*value*/}: + ${3:/*code*/} + break; + case ${4:/*value*/}: + ${5:/*code*/} + break; + ${7:/*more cases*/} + default: + ${6:assert(false);} } endsnippet snippet fsw "final switch (fsw)" switch(${1:/*var*/}) { - case ${2:/*value*/}: - ${3:/*code*/} - break; - case ${4:/*value*/}: - ${5:/*code*/} - break; - ${7:/*more cases*/} + case ${2:/*value*/}: + ${3:/*code*/} + break; + case ${4:/*value*/}: + ${5:/*code*/} + break; + ${7:/*more cases*/} } endsnippet snippet case "case (case)" b case ${1:/*value*/}: - ${2:/*code*/} - break; + ${2:/*code*/} + break; endsnippet snippet ?: "ternary operator (?:)" @@ -176,42 +178,42 @@ endsnippet snippet do "do while (do)" b do { - ${VISUAL}${2:/*code*/} + ${VISUAL}${2:/*code*/} } while(${1:/*condition*/}); endsnippet snippet wh "while (wh)" b while(${1:/*condition*/}) { - ${VISUAL}${2:/*code*/} + ${VISUAL}${2:/*code*/} } endsnippet snippet for "for (for)" b for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) { - ${VISUAL}${0:/*code*/} + ${VISUAL}${0:/*code*/} } endsnippet snippet forever "forever (forever)" b for(;;) { - ${VISUAL}${0:/*code*/} + ${VISUAL}${0:/*code*/} } endsnippet snippet fore "foreach (fore)" foreach(${1:/*elem*/}; ${2:/*range*/}) { - ${VISUAL}${3:/*code*/} + ${VISUAL}${3:/*code*/} } endsnippet snippet forif "foreach if (forif)" b foreach(${1:/*elem*/}; ${2:/*range*/}) if(${3:/*condition*/}) { - ${VISUAL}${4:/*code*/} + ${VISUAL}${4:/*code*/} } endsnippet @@ -219,8 +221,8 @@ endsnippet snippet in "in contract (in)" b in { - assert(${1:/*condition*/}, "${2:error message}"); - ${3} + assert(${1:/*condition*/}, "${2:error message}"); + ${3} } body endsnippet @@ -228,8 +230,8 @@ endsnippet snippet out "out contract (out)" b out${1:(result)} { - assert(${2:/*condition*/}, "${3:error message}"); - ${4} + assert(${2:/*condition*/}, "${3:error message}"); + ${4} } body endsnippet @@ -237,8 +239,8 @@ endsnippet snippet inv "invariant (inv)" b invariant() { - assert(${1:/*condition*/}, "${2:error message}"); - ${3} + assert(${1:/*condition*/}, "${2:error message}"); + ${3} } endsnippet @@ -247,29 +249,29 @@ endsnippet snippet fun "function definition (fun)" ${1:void} ${2:/*function name*/}(${3:/*args*/}) ${4:@safe pure nothrow} { - ${VISUAL}${5:/*code*/} + ${VISUAL}${5:/*code*/} } endsnippet snippet void "void function definition (void)" void ${1:/*function name*/}(${2:/*args*/}) ${3:@safe pure nothrow} { - ${VISUAL}${4:/*code*/} + ${VISUAL}${4:/*code*/} } endsnippet snippet this "ctor (this)" w this(${1:/*args*/}) { - ${VISUAL}${2:/*code*/} + ${VISUAL}${2:/*code*/} } endsnippet -snippet get "getter property (get)" ! +snippet get "getter property (get)" @property ${1:/*type*/} ${2:/*member_name*/}() const pure nothrow {return ${3:$2_};} endsnippet -snippet set "setter property (set)" ! +snippet set "setter property (set)" @property void ${1:/*member_name*/}(${2:/*type*/} rhs) pure nothrow {${3:$1_} = rhs;} endsnippet @@ -278,7 +280,7 @@ endsnippet snippet main "Main" b void main(string[] args) { - ${VISUAL}${0: /*code*/} + ${VISUAL}${0: /*code*/} } endsnippet @@ -293,7 +295,7 @@ endsnippet snippet scope "scope (scope)" b scope(${1:exit}) { - ${VISUAL}${2:/*code*/} + ${VISUAL}${2:/*code*/} } endsnippet @@ -302,7 +304,7 @@ endsnippet snippet with "with (with)" with(${1}) { - ${VISUAL}${2:/*code*/} + ${VISUAL}${2:/*code*/} } endsnippet @@ -311,33 +313,33 @@ endsnippet snippet try "try/catch (try)" b try { - ${VISUAL}${1:/*code to try*/} + ${VISUAL}${1:/*code to try*/} } catch(${2}Exception e) { - ${3:/*handle exception*/} + ${3:/*handle exception*/} } endsnippet snippet tryf "try/catch/finally (tryf)" b try { - ${VISUAL}${1:/*code to try*/} + ${VISUAL}${1:/*code to try*/} } catch(${2}Exception e) { - ${3:/*handle exception*/} + ${3:/*handle exception*/} } finally { - ${4:/*cleanup*/} + ${4:/*cleanup*/} } endsnippet snippet catch "catch (catch)" b catch(${1}Exception e) { - ${2:/*handle exception*/} + ${2:/*handle exception*/} } endsnippet @@ -351,35 +353,35 @@ endsnippet snippet struct "struct (struct)" struct ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + ${2} } endsnippet snippet union "union (union)" union ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + ${2} } endsnippet snippet class "class (class)" class ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + ${2} } endsnippet snippet inter "interface (inter)" interface ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + ${2} } endsnippet snippet enum "enum (enum)" enum ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + ${2} } endsnippet @@ -388,12 +390,12 @@ endsnippet snippet exc "exception declaration (exc)" b /// ${3:/*documentation*/} -class ${1}Exception : ${2}Exception +class ${1}Exception : ${2}Exception { - public this(string msg, string file = __FILE__, int line = __LINE__) - { - super(msg, file, line); - } + public this(string msg, string file = __FILE__, int line = __LINE__) + { + super(msg, file, line); + } } endsnippet @@ -403,14 +405,14 @@ endsnippet snippet version "version (version)" b version(${1:/*version name*/}) { - ${VISUAL}${2:/*code*/} + ${VISUAL}${2:/*code*/} } endsnippet snippet debug "debug" b debug { - ${VISUAL}${1:/*code*/} + ${VISUAL}${1:/*code*/} } endsnippet @@ -420,7 +422,7 @@ endsnippet snippet temp "template (temp)" b template ${2:/*name*/}(${1:/*args*/}) { - ${3:/*code*/} + ${3:/*code*/} } endsnippet @@ -438,7 +440,7 @@ endsnippet snippet unittest "unittest (unittest)" b unittest { - ${1:/*code*/} + ${1:/*code*/} } endsnippet @@ -448,41 +450,41 @@ endsnippet snippet opDis "opDispatch (opDis)" b ${1:/*return type*/} opDispatch(string s)() { - ${2:/*code*/}; + ${2:/*code*/}; } endsnippet snippet op= "opAssign (op=)" b void opAssign(${1} rhs) ${2:@safe pure nothrow} { - ${2:/*code*/} + ${2:/*code*/} } endsnippet snippet opCmp "opCmp (opCmp)" b int opCmp(${1} rhs) @safe const pure nothrow { - ${2:/*code*/} + ${2:/*code*/} } endsnippet snippet opApply "opApply (opApply)" b int opApply(int delegate(ref ${1:/*iterated type/s*/}) dg) { - int result = 0; - ${2:/*loop*/} - { - result = dg(${3:/*arg/s*/}); - if(result){break;} - } - return result; + int result = 0; + ${2:/*loop*/} + { + result = dg(${3:/*arg/s*/}); + if(result){break;} + } + return result; } endsnippet snippet toString "toString (toString)" b string toString() @safe const pure nothrow { - ${1:/*code*/} + ${1:/*code*/} } endsnippet @@ -490,12 +492,11 @@ endsnippet # Comments -snippet todo "TODO (todo)" ! +snippet todo "TODO (todo)" // TODO: ${1} endsnippet - # DDoc snippet doc "generic ddoc block (doc)" b @@ -508,7 +509,7 @@ snippet fdoc "function ddoc block (fdoc)" b /// ${1:description} /// /// ${2:Params: ${3:param} = ${4:param description} -/// ${5}} +/// ${5}} /// /// ${6:Returns: ${7:return value}} /// @@ -517,7 +518,7 @@ endsnippet snippet Par "Params (Par)" Params: ${1:param} = ${2:param description} -/// ${3} +/// ${3} endsnippet snippet Ret "Returns (Ret)" @@ -543,16 +544,16 @@ snippet gpl "GPL (gpl)" b // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 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, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// // Copyright (C) ${1:Author}, `!v strftime("%Y")` ${2} diff --git a/sources_non_forked/vim-snippets/UltiSnips/django.snippets b/sources_non_forked/vim-snippets/UltiSnips/django.snippets index 553babab..9d6ce279 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/django.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/django.snippets @@ -1,3 +1,5 @@ +priority -50 + # Generic Tags snippet % {% ${1} %}${2} @@ -5,7 +7,7 @@ endsnippet snippet %% {% ${1:tag_name} %} - ${2} + ${2} {% end$1 %} endsnippet @@ -17,14 +19,14 @@ endsnippet snippet autoescape {% autoescape ${1:off} %} - ${2} + ${2} {% endautoescape %} endsnippet snippet block {% block ${1} %} - ${2} -{% endblock %} + ${2} +{% endblock $1 %} endsnippet snippet # @@ -33,7 +35,7 @@ endsnippet snippet comment {% comment %} - ${1} + ${1} {% endcomment %} endsnippet @@ -51,7 +53,7 @@ endsnippet snippet filter {% filter ${1} %} - ${2} + ${2} {% endfilter %} endsnippet @@ -61,24 +63,24 @@ endsnippet snippet for {% for ${1} in ${2} %} - ${3} + ${3} {% endfor %} endsnippet snippet empty {% empty %} - ${1} + ${1} endsnippet snippet if {% if ${1} %} - ${2} + ${2} {% endif %} endsnippet -snippet el +snippet else {% else %} - ${1} + ${1} endsnippet snippet ifchanged @@ -87,13 +89,13 @@ endsnippet snippet ifequal {% ifequal ${1} ${2} %} - ${3} + ${3} {% endifequal %} endsnippet snippet ifnotequal {% ifnotequal ${1} ${2} %} - ${3} + ${3} {% endifnotequal %} endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/elixir.snippets b/sources_non_forked/vim-snippets/UltiSnips/elixir.snippets index ae7ea201..1f53edfb 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/elixir.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/elixir.snippets @@ -1,4 +1,4 @@ -# Credit: @iurifg +priority -50 snippet do do diff --git a/sources_non_forked/vim-snippets/UltiSnips/erlang.snippets b/sources_non_forked/vim-snippets/UltiSnips/erlang.snippets index 78231626..e27fbefa 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/erlang.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/erlang.snippets @@ -2,6 +2,8 @@ # TEXTMATE SNIPPETS # ########################################################################### +priority -50 + snippet pat "Case:Receive:Try Clause" ${1:pattern}${2: when ${3:guard}} ->; ${4:body} diff --git a/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets b/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets index cd462fb2..118cdfec 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets @@ -1,3 +1,5 @@ +priority -50 + # TextMate added these variables to cope with changes in ERB handling # in different versions of Rails -- for instance, Rails 3 automatically # strips whitespace so that it's no longer necessary to use a form like @@ -11,16 +13,15 @@ # global !p def textmate_var(var, snip): - lookup = dict( - TM_RAILS_TEMPLATE_START_RUBY_EXPR = snip.opt('g:tm_rails_template_start_ruby_expr', '<%= '), - TM_RAILS_TEMPLATE_END_RUBY_EXPR = snip.opt('g:tm_rails_template_end_ruby_expr', ' %>'), - TM_RAILS_TEMPLATE_START_RUBY_INLINE = snip.opt('g:tm_rails_template_start_ruby_inline', '<% '), - TM_RAILS_TEMPLATE_END_RUBY_INLINE = snip.opt('g:tm_rails_template_end_ruby_inline', ' %>'), - TM_RAILS_TEMPLATE_END_RUBY_BLOCK = '<% end %>' - ) - - snip.rv = lookup[var] - return + lookup = dict( + TM_RAILS_TEMPLATE_START_RUBY_EXPR = snip.opt('g:tm_rails_template_start_ruby_expr', '<%= '), + TM_RAILS_TEMPLATE_END_RUBY_EXPR = snip.opt('g:tm_rails_template_end_ruby_expr', ' %>'), + TM_RAILS_TEMPLATE_START_RUBY_INLINE = snip.opt('g:tm_rails_template_start_ruby_inline', '<% '), + TM_RAILS_TEMPLATE_END_RUBY_INLINE = snip.opt('g:tm_rails_template_end_ruby_inline', ' %>'), + TM_RAILS_TEMPLATE_END_RUBY_BLOCK = '<% end %>' + ) + snip.rv = lookup[var] + return endglobal @@ -42,7 +43,7 @@ endsnippet snippet ft "form_tag" `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_tag(${1::action => "${5:update}"}${6:, {:${8:class} => "${9:form}"\}}) do`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` - $0 + $0 `!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` endsnippet @@ -52,11 +53,11 @@ endsnippet snippet for "for loop (ERB)" <% if !${1:list}.blank? %> - <% for ${2:item} in ${1} %> - $3 - <% end %> + <% for ${2:item} in ${1} %> + $3 + <% end %> <% else %> - $4 + $4 <% end %> endsnippet @@ -74,7 +75,7 @@ snippet ffhf "form_for hidden_field 2" endsnippet snippet ffl "form_for label 2" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute', snip)`${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet ffpf "form_for password_field 2" @@ -99,7 +100,7 @@ endsnippet snippet fields "fields_for" `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`fields_for :${1:model}, @${2:$1} do |$1|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 + $0 `!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` endsnippet @@ -122,7 +123,7 @@ snippet f. "f.hidden_field" endsnippet snippet f. "f.label" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.label :${1:attribute', snip)`${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`f.label :${1:attribute}${2:, "${3:${1/[[:alpha:]]+|(_)/(?1: :\u$0)/g}}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet f. "f.password_field" @@ -148,14 +149,14 @@ endsnippet snippet ffe "form_for with errors" `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`error_messages_for :${1:model}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_for @${2:$1} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`form_for @${2:$1} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` + $0 `!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` endsnippet snippet ff "form_for" -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`form_for @${1:model} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` - $0 +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`form_for @${1:model} do |f|`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` + $0 `!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_BLOCK', snip)` endsnippet @@ -271,9 +272,9 @@ snippet st "submit_tag" `!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`submit_tag "${1:Save changes}"${2:, :id => "${3:submit}"}${4:, :name => "${5:$3}"}${6:, :class => "${7:form_$3}"}${8:, :disabled => ${9:false}}${10:, :disable_with => "${11:Please wait...}"}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet -snippet el "else (ERB)" +snippet else "else (ERB)" <% else %> - + $0 endsnippet snippet if "if (ERB)" diff --git a/sources_non_forked/vim-snippets/UltiSnips/go.snippets b/sources_non_forked/vim-snippets/UltiSnips/go.snippets index ea46931b..d01e3f1c 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/go.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/go.snippets @@ -1,5 +1,7 @@ # Snippets for Go +priority -50 + # when to abbriviate and when not? # b doesn't work here, because it ignores whitespace # optional local name? @@ -31,37 +33,55 @@ const ( ) endsnippet +snippet struct "Struct declaration" b +type ${1:Struct} struct { + ${0:${VISUAL}} +} +endsnippet + +snippet interface "Interface declaration" b +type ${1:Interface} interface { + ${0:${VISUAL}} +} +endsnippet + # statements -snippet for "For loop" !b +snippet for "For loop" b for ${1:condition}${1/(.+)/ /}{ ${0:${VISUAL}} } endsnippet -snippet forr "For range loop" !b +snippet forr "For range loop" b for ${2:name} := range ${1:collection} { ${0:${VISUAL}} } endsnippet -snippet if "If statement" !b +snippet if "If statement" b if ${1:condition}${1/(.+)/ /}{ ${0:${VISUAL}} } endsnippet -snippet switch "Switch statement" !b +snippet switch "Switch statement" b switch ${1:expression}${1/(.+)/ /}{ case${0} } endsnippet -snippet case "Case clause" !b +snippet select "Select statement" b +select { +case${0} +} +endsnippet + +snippet case "Case clause" b case ${1:condition}: ${0:${VISUAL}} endsnippet -snippet default "Default clause" !b +snippet default "Default clause" b default: ${0:${VISUAL}} endsnippet @@ -86,22 +106,26 @@ func ${1:name}(${2:params})${3/(.+)/ /}${3:type} { endsnippet # types and variables -snippet map "Map type" !b +snippet map "Map type" b map[${1:keytype}]${2:valtype} endsnippet -snippet : "Variable declaration :=" !b +snippet : "Variable declaration :=" b ${1:name} := ${0:value} endsnippet -snippet var "Variable declaration" !b +snippet var "Variable declaration" b var ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value}} endsnippet -snippet vars "Variables declaration" !b +snippet vars "Variables declaration" b var ( ${1:name}${2/(.+)/ /}${2:type}${3: = ${0:value} } ) endsnippet +snippet json "JSON field" +\`json:"${1:displayName}"\` +endsnippet + # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/haskell.snippets b/sources_non_forked/vim-snippets/UltiSnips/haskell.snippets index 99f947f8..ad217fd8 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/haskell.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/haskell.snippets @@ -1,13 +1,15 @@ -snippet ife "if ... then ... else ..." +priority -50 + +snippet if "if ... then ... else ..." if ${1:condition} - then ${2:expression} - else ${3:expression} + then ${2:expression} + else ${3:expression} endsnippet snippet case "case ... of ..." -case ${1} of - ${2} -> ${3} - ${4} -> ${5} +case ${1:expression} of + ${2:pattern} -> ${3:expression} + ${4:pattern} -> ${5:expression} endsnippet snippet :: "Type signature" diff --git a/sources_non_forked/vim-snippets/UltiSnips/help.snippets b/sources_non_forked/vim-snippets/UltiSnips/help.snippets index bd0bb12f..61327385 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/help.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/help.snippets @@ -1,10 +1,12 @@ # Snippets for VIM Help Files +priority -50 + global !p def sec_title(snip, t): - file_start = snip.fn.split('.')[0] - sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-') - return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1])) + file_start = snip.fn.split('.')[0] + sec_name = t[1].strip("1234567890. ").lower().replace(' ', '-') + return ("*%s-%s*" % (file_start, sec_name)).rjust(78-len(t[1])) endglobal snippet sec "Section marker" b diff --git a/sources_non_forked/vim-snippets/UltiSnips/html.snippets b/sources_non_forked/vim-snippets/UltiSnips/html.snippets index fd11d70b..31f7cc34 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/html.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/html.snippets @@ -1,13 +1,15 @@ +priority -50 + ########################################################################### # TextMate Snippets # ########################################################################### global !p def x(snip): - if snip.ft.startswith("x"): - snip.rv = '/' - else: - snip.rv = "" + if snip.ft.startswith("x"): + snip.rv = '/' + else: + snip.rv = "" endglobal ############ @@ -123,21 +125,21 @@ endsnippet ############# # HTML TAGS # ############# -snippet input "Input with Label" +snippet input "Input with Label" w endsnippet -snippet input "XHTML " +snippet input "XHTML " w endsnippet -snippet opt "Option" +snippet opt "Option" w ${3:$2} endsnippet -snippet select "Select Box" +snippet select "Select Box" w endsnippet -snippet mailto "XHTML " +snippet mailto "XHTML " w ${3:email me} endsnippet -snippet base "XHTML " +snippet base "XHTML " w endsnippet +snippet img "XHTML " w + +endsnippet + snippet body "XHTML " " - - $0 +snippet div "XHTML
" w + + $0
endsnippet -snippet form "XHTML
" +snippet form "XHTML " w @@ -182,7 +188,7 @@ snip.rv = (snip.basename or 'unnamed') + '_submit'
endsnippet -snippet h1 "XHTML

" +snippet h1 "XHTML

" w

${1}

endsnippet @@ -194,71 +200,70 @@ snippet head "XHTML " endsnippet -snippet link "XHTML " +snippet link "XHTML " w endsnippet -snippet meta "XHTML " +snippet meta "XHTML " w endsnippet -snippet scriptsrc "XHTML endsnippet -snippet script "XHTML endsnippet -snippet style "XHTML endsnippet -snippet table "XHTML " +snippet table "XHTML
" w
${5:Header}
${0:Data}
endsnippet -snippet a "Link" +snippet a "Link" w ${4:Anchor Text} endsnippet -snippet p "paragraph" +snippet p "paragraph" w

$0

endsnippet -snippet li "list item" -
  • +snippet li "list item" w +
  • $0
  • endsnippet -snippet ul "unordered list" +snippet ul "unordered list" w
      $0
    endsnippet -snippet td "table cell" +snippet td "table cell" w $0 endsnippet -snippet tr "table row" +snippet tr "table row" w $0 endsnippet -snippet title "XHTML " +snippet title "XHTML <title>" w <title>${1:`!p snip.rv = snip.basename or "Page Title"`} endsnippet -snippet fieldset "Fieldset" +snippet fieldset "Fieldset" w
    $1 - $0
    endsnippet @@ -282,7 +287,7 @@ snippet html5 "HTML5 Template" ${1} - +
    diff --git a/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets b/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets index 1f77ad7b..48ff4b72 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets @@ -1,6 +1,8 @@ # more can be found in snippets/html_minimal.snippets # these UltiSnips override snippets because nested placeholders are being used +priority -50 + snippet id id="${1}"${2} endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets b/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets index 9df5f788..5836a2f6 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets @@ -1 +1,3 @@ +priority -50 + extends html, django diff --git a/sources_non_forked/vim-snippets/UltiSnips/htmljinja.snippets b/sources_non_forked/vim-snippets/UltiSnips/htmljinja.snippets new file mode 100644 index 00000000..fa3b3c22 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/htmljinja.snippets @@ -0,0 +1,3 @@ +priority -50 + +extends html, jinja2 diff --git a/sources_non_forked/vim-snippets/UltiSnips/java.snippets b/sources_non_forked/vim-snippets/UltiSnips/java.snippets index 617c1616..96cc7a9e 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/java.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/java.snippets @@ -1,27 +1,75 @@ -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### +priority -50 # Many of the snippets here use a global option called # "g:ultisnips_java_brace_style" which, if set to "nl" will put a newline # before '{' braces. +# Setting "g:ultisnips_java_junit" will change how the test method snippet +# looks, it is defaulted to junit4, setting this option to 3 will remove the +# @Test annotation from the method global !p +def junit(snip): + if snip.opt("g:ultisnips_java_junit", "") == "3": + snip += "" + else: + snip.rv += "@Test\n\t" + def nl(snip): - if snip.opt("g:ultisnips_java_brace_style", "") == "nl": - snip += "" - else: - snip.rv += " " + if snip.opt("g:ultisnips_java_brace_style", "") == "nl": + snip += "" + else: + snip.rv += " " +def getArgs(group): + import re + word = re.compile('[a-zA-Z><.]+ \w+') + return [i.split(" ") for i in word.findall(group) ] + +def camel(word): + return word[0].upper() + word[1:] + endglobal +snippet sleep "try sleep catch" b +try { + Thread.sleep(${1:1000}); +} catch (InterruptedException e){ + e.printStackTrace(); +} +endsnippet + +snippet /i|n/ "new primitive or int" br +${1:int} ${2:i} = ${3:1}; +$0 +endsnippet + +snippet /o|v/ "new Object or variable" br +${1:Object} ${2:var} = new $1(${3}); +endsnippet + +snippet f "field" b +${1:private} ${2:String} ${3:`!p snip.rv = t[2].lower()`}; +endsnippet + snippet ab "abstract" b -abstract +abstract $0 endsnippet snippet as "assert" b assert ${1:test}${2/(.+)/(?1: \: ")/}${2:Failure message}${2/(.+)/(?1:")/};$0 endsnippet +snippet at "assert true" b +assertTrue(${1:actual}); +endsnippet + +snippet af "assert false" b +assertFalse(${1:actual});$0 +endsnippet + +snippet ae "assert equals" b +assertEquals(${1:expected}, ${2:actual}); +endsnippet + snippet br "break" break; @@ -39,19 +87,85 @@ catch (${1:Exception} ${2:e})`!p nl(snip)`{ } endsnippet -snippet cl "class" b -class ${1:`!p +snippet cle "class extends" b +public class ${1:`!p snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent} }${4:implements ${5:Interface} }{ $0 } endsnippet +snippet clc "class with constructor, fields, setter and getters" b +public class `!p +snip.rv = snip.basename or "untitled"` { +`!p +args = getArgs(t[1]) +if len(args) == 0: snip.rv = "" +for i in args: + snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";" +if len(args) > 0: + snip.rv += "\n"` + public `!p snip.rv = snip.basename or "unknown"`($1) { `!p +args = getArgs(t[1]) +for i in args: + snip.rv += "\n\t\tthis." + i[1] + " = " + i[1] + ";" +if len(args) == 0: + snip.rv += "\n"` + }$0 +`!p +args = getArgs(t[1]) +if len(args) == 0: snip.rv = "" +for i in args: + snip.rv += "\n\tpublic void set" + camel(i[1]) + "(" + i[0] + " " + i[1] + ") {\n" + "\ + \tthis." + i[1] + " = " + i[1] + ";\n\t}\n" + + snip.rv += "\n\tpublic " + i[0] + " get" + camel(i[1]) + "() {\ + \n\t\treturn " + i[1] + ";\n\t}\n" +` +} +endsnippet + +snippet clc "class with constructor, with field names" b +public class `!p +snip.rv = snip.basename or "untitled"` { +`!p +args = getArgs(t[1]) +for i in args: + snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";" +if len(args) > 0: + snip.rv += "\n"` + public `!p snip.rv = snip.basename or "unknown"`($1) { `!p +args = getArgs(t[1]) +for i in args: + snip.rv += "\n\t\tthis." + i[1] + " = " + i[1] +if len(args) == 0: + snip.rv += "\n"` + } +} +endsnippet + +snippet clc "class and constructor" b +public class `!p +snip.rv = snip.basename or "untitled"` { + + public `!p snip.rv = snip.basename or "untitled"`($2) { + $0 + } +} +endsnippet + +snippet cl "class" b +public class ${1:`!p +snip.rv = snip.basename or "untitled"`} { + $0 +} +endsnippet + snippet cos "constant string" b -static public final String ${1:var} = "$2";$0 +public static final String ${1:var} = "$2";$0 endsnippet snippet co "constant" b -static public final ${1:String} ${2:var} = $3;$0 +public static final ${1:String} ${2:var} = $3;$0 endsnippet snippet de "default" b @@ -59,7 +173,7 @@ default: $0 endsnippet -snippet eif "else if" b +snippet elif "else if" b else if ($1)`!p nl(snip)`{ $0 } @@ -72,7 +186,7 @@ else`!p nl(snip)`{ endsnippet snippet fi "final" b -final +final $0 endsnippet snippet fore "for (each)" b @@ -81,6 +195,12 @@ for ($1 : $2)`!p nl(snip)`{ } endsnippet +snippet fori "for" b +for (int ${1:i} = 0; $1 < ${2:10}; $1++)`!p nl(snip)`{ + $0 +} +endsnippet + snippet for "for" b for ($1; $2; $3)`!p nl(snip)`{ $0 @@ -99,7 +219,7 @@ $0 endsnippet snippet im "import" b -import +import ${1:java}.${2:util}.$0 endsnippet snippet in "interface" b @@ -108,6 +228,48 @@ interface ${1:`!p snip.rv = snip.basename or "untitled"`} ${2:extends ${3:Parent } endsnippet +snippet cc "constructor call or setter body" +this.${1:var} = $1; +endsnippet + +snippet list "Collections List" b +List<${1:String}> ${2:list} = new ${3:Array}List<$1>(); +endsnippet + +snippet map "Collections Map" b +Map<${1:String}, ${2:String}> ${3:map} = new ${4:Hash}Map<$1, $2>(); +endsnippet + +snippet set "Collections Set" b +Set<${1:String}> ${2:set} = new ${3:Hash}Set<$1>(); +endsnippet + +snippet /Str?|str/ "String" br +String $0 +endsnippet + +snippet cn "Constructor" b +public `!p snip.rv = snip.basename or "untitled"`(${1:}) { + $0 +} +endsnippet + +snippet cn "constructor, \w fields + assigments" b + `!p +args = getArgs(t[1]) +for i in args: + snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";" +if len(args) > 0: + snip.rv += "\n"` +public `!p snip.rv = snip.basename or "unknown"`($1) { `!p +args = getArgs(t[1]) +for i in args: + snip.rv += "\n\t\tthis." + i[1] + " = " + i[1] +if len(args) == 0: + snip.rv += "\n"` +} +endsnippet + snippet j.b "java_beans_" i java.beans. endsnippet @@ -134,15 +296,70 @@ public static void main(String[] args)`!p nl(snip)`{ } endsnippet -snippet m "method" b -${1:void} ${2:method}($3) ${4:throws $5 }{ +snippet try "try/catch" b +try { + $1 +} catch(${2:Exception} ${3:e}){ + ${4:e.printStackTrace();} +} +endsnippet + +snippet mt "method throws" b +${1:private} ${2:void} ${3:method}(${4}) ${5:throws $6 }{ $0 } +endsnippet +snippet m "method" b +${1:private} ${2:void} ${3:method}(${4}) { + $0 +} +endsnippet + +snippet md "Method With javadoc" b +/** + * ${7:Short Description}`!p +for i in getArgs(t[4]): + snip.rv += "\n\t * @param " + i[1] + " usage..."` + * `!p +if "throws" in t[5]: + snip.rv = "\n\t * @throws " + t[6] +else: + snip.rv = ""` `!p +if not "void" in t[2]: + snip.rv = "\n\t * @return object" +else: + snip.rv = ""` + **/ +${1:public} ${2:void} ${3:method}($4) ${5:throws $6 }{ + $0 +} +endsnippet + +snippet /get(ter)?/ "getter" br +public ${1:String} get${2:Name}() { + return `!p snip.rv = t[2].lower()`; +} +endsnippet + +snippet /set(ter)?/ "setter" br +public void set${1:Name}(${2:String} $1) { + return this.`!p snip.rv = t[1].lower()` = `!p snip.rv = t[1].lower()`; +} +endsnippet + +snippet /se?tge?t|ge?tse?t|gs/ "setter and getter" br +public void set${1:Name}(${2:String} `!p snip.rv = t[1].lower()`) { + this.`!p snip.rv = t[1].lower()` = `!p snip.rv = t[1].lower()`; +} + +public $2 get$1() { + return `!p snip.rv = t[1].lower()`; +} endsnippet snippet pa "package" b -package +package $0 endsnippet snippet p "print" b @@ -154,33 +371,33 @@ System.out.println($1);$0 endsnippet snippet pr "private" b -private +private $0 endsnippet snippet po "protected" b -protected +protected $0 endsnippet snippet pu "public" b -public +public $0 endsnippet snippet re "return" b -return +return $0 endsnippet snippet st "static" -static +static $0 endsnippet snippet sw "switch" b switch ($1)`!p nl(snip)`{ - $0 + case $2: $0 } endsnippet snippet sy "synchronized" -synchronized +synchronized $0 endsnippet snippet tc "test case" @@ -190,17 +407,19 @@ public class ${1:`!p snip.rv = snip.basename or "untitled"`} extends ${2:TestCas endsnippet snippet t "test" b -public void test${1:Name}() throws Exception`!p nl(snip)`{ +`!p junit(snip)`public void test${1:Name}() { + $0 +} +endsnippet + +snippet tt "test throws" b +`!p junit(snip)`public void test${1:Name}() ${2:throws Exception }{ $0 } endsnippet snippet th "throw" b -throw $0 -endsnippet - -snippet v "variable" b -${1:String} ${2:var}${3: = ${0:null}}; +throw new $0 endsnippet snippet wh "while" b diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets index 439ec874..f8d4790e 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets @@ -1,3 +1,5 @@ +priority -50 + ########################################################################### # TextMate Snippets # ########################################################################### @@ -6,19 +8,19 @@ getElement${1/(T)|.*/(?1:s)/}By${1:T}${1/(T)|(I)|.*/(?1:agName)(?2:d)/}('$2') endsnippet snippet '':f "object method string" -'${1:${2:#thing}:${3:click}}': function(element){ - $0 +'${1:${2:#thing}:${3:click}}': function(element) { + ${VISUAL}$0 }${10:,} endsnippet snippet :f "Object Method" -${1:method_name}: function(${3:attribute}){ - $0 +${1:method_name}: function(${3:attribute}) { + ${VISUAL}$0 }${10:,} endsnippet snippet :, "Object Value JS" -${1:value_name}:${0:value}, +${1:value_name}: ${0:value}, endsnippet snippet : "Object key key: 'value'" @@ -26,47 +28,135 @@ ${1:key}: ${2:"${3:value}"}${4:, } endsnippet snippet proto "Prototype (proto)" -${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) ,,{ - ${0} -} - +${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { + ${VISUAL}$0 +}; + endsnippet -snippet for "for (...) {...} (faster)" -for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2--){ - ${3:$1[$2]}$0 +snippet for "for (...) {...} (counting up)" b +for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) { + ${VISUAL}$0 } endsnippet -snippet for "for (...) {...}" -for (var ${2:i}=0; $2 < ${1:Things}.length; $2++) { - ${3:$1[$2]}$0 +snippet ford "for (...) {...} (counting down, faster)" b +for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) { + ${VISUAL}$0 } endsnippet snippet fun "function (fun)" -function ${1:function_name} (${2:argument}) { - ${0} +function ${1:function_name}(${2:argument}) { + ${VISUAL}$0 } endsnippet -# for one line if .. else you usually use a ? b : c +snippet iife "Immediately-Invoked Function Expression (iife)" +(function (${1:argument}) { + ${VISUAL}$0 +}(${2:$1})); +endsnippet + snippet ife "if ___ else" -if (${1}) { - ${2} -} else { - ${3} +if (${1:condition}) { + ${2://code} +} +else { + ${3://code} } endsnippet snippet if "if" -if (${1}) { - ${2} +if (${1:condition}) { + ${VISUAL}$0 } endsnippet snippet timeout "setTimeout function" -setTimeout(function() {$0}${2:}, ${1:10}) +setTimeout(function() { + ${VISUAL}$0 +}${2:.bind(${3:this})}, ${1:10}); +endsnippet + +# Snippets for Console Debug Output + +snippet ca "console.assert" b +console.assert(${1:assertion}, ${2:"${3:message}"}); +endsnippet + +snippet cclear "console.clear" b +console.clear(); +endsnippet + +snippet cdir "console.dir" b +console.dir(${1:object}); +endsnippet + +snippet cdirx "console.dirxml" b +console.dirxml(${1:object}); +endsnippet + +snippet ce "console.error" b +console.error(${1:"${2:value}"}); +endsnippet + +snippet cgroup "console.group" b +console.group("${1:label}"); +${VISUAL}$0 +console.groupEnd(); +endsnippet + +snippet cgroupc "console.groupCollapsed" b +console.groupCollapsed("${1:label}"); +${VISUAL}$0 +console.groupEnd(); +endsnippet + +snippet ci "console.info" b +console.info(${1:"${2:value}"}); +endsnippet + +snippet cl "console.log" b +console.log(${1:"${2:value}"}); +endsnippet + +snippet cprof "console.profile" b +console.profile("${1:label}"); +${VISUAL}$0 +console.profileEnd(); +endsnippet + +snippet ctable "console.table" b +console.table(${1:"${2:value}"}); +endsnippet + +snippet ctime "console.time" b +console.time("${1:label}"); +${VISUAL}$0 +console.timeEnd("$1"); +endsnippet + +snippet ctimestamp "console.timeStamp" b +console.timeStamp("${1:label}"); +endsnippet + +snippet ctrace "console.trace" b +console.trace(); +endsnippet + +snippet cw "console.warn" b +console.warn(${1:"${2:value}"}); +endsnippet + +# AMD (Asynchronous Module Definition) snippets + +snippet def "define an AMD module" +define(${1:optional_name, }[${2:'jquery'}], ${3:callback}); +endsnippet + +snippet req "require an AMD module" +require([${1:'dependencies'}], ${2:callback}); endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript_ember.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript_ember.snippets index 543a26ad..1b7e7b8d 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript_ember.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript_ember.snippets @@ -2,6 +2,8 @@ # Ember snippets # ################################################################### +priority -50 + # Application snippet eapp "App.Name = Ember.Application.create({});" ${1:App.Name} = Ember.Application.create({}); @@ -10,48 +12,48 @@ endsnippet # Models snippet emod "App.ModelName = Ember.Model.extend({...});" ${1:model_name} = Ember.Model.extend({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet # View snippet eview "App.ViewName = Ember.Model.extend({...});" ${1:view_name} = Ember.View.extend({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet # Controller snippet econtroller "App.ControllerName = Ember.Model.extend({...});" ${1:controller_name} = Ember.ObjectController.extend({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet # Route snippet eroute "App.RouteName = Ember.Route.extend({...});" ${1:route_name} = Ember.Route.extend({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet snippet eview "App.ViewName = Ember.Model.create({...});" ${1:view_name} = Ember.View.create({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet # Object snippet eobj "App.ObjectName = Ember.Object.extend({...});" ${1:object_name} = Ember.Object.create({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet # Mixin snippet emix "App.MixinName = Ember.Model.extend({...});" ${1:view_name} = Ember.Mixin.create({ - ${0://Properties here...} + ${0://Properties here...} }); endsnippet @@ -67,13 +69,13 @@ endsnippet # Computer properties snippet cpro "property_name: function() {...}.property()," ${1:property_name}: function() { - ${0://body...} + ${0://body...} }.property('${3:argumenet}'), endsnippet snippet cpro ": function() {...}.property('property')," ${1:property_name}: function() { - ${0://body...} + ${0://body...} }.property(), endsnippet @@ -81,7 +83,7 @@ endsnippet # Observes snippet proo "property_name: function() {...}.property()" ${1:property_name}: function() { - ${0://body...} + ${0://body...} }.observes('${3:property}'), endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript_jasmine.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript_jasmine.snippets index 49e38a35..3a872985 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript_jasmine.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript_jasmine.snippets @@ -1,8 +1,8 @@ -# +priority -50 + # JavaScript versions -- from the TextMate bundle + some additions # for jasmine-jquery matchers # -extends javascript snippet des "Describe (js)" b describe('${1:description}', function() { @@ -165,4 +165,3 @@ endsnippet snippet noscw "expect was not called with (js)" b expect(${1:target}).wasNotCalledWith(${2:arguments}); endsnippet - diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript_jsdoc.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript_jsdoc.snippets new file mode 100644 index 00000000..ca943fc7 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript_jsdoc.snippets @@ -0,0 +1,51 @@ +priority -50 + +# JSDoc snippets + +snippet /* "A JSDoc comment" b +/** + * ${1:${VISUAL}}$0 + */ +endsnippet + +snippet @au "@author email (First Last)" +@author ${1:`!v g:snips_author_email`} (${2:`!v g:snips_author`}) +endsnippet + +snippet @li "@license Description" +@license ${1:MIT}$0 +endsnippet + +snippet @ver "@version Semantic version" +@version ${1:0.1.0}$0 +endsnippet + +snippet @fileo "@fileoverview Description" b +/** + * @fileoverview ${1:${VISUAL:A description of the file}}$0 + */ +endsnippet + +snippet @constr "@constructor" +@constructor +endsnippet + +snippet @p "@param {Type} varname Description" +@param {${1:Type}} ${2:varname} ${3:Description} +endsnippet + +snippet @ret "@return {Type} Description" +@return {${1:Type}} ${2:Description} +endsnippet + +snippet @pri "@private" +@private +endsnippet + +snippet @over "@override" +@override +endsnippet + +snippet @pro "@protected" +@protected +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/jinja2.snippets b/sources_non_forked/vim-snippets/UltiSnips/jinja2.snippets index 6fef6edf..ded01dcf 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/jinja2.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/jinja2.snippets @@ -1,3 +1,4 @@ +priority -50 # http://jinja.pocoo.org/ @@ -11,7 +12,7 @@ snippet block "block" b {% block ${1:name} %} - $2 + $2 {% endblock $1 %} endsnippet @@ -33,7 +34,7 @@ endsnippet snippet raw "escaped block" b {% raw %} - $1 + $1 {% endraw %} endsnippet @@ -60,7 +61,7 @@ endsnippet snippet filter "filter" b {% filter ${1:filter} %} - $2 + $2 {% endfilter %} endsnippet @@ -78,57 +79,57 @@ endsnippet snippet for "for" b {% for ${1:item} in ${2:sequence} %} - $3 + $3 {% endfor %} endsnippet snippet for "for/else" b {% for ${1:item} in ${2:sequence} %} - $3 + $3 {% else %} - $4 + $4 {% endfor %} endsnippet snippet if "if" b {% if ${1:expr} %} - $2 + $2 {% endif %} endsnippet snippet if "if/else" b {% if ${1:expr} %} - $2 + $2 {% else %} - $3 + $3 {% endif %} endsnippet snippet if "if/elif/else" b {% if ${1:expr} %} - $2 + $2 {% elif %} - $3 + $3 {% else %} - $4 + $4 {% endif %} endsnippet snippet macro "macro" b {% macro ${1:name}(${2:args}) %} - $3 + $3 {% endmacro %} endsnippet snippet call "call" b {% call ${1:name}(${2:args}) %} - $3 + $3 {% endcall %} endsnippet @@ -140,25 +141,24 @@ endsnippet snippet trans "translation" b {% trans %} - $1 + $1 {% endtrans %} endsnippet snippet with "with" b {% with %} - $1 + $1 {% endwith %} endsnippet - snippet autoescape "autoescape" b {% autoescape ${1:true} %} - $2 + $2 {% endautoescape %} endsnippet -# Filters +# Filters # @todo: expand only when snippet is preceeded by a | snippet batch "batch items" w diff --git a/sources_non_forked/vim-snippets/UltiSnips/json.snippets b/sources_non_forked/vim-snippets/UltiSnips/json.snippets index 81e65611..b0cad830 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/json.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/json.snippets @@ -1,3 +1,5 @@ +priority -50 + snippet s "String" b "${1:key}": "${0:value}", endsnippet @@ -8,12 +10,11 @@ endsnippet snippet a "Array" b [ - ${VISUAL}$0 + ${VISUAL}$0 ], endsnippet snippet o "Object" b { - ${VISUAL}$0 + ${VISUAL}$0 }, endsnippet - diff --git a/sources_non_forked/vim-snippets/UltiSnips/ledger.snippets b/sources_non_forked/vim-snippets/UltiSnips/ledger.snippets new file mode 100644 index 00000000..4bf46916 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/ledger.snippets @@ -0,0 +1,8 @@ +priority -50 + +snippet t "Transaction" b +${1:`!v strftime("%Y")`}-${2:`!v strftime("%m")`}-${3:`!v strftime("%d")`} ${4:*} ${5:Payee} + ${6:Expenses} \$${7:0.00} + ${8:Assets:Checking} +$0 +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/lhaskell.snippets b/sources_non_forked/vim-snippets/UltiSnips/lhaskell.snippets new file mode 100644 index 00000000..29169a55 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/lhaskell.snippets @@ -0,0 +1,3 @@ +priority -50 + +extends haskell diff --git a/sources_non_forked/vim-snippets/UltiSnips/lua.snippets b/sources_non_forked/vim-snippets/UltiSnips/lua.snippets index 1b82a245..bc59c60c 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/lua.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/lua.snippets @@ -1,3 +1,5 @@ +priority -50 + ################################# # Snippets for the Lua language # ################################# @@ -8,25 +10,25 @@ endsnippet snippet !fun(ction)?! "New function" br function ${1:new_function}(${2:args}) - $0 + $0 end endsnippet snippet forp "pair for loop" b for ${1:name},${2:val} in pairs(${3:table_name}) do - $0 + $0 end endsnippet snippet fori "ipair for foop" b for ${1:idx},${2:val} in ipairs(${3:table_name}) do - $0 + $0 end endsnippet snippet for "numeric for loop" b for ${1:i}=${2:first},${3:last}${4/^..*/(?0:,:)/}${4:step} do - $0 + $0 end endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/mako.snippets b/sources_non_forked/vim-snippets/UltiSnips/mako.snippets index 92a7be38..fb31ec84 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/mako.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/mako.snippets @@ -1,3 +1,5 @@ +priority -50 + ################# # From snipmate # ################# diff --git a/sources_non_forked/vim-snippets/UltiSnips/markdown.snippets b/sources_non_forked/vim-snippets/UltiSnips/markdown.snippets index c3189b8a..fa708ab8 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/markdown.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/markdown.snippets @@ -1,6 +1,4 @@ -########################################################################### -# SNIPPETS for MARKDOWN # -########################################################################### +priority -50 ########################### # Sections and Paragraphs # diff --git a/sources_non_forked/vim-snippets/UltiSnips/objc.snippets b/sources_non_forked/vim-snippets/UltiSnips/objc.snippets index 0c676641..45e41fc1 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/objc.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/objc.snippets @@ -1,3 +1,5 @@ +priority -50 + ########################################################################### # TextMate Snippets # ########################################################################### @@ -11,11 +13,11 @@ snippet Imp "#import <> (Imp)" endsnippet snippet cl "020 Class (objc)" -@interface ${1:`!p +@interface ${1:`!p if len(fn): - snip.rv = re.sub(r'\..*$', '', fn) + snip.rv = re.sub(r'\..*$', '', fn) else: - snip.rv = "object" + snip.rv = "object" `} : ${2:NSObject} { } @@ -118,7 +120,7 @@ snippet arracc "LoD array (arracc)" [${3:${1/./\l$0/}} addObject:anObject]; } -- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i +- (void)insertObject:($2)anObject in$1AtIndex:(unsigned int)i { [$3 insertObject:anObject atIndex:i]; } @@ -189,7 +191,7 @@ if(choice == NSAlertDefaultReturn) // "$3" } else if(choice == NSAlertAlternateReturn) // "$4" { - + $0 } endsnippet @@ -217,7 +219,7 @@ endsnippet snippet responds "Responds to Selector" if ([${1:self} respondsToSelector:@selector(${2:someSelector:})]) { - [$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}]; + [$1 ${3:${2/((:\s*$)|(:\s*))/:<>(?3: )/g}}]; } endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/ocaml.snippets b/sources_non_forked/vim-snippets/UltiSnips/ocaml.snippets index 157eb91a..1ebc3477 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/ocaml.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/ocaml.snippets @@ -1,20 +1,22 @@ +priority -50 + snippet rs "raise" b raise (${1:Not_found}) endsnippet snippet open "open" let open ${1:module} in -${2} +${2:e} endsnippet snippet try "try" -try ${1} +try ${1:e} with ${2:Not_found} -> ${3:()} endsnippet snippet ref "ref" -let ${1} = ref ${2} in -${3} +let ${1:name} = ref ${2:val} in +${3:e} endsnippet snippet matchl "pattern match on a list" @@ -24,83 +26,88 @@ match ${1:list} with endsnippet snippet matcho "pattern match on an option type" -match ${1} with -| Some(${2}) -> ${3:()} +match ${1:x} with +| Some(${2:y}) -> ${3:()} | None -> ${4:()} endsnippet snippet fun "anonymous function" -(fun ${1} -> ${2}) +(fun ${1:x} -> ${2:x}) endsnippet snippet cc "commment" -(* ${1} *) +(* ${1:comment} *) endsnippet snippet let "let .. in binding" -let ${1} = ${2} in -${3} +let ${1:x} = ${2:v} in +${3:e} endsnippet snippet lr "let rec" -let rec ${1} = - ${2} +let rec ${1:f} = + ${2:expr} endsnippet -snippet ife "if" -if ${1} then - ${2} +snippet if "if" +if ${1:(* condition *)} then + ${2:(* A *)} else - ${3} + ${3:(* B *)} endsnippet -snippet if "If" -if ${1} then - ${2} +snippet If "If" +if ${1:(* condition *)} then + ${2:(* A *)} endsnippet -snippet wh "while" -while ${1} do - ${2} +snippet while "while" +while ${1:(* condition *)} do + ${2:(* A *)} done endsnippet snippet for "for" for ${1:i} = ${2:1} to ${3:10} do - ${4} + ${4:(* BODY *)} done endsnippet snippet match "match" -match ${1} with -| ${2} -> ${3} +match ${1:(* e1 *)} with +| ${2:p} -> ${3:e2} +endsnippet + +snippet Match "match" +match ${1:(* e1 *)} with +| ${2:p} -> ${3:e2} endsnippet snippet class "class" class ${1:name} = object - ${2} + ${2:methods} end endsnippet snippet obj "obj" object - ${2} + ${2:methods} end endsnippet snippet Obj "object" object (self) - ${2} + ${2:methods} end endsnippet snippet {{ "object functional update" -{< ${1} = ${2} >} +{< ${1:x} = ${2:y} >} endsnippet snippet beg "beg" begin - ${1}${VISUAL} + ${1:block} end endsnippet @@ -110,19 +117,19 @@ endsnippet snippet mod "module - no signature" module ${1:(* Name *)} = struct - ${2} + ${2:(* BODY *)} end endsnippet snippet Mod "module with signature" module ${1:(* Name *)} : ${2:(* SIG *)} = struct - ${3} + ${3:(* BODY *)} end endsnippet snippet sig "anonymous signature" sig - ${2} + ${2:(* BODY *)} end endsnippet @@ -132,36 +139,36 @@ endsnippet snippet func "define functor - no signature" module ${1:M} (${2:Arg} : ${3:ARG}) = struct - ${4} + ${4:(* BODY *)} end endsnippet snippet Func "define functor - with signature" module ${1:M} (${2:Arg} : ${3:ARG}) : ${4:SIG} = struct - ${5} + ${5:(* BODY *)} end endsnippet snippet mot "Declare module signature" module type ${1:(* Name *)} = sig - ${2} + ${2:(* BODY *)} end endsnippet snippet module "Module with anonymous signature" module ${1:(* Name *)} : sig - ${2} + ${2:(* SIGNATURE *)} end = struct - ${3} + ${3:(* BODY *)} end endsnippet snippet oo "odoc" -(** ${1} *) +(** ${1:odoc} *) endsnippet snippet qt "inline qtest" (*$T ${1:name} - ${2:test} + ${2:test} *) endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/perl.snippets b/sources_non_forked/vim-snippets/UltiSnips/perl.snippets index e183b115..abaae3f5 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/perl.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/perl.snippets @@ -1,10 +1,13 @@ +priority -50 + ########################################################################### # TextMate Snippets # ########################################################################### snippet ife "Conditional if..else (ife)" if ($1) { ${2:# body...} -} else { +} +else { ${3:# else...} } @@ -13,9 +16,11 @@ endsnippet snippet ifee "Conditional if..elsif..else (ifee)" if ($1) { ${2:# body...} -} elsif ($3) { +} +elsif ($3) { ${4:# elsif...} -} else { +} +else { ${5:# else...} } @@ -49,7 +54,7 @@ ${1:expression} while ${2:condition}; endsnippet snippet test "Test" -#!/usr/bin/perl -w +#!/usr/bin/env perl -w use strict; use Test::More tests => ${1:1}; @@ -62,7 +67,7 @@ endsnippet snippet class "class" package ${1:ClassName}; -${2:use base qw(${3:ParentClass});}${2/.+/\n\n/}sub new { +${2:use parent qw(${3:ParentClass});}${2/.+/\n\n/}sub new { my $class = shift; $class = ref $class if ref $class; my $self = bless {}, $class; @@ -74,11 +79,12 @@ ${2:use base qw(${3:ParentClass});}${2/.+/\n\n/}sub new { endsnippet snippet eval "eval" +local $@; eval { ${1:# do something risky...} }; -if ($@) { - ${2:# handle failure...} +if (my $${2:exception} = $@) { + ${3:# handle failure...} } endsnippet @@ -105,8 +111,7 @@ if ($1) { endsnippet snippet slurp "slurp" -my $${1:var}; -{ local $/ = undef; local *FILE; open FILE, "<${2:file}"; $$1 = ; close FILE } +my $${1:var} = do { local $/ = undef; open my $fh, '<', ${2:$file}; <$fh> }; endsnippet @@ -117,7 +122,7 @@ unless ($1) { endsnippet -snippet wh "while" +snippet while "while" while ($1) { ${2:# body...} } diff --git a/sources_non_forked/vim-snippets/UltiSnips/php.snippets b/sources_non_forked/vim-snippets/UltiSnips/php.snippets index b7d01670..24f6cc52 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php.snippets @@ -1,108 +1,264 @@ -snippet ${3});${4} endsnippet -snippet vdd "php var_dump and die" -var_dump(${1}); die(); +snippet def "def" +define('${1}'${2});${3} endsnippet -snippet ns "php namespace" b -namespace ${1:`!p -abspath = os.path.abspath(path) -m = re.search(r'[A-Z].+(?=/)', abspath) -if m: - snip.rv = m.group().replace('/', '\\') -`}; - +snippet do "do" +do { + ${2:// code... } +} while (${1:/* condition */});" endsnippet -snippet nc "php namespace and class or interface" b -namespace ${1:`!p -abspath = os.path.abspath(path) -m = re.search(r'[A-Z].+(?=/)', abspath) -if m: - snip.rv = m.group().replace('/', '\\') -`}; - +snippet doc_f "doc_f" /** - * ${3:@author `whoami`}${4} - */ -`!p -m = re.search(r'Abstract', path) -if m: - snip.rv = 'abstract ' -``!p -if re.search(r'Interface', path): - snip.rv = 'interface' -elif re.search(r'Trait', path): - snip.rv = 'trait' -else: - snip.rv = 'class' -` ${2:`!p -snip.rv = re.match(r'.*(?=\.)', fn).group() -`} -{ + * $2 + * @return ${4:void} + * @author ${5:`!v g:snips_author`} + **/ +${1:public }function ${2:someFunc}(${3}) +{${6} } endsnippet -snippet st "php static function" b -${1:public} static function $2($3) -{ - ${4} -} -endsnippet - -snippet __ "php constructor" b -${1:public} function __construct($2) -{ - ${3} -} -endsnippet - -snippet sg "Setter and Getter" b +snippet doc_i "doc_i" /** - * @var ${3:`!p snip.rv = t[2][0:1].upper() + t[2][1:]`} - * - * ${4} + * $1 + * @package ${2:default} + * @author ${3:`!v g:snips_author`} + **/ +interface ${1:someClass} +{${4} +} // END interface $1" +endsnippet + +snippet else "else" +else { + ${1:// code...} +} +endsnippet + +snippet for "for" +for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { + ${4:// code...} +} +endsnippet + +snippet foreachk "foreachk" +foreach ($${1:variable} as $${2:key} => $${3:value}){ + ${4:// code...} +} +endsnippet + +snippet get "get" +$_GET['${1}']${2} +endsnippet + +snippet if "if" +if (${1:/* condition */}) { + ${2:// code...} +} +endsnippet + +snippet inc "inc" +include '${1:file}';${2} +endsnippet + +snippet log "log" +error_log(var_export(${1}, true));${2} +endsnippet + +snippet post "post" +$_POST['${1}']${2} +endsnippet + +snippet req1 "req1" +require_once '${1:file}';${2} +endsnippet + +snippet session "session" +$_SESSION['${1}']${2} +endsnippet + +snippet t "t" +$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5} +endsnippet + +snippet var "var" +var_export(${1});${2} +endsnippet + +snippet getter "PHP Class Getter" b +/* + * Getter for $1 */ -${1:protected} $${2}; - -public function set`!p snip.rv = t[2][0:1].upper() + t[2][1:]`(`!p -if re.match(r'^(\\|[A-Z]).*', t[3]): - snip.rv = t[3] + ' ' -else: - snip.rv = '' -`$$2) +public function get${1/\w+\s*/\u$0/}() { - $this->$2 = $$2; - - return $this; -} - -public function get`!p snip.rv = t[2][0:1].upper() + t[2][1:]`() -{ - return $this->$2; + return $this->$1;$2 } +$4 endsnippet -snippet if "php if" !b -if (${1}) { - ${2} +snippet setter "PHP Class Setter" b +/* + * Setter for $1 + */ +public function set${1/\w+\s*/\u$0/}($$1) +{ + $this->$1 = $$1;$3 + ${4:return $this;} } +$0 endsnippet -snippet ife "php ife" !b -if (${1}) { - ${2} +snippet gs "PHP Class Getter Setter" b +/* + * Getter for ${1/(\w+)\s*;/$1/} + */ +public function get${1/(\w+)\s*;/\u$1/}() +{ + return $this->${1/(\w+)\s*;/$1/};$2 +} + +/* + * Setter for ${1/(\w+)\s*;/$1/} + */ +public function set${1/(\w+)\s*;/\u$1/}($${1/(\w+)\s*;/$1/}) +{ + $this->${1/(\w+)\s*;/$1/} = $${1/(\w+)\s*;/$1/};$3 + ${4:return $this;} +} +$0 +endsnippet + +snippet pub "Public function" b +public function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pro "Protected function" b +protected function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pri "Private function" b +private function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pubs "Public static function" b +public static function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pros "Protected static function" b +protected static function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet pris "Private static function" b +private static function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet fu "Function snip" b +function ${1:name}(${2:$param}) +{ + ${VISUAL}${3:return null;} +} +$0 +endsnippet + +snippet fore "Foreach loop" +foreach ($${1:variable} as $${3:value}){ + ${VISUAL}${4} +} +$0 +endsnippet + +snippet new "New class instance" b +$$1 = new $1($2); +$0 +endsnippet + +snippet ife "if else" +if (${1:/* condition */}) { + ${2:// code...} } else { + ${3:// code...} +} +$0 +endsnippet +snippet class "Class declaration template" b +/** + * Class ${1:`!p snip.rv=snip.fn.split('.')[0]`} + * @author ${2:`!v g:snips_author`} + */ +class $1 +{ + public function ${3:__construct}(${4:$options}) + { + ${4:// code} + } +} +$0 +endsnippet + +snippet construct "__construct()" b +/** + * @param $2mixed ${1/, /\n * \@param mixed /g} + */ +public function __construct(${1:$dependencies}) +{${1/\$(\w+)(, )*/\n $this->$1 = $$1;/g} +} +$0 +endsnippet + +snippet pr "Dumb debug helper in HTML" +echo '
    ' . var_export($1, 1) . '
    ';$0 +endsnippet + +snippet pc "Dumb debug helper in cli" +var_export($1);$0 +endsnippet + +# Symfony 2 based snippets +snippet sfa "Symfony 2 Controller action" +/** +* @Route("/${1:route_name}", name="$1") +* @Template() +*/ +public function $1Action($2) +{ + $3 + return ${4:array();}$0 } endsnippet -snippet /** "php comment block" b -/** - * @${1} - */ -endsnippet +# :vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/php/phpunit.snippets b/sources_non_forked/vim-snippets/UltiSnips/php_phpunit.snippets similarity index 90% rename from sources_non_forked/vim-snippets/UltiSnips/php/phpunit.snippets rename to sources_non_forked/vim-snippets/UltiSnips/php_phpunit.snippets index 6609f3fa..1a310a19 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php/phpunit.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php_phpunit.snippets @@ -1,7 +1,9 @@ -# sugguestion? report bugs? +# suggestion? report bugs? # please go to https://github.com/chrisyue/vim-snippets/issues +priority -50 + snippet test "phpunit test class" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: diff --git a/sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets b/sources_non_forked/vim-snippets/UltiSnips/php_symfony2.snippets similarity index 94% rename from sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets rename to sources_non_forked/vim-snippets/UltiSnips/php_symfony2.snippets index 77f923f6..3d433169 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php/symfony2.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php_symfony2.snippets @@ -1,8 +1,10 @@ -# sugguestion? report bugs? +# sugguestion? report bugs? # go to https://github.com/chrisyue/vim-snippets/issues +priority -50 + snippet contr "Symfony2 controller" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: @@ -52,7 +54,7 @@ abspath = os.path.abspath(path)` endsnippet snippet comm "Symfony2 command" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: @@ -89,7 +91,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() endsnippet snippet subs "Symfony2 subscriber" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: @@ -120,7 +122,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() endsnippet snippet transf "Symfony2 form data transformer" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: @@ -154,7 +156,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() endsnippet snippet ent "Symfony2 doctrine entity" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: @@ -167,7 +169,7 @@ use Doctrine\ORM\Mapping as ORM; * ${3:@author `whoami`} * * @ORM\Entity() - * @ORM\Table(name="`!p + * @ORM\Table(name="`!p tmp = re.match(r'.*(?=\.)', fn).group() tmp = re.sub(r'\B([A-Z])', r'_\1', tmp) snip.rv = tmp.lower() @@ -191,7 +193,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() endsnippet snippet form "Symfony2 form type" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: @@ -209,33 +211,33 @@ class `!p snip.rv = re.match(r'.*(?=\.)', fn).group() ` extends AbstractType { - /** - * {@inheritDoc} + /** + * {@inheritDoc} */ public function buildForm(FormBuilderInterface $builder, array $options) - { + { } - /** - * {@inheritDoc} + /** + * {@inheritDoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) - { - $resolver->setDefaults(); - } + { + $resolver->setDefaults(); + } - /** - * {@inheritDoc} + /** + * {@inheritDoc} */ public function getName() - { + { return '${1}'; } } endsnippet snippet ev "Symfony2 event" b -namespace `!p +namespace `!p abspath = os.path.abspath(path) m = re.search(r'[A-Z].+(?=/)', abspath) if m: diff --git a/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets b/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets index 68ae0fe4..1b2cfc57 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets @@ -1,78 +1,235 @@ -# Snippets for Puppet +priority -50 -snippet /^class/ "Class declaration" r -class ${1:name} { - ${0:# body} +######################################################################### +# Python helper code # +######################################################################### + +global !p +import vim +import os.path +def get_module_namespace_and_basename(): + """This function will try to guess the current class or define name you are + trying to create. Note that for this to work you should be using the module + structure as per the style guide. Examples inputs and it's output + * /home/nikolavp/puppet/modules/collectd/manifests/init.pp -> collectd + * /home/nikolavp/puppet/modules/collectd/manfistes/mysql.pp -> collectd::mysql + """ + first_time = True + current_file_path_without_ext = vim.eval('expand("%:p:r")') or "" + if not current_file_path_without_ext: + return "name" + parts = os.path.split(current_file_path_without_ext) + namespace = '' + while parts[0] and parts[0] != '/': + if parts[1] == 'init' and first_time and not namespace: + first_time = False + parts = os.path.split(parts[0]) + continue + if parts[1] == 'manifests': + return os.path.split(parts[0])[1] + ('::' + namespace).rstrip(':') + else: + namespace = parts[1] + '::' + namespace + parts = os.path.split(parts[0]) + # couldn't guess the namespace. The user is editing a raw file in no module like the site.pp file + return "name" +endglobal + +############################################################################### +# Puppet Language Constructs # +# See http://docs.puppetlabs.com/puppet/latest/reference/lang_summary.html # +############################################################################### + +snippet class "Class declaration" b +class ${1:`!p snip.rv = get_module_namespace_and_basename()`} { + ${0:# body} +} +endsnippet + +snippet define "Definition" b +define ${1:`!p snip.rv = get_module_namespace_and_basename()`} { + ${0:# body} +} +endsnippet + +################################################################# +# Puppet Types # +# See http://docs.puppetlabs.com/references/latest/type.html # +################################################################# + +snippet cron "Cron resource type" b +cron { '${1:name}': + user => ${2:user}, + command => '${3:command}', + minute => ${3:minute}, + hour => ${4:hour}, +} +endsnippet + +snippet exec "Exec resource type" b +exec { '${1:command}': + refreshonly => true, +} +endsnippet + +snippet file "File resource type" b +file { '${1:name}': + source => "puppet://${2:path}", + mode => ${3:mode}, } endsnippet snippet File "Defaults for file" b File { - owner => ${1:username}, - group => ${2:groupname}, + owner => ${1:username}, + group => ${2:groupname}, } endsnippet -# Resource types -snippet package "Package resource type" b -package { "${1:name}": - ensure => ${2:installed}, -} -endsnippet - -snippet file "File resource type" b -file { "${1:name}": - source => "puppet://${2:path}", - mode => ${3:mode}, -endsnippet - snippet group "Group resource type" b -group { "${1:groupname}": - ensure => ${3:present}, - gid => ${2:gid}, -endsnippet - -snippet user "user resource type" b -group { "${1:username}": - ensure => ${2:present}, - uid => ${3:uid}, - gid => ${4:gid}, - comment => ${5:gecos}, - home => ${6:homedirectory}, - managehome => false, - require => Group["${7:group"], -endsnippet - -snippet exec "Exec resource type" b -exec { "${1:command}": - refreshonly => true, -} -endsnippet - -snippet cron "Cron resource type" b -cron { "${1:name}": - user => ${2:user}, - command => "${3:command}", - minute => ${3:minute}, - hour => ${4:hour}, +group { '${1:groupname}': + ensure => ${3:present}, + gid => ${2:gid}, } endsnippet snippet mount "Mount resource type" b -mount { "${1:path}": - device => "${2:/dev}", - fstype => "${3:filesystem}", - ensure => mounted, - options => "rw,errors=remount-ro", +mount { '${1:path}': + device => '${2:/dev}', + fstype => '${3:filesystem}', + ensure => mounted, + options => 'rw,errors=remount-ro', +} +endsnippet + +snippet package "Package resource type" b +package { '${1:name}': + ensure => ${2:installed}, +} +endsnippet + +snippet user "user resource type" b +user { '${1:username}': + ensure => ${2:present}, + uid => ${3:uid}, + gid => ${4:gid}, + comment => ${5:gecos}, + home => ${6:homedirectory}, + managehome => false, + require => Group['${7:group'}], } endsnippet snippet service "Service resource type" b -service { "${1:name}": - hasstatus => true, - enable => true, - ensure => running, +service { '${1:name}': + hasstatus => true, + enable => true, + ensure => running, } endsnippet +######################################################################## +# Puppet Functions # +# See http://docs.puppetlabs.com/references/latest/function.html # +######################################################################## + +snippet alert "Alert Function" b +alert("${1:message}")${0} +endsnippet + +snippet crit "Crit Function" b +crit("${1:message}")${0} +endsnippet + +snippet debug "Debug Function" b +debug("${1:message}")${0} +endsnippet + +snippet defined "Defined Function" b +defined(${1:Resource}["${2:name}"])${0} +endsnippet + +snippet emerg "Emerg Function" b +emerg("${1:message}")${0} +endsnippet + +snippet extlookup "Simple Extlookup" b +$${1:Variable} = extlookup("${2:Lookup}")${0} +endsnippet + +snippet extlookup "Extlookup with defaults" b +$${1:Variable} = extlookup("${2:Lookup}", ${3:Default})${0} +endsnippet + +snippet extlookup "Extlookup with defaults and custom data file" b +$${1:Variable} = extlookup("${2:Lookup}", ${3:Default}, ${4:Data Source})${0} +endsnippet + +snippet fail "Fail Function" b +fail("${1:message}")${0} +endsnippet + +snippet hiera "Hiera Function" b +$${1:Variable} = hiera("${2:Lookup}")${0} +endsnippet + +snippet hiera "Hiera with defaults" b +$${1:Variable} = hiera("${2:Lookup}", ${3:Default})${0} +endsnippet + +snippet hiera "Hiera with defaults and override" b +$${1:Variable} = hiera("${2:Lookup}", ${3:Default}, ${4:Override})${0} +endsnippet + +snippet hiera_hash "Hiera Hash Function" b +$${1:Variable} = hiera_hash("${2:Lookup}")${0} +endsnippet + +snippet hiera_hash "Hiera Hash with defaults" b +$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default})${0} +endsnippet + +snippet hiera_hash "Hiera Hash with defaults and override" b +$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default}, ${4:Override})${0} +endsnippet + +snippet hiera_include "Hiera Include Function" b +hiera_include("${1:Lookup}")${0} +endsnippet + +snippet include "Include Function" b +include ${1:classname}${0} +endsnippet + +snippet info "Info Function" b +info("${1:message}")${0} +endsnippet + +snippet inline_template "Inline Template Function" b +inline_template("<%= ${1:template} %>")${0} +endsnippet + +snippet notice "Notice Function" b +notice("${1:message}")${0} +endsnippet + +snippet realize "Realize Function" b +realize(${1:Resource}["${2:name}"])${0} +endsnippet + +snippet regsubst "Regsubst Function" b +regsubst($${1:Target}, '${2:regexp}', '${3:replacement}')${0} +endsnippet + +snippet split "Split Function" b +$${1:Variable} = split($${1:Target}, '${2:regexp}')${0} +endsnippet + +snippet versioncmp "Version Compare Function" b +$${1:Variable} = versioncmp('${1:version}', '${2:version}')${0} +endsnippet + +snippet warning "Warning Function" b +warning("${1:message}")${0} +endsnippet + # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/python.snippets b/sources_non_forked/vim-snippets/UltiSnips/python.snippets index a770d2a9..357d01d3 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/python.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/python.snippets @@ -1,3 +1,5 @@ +priority -50 + ########################################################################### # TEXTMATE SNIPPETS # ########################################################################### @@ -14,6 +16,10 @@ if __name__ == '__main__': ${1:main()}$0 endsnippet +snippet for "for loop" b +for ${1:item} in ${2:iterable}: + ${3:pass} +endsnippet ########## # COMMON # @@ -29,67 +35,81 @@ NORMAL = 0x1 DOXYGEN = 0x2 SPHINX = 0x3 +SINGLE_QUOTES = 0x1 +DOUBLE_QUOTES = 0x2 + def get_args(arglist): - args = [arg.split('=')[0].strip() for arg in arglist.split(',') if arg] - args = [arg for arg in args if arg and arg != "self"] + args = [arg.split('=')[0].strip() for arg in arglist.split(',') if arg] + args = [arg for arg in args if arg and arg != "self"] - return args + return args +def get_quoting_style(snip): + style = snip.opt("g:ultisnips_python_quoting_style", "double") + if style == 'single': + return SINGLE_QUOTES + return DOUBLE_QUOTES + +def tripple_quotes(snip): + if get_quoting_style(snip) == SINGLE_QUOTES: + return "'''" + return '"""' + def get_style(snip): - style = snip.opt("g:ultisnips_python_style", "normal") + style = snip.opt("g:ultisnips_python_style", "normal") - if style == "doxygen": return DOXYGEN - elif style == "sphinx": return SPHINX - else: return NORMAL + if style == "doxygen": return DOXYGEN + elif style == "sphinx": return SPHINX + else: return NORMAL def format_arg(arg, style): - if style == DOXYGEN: - return "@param %s @todo" % arg - elif style == SPHINX: - return ":param %s: @todo" % arg - elif style == NORMAL: - return ":%s: @todo" % arg + if style == DOXYGEN: + return "@param %s @todo" % arg + elif style == SPHINX: + return ":param %s: @todo" % arg + elif style == NORMAL: + return ":%s: @todo" % arg def format_return(style): - if style == DOXYGEN: - return "@return: @todo" - elif style in (NORMAL, SPHINX): - return ":returns: @todo" + if style == DOXYGEN: + return "@return: @todo" + elif style in (NORMAL, SPHINX): + return ":returns: @todo" def write_docstring_args(args, snip): - if not args: - snip.rv += ' """' - return + if not args: + snip.rv += ' {0}'.format(tripple_quotes(snip)) + return - snip.rv += '\n' + snip.mkline('', indent='') + snip.rv += '\n' + snip.mkline('', indent='') - style = get_style(snip) + style = get_style(snip) - for arg in args: - snip += format_arg(arg, style) + for arg in args: + snip += format_arg(arg, style) def write_init_body(args, parents, snip): - parents = [p.strip() for p in parents.split(",")] - parents = [p for p in parents if p != 'object'] + parents = [p.strip() for p in parents.split(",")] + parents = [p for p in parents if p != 'object'] - for p in parents: - snip += p + ".__init__(self)" + for p in parents: + snip += p + ".__init__(self)" - if parents: - snip.rv += '\n' + snip.mkline('', indent='') + if parents: + snip.rv += '\n' + snip.mkline('', indent='') - for arg in args: - snip += "self._%s = %s" % (arg, arg) + for arg in args: + snip += "self._%s = %s" % (arg, arg) def write_slots_args(args, snip): - args = ['"%s"' % arg for arg in args] - snip += '__slots__ = (%s,)' % ', '.join(args) + args = ['"_%s"' % arg for arg in args] + snip += '__slots__ = (%s,)' % ', '.join(args) endglobal @@ -99,10 +119,11 @@ endglobal snippet class "class with docstrings" b class ${1:MyClass}(${2:object}): - """${3:Docstring for $1 }""" + + `!p snip.rv = tripple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = tripple_quotes(snip)` def __init__(self$4): - """${5:@todo: to be defined}`!p + `!p snip.rv = tripple_quotes(snip)`${5:@todo: to be defined1.}`!p snip.rv = "" snip >> 2 @@ -110,8 +131,8 @@ args = get_args(t[4]) write_docstring_args(args, snip) if args: - snip.rv += '\n' + snip.mkline('', indent='') - snip += '"""' + snip.rv += '\n' + snip.mkline('', indent='') + snip += '{0}'.format(tripple_quotes(snip)) write_init_body(args, t[2], snip) ` @@ -121,7 +142,8 @@ endsnippet snippet slotclass "class with slots and docstrings" b class ${1:MyClass}(${2:object}): - """${3:Docstring for $1 }""" + + `!p snip.rv = tripple_quotes(snip)`${3:Docstring for $1. }`!p snip.rv = tripple_quotes(snip)` `!p snip >> 1 args = get_args(t[4]) @@ -129,7 +151,7 @@ write_slots_args(args, snip) ` def __init__(self$4): - """${5:@todo: to be defined}`!p + `!p snip.rv = tripple_quotes(snip)`${5:@todo: to be defined.}`!p snip.rv = "" snip >> 2 @@ -137,8 +159,8 @@ args = get_args(t[4]) write_docstring_args(args, snip) if args: - snip.rv += '\n' + snip.mkline('', indent='') - snip += '"""' + snip.rv += '\n' + snip.mkline('', indent='') + snip += tripple_quotes(snip) write_init_body(args, t[2], snip) ` @@ -330,19 +352,19 @@ endsnippet snippet def "function with docstrings" b def ${1:function}(`!p if snip.indent: - snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}): - """${4:@todo: Docstring for $1}`!p + snip.rv = 'self' + (", " if len(t[2]) else "")`${2:arg1}): + `!p snip.rv = tripple_quotes(snip)`${4:@todo: Docstring for $1.}`!p snip.rv = "" snip >> 1 args = get_args(t[2]) if args: - write_docstring_args(args, snip) + write_docstring_args(args, snip) style = get_style(snip) snip += format_return(style) snip.rv += '\n' + snip.mkline('', indent='') -snip += '"""' ` +snip += tripple_quotes(snip) ` ${0:pass} endsnippet @@ -362,23 +384,57 @@ endsnippet ############## snippet roprop "Read Only Property" b @property -def ${1:property}(self): +def ${1:name}(self): ${2:return self._$1}$0 endsnippet snippet rwprop "Read write property" b -def ${1:property}(): - ${2/.+/(?0:""")/}${2:The RW property $1}`!p if t[2]: - snip.rv += '"""' - snip >> 1 - snip += "" +def ${1:name}(): + `!p snip.rv = tripple_quotes(snip) if t[2] else '' +`${2:@todo: Docstring for $1.}`!p +if t[2]: + snip >> 1 + + style = get_style(snip) + snip.rv += '\n' + snip.mkline('', indent='') + snip += format_return(style) + snip.rv += '\n' + snip.mkline('', indent='') + snip += tripple_quotes(snip) else: - snip.rv = ""`def fget(self): + snip.rv = ""` + def fget(self): return self._$1$0 + def fset(self, value): self._$1 = value return locals() -$1 = property(**$1()) + +$1 = property(**$1(), doc=$1.__doc__) +endsnippet + + +#################### +# If / Else / Elif # +#################### +snippet if "If" b +if ${1:condition}: + ${2:pass} +endsnippet + +snippet ife "If / Else" b +if ${1:condition}: + ${2:pass} +else: + ${3:pass} +endsnippet + +snippet ifee "If / Elif / Else" b +if ${1:condition}: + ${2:pass} +elif ${3:condition}: + ${4:pass} +else: + ${5:pass} endsnippet @@ -430,6 +486,14 @@ snippet pdb "Set PDB breakpoint" b import pdb; pdb.set_trace() endsnippet +snippet ipdb "Set IPDB breakpoint" b +import ipdb; ipdb.set_trace() +endsnippet + +snippet pudb "Set PUDB breakpoint" b +import pudb; pudb.set_trace() +endsnippet + snippet ae "Assert equal" b self.assertEqual(${1:first},${2:second}) endsnippet @@ -453,7 +517,8 @@ endsnippet snippet testcase "pyunit testcase" b class Test${1:Class}(${2:unittest.TestCase}): - """${3:Test case docstring}""" + + `!p snip.rv = tripple_quotes(snip)`${3:Test case docstring.}`!p snip.rv = tripple_quotes(snip)` def setUp(self): ${4:pass} diff --git a/sources_non_forked/vim-snippets/UltiSnips/rails.snippets b/sources_non_forked/vim-snippets/UltiSnips/rails.snippets index 9e0e29f8..5c521795 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/rails.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/rails.snippets @@ -1,6 +1,4 @@ -########################################################################### -# GENERATED FROM get_tm_snippets.py # -########################################################################### +priority -50 snippet anaf "accepts_nested_attributes_for" accepts_nested_attributes_for :${1:association_name}${2:${3:, :allow_destroy => true}${4:, :reject_if => proc \{ |obj| ${5:obj.blank?} \}}} @@ -77,90 +75,90 @@ endsnippet snippet resources "Create resources controller class" class ${1:Model}sController < ApplicationController - before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy] + before_filter :find_${1/./\l$0/}, :only => [:show, :edit, :update, :destroy] - # GET /${1/./\l$0/}s - # GET /${1/./\l$0/}s.xml - def index - @${1/./\l$0/}s = ${1:Model}.all + # GET /${1/./\l$0/}s + # GET /${1/./\l$0/}s.xml + def index + @${1/./\l$0/}s = ${1:Model}.all - respond_to do |wants| - wants.html # index.html.erb - wants.xml { render :xml => @${1/./\l$0/}s } - end - end + respond_to do |wants| + wants.html # index.html.erb + wants.xml { render :xml => @${1/./\l$0/}s } + end + end - # GET /${1/./\l$0/}s/1 - # GET /${1/./\l$0/}s/1.xml - def show - respond_to do |wants| - wants.html # show.html.erb - wants.xml { render :xml => @${1/./\l$0/} } - end - end + # GET /${1/./\l$0/}s/1 + # GET /${1/./\l$0/}s/1.xml + def show + respond_to do |wants| + wants.html # show.html.erb + wants.xml { render :xml => @${1/./\l$0/} } + end + end - # GET /${1/./\l$0/}s/new - # GET /${1/./\l$0/}s/new.xml - def new - @${1/./\l$0/} = ${1:Model}.new + # GET /${1/./\l$0/}s/new + # GET /${1/./\l$0/}s/new.xml + def new + @${1/./\l$0/} = ${1:Model}.new - respond_to do |wants| - wants.html # new.html.erb - wants.xml { render :xml => @${1/./\l$0/} } - end - end + respond_to do |wants| + wants.html # new.html.erb + wants.xml { render :xml => @${1/./\l$0/} } + end + end - # GET /${1/./\l$0/}s/1/edit - def edit - end + # GET /${1/./\l$0/}s/1/edit + def edit + end - # POST /${1/./\l$0/}s - # POST /${1/./\l$0/}s.xml - def create - @${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}]) + # POST /${1/./\l$0/}s + # POST /${1/./\l$0/}s.xml + def create + @${1/./\l$0/} = ${1:Model}.new(params[:${1/./\l$0/}]) - respond_to do |wants| - if @${1/./\l$0/}.save - flash[:notice] = '${1:Model} was successfully created.' - wants.html { redirect_to(@${1/./\l$0/}) } - wants.xml { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} } - else - wants.html { render :action => "new" } - wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } - end - end - end + respond_to do |wants| + if @${1/./\l$0/}.save + flash[:notice] = '${1:Model} was successfully created.' + wants.html { redirect_to(@${1/./\l$0/}) } + wants.xml { render :xml => @${1/./\l$0/}, :status => :created, :location => @${1/./\l$0/} } + else + wants.html { render :action => "new" } + wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } + end + end + end - # PUT /${1/./\l$0/}s/1 - # PUT /${1/./\l$0/}s/1.xml - def update - respond_to do |wants| - if @${1/./\l$0/}.update_attributes(params[:${1/./\l$0/}]) - flash[:notice] = '${1:Model} was successfully updated.' - wants.html { redirect_to(@${1/./\l$0/}) } - wants.xml { head :ok } - else - wants.html { render :action => "edit" } - wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } - end - end - end + # PUT /${1/./\l$0/}s/1 + # PUT /${1/./\l$0/}s/1.xml + def update + respond_to do |wants| + if @${1/./\l$0/}.update_attributes(params[:${1/./\l$0/}]) + flash[:notice] = '${1:Model} was successfully updated.' + wants.html { redirect_to(@${1/./\l$0/}) } + wants.xml { head :ok } + else + wants.html { render :action => "edit" } + wants.xml { render :xml => @${1/./\l$0/}.errors, :status => :unprocessable_entity } + end + end + end - # DELETE /${1/./\l$0/}s/1 - # DELETE /${1/./\l$0/}s/1.xml - def destroy - @${1/./\l$0/}.destroy + # DELETE /${1/./\l$0/}s/1 + # DELETE /${1/./\l$0/}s/1.xml + def destroy + @${1/./\l$0/}.destroy - respond_to do |wants| - wants.html { redirect_to(${1/./\l$0/}s_url) } - wants.xml { head :ok } - end - end + respond_to do |wants| + wants.html { redirect_to(${1/./\l$0/}s_url) } + wants.xml { head :ok } + end + end - private - def find_${1/./\l$0/} - @${1/./\l$0/} = ${1:Model}.find(params[:id]) - end + private + def find_${1/./\l$0/} + @${1/./\l$0/} = ${1:Model}.find(params[:id]) + end end @@ -227,31 +225,31 @@ assert_response :${1:success}, @response.body$0 endsnippet snippet aftc "after_create" -after_create +after_create $0 endsnippet snippet aftd "after_destroy" -after_destroy +after_destroy $0 endsnippet snippet afts "after_save" -after_save +after_save $0 endsnippet snippet aftu "after_update" -after_update +after_update $0 endsnippet snippet aftv "after_validation" -after_validation +after_validation $0 endsnippet snippet aftvoc "after_validation_on_create" -after_validation_on_create +after_validation_on_create $0 endsnippet snippet aftvou "after_validation_on_update" -after_validation_on_update +after_validation_on_update $0 endsnippet snippet asg "assert(var = assigns(:var))" @@ -261,13 +259,13 @@ endsnippet snippet asd "assert_difference" assert_difference "${1:Model}.${2:count}", ${3:1} do - $0 + $0 end endsnippet snippet asnd "assert_no_difference" assert_no_difference "${1:Model}.${2:count}" do - $0 + $0 end endsnippet @@ -298,27 +296,27 @@ end} endsnippet snippet befc "before_create" -before_create +before_create $0 endsnippet snippet befd "before_destroy" -before_destroy +before_destroy $0 endsnippet snippet befs "before_save" -before_save +before_save $0 endsnippet snippet befu "before_update" -before_update +before_update $0 endsnippet snippet befv "before_validation" -before_validation +before_validation $0 endsnippet snippet befvoc "before_validation_on_create" -before_validation_on_create +before_validation_on_create $0 endsnippet snippet befvou "before_validation_on_update" @@ -456,13 +454,13 @@ endsnippet snippet mapr "map.resource" ${1:map}.resource :${2:resource}${10: do |${11:$2}| - $0 + $0 end} endsnippet snippet maprs "map.resources" ${1:map}.resources :${2:resource}${10: do |${11:$2}| - $0 + $0 end} endsnippet @@ -605,7 +603,7 @@ endsnippet snippet resw "respond_with" respond_with(${1:@${2:model}})${3: do |format| - format.${4:html} { $0 \} + format.${4:html} { $0 \} end} endsnippet @@ -807,32 +805,32 @@ endsnippet snippet sweeper "Create sweeper class" class ${1:Model}Sweeper < ActionController::Caching::Sweeper - observe ${1:Model} + observe ${1:Model} - def after_save(${1/./\l$0/}) - expire_cache(${1/./\l$0/}) - end + def after_save(${1/./\l$0/}) + expire_cache(${1/./\l$0/}) + end - def after_destroy(${1/./\l$0/}) - expire_cache(${1/./\l$0/}) - end + def after_destroy(${1/./\l$0/}) + expire_cache(${1/./\l$0/}) + end - private + private - def expire_cache(${1/./\l$0/}) - ${0:expire_page ${1/./\l$0/}s_path - expire_page ${1/./\l$0/}_path(${1/./\l$0/})} - end + def expire_cache(${1/./\l$0/}) + ${0:expire_page ${1/./\l$0/}s_path + expire_page ${1/./\l$0/}_path(${1/./\l$0/})} + end end endsnippet snippet col "collection routes" collection do - ${1:get :${2:action}} - ${3:put :${4:action}} - ${5:post :${6:action}} - ${7:delete :${8:action}} + ${1:get :${2:action}} + ${3:put :${4:action}} + ${5:post :${6:action}} + ${7:delete :${8:action}} end endsnippet @@ -854,16 +852,16 @@ endsnippet snippet member "member routes" member do - ${1:get :${2:action}} - ${3:put :${4:action}} - ${5:post :${6:action}} - ${7:delete :${8:action}} + ${1:get :${2:action}} + ${3:put :${4:action}} + ${5:post :${6:action}} + ${7:delete :${8:action}} end endsnippet snippet res "resources" resources :${1:posts}${2: do - $3 + $3 end} endsnippet @@ -877,9 +875,9 @@ endsnippet snippet scopee "scope with extension" scope :${1:name}, ${2:where(${3::${4:field} => ${5:'${6:value}'}})} do - def ${7:method_name} - $0 - end + def ${7:method_name} + $0 + end end endsnippet @@ -893,13 +891,13 @@ setup do end endsnippet -snippet trans "Translation snippet" +snippet trans "Translation snippet" I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}${3}', :default => "${1:some_text}"${4})${5:$0} endsnippet snippet route_spec it 'routes to #${1:action}' do - ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6} + ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6} end endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/rst.snippets b/sources_non_forked/vim-snippets/UltiSnips/rst.snippets index 88e0caaf..e8aef2b2 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/rst.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/rst.snippets @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- +priority -50 + ########################################################################### -# General Stuff # +# General Stuff # ########################################################################### global !p import vim @@ -12,25 +14,25 @@ from collections import Counter #http://docutils.sourceforge.net/docs/ref/rst/roles.html TEXT_ROLES = ['emphasis','literal','code','math', - 'pep-reference','rfc-reference', - 'strong','subscript','superscript', - 'title-reference','raw'] + 'pep-reference','rfc-reference', + 'strong','subscript','superscript', + 'title-reference','raw'] TEXT_ROLES_REGEX = r'\.\.\srole::?\s(w+)' #http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions -SPECIFIC_ADMONITIONS = ["attention", "caution", "danger", - "error", "hint", "important", "note", - "tip", "warning"] +SPECIFIC_ADMONITIONS = ["attention", "caution", "danger", + "error", "hint", "important", "note", + "tip", "warning"] #http://docutils.sourceforge.net/docs/ref/rst/directives.html DIRECTIVES = ['topic','sidebar','math','epigraph', - 'parsed-literal','code','highlights', - 'pull-quote','compound','container', - 'list-table','class','sectnum', - 'role','default-role','unicode', - 'raw'] + 'parsed-literal','code','highlights', + 'pull-quote','compound','container', + 'list-table','class','sectnum', + 'role','default-role','unicode', + 'raw'] NONE_CONTENT_DIRECTIVES = ['rubric', 'contents', 'header', - 'footer', 'date', 'include', 'title'] + 'footer', 'date', 'include', 'title'] INCLUDABLE_DIRECTIVES = ['image', 'figure', 'include'] # CJK chars @@ -39,115 +41,115 @@ CJK_RE = re.compile(u'[⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〺〻㐀-䶵一- def has_cjk(char): - """ - Detect char contains CJK character - - :param char: characters needs to be detect - """ - try: - CJK_RE.finditer(char).next() - except StopIteration: - return False - else: - return True + """ + Detect char contains CJK character + + :param char: characters needs to be detect + """ + try: + CJK_RE.finditer(char).next() + except StopIteration: + return False + else: + return True def real_filename(filename): - """peal extension name off if possible - # i.e. "foo.bar.png will return "foo.bar" + """pealeextension name off if possible + # i.e. "foo.bar.png will return "foo.bar" """ - return ospath.splitext(filename)[0] + return ospath.splitext(filename)[0] def check_file_exist(rst_path, relative_path): - """ - For RST file, it can just include files as relative path. - - :param rst_path: absolute path to rst file - :param relative_path: path related to rst file - :return: relative file's absolute path if file exist - """ - abs_path = ospath.join(ospath.dirname(rst_path), relative_path) - if ospath.isfile(abs_path): - return abs_path + """ + For RST file, it can just include files as relative path. + + :param rst_path: absolute path to rst file + :param relative_path: path related to rst file + :return: relative file's absolute path if file exist + """ + abs_path = ospath.join(ospath.dirname(rst_path), relative_path) + if ospath.isfile(abs_path): + return abs_path def rst_char_len(char): - """ - return len of string which fit in rst - For instance:chinese "我" decode as only one character, - However, the rst interpreter needs 2 "=" instead of 1. + """ + return len of string which fit in rst + For instance:chinese "我" decode as only one character, + However, the rst interpreter needs 2 "=" instead of 1. - :param: char needs to be count - """ - return len(re.findall(r'[^\u4e00-\u9fff\s]', char))+len(char) + :param: char needs to be count + """ + return len(re.findall(r'[^\u4e00-\u9fff\s]', char))+len(char) def make_items(times, leading='+'): - """ - make lines with leading char multitimes - - :param: times, how many times you need - :param: leading, leading character - """ - times = int(times) - if leading == 1: - msg = "" - for x in xrange(1, times+1): - msg += "%s. Item\n" % x - return msg - else: - return ("%s Item\n" % leading) * times + """ + make lines with leading char multitimes + + :param: times, how many times you need + :param: leading, leading character + """ + times = int(times) + if leading == 1: + msg = "" + for x in xrange(1, times+1): + msg += "%s. Item\n" % x + return msg + else: + return ("%s Item\n" % leading) * times def look_up_directives(regex, fpath): - """ - find all directive args in given file - :param: regex, the regex that needs to match - :param: path, to path to rst file + """ + find all directive args in given file + :param: regex, the regex that needs to match + :param: path, to path to rst file - :return: list, empty list if nothing match - """ - try: - with open(fpath) as source: - match = re.findall(regex, source.read()) - except IOError: - match = [] - return match + :return: list, empty list if nothing match + """ + try: + with open(fpath) as source: + match = re.findall(regex, source.read()) + except IOError: + match = [] + return match def get_popular_code_type(): - """ - find most popular code type in the given rst + """ + find most popular code type in the given rst - :param path: file to detect + :param path: file to detect + + :return: string, most popular code type in file + """ + buf = "".join(vim.current.buffer) + types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', buf) + try: + popular_type = Counter(types).most_common()[0][0] + except IndexError: + popular_type = "lua" # Don't break default + return popular_type - :return: string, most popular code type in file - """ - buf = "".join(vim.current.buffer) - types = re.findall(r'[:|\.\.\s]code::?\s(\w+)', buf) - try: - popular_type = Counter(types).most_common()[0][0] - except IndexError: - popular_type = "lua" # Don't break default - return popular_type - def complete(t, opts): - """ - get options that start with t + """ + get options that start with t - :param t: query string - :param opts: list that needs to be completed + :param t: query string + :param opts: list that needs to be completed - :return: a string that start with t - """ - msg = "({0})" - if t: - opts = [ m[len(t):] for m in opts if m.startswith(t) ] - if len(opts) == 1: - return opts[0] + :return: a string that start with t + """ + msg = "({0})" + if t: + opts = [ m[len(t):] for m in opts if m.startswith(t) ] + if len(opts) == 1: + return opts[0] - if not len(opts): - msg = "{0}" - return msg.format("|".join(opts)) + if not len(opts): + msg = "{0}" + return msg.format("|".join(opts)) endglobal @@ -199,22 +201,22 @@ snippet em "Emphasize string" i `!p # dirty but works with CJK charactor detection if has_cjk(vim.current.line): - snip.rv ="\ "`*${1:${VISUAL:Em}}*`!p -if has_cjk(vim.current.line): - snip.rv ="\ " + snip.rv ="\ "`*${1:${VISUAL:Em}}*`!p +if has_cjk(vim.current.line): + snip.rv ="\ " else: - snip.rv = " " + snip.rv = " " `$0 endsnippet snippet st "Strong string" i -`!p +`!p if has_cjk(vim.current.line): - snip.rv ="\ "`**${1:${VISUAL:Strong}}**`!p -if has_cjk(vim.current.line): - snip.rv ="\ " + snip.rv ="\ "`**${1:${VISUAL:Strong}}**`!p +if has_cjk(vim.current.line): + snip.rv ="\ " else: - snip.rv = " " + snip.rv = " " `$0 endsnippet @@ -236,12 +238,12 @@ snip.rv = make_items(match.groupdict()['num'], 1) ` endsnippet ########################################################################### -# More Specialized Stuff. # +# More Specialized Stuff. # ########################################################################### snippet cb "Code Block" b .. code-block:: ${1:`!p snip.rv = get_popular_code_type()`} - ${2:code} + ${2:code} $0 endsnippet @@ -249,7 +251,7 @@ endsnippet # match snippets : # img, inc, fig snippet id "Includable Directives" b -`!p +`!p real_name=real_filename(ospath.basename(t[2])) di=t[1][:2] @@ -257,28 +259,28 @@ link="" content="" if di == 'im': - link = "|{0}|".format(real_name) + link = "|{0}|".format(real_name) if di == 'fi': - content=""" - :alt: {0} - {0}""".format(real_name) + content=""" + :alt: {0} + {0}""".format(real_name) ` ..`!p snip.rv = " %s" % link if link else ""` $1`!p snip.rv=complete(t[1], INCLUDABLE_DIRECTIVES)`:: ${2:file}`!p if content: - snip.rv +=" "+content` + snip.rv +=" "+content` `!p # Tip of whether file is exist in comment type if not check_file_exist(path, t[2]): - snip.rv='.. FILE {0} does not exist'.format(t[2]) + snip.rv='.. FILE {0} does not exist'.format(t[2]) else: - snip.rv="" + snip.rv="" `$0 endsnippet snippet di "Directives" b .. $1`!p snip.rv=complete(t[1], DIRECTIVES)`:: $2 - ${3:Content} + ${3:Content} $0 endsnippet @@ -289,8 +291,8 @@ endsnippet snippet sa "Specific Admonitions" b .. $1`!p snip.rv =complete(t[1], SPECIFIC_ADMONITIONS)`:: - - ${2:Content} + + ${2:Content} $0 endsnippet @@ -298,8 +300,8 @@ endsnippet #it will be trigger at start of line or after a word snippet ro "Text Roles" w \ :$1`!p snip.rv=complete(t[1], - TEXT_ROLES+look_up_directives(TEXT_ROLES_REGEX, - path))`:\`$2\`\ + TEXT_ROLES+look_up_directives(TEXT_ROLES_REGEX, + path))`:\`$2\`\ endsnippet ############ @@ -309,6 +311,6 @@ endsnippet snippet sid "SideBar" b .. sidebar:: ${1:SideBar Title} - ${2:SideBar Content} + ${2:SideBar Content} endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/ruby.snippets b/sources_non_forked/vim-snippets/UltiSnips/ruby.snippets index 90001b1a..09a114f6 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/ruby.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/ruby.snippets @@ -1,3 +1,5 @@ +priority -50 + snippet "^#!" "#!/usr/bin/env ruby" r #!/usr/bin/env ruby $0 @@ -25,7 +27,7 @@ endsnippet snippet if "if ... end" if ${1:condition} - ${2} + ${2:# TODO} end endsnippet @@ -33,9 +35,9 @@ endsnippet snippet ife "if ... else ... end" if ${1:condition} - ${2} + ${2:# TODO} else - ${3} + ${3:# TODO} end endsnippet @@ -43,11 +45,11 @@ endsnippet snippet ifee "if ... elseif ... else ... end" if ${1:condition} - ${2} + ${2:# TODO} elsif ${3:condition} - ${4} + ${4:# TODO} else - ${0} + ${0:# TODO} end endsnippet @@ -55,7 +57,7 @@ endsnippet snippet unless "unless ... end" unless ${1:condition} - ${0} + ${0:# TODO} end endsnippet @@ -63,9 +65,9 @@ endsnippet snippet unlesse "unless ... else ... end" unless ${1:condition} - ${2} + ${2:# TODO} else - ${0} + ${0:# TODO} end endsnippet @@ -73,11 +75,11 @@ endsnippet snippet unlesee "unless ... elseif ... else ... end" unless ${1:condition} - ${2} + ${2:# TODO} elsif ${3:condition} - ${4} + ${4:# TODO} else - ${0} + ${0:# TODO} end endsnippet @@ -85,7 +87,7 @@ endsnippet snippet "\b(de)?f" "def ..." r def ${1:function_name}${2: ${3:*args}} - ${0} + ${0:# TODO} end endsnippet @@ -93,7 +95,7 @@ endsnippet snippet defi "def initialize ..." def initialize${1: ${2:*args}} - ${0} + ${0:# TODO} end endsnippet @@ -101,23 +103,23 @@ endsnippet snippet defr "def ... rescue ..." def ${1:function_name}${2: ${3:*args}} - ${4} + ${4:# TODO} rescue - ${0} + ${0:# TODO} end endsnippet snippet For "(..).each { || }" -(${1:from}..${2:to}).each { |${3:i}| ${4} } +(${1:from}..${2:to}).each { |${3:i}| ${4:# TODO} } endsnippet snippet for "(..).each do || end" (${1:from}..${2:to}).each do |${3:i}| - ${0} + ${0:# TODO} end endsnippet @@ -138,42 +140,42 @@ endsnippet snippet "(\S+)\.Del(ete)?_?if" ".delete_if { |,| }" r -`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| ${3} } +`!p snip.rv=match.group(1)`.delete_if { |${1:key},${2:value}| ${3:# TODO} } endsnippet snippet "(\S+)\.del(ete)?_?if" ".delete_if do |,| end" r `!p snip.rv=match.group(1)`.delete_if do |${1:key},${2:value}| - ${0} + ${0:# TODO} end endsnippet snippet "(\S+)\.Keep_?if" ".keep_if { |,| }" r -`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| ${3} } +`!p snip.rv=match.group(1)`.keep_if { |${1:key},${2:value}| ${3:# TODO} } endsnippet snippet "(\S+)\.keep_?if" ".keep_if do ,| end" r `!p snip.rv=match.group(1)`.keep_if do |${1:key},${2:value}| - ${0} + ${0:# TODO} end endsnippet snippet "(\S+)\.Reject" ".reject { |,| }" r -`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| ${3} } +`!p snip.rv=match.group(1)`.reject { |${1:key},${2:value}| ${3:# TODO} } endsnippet snippet "(\S+)\.reject" ".reject do ,| end" r `!p snip.rv=match.group(1)`.reject do |${1:key},${2:value}| - ${0} + ${0:# TODO} end endsnippet @@ -194,71 +196,71 @@ endsnippet snippet "(\S+)\.Sort" ".sort { |,| }" r -`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| ${3} } +`!p snip.rv=match.group(1)`.sort { |${1:a},${2:b}| ${3:# TODO} } endsnippet snippet "(\S+)\.sort" ".sort do |,| end" r `!p snip.rv=match.group(1)`.sort do |${1:a},${2:b}| - ${0} + ${0:# TODO} end endsnippet snippet "(\S+)\.Each_?k(ey)?" ".each_key { || }" r -`!p snip.rv=match.group(1)`.each_key { |${1:key}| ${2} } +`!p snip.rv=match.group(1)`.each_key { |${1:key}| ${2:# TODO} } endsnippet snippet "(\S+)\.each_?k(ey)?" ".each_key do |key| end" r `!p snip.rv=match.group(1)`.each_key do |${1:key}| - ${0} + ${0:# TODO} end endsnippet snippet "(\S+)\.Each_?val(ue)?" ".each_value { || }" r -`!p snip.rv=match.group(1)`.each_value { |${1:value}| ${2} } +`!p snip.rv=match.group(1)`.each_value { |${1:value}| ${2:# TODO} } endsnippet snippet "(\S+)\.each_?val(ue)?" ".each_value do || end" r `!p snip.rv=match.group(1)`.each_value do |${1:value}| - ${0} + ${0:# TODO} end endsnippet snippet Each ".each { || }" -${1:elements}.each { |${2:${1/s$//}}| ${3} } +${1:elements}.each { |${2:${1/s$//}}| ${3:# TODO} } endsnippet snippet each ".each do || end" ${1:elements}.each do |${2:${1/s$//}}| - ${0} + ${0:# TODO} end endsnippet -snippet each_?s(lice)? ".each_slice(n) do |slice| end" -each_slice(${1:2}) do |${2:slice}| - ${0} +snippet "each_?s(lice)?" ".each_slice(n) do |slice| end" r +${1:elements}.each_slice(${2:2}) do |${3:slice}| + ${0:# TODO} end endsnippet -snippet Each_?s(lice)? ".each_slice(n) { |slice| }" -each_slice(${1:2}) { |${2:slice}| ${3} } +snippet "Each_?s(lice)?" ".each_slice(n) { |slice| }" r +${1:elements}.each_slice(${2:2}) { |${3:slice}| ${0:# TODO} } endsnippet @@ -273,7 +275,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`}| ${2} } +`}| ${2:# TODO} } endsnippet @@ -288,7 +290,7 @@ try: except: snip.rv = 'element' `}| - ${0} + ${0:# TODO} end endsnippet @@ -303,7 +305,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`}| ${2} } +`}| ${2:# TODO} } endsnippet @@ -318,7 +320,7 @@ try: except: snip.rv = 'element' `}| - ${0} + ${0:# TODO} end endsnippet @@ -333,7 +335,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`}| ${2} } +`}| ${2:# TODO} } endsnippet @@ -348,14 +350,14 @@ try: except: snip.rv = 'element' `}| - ${0} + ${0:# TODO} end endsnippet -snippet "(\S+)\.Each_w(ith)?_?i(ndex)?" ".each_with_index { |,| }" r +snippet "(\S+)\.Each_?w(ith)?_?i(ndex)?" ".each_with_index { |,| }" r `!p snip.rv=match.group(1)`.each_with_index { |${1:`!p element_name = match.group(1).lstrip('$@') ematch = re.search("([A-Za-z][A-Za-z0-9_]+?)s?[^A-Za-z0-9_]*?$", element_name) @@ -364,7 +366,7 @@ try: snip.rv = wmatch.group(1).lower() except: snip.rv = 'element' -`},${2:i}| ${3} }$0 +`},${2:i}| ${3:# TODO} }$0 endsnippet @@ -379,7 +381,7 @@ try: except: snip.rv = 'element' `},${2:i}| - ${0} + ${0:# TODO} end endsnippet @@ -387,14 +389,14 @@ endsnippet snippet "(\S+)\.Each_?p(air)?" ".each_pair { |,| }" r -`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| ${3} } +`!p snip.rv=match.group(1)`.each_pair { |${1:key},${2:value}| ${3:# TODO} } endsnippet snippet "(\S+)\.each_?p(air)?" ".each_pair do |,| end" r `!p snip.rv=match.group(1)`.each_pair do |${1:key},${2:value}| - ${0} + ${0:# TODO} end endsnippet @@ -424,24 +426,26 @@ snippet "(\S+)\.Index" ".index do |item| ... end" r end endsnippet -# comments about do and dov see snippets/ruby.snippets -snippet do "do ... end" i + + +snippet do "do || ... end" i +do |${1:args}| + $0 +end +endsnippet + + + +snippet Do "do ... end" i do $0 end endsnippet -snippet dov "do || ... end" i -do |${1:v}| - $2 -end -endsnippet - - snippet until "until ... end" until ${1:expression} - ${0} + ${0:# TODO} end endsnippet @@ -449,15 +453,15 @@ endsnippet snippet Until "begin ... end until " begin - ${0} + ${0:# TODO} end until ${1:expression} endsnippet -snippet wh "while ... end" +snippet while "while ... end" while ${1:expression} - ${0} + ${0:# TODO} end endsnippet @@ -465,7 +469,7 @@ endsnippet snippet While "begin ... end while " begin - ${0} + ${0:# TODO} end while ${1:expression} endsnippet @@ -491,9 +495,9 @@ endsnippet snippet begin "begin ... rescue ... end" begin - ${1} + ${1:# TODO} rescue - ${0} + ${0:# TODO} end endsnippet @@ -559,7 +563,7 @@ endsnippet snippet ### =begin - $0 + $0 =end endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/scss.snippets b/sources_non_forked/vim-snippets/UltiSnips/scss.snippets new file mode 100644 index 00000000..70a44a07 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/scss.snippets @@ -0,0 +1,55 @@ +priority -50 + +snippet /@?imp/ "@import '...';" br +@import '${1:file}'; +endsnippet + +snippet /@?inc/ "@include mixin(...);" br +@include ${1:mixin}(${2:arguments}); +endsnippet + +snippet /@?ext?/ "@extend %placeholder;" br +@extend %${1:placeholder}; +endsnippet + +snippet /@?mixin/ "@mixin (...) { ... }" br +@mixin ${1:name}(${2:arguments}) { + ${VISUAL}$0 +} +endsnippet + +snippet /@?fun/ "@function (...) { ... }" br +@function ${1:name}(${2:arguments}) { + ${VISUAL}$0 +} +endsnippet + +snippet /@?if/ "@if (...) { ... }" br +@if ${1:condition} { + ${VISUAL}$0 +} +endsnippet + +snippet /(} )?@?else/ "@else { ... }" br +@else ${1:condition} { + ${VISUAL}$0 +} +endsnippet + +snippet /@?for/ "@for loop" br +@for ${1:$i} from ${2:1} through ${3:3} { + ${VISUAL}$0 +} +endsnippet + +snippet /@?each/ "@each loop" br +@each ${1:$item} in ${2:item, item, item} { + ${VISUAL}$0 +} +endsnippet + +snippet /@?while/ "@while loop" br +@while ${1:$i} ${2:>} ${3:0} { + ${VISUAL}$0 +} +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/sh.snippets b/sources_non_forked/vim-snippets/UltiSnips/sh.snippets index cce06ef3..9cc45779 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/sh.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/sh.snippets @@ -1,21 +1,25 @@ +priority -50 + global !p import vim # Tests for the existence of a variable declared by Vim's filetype detection # suggesting the type of shell script of the current file def testShell(scope, shell): - return vim.eval("exists('" + scope + ":is_" + shell + "')") + return vim.eval("exists('" + scope + ":is_" + shell + "')") # Loops over the possible variables, checking for global variables # first since they indicate an override by the user. def getShell(): - for scope in ["g", "b"]: - for shell in ["bash", "sh", "kornshell"]: - if testShell(scope, shell) == "1": - if shell == "kornshell": - return "ksh" - return shell - return "sh" + for scope in ["g", "b"]: + for shell in ["bash", "posix", "sh", "kornshell"]: + if testShell(scope, shell) == "1": + if shell == "kornshell": + return "ksh" + if shell == "posix": + return "sh" + return shell + return "sh" endglobal ########################################################################### @@ -79,7 +83,7 @@ until ${2:[[ ${1:condition} ]]}; do done endsnippet -snippet wh "while ... (done)" +snippet while "while ... (done)" while ${2:[[ ${1:condition} ]]}; do ${0:#statements} done diff --git a/sources_non_forked/vim-snippets/UltiSnips/snippets.snippets b/sources_non_forked/vim-snippets/UltiSnips/snippets.snippets index 414f350e..ee0c8c76 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/snippets.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/snippets.snippets @@ -1,16 +1,14 @@ -######################### -# SNIPPETS for SNIPPETS # -######################### +priority -50 # We use a little hack so that the snippet is expanded # and parsed correctly -snippet snip "Snippet definition" ! -`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:!b} +snippet snip "Snippet definition" b +`!p snip.rv = "snippet"` ${1:Tab_trigger} "${2:Description}" ${3:b} $0 `!p snip.rv = "endsnippet"` endsnippet -snippet global "Global snippet" ! +snippet global "Global snippet" b `!p snip.rv = "global"` !p $0 `!p snip.rv = "endglobal"` diff --git a/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets b/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets index fd53d265..65849157 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets @@ -1,3 +1,5 @@ +priority -50 + ########################################################################### # TEXTMATE SNIPPETS # ########################################################################### @@ -16,14 +18,14 @@ foreach ${1:var} ${2:\$list} { endsnippet snippet if "if... (if)" b -if {${1}} { +if {${1:condition}} { ${2} } endsnippet snippet proc "proc... (proc)" b -proc ${1} {${2}} \ +proc ${1:name} {${2:args}} \ { ${3} } @@ -40,8 +42,8 @@ switch ${1:-exact} -- ${2:\$var} { endsnippet -snippet wh "while... (while)" b -while {${1}} { +snippet while "while... (while)" b +while {${1:condition}} { ${2} } diff --git a/sources_non_forked/vim-snippets/UltiSnips/tex.snippets b/sources_non_forked/vim-snippets/UltiSnips/tex.snippets index db533070..c32d21f1 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/tex.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/tex.snippets @@ -1,38 +1,28 @@ +priority -50 -########################################################################### -# LATEX SNIPPETS # -########################################################################### +extends texmath -snippet r "\ref{}" w -\ref{$1} -endsnippet - -########################################################################### -# TEXTMATE SNIPPETS # -########################################################################### - -################# -# GENERAL STUFF # -################# snippet "b(egin)?" "begin{} / end{}" br \begin{${1:something}} ${0:${VISUAL}} \end{$1} endsnippet -#################### -# TABULARS, ARRAYS # -#################### - snippet tab \begin{${1:t}${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}}{${2:c}} $0${2/((?<=.)c|l|r)|./(?1: & )/g} \end{$1${1/(t)$|(a)$|(.*)/(?1:abular)(?2:rray)/}} endsnippet -######################## -# ENUM, DESCR, ITEMIZE # -######################## +snippet fig "Figure environment" b +\begin{figure}${2:[htpb]} + \centering + \includegraphics[width=${3:0.8}\linewidth]{${4:name.ext}} + \caption{${4/(\w+)\.\w+/\u$1/}$0} + \label{fig:${4/(\w+)\.\w+/$1/}} +\end{figure} +endsnippet + snippet enum "Enumerate" b \begin{enumerate} \item $0 @@ -51,74 +41,70 @@ snippet desc "Description" b \end{description} endsnippet -##################################### -# SECTIONS, CHAPTERS AND THERE LIKE # -##################################### +snippet it "Individual item" b +\item ${1} +$0 +endsnippet snippet part "Part" b \part{${1:part name}} -\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/g}}} +\label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}} ${0} - -% part $2 (end) endsnippet snippet cha "Chapter" b \chapter{${1:chapter name}} -\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} +\label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} ${0} - -% chapter $2 (end) endsnippet snippet sec "Section" b \section{${1:section name}} -\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} +\label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} ${0} - -% section $2 (end) endsnippet - snippet sub "Subsection" b \subsection{${1:subsection name}} -\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} +\label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} ${0} - -% subsection $2 (end) endsnippet snippet ssub "Subsubsection" b \subsubsection{${1:subsubsection name}} -\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} +\label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} ${0} - -% subsubsection $2 (end) - endsnippet snippet par "Paragraph" b \paragraph{${1:paragraph name}} -\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} +\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} ${0} - -% paragraph $2 (end) endsnippet - snippet subp "Subparagraph" b \subparagraph{${1:subparagraph name}} -\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/g}}} +\label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} ${0} - -% subparagraph $2 (end) endsnippet +snippet ni "Non-indented paragraph" b +\noindent +${0} +endsnippet + +snippet pac "Package" b +\usepackage[${1:options}]{${2:package}}$0 +endsnippet + +snippet lp "Long parenthesis" +\left(${1:${VISUAL:contents}}\right)$0 +endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/texmath.snippets b/sources_non_forked/vim-snippets/UltiSnips/texmath.snippets index 03589f0f..d0a25e9a 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/texmath.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/texmath.snippets @@ -1,3 +1,5 @@ +priority -50 + ############## # MATH STUFF # ############## diff --git a/sources_non_forked/vim-snippets/UltiSnips/twig.snippets b/sources_non_forked/vim-snippets/UltiSnips/twig.snippets index 9db43f7d..156b981b 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/twig.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/twig.snippets @@ -1,3 +1,5 @@ +priority -50 + snippet bl "twig block" b {% block ${1} %} ${2} diff --git a/sources_non_forked/vim-snippets/UltiSnips/vim.snippets b/sources_non_forked/vim-snippets/UltiSnips/vim.snippets index 5655c4b1..5ff22d2e 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/vim.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/vim.snippets @@ -1,3 +1,5 @@ +priority -50 + ########################################################################### # SnipMate Snippets # ########################################################################### @@ -25,30 +27,30 @@ endsnippet snippet f fun ${1:function_name}(${2}) - ${3} + ${3:" code} endf endsnippet snippet for -for ${1} in ${2} - ${3} +for ${1:needle} in ${2:haystack} + ${3:" code} endfor endsnippet snippet wh -while ${1} - ${2} +while ${1:condition} + ${2:" code} endw endsnippet snippet if -if ${1} - ${2} +if ${1:condition} + ${2:" code} endif endsnippet snippet ife -if ${1} +if ${1:condition} ${2} else ${3} diff --git a/sources_non_forked/vim-snippets/UltiSnips/xhtml.snippets b/sources_non_forked/vim-snippets/UltiSnips/xhtml.snippets index e69de29b..a9c5a29a 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/xhtml.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/xhtml.snippets @@ -0,0 +1,3 @@ +priority -50 + +extends html diff --git a/sources_non_forked/vim-snippets/UltiSnips/xml.snippets b/sources_non_forked/vim-snippets/UltiSnips/xml.snippets index 80b017ce..92dfb6e1 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/xml.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/xml.snippets @@ -1,3 +1,10 @@ +priority -50 + +snippet xml "XML declaration" b + + +endsnippet + snippet t "Simple tag" b <${1:tag}> ${2:content} diff --git a/sources_non_forked/vim-snippets/UltiSnips/zsh.snippets b/sources_non_forked/vim-snippets/UltiSnips/zsh.snippets index 80394597..f7986ea5 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/zsh.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/zsh.snippets @@ -1,9 +1,15 @@ -snippet #! "shebang" ! +priority -50 + +extends sh + +priority -49 + +snippet #! "shebang" b #!/bin/zsh endsnippet -snippet !env "#!/usr/bin/env (!env)" ! +snippet !env "#!/usr/bin/env (!env)" b #!/usr/bin/env zsh endsnippet diff --git a/sources_non_forked/vim-snippets/snippets/coffee.snippets b/sources_non_forked/vim-snippets/snippets/coffee.snippets deleted file mode 100644 index 7ed1ebf4..00000000 --- a/sources_non_forked/vim-snippets/snippets/coffee.snippets +++ /dev/null @@ -1,109 +0,0 @@ -# Closure loop -snippet forindo - for ${1:name} in ${2:array} - do ($1) -> - ${0:// body} -# Array comprehension -snippet fora - for ${1:name} in ${2:array} - ${0:# body...} -# Object comprehension -snippet foro - for ${1:key}, ${2:value} of ${3:object} - ${0:# body...} -# Range comprehension (inclusive) -snippet forr - for ${1:name} in [${2:start}..${3:finish}] - ${0:# body...} -snippet forrb - for ${1:name} in [${2:start}..${3:finish}] by ${4:step} - ${0:# body...} -# Range comprehension (exclusive) -snippet forrex - for ${1:name} in [${2:start}...${3:finish}] - ${0:# body...} -snippet forrexb - for ${1:name} in [${2:start}...${3:finish}] by ${4:step} - ${0:# body...} -# Function -snippet fun - (${1:args}) -> - ${0:# body...} -# Function (bound) -snippet bfun - (${1:args}) => - ${0:# body...} -# Class -snippet cla class .. - class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - ${0} -snippet cla class .. constructor: .. - class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - constructor: (${2:args}) -> - ${3} - - ${0} -snippet cla class .. extends .. - class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass} - ${0} -snippet cla class .. extends .. constructor: .. - class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass} - constructor: (${3:args}) -> - ${4} - - ${0} -# If -snippet if - if ${1:condition} - ${0:# body...} -# If __ Else -snippet ife - if ${1:condition} - ${2:# body...} - else - ${0:# body...} -# Else if -snippet eif - else if ${1:condition} - ${0:# body...} -# Ternary If -snippet ifte - if ${1:condition} then ${2:value} else ${0:other} -# Unless -snippet unl - ${1:action} unless ${0:condition} -# Switch -snippet swi - switch ${1:object} - when ${2:value} - ${0:# body...} - -# Log -snippet log - console.log ${0} -# Try __ Catch -snippet try - try - ${1} - catch ${2:error} - ${0} -# Require -snippet req - ${2:$1} = require '${1:sys}' -# Export -snippet exp - ${0:root} = exports ? this - - -snippet ajax - $.ajax - url: "${1:mydomain.com/url}" - type: "${2:POST}" - dataType: "${3:xml/html/script/json}" - data: ${4:data} - complete: (jqXHR, textStatus) -> - ${5:// callback} - success: (data, textStatus, jqXHR) -> - ${6:// success callback} - error: (jqXHR, textStatus, errorThrown) -> - ${0:// error callback} diff --git a/sources_non_forked/vim-snippets/snippets/html.snippets b/sources_non_forked/vim-snippets/snippets/html.snippets index d8892b5b..567003f7 100644 --- a/sources_non_forked/vim-snippets/snippets/html.snippets +++ b/sources_non_forked/vim-snippets/snippets/html.snippets @@ -361,15 +361,15 @@ snippet footer# ${0} snippet form -
    + ${0}
    snippet form. -
    + ${0}
    snippet form# -
    + ${0}
    snippet h1 diff --git a/sources_non_forked/vim-snippets/snippets/javascript-jquery.snippets b/sources_non_forked/vim-snippets/snippets/javascript-jquery.snippets deleted file mode 100644 index ef6f66c7..00000000 --- a/sources_non_forked/vim-snippets/snippets/javascript-jquery.snippets +++ /dev/null @@ -1,589 +0,0 @@ -snippet add - ${1:obj}.add('${2:selector expression}') -snippet addClass - ${1:obj}.addClass('${2:class name}') -snippet after - ${1:obj}.after('${2:Some text and bold!}') -snippet ajax - $.ajax({ - url: '${1:mydomain.com/url}', - type: '${2:POST}', - dataType: '${3:xml/html/script/json}', - data: $.param( $('${4:Element or Expression}') ), - complete: function (jqXHR, textStatus) { - ${5:// callback} - }, - success: function (data, textStatus, jqXHR) { - ${6:// success callback} - }, - error: function (jqXHR, textStatus, errorThrown) { - ${0:// error callback} - } - }); -snippet ajaxcomplete - ${1:obj}.ajaxComplete(function (${1:e}, xhr, settings) { - ${0:// callback} - }); -snippet ajaxerror - ${1:obj}.ajaxError(function (${1:e}, xhr, settings, thrownError) { - ${2:// error callback} - }); - ${0} -snippet ajaxget - $.get('${1:mydomain.com/url}', - ${2:{ param1: value1 },} - function (data, textStatus, jqXHR) { - ${0:// success callback} - } - ); -snippet ajaxpost - $.post('${1:mydomain.com/url}', - ${2:{ param1: value1 },} - function (data, textStatus, jqXHR) { - ${0:// success callback} - } - ); -snippet ajaxprefilter - $.ajaxPrefilter(function (${1:options}, ${2:originalOptions}, jqXHR) { - ${0: // Modify options, control originalOptions, store jqXHR, etc} - }); -snippet ajaxsend - ${1:obj}.ajaxSend(function (${1:request, settings}) { - ${2:// error callback} - }); - ${0} -snippet ajaxsetup - $.ajaxSetup({ - url: "${1:mydomain.com/url}", - type: "${2:POST}", - dataType: "${3:xml/html/script/json}", - data: $.param( $("${4:Element or Expression}") ), - complete: function (jqXHR, textStatus) { - ${5:// callback} - }, - success: function (data, textStatus, jqXHR) { - ${6:// success callback} - }, - error: function (jqXHR, textStatus, errorThrown) { - ${0:// error callback} - } - }); -snippet ajaxstart - $.ajaxStart(function () { - ${1:// handler for when an AJAX call is started and no other AJAX calls are in progress}; - }); - ${0} -snippet ajaxstop - $.ajaxStop(function () { - ${1:// handler for when all AJAX calls have been completed}; - }); - ${0} -snippet ajaxsuccess - $.ajaxSuccess(function (${1:e}, xhr, settings) { - ${2:// handler for when any AJAX call is successfully completed}; - }); - ${0} -snippet andself - ${1:obj}.andSelf() -snippet animate - ${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed}) -snippet append - ${1:obj}.append('${2:Some text and bold!}') -snippet appendTo - ${1:obj}.appendTo('${2:selector expression}') -snippet attr - ${1:obj}.attr('${2:attribute}', '${3:value}') -snippet attrm - ${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'}) -snippet before - ${1:obj}.before('${2:Some text and bold!}') -snippet bind - ${1:obj}.bind('${2:event name}', function (${3:e}) { - ${0:// event handler} - }); -snippet blur - ${1:obj}.blur(function (${2:e}) { - ${0:// event handler} - }); -snippet C - $.Callbacks() -snippet Cadd - ${1:callbacks}.add(${2:callbacks}) -snippet Cdis - ${1:callbacks}.disable() -snippet Cempty - ${1:callbacks}.empty() -snippet Cfire - ${1:callbacks}.fire(${2:args}) -snippet Cfired - ${1:callbacks}.fired() -snippet Cfirew - ${1:callbacks}.fireWith(${2:this}, ${3:args}) -snippet Chas - ${1:callbacks}.has(${2:callback}) -snippet Clock - ${1:callbacks}.lock() -snippet Clocked - ${1:callbacks}.locked() -snippet Crem - ${1:callbacks}.remove(${2:callbacks}) -snippet change - ${1:obj}.change(function (${2:e}) { - ${0:// event handler} - }); -snippet children - ${1:obj}.children('${2:selector expression}') -snippet clearq - ${1:obj}.clearQueue(${2:'queue name'}) -snippet click - ${1:obj}.click(function (${2:e}) { - ${0:// event handler} - }); -snippet clone - ${1:obj}.clone() -snippet contains - $.contains(${1:container}, ${0:contents}); -snippet css - ${1:obj}.css('${2:attribute}', '${3:value}') -snippet csshooks - $.cssHooks['${1:CSS prop}'] = { - get: function (elem, computed, extra) { - ${2: // handle getting the CSS property} - }, - set: function (elem, value) { - ${0: // handle setting the CSS value} - } - }; -snippet cssm - ${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'}) -snippet D - $.Deferred() -snippet Dalways - ${1:deferred}.always(${2:callbacks}) -snippet Ddone - ${1:deferred}.done(${2:callbacks}) -snippet Dfail - ${1:deferred}.fail(${2:callbacks}) -snippet Disrej - ${1:deferred}.isRejected() -snippet Disres - ${1:deferred}.isResolved() -snippet Dnotify - ${1:deferred}.notify(${2:args}) -snippet Dnotifyw - ${1:deferred}.notifyWith(${2:this}, ${3:args}) -snippet Dpipe - ${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter}) -snippet Dprog - ${1:deferred}.progress(${2:callbacks}) -snippet Dprom - ${1:deferred}.promise(${2:target}) -snippet Drej - ${1:deferred}.reject(${2:args}) -snippet Drejw - ${1:deferred}.rejectWith(${2:this}, ${3:args}) -snippet Dres - ${1:deferred}.resolve(${2:args}) -snippet Dresw - ${1:deferred}.resolveWith(${2:this}, ${3:args}) -snippet Dstate - ${1:deferred}.state() -snippet Dthen - ${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks}) -snippet Dwhen - $.when(${1:deferreds}) -snippet data - ${1:obj}.data(${2:obj}) -snippet dataa - $.data('${1:selector expression}', '${2:key}'${3:, 'value'}) -snippet dblclick - ${1:obj}.dblclick(function (${2:e}) { - ${0:// event handler} - }); -snippet delay - ${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'}) -snippet dele - ${1:obj}.delegate('${2:selector expression}', '${3:event name}', function (${4:e}) { - ${0:// event handler} - }); -snippet deq - ${1:obj}.dequeue(${2:'queue name'}) -snippet deqq - $.dequeue('${1:selector expression}'${2:, 'queue name'}) -snippet detach - ${1:obj}.detach('${2:selector expression}') -snippet die - ${1:obj}.die(${2:event}, ${3:handler}) -snippet each - ${1:obj}.each(function (index) { - ${0:this.innerHTML = this + " is the element, " + index + " is the position";} - }); -snippet el - $('<${1}/>'${2:, {}}) -snippet eltrim - $.trim('${1:string}') -snippet empty - ${1:obj}.empty() -snippet end - ${1:obj}.end() -snippet eq - ${1:obj}.eq(${2:element index}) -snippet error - ${1:obj}.error(function (${2:e}) { - ${0:// event handler} - }); -snippet eventsmap - { - :f${0} - } -snippet extend - $.extend(${1:true, }${2:target}, ${3:obj}) -snippet fadein - ${1:obj}.fadeIn('${2:slow/400/fast}') -snippet fadeinc - ${1:obj}.fadeIn('slow/400/fast', function () { - ${0:// callback}; - }); -snippet fadeout - ${1:obj}.fadeOut('${2:slow/400/fast}') -snippet fadeoutc - ${1:obj}.fadeOut('slow/400/fast', function () { - ${0:// callback}; - }); -snippet fadeto - ${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5}) -snippet fadetoc - ${1:obj}.fadeTo('slow/400/fast', ${2:0.5}, function () { - ${0:// callback}; - }); -snippet filter - ${1:obj}.filter('${2:selector expression}') -snippet filtert - ${1:obj}.filter(function (${2:index}) { - ${3} - }) -snippet find - ${1:obj}.find('${2:selector expression}') -snippet focus - ${1:obj}.focus(function (${2:e}) { - ${0:// event handler} - }); -snippet focusin - ${1:obj}.focusIn(function (${2:e}) { - ${0:// event handler} - }); -snippet focusout - ${1:obj}.focusOut(function (${2:e}) { - ${0:// event handler} - }); -snippet get - ${1:obj}.get(${2:element index}) -snippet getjson - $.getJSON('${1:mydomain.com/url}', - ${2:{ param1: value1 },} - function (data, textStatus, jqXHR) { - ${0:// success callback} - } - ); -snippet getscript - $.getScript('${1:mydomain.com/url}', function (script, textStatus, jqXHR) { - ${0:// callback} - }); -snippet grep - $.grep(${1:array}, function (item, index) { - ${2} - }${0:, true}); -snippet hasc - ${1:obj}.hasClass('${2:className}') -snippet hasd - $.hasData('${0:selector expression}'); -snippet height - ${1:obj}.height(${2:integer}) -snippet hide - ${1:obj}.hide('${2:slow/400/fast}') -snippet hidec - ${1:obj}.hide('${2:slow/400/fast}', function () { - ${0:// callback} - }); -snippet hover - ${1:obj}.hover(function (${2:e}) { - ${3:// event handler} - }, function ($2) { - ${4:// event handler} - }); -snippet html - ${1:obj}.html('${2:Some text and bold!}') -snippet inarr - $.inArray(${1:value}, ${0:array}); -snippet insa - ${1:obj}.insertAfter('${2:selector expression}') -snippet insb - ${1:obj}.insertBefore('${2:selector expression}') -snippet is - ${1:obj}.is('${2:selector expression}') -snippet isarr - $.isArray(${1:obj}) -snippet isempty - $.isEmptyObject(${1:obj}) -snippet isfunc - $.isFunction(${1:obj}) -snippet isnum - $.isNumeric(${1:value}) -snippet isobj - $.isPlainObject(${1:obj}) -snippet iswin - $.isWindow(${1:obj}) -snippet isxml - $.isXMLDoc(${1:node}) -snippet jj - $('${1:selector}') -snippet kdown - ${1:obj}.keydown(function (${2:e}) { - ${0:// event handler} - }); -snippet kpress - ${1:obj}.keypress(function (${2:e}) { - ${0:// event handler} - }); -snippet kup - ${1:obj}.keyup(function (${2:e}) { - ${0:// event handler} - }); -snippet last - ${1:obj}.last('${1:selector expression}') -snippet live - ${1:obj}.live('${2:events}', function (${3:e}) { - ${0:// event handler} - }); -snippet load - ${1:obj}.load(function (${2:e}) { - ${0:// event handler} - }); -snippet loadf - ${1:obj}.load('${2:mydomain.com/url}', - ${2:{ param1: value1 },} - function (responseText, textStatus, xhr) { - ${0:// success callback} - } - }); -snippet makearray - $.makeArray(${0:obj}); -snippet map - ${1:obj}.map(function (${2:index}, ${3:element}) { - ${0:// callback} - }); -snippet mapp - $.map(${1:arrayOrObject}, function (${2:value}, ${3:indexOrKey}) { - ${0:// callback} - }); -snippet merge - $.merge(${1:target}, ${0:original}); -snippet mdown - ${1:obj}.mousedown(function (${2:e}) { - ${0:// event handler} - }); -snippet menter - ${1:obj}.mouseenter(function (${2:e}) { - ${0:// event handler} - }); -snippet mleave - ${1:obj}.mouseleave(function (${2:e}) { - ${0:// event handler} - }); -snippet mmove - ${1:obj}.mousemove(function (${2:e}) { - ${0:// event handler} - }); -snippet mout - ${1:obj}.mouseout(function (${2:e}) { - ${0:// event handler} - }); -snippet mover - ${1:obj}.mouseover(function (${2:e}) { - ${0:// event handler} - }); -snippet mup - ${1:obj}.mouseup(function (${2:e}) { - ${0:// event handler} - }); -snippet next - ${1:obj}.next('${2:selector expression}') -snippet nexta - ${1:obj}.nextAll('${2:selector expression}') -snippet nextu - ${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'}) -snippet not - ${1:obj}.not('${2:selector expression}') -snippet off - ${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler}) -snippet offset - ${1:obj}.offset() -snippet offsetp - ${1:obj}.offsetParent() -snippet on - ${1:obj}.on('${2:events}', '${3:selector expression}', function (${4:e}) { - ${0:// event handler} - }); -snippet one - ${1:obj}.one('${2:event name}', function (${3:e}) { - ${0:// event handler} - }); -snippet outerh - ${1:obj}.outerHeight() -snippet outerw - ${1:obj}.outerWidth() -snippet param - $.param(${1:obj}) -snippet parent - ${1:obj}.parent('${2:selector expression}') -snippet parents - ${1:obj}.parents('${2:selector expression}') -snippet parentsu - ${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'}) -snippet parsejson - $.parseJSON(${1:data}) -snippet parsexml - $.parseXML(${1:data}) -snippet pos - ${1:obj}.position() -snippet prepend - ${1:obj}.prepend('${2:Some text and bold!}') -snippet prependto - ${1:obj}.prependTo('${2:selector expression}') -snippet prev - ${1:obj}.prev('${2:selector expression}') -snippet preva - ${1:obj}.prevAll('${2:selector expression}') -snippet prevu - ${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'}) -snippet promise - ${1:obj}.promise(${2:'fx'}, ${3:target}) -snippet prop - ${1:obj}.prop('${2:property name}') -snippet proxy - $.proxy(${1:function}, ${2:this}) -snippet pushstack - ${1:obj}.pushStack(${2:elements}) -snippet queue - ${1:obj}.queue(${2:name}${3:, newQueue}) -snippet queuee - $.queue(${1:element}${2:, name}${3:, newQueue}) -snippet ready - $(function () { - ${0} - }); -snippet rem - ${1:obj}.remove() -snippet rema - ${1:obj}.removeAttr('${2:attribute name}') -snippet remc - ${1:obj}.removeClass('${2:class name}') -snippet remd - ${1:obj}.removeData('${2:key name}') -snippet remdd - $.removeData(${1:element}${2:, 'key name}') -snippet remp - ${1:obj}.removeProp('${2:property name}') -snippet repa - ${1:obj}.replaceAll(${2:target}) -snippet repw - ${1:obj}.replaceWith(${2:content}) -snippet reset - ${1:obj}.reset(function (${2:e}) { - ${0:// event handler} - }); -snippet resize - ${1:obj}.resize(function (${2:e}) { - ${0:// event handler} - }); -snippet scroll - ${1:obj}.scroll(function (${2:e}) { - ${0:// event handler} - }); -snippet scrolll - ${1:obj}.scrollLeft(${2:value}) -snippet scrollt - ${1:obj}.scrollTop(${2:value}) -snippet sdown - ${1:obj}.slideDown('${2:slow/400/fast}') -snippet sdownc - ${1:obj}.slideDown('${2:slow/400/fast}', function () { - ${0:// callback}; - }); -snippet select - ${1:obj}.select(function (${2:e}) { - ${0:// event handler} - }); -snippet serialize - ${1:obj}.serialize() -snippet serializea - ${1:obj}.serializeArray() -snippet show - ${1:obj}.show('${2:slow/400/fast}') -snippet showc - ${1:obj}.show('${2:slow/400/fast}', function () { - ${0:// callback} - }); -snippet sib - ${1:obj}.siblings('${2:selector expression}') -snippet size - ${1:obj}.size() -snippet slice - ${1:obj}.slice(${2:start}${3:, end}) -snippet stoggle - ${1:obj}.slideToggle('${2:slow/400/fast}') -snippet stop - ${1:obj}.stop('${2:queue}', ${3:false}, ${4:false}) -snippet submit - ${1:obj}.submit(function (${2:e}) { - ${0:// event handler} - }); -snippet sup - ${1:obj}.slideUp('${2:slow/400/fast}') -snippet supc - ${1:obj}.slideUp('${2:slow/400/fast}', function () { - ${0:// callback}; - }); -snippet text - ${1:obj}.text(${2:'some text'}) -snippet this - $(this) -snippet toarr - ${0:obj}.toArray() -snippet tog - ${1:obj}.toggle(function (${2:e}) { - ${3:// event handler} - }, function ($2) { - ${4:// event handler} - }); - ${0} -snippet togclass - ${1:obj}.toggleClass('${2:class name}') -snippet togsh - ${1:obj}.toggle('${2:slow/400/fast}') -snippet trig - ${1:obj}.trigger('${2:event name}') -snippet trigh - ${1:obj}.triggerHandler('${2:event name}') -snippet $trim - $.trim(${1:str}) -snippet $type - $.type(${1:obj}) -snippet unbind - ${1:obj}.unbind('${2:event name}') -snippet undele - ${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler}) -snippet uniq - $.unique(${1:array}) -snippet unload - ${1:obj}.unload(function (${2:e}) { - ${0:// event handler} - }); -snippet unwrap - ${1:obj}.unwrap() -snippet val - ${1:obj}.val('${2:text}') -snippet width - ${1:obj}.width(${2:integer}) -snippet wrap - ${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}') diff --git a/sources_non_forked/vim-snippets/snippets/javascript.d3.snippets b/sources_non_forked/vim-snippets/snippets/javascript.d3.snippets deleted file mode 100644 index a3f7fa7a..00000000 --- a/sources_non_forked/vim-snippets/snippets/javascript.d3.snippets +++ /dev/null @@ -1,30 +0,0 @@ -snippet .attr - .attr("${1}", ${2}) -snippet .style - .style("${1}", ${2}) -snippet axis - d3.svg.axis() - .orient(${1}) - .scale(${2}) -snippet fd - function(d) { ${1} } -snippet fdi - function(d, i) { ${1} } -snippet marginconvention - var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} }; - var ${6:width} = ${7:970} - $1.left - $1.right; - var ${8:height} = ${9:500} - $1.top - $1.bottom; - - var ${10:svg} = d3.select("${11}").append("svg") - .attr("width", $6) - .attr("height", $8) - .append("g") - .attr("transform", "translate(" + $1.left + "," + $1.top + ")") -snippet nest - d3.nest() - .key(${1}) - .entries(${2}) -snippet scale - d3.scale.linear() - .domain(${1}) - .range(${2}) diff --git a/sources_non_forked/vim-snippets/snippets/javascript.snippets b/sources_non_forked/vim-snippets/snippets/javascript.snippets deleted file mode 100644 index 0a046dbf..00000000 --- a/sources_non_forked/vim-snippets/snippets/javascript.snippets +++ /dev/null @@ -1,200 +0,0 @@ -# Prototype -snippet proto - ${1:class_name}.prototype.${2:method_name} = - function(${3:first_argument}) { - ${0:// body...} - }; -# Function -snippet fun - function ${1:function_name}(${2:argument}) { - ${0:// body...} - } -# Anonymous Function -snippet f - function (${1}) { - ${0} - }${2:;} -# Immediate function -snippet (f - (function (${1}) { - ${0} - }(${2})); -# if -snippet if - if (${1:true}) { - ${0} - } -# if ... else -snippet ife - if (${1:true}) { - ${2} - } else { - ${0} - } -# tertiary conditional -snippet ter - ${1:/* condition */} ? ${2:a} : ${0:b} -# switch -snippet switch - switch (${1:expression}) { - case '${3:case}': - ${4} - break; - ${0} - default: - ${2} - } -# case -snippet case - case '${1:case}': - ${2} - break; - ${0} -# for (...) {...} -snippet for - for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2 ++) { - var ${3:v} = $1[$2];${0:} - } -# for (...) {...} (Improved Native For-Loop) -snippet forr - for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2 --) { - var ${3:v} = $1[$2];${0:} - } -# while (...) {...} -snippet wh - while (${1:/* condition */}) { - ${0} - } -# try -snippet try - try { - ${1} - } catch (${2:e}) { - ${0:/* handle error */} - } -# do...while -snippet do - do { - ${0} - } while (${1:/* condition */}); -# Object Method -snippet :f - ${1:method_name}: function (${2:attribute}) { - ${0} - }${3:,} -# setTimeout function -snippet timeout - setTimeout(function () {${0}}${2}, ${1:10}); -# Get Elements -snippet get - getElementsBy${1:TagName}('${2}') -# Get Element -snippet gett - getElementBy${1:Id}('${2}') -# console.log (Firebug) -snippet cl - console.log(${0}); -# return -snippet ret - return ${0:result} -# for (property in object ) { ... } -snippet fori - for (var ${1:prop} in ${2:Things}) { - ${0:$2[$1]} - } -# hasOwnProperty -snippet has - hasOwnProperty(${0}) -# docstring -snippet /** - /** - * ${0:description} - * - */ -snippet @par - @param {${1:type}} ${2:name} ${0:description} -snippet @ret - @return {${1:type}} ${0:description} -# JSON.parse -snippet jsonp - JSON.parse(${0:jstr}); -# JSON.stringify -snippet jsons - JSON.stringify(${0:object}); -# self-defining function -snippet sdf - var ${1:function_name} = function (${2:argument}) { - ${3} - - $1 = function ($2) { - ${0} - }; - }; -# singleton -snippet sing - function ${1:Singleton} (${2:argument}) { - // the cached instance - var instance; - - // rewrite the constructor - $1 = function $1($2) { - return instance; - }; - - // carry over the prototype properties - $1.prototype = this; - - // the instance - instance = new $1(); - - // reset the constructor pointer - instance.constructor = $1; - - ${0} - - return instance; - } -# Crockford's object function -snippet obj - function object(o) { - function F() {} - F.prototype = o; - return new F(); - } -# Define multiple properties -snippet props - var ${1:my_object} = Object.defineProperties( - ${2:new Object()}, - { - ${3:property} : { - get : function $1_$3_getter() { - // getter code - }, - set : function $1_$3_setter(value) { - // setter code - }, - value : ${4:value}, - writeable : ${5:boolean}, - enumerable : ${6:boolean}, - configurable : ${0:boolean} - } - } - ); -# Define single property -snippet prop - Object.defineProperty( - ${1:object}, - "${2:property}", - { - get : function $1_$2_getter() { - // getter code - }, - set : function $1_$2_setter(value) { - // setter code - }, - value : ${3:value}, - writeable : ${4:boolean}, - enumerable : ${5:boolean}, - configurable : ${0:boolean} - } - ); diff --git a/sources_non_forked/vim-snippets/snippets/javascript_jquery.snippets b/sources_non_forked/vim-snippets/snippets/javascript_jquery.snippets deleted file mode 100644 index 9b4966db..00000000 --- a/sources_non_forked/vim-snippets/snippets/javascript_jquery.snippets +++ /dev/null @@ -1 +0,0 @@ -javascript-jquery.snippets \ No newline at end of file diff --git a/sources_non_forked/vim-snippets/snippets/vim.snippets b/sources_non_forked/vim-snippets/snippets/vim.snippets index dd1e65e8..8e8093b9 100644 --- a/sources_non_forked/vim-snippets/snippets/vim.snippets +++ b/sources_non_forked/vim-snippets/snippets/vim.snippets @@ -25,9 +25,8 @@ snippet for snippet forkv for [${1},${2}] in items(${3}) ${0} - unlet $1 $2 + unlet $1 $2 endfor - snippet wh while ${1} ${0} diff --git a/update_plugins.py b/update_plugins.py index 3dacaf08..78de7826 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -38,6 +38,7 @@ vim-zenroom2 https://github.com/amix/vim-zenroom2 syntastic https://github.com/scrooloose/syntastic vim-repeat https://github.com/tpope/vim-repeat vim-commentary https://github.com/tpope/vim-commentary +vim-golang https://github.com/jnwhiteh/vim-golang """.strip() GITHUB_ZIP = '%s/archive/master.zip' From cdea5a5ee3c8593d31b19396a46b6a4eef508da9 Mon Sep 17 00:00:00 2001 From: amix Date: Tue, 11 Mar 2014 21:59:33 +0100 Subject: [PATCH 31/37] New snippets --- .../snippets/coffee/angular_coffee.snippets | 116 ++++ .../snippets/coffee/coffee.snippets | 101 +++ .../snippets/coffee/jquery_coffee.snippets | 524 ++++++++++++++++ .../javascript/javascript-jquery.snippets | 589 ++++++++++++++++++ .../javascript/javascript.d3.snippets | 30 + .../snippets/javascript/javascript.snippets | 200 ++++++ 6 files changed, 1560 insertions(+) create mode 100644 sources_non_forked/vim-snippets/snippets/coffee/angular_coffee.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/coffee/jquery_coffee.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/javascript/javascript-jquery.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/javascript/javascript.d3.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets diff --git a/sources_non_forked/vim-snippets/snippets/coffee/angular_coffee.snippets b/sources_non_forked/vim-snippets/snippets/coffee/angular_coffee.snippets new file mode 100644 index 00000000..f98cae35 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/coffee/angular_coffee.snippets @@ -0,0 +1,116 @@ +## Global Snippets +# Define a new Angular Controller; +# You can change the controller name and parameters +snippet ngc + ${1:controllerName} = (${2:scope}, ${3:injectables}) -> + ${4} +# angular.foreach loop +snippet ngfor + angular.forEach ${1:iterateOver}, (value, key) -> + ${2} +## Module Based Snippets +# A new angular module without a config function +snippet ngm + angular.module '${1:moduleName}', [${2:moduleDependencies}] + ${3} +# A new angular module without a config function and a variable assignment +snippet ngma + ${1:moduleName} = angular.module '$1', [${2:moduleDeps}] + ${3} +# A new angular module with a config function +snippet ngmc + ${1:moduleName} = angular.module('$1', [${2:moduleDeps}], (${3:configDeps}) -> + ${4} + ) +# A factory in a module +snippet ngmfa + factory '${1:factoryName}', (${2:dependencies}) -> + ${3} +# Define an Angular Module Service to be attached to a previously defined module +# You can change the service name and service injectables +snippet ngms + service '${1:serviceName}', (${2:injectables}) -> + ${3} +# Define an Angular Module Filter to be attached to a previously defined module +# You can change the filter name +snippet ngmfi + filter '${1:filterName}', (${2:injectables}) -> + (input, ${3:args}) -> + ${4} +## Route Based Snippets +# Defines a when condition of an AngularJS route +snippet ngrw + $routeProvider.when '${1:url}', + templateUrl: '${2:templateUrl}' + controller: '${3:controller}' + ${4} +# Defines a when condition of an AngularJS route with the resolve block +snippet ngrwr + $routeProvider.when '${1:url}', + templateUrl: '${2:templateUrl}' + controller: '${3:controller}' + resolve: + ${4} + ${5} +# Defines an otherwise condition of an AngularJS route +snippet ngro + $routeProvider.otherwise redirectTo: '${1:url}' + ${2} +## Scope Related Snippets +# Define a new $scope'd function (usually inside an AngularJS Controller) +# You can change the function name and arguments +snippet $f + $scope.${1:functionName} = (${2:args}) -> + ${3} +# Defines a new $scope'd variable inside an AngularJS controller +snippet $v + $scope.${1:variable} = ${2:value} + ${3} +# Defines a new $scope'd variable inside an AngularJS controller and assigns a value from a constructor arguments +snippet $va + $scope.${1:variable} = ${2:variable} + ${3} +# Define a $watch for an expression +# You can change the expression to be watched +snippet $w + $scope.$watch '${1:watchExpr}', (newValue, oldValue) -> + ${2} +# Define a $on for a $broadcast/$emit on the $scope inside an Angular Controller +# You can change the event name to listen on +snippet $on + $scope.$on '${1:eventName}', (event, ${2:args}) -> + ${3} +# Define a $broadcast for a $scope inside an Angular Controller / Angular Controller Function +# You can change the event name and optional event arguments +snippet $b + $scope.$broadcast '${1:eventName}', ${2:eventArgs} + ${3} +# Define an $emit for a $scope inside an Angular Controller / Angular Controller Function +# You can change the event name and optional event arguments +snippet $e + $scope.$emit '${1:eventName}', ${2:eventArgs} + ${3} +## Directive related snippets +# A compile function +snippet ngdcf + compile = (tElement, tAttrs, transclude) -> + (scope, element, attrs) -> + ${1} +# A linking function in a directive +snippet ngdlf + (scope, element, attrs${1:ctrl}) -> + ${2} +# A directive with a compile function +snippet ngdc + directive '${1:directiveName}', factory = (${2:injectables}) -> + directiveDefinitionObject = + ${3:directiveAttrs} + compile: compile = (tElement, tAttrs, transclude) -> + (scope, element, attrs) -> + directiveDefinitionObject +# A directive with a linking function only +snippet ngdl + .directive('${1:directiveName}', (${2:directiveDeps}) -> + (scope, element, attrs${3:ctrl}) -> + ${4} + ) \ No newline at end of file diff --git a/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets b/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets new file mode 100644 index 00000000..bb964346 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets @@ -0,0 +1,101 @@ +# Closure loop +snippet forindo + for ${1:name} in ${2:array} + do ($1) -> + ${0:// body} +# Array comprehension +snippet fora + for ${1:name} in ${2:array} + ${0:# body...} +# Object comprehension +snippet foro + for ${1:key}, ${2:value} of ${3:object} + ${0:# body...} +# Range comprehension (inclusive) +snippet forr + for ${1:name} in [${2:start}..${3:finish}] + ${0:# body...} +snippet forrb + for ${1:name} in [${2:start}..${3:finish}] by ${4:step} + ${0:# body...} +# Range comprehension (exclusive) +snippet forrex + for ${1:name} in [${2:start}...${3:finish}] + ${0:# body...} +snippet forrexb + for ${1:name} in [${2:start}...${3:finish}] by ${4:step} + ${0:# body...} +# Function +snippet fun + (${1:args}) -> + ${0:# body...} +# Function (bound) +snippet bfun + (${1:args}) => + ${0:# body...} +# Class +snippet cla class .. + class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} + ${0} +snippet cla class .. constructor: .. + class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} + constructor: (${2:args}) -> + ${3} + + ${0} +snippet cla class .. extends .. + class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass} + ${0} +snippet cla class .. extends .. constructor: .. + class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} extends ${2:ParentClass} + constructor: (${3:args}) -> + ${4} + + ${0} +# If +snippet if + if ${1:condition} + ${0:# body...} +# If __ Else +snippet ife + if ${1:condition} + ${2:# body...} + else + ${0:# body...} +# Else if +snippet eif + else if ${1:condition} + ${0:# body...} +# Ternary If +snippet ifte + if ${1:condition} then ${2:value} else ${0:other} +# Unless +snippet unl + ${1:action} unless ${0:condition} +# Switch +snippet swi + switch ${1:object} + when ${2:value} + ${0:# body...} + +# Log +snippet log + console.log ${0} +# Try __ Catch +snippet try + try + ${1} + catch ${2:error} + ${0} +# Require +snippet req + ${2:$1} = require '${1:sys}' +# Export +snippet exp + ${0:root} = exports ? this + +snippet jsonp + JSON.parse ${0:jstr} +# JSON.stringify +snippet jsons + JSON.stringify ${0:object} diff --git a/sources_non_forked/vim-snippets/snippets/coffee/jquery_coffee.snippets b/sources_non_forked/vim-snippets/snippets/coffee/jquery_coffee.snippets new file mode 100644 index 00000000..10bcd775 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/coffee/jquery_coffee.snippets @@ -0,0 +1,524 @@ +snippet add + ${1:obj}.add('${2:selector expression}') +snippet addClass + ${1:obj}.addClass('${2:class name}') +snippet after + ${1:obj}.after('${2:Some text and bold!}') +snippet ajax + $.ajax + url: "${1:mydomain.com/url}" + type: "${2:POST}" + dataType: "${3:xml/html/script/json}" + data: ${4:data} + complete: (jqXHR, textStatus) -> + ${5:// callback} + success: (data, textStatus, jqXHR) -> + ${6:// success callback} + error: (jqXHR, textStatus, errorThrown) -> + ${0:// error callback} +snippet ajaxcomplete + ${1:obj}.ajaxComplete (${1:e}, xhr, settings) -> + ${0:// callback} +snippet ajaxerror + ${1:obj}.ajaxError (${1:e}, xhr, settings, thrownError) -> + ${2:// error callback} + ${0} +snippet ajaxget + $.get '${1:mydomain.com/url}', + ${2:{ param1: value1 },} + (data, textStatus, jqXHR) -> + ${0:// success callback} +snippet ajaxpost + $.post '${1:mydomain.com/url}', + ${2:{ param1: value1 },} + (data, textStatus, jqXHR) -> + ${0:// success callback} +snippet ajaxprefilter + $.ajaxPrefilter (${1:options}, ${2:originalOptions}, jqXHR) -> + ${0: // Modify options, control originalOptions, store jqXHR, etc} +snippet ajaxsend + ${1:obj}.ajaxSend (${1:request, settings}) -> + ${2:// error callback} + ${0} +snippet ajaxsetup + $.ajaxSetup({ + url: "${1:mydomain.com/url}", + type: "${2:POST}", + dataType: "${3:xml/html/script/json}", + data: $.param( $("${4:Element or Expression}") ), + complete: (jqXHR, textStatus) -> + ${5:// callback} + , + success: (data, textStatus, jqXHR) -> + ${6:// success callback} + , + error: (jqXHR, textStatus, errorThrown) -> + ${0:// error callback} + }) +snippet ajaxstart + $.ajaxStart -> + ${1:// handler for when an AJAX call is started and no other AJAX calls are in progress} + ${0} +snippet ajaxstop + $.ajaxStop -> + ${1:// handler for when all AJAX calls have been completed} + ${0} +snippet ajaxsuccess + $.ajaxSuccess (${1:e}, xhr, settings) -> + ${2:// handler for when any AJAX call is successfully completed} + ${0} +snippet andself + ${1:obj}.andSelf() +snippet animate + ${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed}) +snippet append + ${1:obj}.append('${2:Some text and bold!}') +snippet appendTo + ${1:obj}.appendTo('${2:selector expression}') +snippet attr + ${1:obj}.attr('${2:attribute}', '${3:value}') +snippet attrm + ${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'}) +snippet before + ${1:obj}.before('${2:Some text and bold!}') +snippet bind + ${1:obj}.bind('${2:event name}', (${3:e}) -> + ${0:// event handler} +snippet blur + ${1:obj}.blur (${2:e}) -> + ${0:// event handler} +snippet C + $.Callbacks() +snippet Cadd + ${1:callbacks}.add(${2:callbacks}) +snippet Cdis + ${1:callbacks}.disable() +snippet Cempty + ${1:callbacks}.empty() +snippet Cfire + ${1:callbacks}.fire(${2:args}) +snippet Cfired + ${1:callbacks}.fired() +snippet Cfirew + ${1:callbacks}.fireWith(${2:this}, ${3:args}) +snippet Chas + ${1:callbacks}.has(${2:callback}) +snippet Clock + ${1:callbacks}.lock() +snippet Clocked + ${1:callbacks}.locked() +snippet Crem + ${1:callbacks}.remove(${2:callbacks}) +snippet change + ${1:obj}.change (${2:e}) -> + ${0:// event handler} +snippet children + ${1:obj}.children('${2:selector expression}') +snippet clearq + ${1:obj}.clearQueue(${2:'queue name'}) +snippet click + ${1:obj}.click (${2:e}) -> + ${0:// event handler} +snippet clone + ${1:obj}.clone() +snippet contains + $.contains(${1:container}, ${0:contents}) +snippet css + ${1:obj}.css('${2:attribute}', '${3:value}') +snippet csshooks + $.cssHooks['${1:CSS prop}'] = { + get: (elem, computed, extra) -> + ${2: // handle getting the CSS property} + set: (elem, value) -> + ${0: // handle setting the CSS value} + } +snippet cssm + ${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'}) +snippet D + $.Deferred() +snippet Dalways + ${1:deferred}.always(${2:callbacks}) +snippet Ddone + ${1:deferred}.done(${2:callbacks}) +snippet Dfail + ${1:deferred}.fail(${2:callbacks}) +snippet Disrej + ${1:deferred}.isRejected() +snippet Disres + ${1:deferred}.isResolved() +snippet Dnotify + ${1:deferred}.notify(${2:args}) +snippet Dnotifyw + ${1:deferred}.notifyWith(${2:this}, ${3:args}) +snippet Dpipe + ${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter}) +snippet Dprog + ${1:deferred}.progress(${2:callbacks}) +snippet Dprom + ${1:deferred}.promise(${2:target}) +snippet Drej + ${1:deferred}.reject(${2:args}) +snippet Drejw + ${1:deferred}.rejectWith(${2:this}, ${3:args}) +snippet Dres + ${1:deferred}.resolve(${2:args}) +snippet Dresw + ${1:deferred}.resolveWith(${2:this}, ${3:args}) +snippet Dstate + ${1:deferred}.state() +snippet Dthen + ${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks}) +snippet Dwhen + $.when(${1:deferreds}) +snippet data + ${1:obj}.data(${2:obj}) +snippet dataa + $.data('${1:selector expression}', '${2:key}'${3:, 'value'}) +snippet dblclick + ${1:obj}.dblclick (${2:e}) -> + ${0:// event handler} +snippet delay + ${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'}) +snippet dele + ${1:obj}.delegate '${2:selector expression}', '${3:event name}', (${4:e}) -> + ${0:// event handler} +snippet deq + ${1:obj}.dequeue(${2:'queue name'}) +snippet deqq + $.dequeue('${1:selector expression}'${2:, 'queue name'}) +snippet detach + ${1:obj}.detach('${2:selector expression}') +snippet die + ${1:obj}.die(${2:event}, ${3:handler}) +snippet each + ${1:obj}.each (index) -> + ${0:this.innerHTML = this + " is the element, " + index + " is the position"} +snippet el + $('<${1}/>'${2:, {}}) +snippet eltrim + $.trim('${1:string}') +snippet empty + ${1:obj}.empty() +snippet end + ${1:obj}.end() +snippet eq + ${1:obj}.eq(${2:element index}) +snippet error + ${1:obj}.error (${2:e}) -> + ${0:// event handler} +snippet eventsmap + { + :f${0} + } +snippet extend + $.extend(${1:true, }${2:target}, ${3:obj}) +snippet fadein + ${1:obj}.fadeIn('${2:slow/400/fast}') +snippet fadeinc + ${1:obj}.fadeIn 'slow/400/fast', -> + ${0:// callback} +snippet fadeout + ${1:obj}.fadeOut('${2:slow/400/fast}') +snippet fadeoutc + ${1:obj}.fadeOut 'slow/400/fast', -> + ${0:// callback} +snippet fadeto + ${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5}) +snippet fadetoc + ${1:obj}.fadeTo 'slow/400/fast', ${2:0.5}, -> + ${0:// callback} +snippet filter + ${1:obj}.filter('${2:selector expression}') +snippet filtert + ${1:obj}.filter (${2:index}) -> + ${3} +snippet find + ${1:obj}.find('${2:selector expression}') +snippet focus + ${1:obj}.focus (${2:e}) -> + ${0:// event handler} +snippet focusin + ${1:obj}.focusIn (${2:e}) -> + ${0:// event handler} +snippet focusout + ${1:obj}.focusOut (${2:e}) -> + ${0:// event handler} +snippet get + ${1:obj}.get(${2:element index}) +snippet getjson + $.getJSON '${1:mydomain.com/url}', + ${2:{ param1: value1 },} + (data, textStatus, jqXHR) -> + ${0:// success callback} +snippet getscript + $.getScript '${1:mydomain.com/url}', (script, textStatus, jqXHR) -> + ${0:// callback} +snippet grep + $.grep(${1:array}, (item, index) > + ${2} + ${0:, true}) +snippet hasc + ${1:obj}.hasClass('${2:className}') +snippet hasd + $.hasData('${0:selector expression}') +snippet height + ${1:obj}.height(${2:integer}) +snippet hide + ${1:obj}.hide('${2:slow/400/fast}') +snippet hidec + ${1:obj}.hide '${2:slow/400/fast}', -> + ${0:// callback} +snippet hover + ${1:obj}.hover (${2:e}) -> + ${3:// event handler} + , ($2) -> + ${4:// event handler} +snippet html + ${1:obj}.html('${2:Some text and bold!}') +snippet inarr + $.inArray(${1:value}, ${0:array}) +snippet insa + ${1:obj}.insertAfter('${2:selector expression}') +snippet insb + ${1:obj}.insertBefore('${2:selector expression}') +snippet is + ${1:obj}.is('${2:selector expression}') +snippet isarr + $.isArray(${1:obj}) +snippet isempty + $.isEmptyObject(${1:obj}) +snippet isfunc + $.isFunction(${1:obj}) +snippet isnum + $.isNumeric(${1:value}) +snippet isobj + $.isPlainObject(${1:obj}) +snippet iswin + $.isWindow(${1:obj}) +snippet isxml + $.isXMLDoc(${1:node}) +snippet jj + $('${1:selector}') +snippet kdown + ${1:obj}.keydown (${2:e}) -> + ${0:// event handler} +snippet kpress + ${1:obj}.keypress (${2:e}) -> + ${0:// event handler} +snippet kup + ${1:obj}.keyup (${2:e}) -> + ${0:// event handler} +snippet last + ${1:obj}.last('${1:selector expression}') +snippet live + ${1:obj}.live '${2:events}', (${3:e}) -> + ${0:// event handler} +snippet load + ${1:obj}.load (${2:e}) -> + ${0:// event handler} +snippet loadf + ${1:obj}.load('${2:mydomain.com/url}', + ${2:{ param1: value1 },} + (responseText, textStatus, xhr) -> + ${0:// success callback} + }) +snippet makearray + $.makeArray(${0:obj}) +snippet map + ${1:obj}.map (${2:index}, ${3:element}) -> + ${0:// callback} +snippet mapp + $.map ${1:arrayOrObject}, (${2:value}, ${3:indexOrKey}) -> + ${0:// callback} +snippet merge + $.merge(${1:target}, ${0:original}) +snippet mdown + ${1:obj}.mousedown (${2:e}) -> + ${0:// event handler} +snippet menter + ${1:obj}.mouseenter (${2:e}) -> + ${0:// event handler} +snippet mleave + ${1:obj}.mouseleave (${2:e}) -> + ${0:// event handler} +snippet mmove + ${1:obj}.mousemove (${2:e}) -> + ${0:// event handler} +snippet mout + ${1:obj}.mouseout (${2:e}) -> + ${0:// event handler} +snippet mover + ${1:obj}.mouseover (${2:e}) -> + ${0:// event handler} +snippet mup + ${1:obj}.mouseup (${2:e}) -> + ${0:// event handler} +snippet next + ${1:obj}.next('${2:selector expression}') +snippet nexta + ${1:obj}.nextAll('${2:selector expression}') +snippet nextu + ${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'}) +snippet not + ${1:obj}.not('${2:selector expression}') +snippet off + ${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler}) +snippet offset + ${1:obj}.offset() +snippet offsetp + ${1:obj}.offsetParent() +snippet on + ${1:obj}.on '${2:events}', '${3:selector expression}', (${4:e}) -> + ${0:// event handler} +snippet one + ${1:obj}.one '${2:event name}', (${3:e}) -> + ${0:// event handler} +snippet outerh + ${1:obj}.outerHeight() +snippet outerw + ${1:obj}.outerWidth() +snippet param + $.param(${1:obj}) +snippet parent + ${1:obj}.parent('${2:selector expression}') +snippet parents + ${1:obj}.parents('${2:selector expression}') +snippet parentsu + ${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'}) +snippet parsejson + $.parseJSON(${1:data}) +snippet parsexml + $.parseXML(${1:data}) +snippet pos + ${1:obj}.position() +snippet prepend + ${1:obj}.prepend('${2:Some text and bold!}') +snippet prependto + ${1:obj}.prependTo('${2:selector expression}') +snippet prev + ${1:obj}.prev('${2:selector expression}') +snippet preva + ${1:obj}.prevAll('${2:selector expression}') +snippet prevu + ${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'}) +snippet promise + ${1:obj}.promise(${2:'fx'}, ${3:target}) +snippet prop + ${1:obj}.prop('${2:property name}') +snippet proxy + $.proxy(${1:function}, ${2:this}) +snippet pushstack + ${1:obj}.pushStack(${2:elements}) +snippet queue + ${1:obj}.queue(${2:name}${3:, newQueue}) +snippet queuee + $.queue(${1:element}${2:, name}${3:, newQueue}) +snippet ready + $(() -> + ${0} + ) +snippet rem + ${1:obj}.remove() +snippet rema + ${1:obj}.removeAttr('${2:attribute name}') +snippet remc + ${1:obj}.removeClass('${2:class name}') +snippet remd + ${1:obj}.removeData('${2:key name}') +snippet remdd + $.removeData(${1:element}${2:, 'key name}') +snippet remp + ${1:obj}.removeProp('${2:property name}') +snippet repa + ${1:obj}.replaceAll(${2:target}) +snippet repw + ${1:obj}.replaceWith(${2:content}) +snippet reset + ${1:obj}.reset (${2:e}) -> + ${0:// event handler} +snippet resize + ${1:obj}.resize (${2:e}) -> + ${0:// event handler} +snippet scroll + ${1:obj}.scroll (${2:e}) -> + ${0:// event handler} +snippet scrolll + ${1:obj}.scrollLeft(${2:value}) +snippet scrollt + ${1:obj}.scrollTop(${2:value}) +snippet sdown + ${1:obj}.slideDown('${2:slow/400/fast}') +snippet sdownc + ${1:obj}.slideDown('${2:slow/400/fast}', -> + ${0:// callback} +snippet select + ${1:obj}.select (${2:e}) -> + ${0:// event handler} +snippet serialize + ${1:obj}.serialize() +snippet serializea + ${1:obj}.serializeArray() +snippet show + ${1:obj}.show('${2:slow/400/fast}') +snippet showc + ${1:obj}.show '${2:slow/400/fast}', -> + ${0:// callback} +snippet sib + ${1:obj}.siblings('${2:selector expression}') +snippet size + ${1:obj}.size() +snippet slice + ${1:obj}.slice(${2:start}${3:, end}) +snippet stoggle + ${1:obj}.slideToggle('${2:slow/400/fast}') +snippet stop + ${1:obj}.stop('${2:queue}', ${3:false}, ${4:false}) +snippet submit + ${1:obj}.submit (${2:e}) -> + ${0:// event handler} +snippet sup + ${1:obj}.slideUp('${2:slow/400/fast}') +snippet supc + ${1:obj}.slideUp '${2:slow/400/fast}', -> + ${0:// callback} +snippet text + ${1:obj}.text(${2:'some text'}) +snippet this + $(this) +snippet toarr + ${0:obj}.toArray() +snippet tog + ${1:obj}.toggle (${2:e}) -> + ${3:// event handler} + , ($2) -> + ${4:// event handler} + ${0} +snippet togclass + ${1:obj}.toggleClass('${2:class name}') +snippet togsh + ${1:obj}.toggle('${2:slow/400/fast}') +snippet trig + ${1:obj}.trigger('${2:event name}') +snippet trigh + ${1:obj}.triggerHandler('${2:event name}') +snippet $trim + $.trim(${1:str}) +snippet $type + $.type(${1:obj}) +snippet unbind + ${1:obj}.unbind('${2:event name}') +snippet undele + ${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler}) +snippet uniq + $.unique(${1:array}) +snippet unload + ${1:obj}.unload (${2:e}) -> + ${0:// event handler} +snippet unwrap + ${1:obj}.unwrap() +snippet val + ${1:obj}.val('${2:text}') +snippet width + ${1:obj}.width(${2:integer}) +snippet wrap + ${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}') diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript-jquery.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript-jquery.snippets new file mode 100644 index 00000000..ef6f66c7 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript-jquery.snippets @@ -0,0 +1,589 @@ +snippet add + ${1:obj}.add('${2:selector expression}') +snippet addClass + ${1:obj}.addClass('${2:class name}') +snippet after + ${1:obj}.after('${2:Some text and bold!}') +snippet ajax + $.ajax({ + url: '${1:mydomain.com/url}', + type: '${2:POST}', + dataType: '${3:xml/html/script/json}', + data: $.param( $('${4:Element or Expression}') ), + complete: function (jqXHR, textStatus) { + ${5:// callback} + }, + success: function (data, textStatus, jqXHR) { + ${6:// success callback} + }, + error: function (jqXHR, textStatus, errorThrown) { + ${0:// error callback} + } + }); +snippet ajaxcomplete + ${1:obj}.ajaxComplete(function (${1:e}, xhr, settings) { + ${0:// callback} + }); +snippet ajaxerror + ${1:obj}.ajaxError(function (${1:e}, xhr, settings, thrownError) { + ${2:// error callback} + }); + ${0} +snippet ajaxget + $.get('${1:mydomain.com/url}', + ${2:{ param1: value1 },} + function (data, textStatus, jqXHR) { + ${0:// success callback} + } + ); +snippet ajaxpost + $.post('${1:mydomain.com/url}', + ${2:{ param1: value1 },} + function (data, textStatus, jqXHR) { + ${0:// success callback} + } + ); +snippet ajaxprefilter + $.ajaxPrefilter(function (${1:options}, ${2:originalOptions}, jqXHR) { + ${0: // Modify options, control originalOptions, store jqXHR, etc} + }); +snippet ajaxsend + ${1:obj}.ajaxSend(function (${1:request, settings}) { + ${2:// error callback} + }); + ${0} +snippet ajaxsetup + $.ajaxSetup({ + url: "${1:mydomain.com/url}", + type: "${2:POST}", + dataType: "${3:xml/html/script/json}", + data: $.param( $("${4:Element or Expression}") ), + complete: function (jqXHR, textStatus) { + ${5:// callback} + }, + success: function (data, textStatus, jqXHR) { + ${6:// success callback} + }, + error: function (jqXHR, textStatus, errorThrown) { + ${0:// error callback} + } + }); +snippet ajaxstart + $.ajaxStart(function () { + ${1:// handler for when an AJAX call is started and no other AJAX calls are in progress}; + }); + ${0} +snippet ajaxstop + $.ajaxStop(function () { + ${1:// handler for when all AJAX calls have been completed}; + }); + ${0} +snippet ajaxsuccess + $.ajaxSuccess(function (${1:e}, xhr, settings) { + ${2:// handler for when any AJAX call is successfully completed}; + }); + ${0} +snippet andself + ${1:obj}.andSelf() +snippet animate + ${1:obj}.animate({${2:param1: value1, param2: value2}}, ${3:speed}) +snippet append + ${1:obj}.append('${2:Some text and bold!}') +snippet appendTo + ${1:obj}.appendTo('${2:selector expression}') +snippet attr + ${1:obj}.attr('${2:attribute}', '${3:value}') +snippet attrm + ${1:obj}.attr({'${2:attr1}': '${3:value1}', '${4:attr2}': '${5:value2}'}) +snippet before + ${1:obj}.before('${2:Some text and bold!}') +snippet bind + ${1:obj}.bind('${2:event name}', function (${3:e}) { + ${0:// event handler} + }); +snippet blur + ${1:obj}.blur(function (${2:e}) { + ${0:// event handler} + }); +snippet C + $.Callbacks() +snippet Cadd + ${1:callbacks}.add(${2:callbacks}) +snippet Cdis + ${1:callbacks}.disable() +snippet Cempty + ${1:callbacks}.empty() +snippet Cfire + ${1:callbacks}.fire(${2:args}) +snippet Cfired + ${1:callbacks}.fired() +snippet Cfirew + ${1:callbacks}.fireWith(${2:this}, ${3:args}) +snippet Chas + ${1:callbacks}.has(${2:callback}) +snippet Clock + ${1:callbacks}.lock() +snippet Clocked + ${1:callbacks}.locked() +snippet Crem + ${1:callbacks}.remove(${2:callbacks}) +snippet change + ${1:obj}.change(function (${2:e}) { + ${0:// event handler} + }); +snippet children + ${1:obj}.children('${2:selector expression}') +snippet clearq + ${1:obj}.clearQueue(${2:'queue name'}) +snippet click + ${1:obj}.click(function (${2:e}) { + ${0:// event handler} + }); +snippet clone + ${1:obj}.clone() +snippet contains + $.contains(${1:container}, ${0:contents}); +snippet css + ${1:obj}.css('${2:attribute}', '${3:value}') +snippet csshooks + $.cssHooks['${1:CSS prop}'] = { + get: function (elem, computed, extra) { + ${2: // handle getting the CSS property} + }, + set: function (elem, value) { + ${0: // handle setting the CSS value} + } + }; +snippet cssm + ${1:obj}.css({${2:attribute1}: '${3:value1}', ${4:attribute2}: '${5:value2}'}) +snippet D + $.Deferred() +snippet Dalways + ${1:deferred}.always(${2:callbacks}) +snippet Ddone + ${1:deferred}.done(${2:callbacks}) +snippet Dfail + ${1:deferred}.fail(${2:callbacks}) +snippet Disrej + ${1:deferred}.isRejected() +snippet Disres + ${1:deferred}.isResolved() +snippet Dnotify + ${1:deferred}.notify(${2:args}) +snippet Dnotifyw + ${1:deferred}.notifyWith(${2:this}, ${3:args}) +snippet Dpipe + ${1:deferred}.then(${2:doneFilter}, ${3:failFilter}, ${4:progressFilter}) +snippet Dprog + ${1:deferred}.progress(${2:callbacks}) +snippet Dprom + ${1:deferred}.promise(${2:target}) +snippet Drej + ${1:deferred}.reject(${2:args}) +snippet Drejw + ${1:deferred}.rejectWith(${2:this}, ${3:args}) +snippet Dres + ${1:deferred}.resolve(${2:args}) +snippet Dresw + ${1:deferred}.resolveWith(${2:this}, ${3:args}) +snippet Dstate + ${1:deferred}.state() +snippet Dthen + ${1:deferred}.then(${2:doneCallbacks}, ${3:failCallbacks}, ${4:progressCallbacks}) +snippet Dwhen + $.when(${1:deferreds}) +snippet data + ${1:obj}.data(${2:obj}) +snippet dataa + $.data('${1:selector expression}', '${2:key}'${3:, 'value'}) +snippet dblclick + ${1:obj}.dblclick(function (${2:e}) { + ${0:// event handler} + }); +snippet delay + ${1:obj}.delay('${2:slow/400/fast}'${3:, 'queue name'}) +snippet dele + ${1:obj}.delegate('${2:selector expression}', '${3:event name}', function (${4:e}) { + ${0:// event handler} + }); +snippet deq + ${1:obj}.dequeue(${2:'queue name'}) +snippet deqq + $.dequeue('${1:selector expression}'${2:, 'queue name'}) +snippet detach + ${1:obj}.detach('${2:selector expression}') +snippet die + ${1:obj}.die(${2:event}, ${3:handler}) +snippet each + ${1:obj}.each(function (index) { + ${0:this.innerHTML = this + " is the element, " + index + " is the position";} + }); +snippet el + $('<${1}/>'${2:, {}}) +snippet eltrim + $.trim('${1:string}') +snippet empty + ${1:obj}.empty() +snippet end + ${1:obj}.end() +snippet eq + ${1:obj}.eq(${2:element index}) +snippet error + ${1:obj}.error(function (${2:e}) { + ${0:// event handler} + }); +snippet eventsmap + { + :f${0} + } +snippet extend + $.extend(${1:true, }${2:target}, ${3:obj}) +snippet fadein + ${1:obj}.fadeIn('${2:slow/400/fast}') +snippet fadeinc + ${1:obj}.fadeIn('slow/400/fast', function () { + ${0:// callback}; + }); +snippet fadeout + ${1:obj}.fadeOut('${2:slow/400/fast}') +snippet fadeoutc + ${1:obj}.fadeOut('slow/400/fast', function () { + ${0:// callback}; + }); +snippet fadeto + ${1:obj}.fadeTo('${2:slow/400/fast}', ${3:0.5}) +snippet fadetoc + ${1:obj}.fadeTo('slow/400/fast', ${2:0.5}, function () { + ${0:// callback}; + }); +snippet filter + ${1:obj}.filter('${2:selector expression}') +snippet filtert + ${1:obj}.filter(function (${2:index}) { + ${3} + }) +snippet find + ${1:obj}.find('${2:selector expression}') +snippet focus + ${1:obj}.focus(function (${2:e}) { + ${0:// event handler} + }); +snippet focusin + ${1:obj}.focusIn(function (${2:e}) { + ${0:// event handler} + }); +snippet focusout + ${1:obj}.focusOut(function (${2:e}) { + ${0:// event handler} + }); +snippet get + ${1:obj}.get(${2:element index}) +snippet getjson + $.getJSON('${1:mydomain.com/url}', + ${2:{ param1: value1 },} + function (data, textStatus, jqXHR) { + ${0:// success callback} + } + ); +snippet getscript + $.getScript('${1:mydomain.com/url}', function (script, textStatus, jqXHR) { + ${0:// callback} + }); +snippet grep + $.grep(${1:array}, function (item, index) { + ${2} + }${0:, true}); +snippet hasc + ${1:obj}.hasClass('${2:className}') +snippet hasd + $.hasData('${0:selector expression}'); +snippet height + ${1:obj}.height(${2:integer}) +snippet hide + ${1:obj}.hide('${2:slow/400/fast}') +snippet hidec + ${1:obj}.hide('${2:slow/400/fast}', function () { + ${0:// callback} + }); +snippet hover + ${1:obj}.hover(function (${2:e}) { + ${3:// event handler} + }, function ($2) { + ${4:// event handler} + }); +snippet html + ${1:obj}.html('${2:Some text and bold!}') +snippet inarr + $.inArray(${1:value}, ${0:array}); +snippet insa + ${1:obj}.insertAfter('${2:selector expression}') +snippet insb + ${1:obj}.insertBefore('${2:selector expression}') +snippet is + ${1:obj}.is('${2:selector expression}') +snippet isarr + $.isArray(${1:obj}) +snippet isempty + $.isEmptyObject(${1:obj}) +snippet isfunc + $.isFunction(${1:obj}) +snippet isnum + $.isNumeric(${1:value}) +snippet isobj + $.isPlainObject(${1:obj}) +snippet iswin + $.isWindow(${1:obj}) +snippet isxml + $.isXMLDoc(${1:node}) +snippet jj + $('${1:selector}') +snippet kdown + ${1:obj}.keydown(function (${2:e}) { + ${0:// event handler} + }); +snippet kpress + ${1:obj}.keypress(function (${2:e}) { + ${0:// event handler} + }); +snippet kup + ${1:obj}.keyup(function (${2:e}) { + ${0:// event handler} + }); +snippet last + ${1:obj}.last('${1:selector expression}') +snippet live + ${1:obj}.live('${2:events}', function (${3:e}) { + ${0:// event handler} + }); +snippet load + ${1:obj}.load(function (${2:e}) { + ${0:// event handler} + }); +snippet loadf + ${1:obj}.load('${2:mydomain.com/url}', + ${2:{ param1: value1 },} + function (responseText, textStatus, xhr) { + ${0:// success callback} + } + }); +snippet makearray + $.makeArray(${0:obj}); +snippet map + ${1:obj}.map(function (${2:index}, ${3:element}) { + ${0:// callback} + }); +snippet mapp + $.map(${1:arrayOrObject}, function (${2:value}, ${3:indexOrKey}) { + ${0:// callback} + }); +snippet merge + $.merge(${1:target}, ${0:original}); +snippet mdown + ${1:obj}.mousedown(function (${2:e}) { + ${0:// event handler} + }); +snippet menter + ${1:obj}.mouseenter(function (${2:e}) { + ${0:// event handler} + }); +snippet mleave + ${1:obj}.mouseleave(function (${2:e}) { + ${0:// event handler} + }); +snippet mmove + ${1:obj}.mousemove(function (${2:e}) { + ${0:// event handler} + }); +snippet mout + ${1:obj}.mouseout(function (${2:e}) { + ${0:// event handler} + }); +snippet mover + ${1:obj}.mouseover(function (${2:e}) { + ${0:// event handler} + }); +snippet mup + ${1:obj}.mouseup(function (${2:e}) { + ${0:// event handler} + }); +snippet next + ${1:obj}.next('${2:selector expression}') +snippet nexta + ${1:obj}.nextAll('${2:selector expression}') +snippet nextu + ${1:obj}.nextUntil('${2:selector expression}'${3:, 'filter expression'}) +snippet not + ${1:obj}.not('${2:selector expression}') +snippet off + ${1:obj}.off('${2:events}', '${3:selector expression}'${4:, handler}) +snippet offset + ${1:obj}.offset() +snippet offsetp + ${1:obj}.offsetParent() +snippet on + ${1:obj}.on('${2:events}', '${3:selector expression}', function (${4:e}) { + ${0:// event handler} + }); +snippet one + ${1:obj}.one('${2:event name}', function (${3:e}) { + ${0:// event handler} + }); +snippet outerh + ${1:obj}.outerHeight() +snippet outerw + ${1:obj}.outerWidth() +snippet param + $.param(${1:obj}) +snippet parent + ${1:obj}.parent('${2:selector expression}') +snippet parents + ${1:obj}.parents('${2:selector expression}') +snippet parentsu + ${1:obj}.parentsUntil('${2:selector expression}'${3:, 'filter expression'}) +snippet parsejson + $.parseJSON(${1:data}) +snippet parsexml + $.parseXML(${1:data}) +snippet pos + ${1:obj}.position() +snippet prepend + ${1:obj}.prepend('${2:Some text and bold!}') +snippet prependto + ${1:obj}.prependTo('${2:selector expression}') +snippet prev + ${1:obj}.prev('${2:selector expression}') +snippet preva + ${1:obj}.prevAll('${2:selector expression}') +snippet prevu + ${1:obj}.prevUntil('${2:selector expression}'${3:, 'filter expression'}) +snippet promise + ${1:obj}.promise(${2:'fx'}, ${3:target}) +snippet prop + ${1:obj}.prop('${2:property name}') +snippet proxy + $.proxy(${1:function}, ${2:this}) +snippet pushstack + ${1:obj}.pushStack(${2:elements}) +snippet queue + ${1:obj}.queue(${2:name}${3:, newQueue}) +snippet queuee + $.queue(${1:element}${2:, name}${3:, newQueue}) +snippet ready + $(function () { + ${0} + }); +snippet rem + ${1:obj}.remove() +snippet rema + ${1:obj}.removeAttr('${2:attribute name}') +snippet remc + ${1:obj}.removeClass('${2:class name}') +snippet remd + ${1:obj}.removeData('${2:key name}') +snippet remdd + $.removeData(${1:element}${2:, 'key name}') +snippet remp + ${1:obj}.removeProp('${2:property name}') +snippet repa + ${1:obj}.replaceAll(${2:target}) +snippet repw + ${1:obj}.replaceWith(${2:content}) +snippet reset + ${1:obj}.reset(function (${2:e}) { + ${0:// event handler} + }); +snippet resize + ${1:obj}.resize(function (${2:e}) { + ${0:// event handler} + }); +snippet scroll + ${1:obj}.scroll(function (${2:e}) { + ${0:// event handler} + }); +snippet scrolll + ${1:obj}.scrollLeft(${2:value}) +snippet scrollt + ${1:obj}.scrollTop(${2:value}) +snippet sdown + ${1:obj}.slideDown('${2:slow/400/fast}') +snippet sdownc + ${1:obj}.slideDown('${2:slow/400/fast}', function () { + ${0:// callback}; + }); +snippet select + ${1:obj}.select(function (${2:e}) { + ${0:// event handler} + }); +snippet serialize + ${1:obj}.serialize() +snippet serializea + ${1:obj}.serializeArray() +snippet show + ${1:obj}.show('${2:slow/400/fast}') +snippet showc + ${1:obj}.show('${2:slow/400/fast}', function () { + ${0:// callback} + }); +snippet sib + ${1:obj}.siblings('${2:selector expression}') +snippet size + ${1:obj}.size() +snippet slice + ${1:obj}.slice(${2:start}${3:, end}) +snippet stoggle + ${1:obj}.slideToggle('${2:slow/400/fast}') +snippet stop + ${1:obj}.stop('${2:queue}', ${3:false}, ${4:false}) +snippet submit + ${1:obj}.submit(function (${2:e}) { + ${0:// event handler} + }); +snippet sup + ${1:obj}.slideUp('${2:slow/400/fast}') +snippet supc + ${1:obj}.slideUp('${2:slow/400/fast}', function () { + ${0:// callback}; + }); +snippet text + ${1:obj}.text(${2:'some text'}) +snippet this + $(this) +snippet toarr + ${0:obj}.toArray() +snippet tog + ${1:obj}.toggle(function (${2:e}) { + ${3:// event handler} + }, function ($2) { + ${4:// event handler} + }); + ${0} +snippet togclass + ${1:obj}.toggleClass('${2:class name}') +snippet togsh + ${1:obj}.toggle('${2:slow/400/fast}') +snippet trig + ${1:obj}.trigger('${2:event name}') +snippet trigh + ${1:obj}.triggerHandler('${2:event name}') +snippet $trim + $.trim(${1:str}) +snippet $type + $.type(${1:obj}) +snippet unbind + ${1:obj}.unbind('${2:event name}') +snippet undele + ${1:obj}.undelegate(${2:selector expression}, ${3:event}, ${4:handler}) +snippet uniq + $.unique(${1:array}) +snippet unload + ${1:obj}.unload(function (${2:e}) { + ${0:// event handler} + }); +snippet unwrap + ${1:obj}.unwrap() +snippet val + ${1:obj}.val('${2:text}') +snippet width + ${1:obj}.width(${2:integer}) +snippet wrap + ${1:obj}.wrap('${2:<div class="extra-wrapper"></div>}') diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.d3.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.d3.snippets new file mode 100644 index 00000000..a3f7fa7a --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.d3.snippets @@ -0,0 +1,30 @@ +snippet .attr + .attr("${1}", ${2}) +snippet .style + .style("${1}", ${2}) +snippet axis + d3.svg.axis() + .orient(${1}) + .scale(${2}) +snippet fd + function(d) { ${1} } +snippet fdi + function(d, i) { ${1} } +snippet marginconvention + var ${1:margin} = { top: ${2:10}, right: ${3:10}, bottom: ${4:10}, left: ${5:10} }; + var ${6:width} = ${7:970} - $1.left - $1.right; + var ${8:height} = ${9:500} - $1.top - $1.bottom; + + var ${10:svg} = d3.select("${11}").append("svg") + .attr("width", $6) + .attr("height", $8) + .append("g") + .attr("transform", "translate(" + $1.left + "," + $1.top + ")") +snippet nest + d3.nest() + .key(${1}) + .entries(${2}) +snippet scale + d3.scale.linear() + .domain(${1}) + .range(${2}) diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets new file mode 100644 index 00000000..0a046dbf --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets @@ -0,0 +1,200 @@ +# Prototype +snippet proto + ${1:class_name}.prototype.${2:method_name} = + function(${3:first_argument}) { + ${0:// body...} + }; +# Function +snippet fun + function ${1:function_name}(${2:argument}) { + ${0:// body...} + } +# Anonymous Function +snippet f + function (${1}) { + ${0} + }${2:;} +# Immediate function +snippet (f + (function (${1}) { + ${0} + }(${2})); +# if +snippet if + if (${1:true}) { + ${0} + } +# if ... else +snippet ife + if (${1:true}) { + ${2} + } else { + ${0} + } +# tertiary conditional +snippet ter + ${1:/* condition */} ? ${2:a} : ${0:b} +# switch +snippet switch + switch (${1:expression}) { + case '${3:case}': + ${4} + break; + ${0} + default: + ${2} + } +# case +snippet case + case '${1:case}': + ${2} + break; + ${0} +# for (...) {...} +snippet for + for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2 ++) { + var ${3:v} = $1[$2];${0:} + } +# for (...) {...} (Improved Native For-Loop) +snippet forr + for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2 --) { + var ${3:v} = $1[$2];${0:} + } +# while (...) {...} +snippet wh + while (${1:/* condition */}) { + ${0} + } +# try +snippet try + try { + ${1} + } catch (${2:e}) { + ${0:/* handle error */} + } +# do...while +snippet do + do { + ${0} + } while (${1:/* condition */}); +# Object Method +snippet :f + ${1:method_name}: function (${2:attribute}) { + ${0} + }${3:,} +# setTimeout function +snippet timeout + setTimeout(function () {${0}}${2}, ${1:10}); +# Get Elements +snippet get + getElementsBy${1:TagName}('${2}') +# Get Element +snippet gett + getElementBy${1:Id}('${2}') +# console.log (Firebug) +snippet cl + console.log(${0}); +# return +snippet ret + return ${0:result} +# for (property in object ) { ... } +snippet fori + for (var ${1:prop} in ${2:Things}) { + ${0:$2[$1]} + } +# hasOwnProperty +snippet has + hasOwnProperty(${0}) +# docstring +snippet /** + /** + * ${0:description} + * + */ +snippet @par + @param {${1:type}} ${2:name} ${0:description} +snippet @ret + @return {${1:type}} ${0:description} +# JSON.parse +snippet jsonp + JSON.parse(${0:jstr}); +# JSON.stringify +snippet jsons + JSON.stringify(${0:object}); +# self-defining function +snippet sdf + var ${1:function_name} = function (${2:argument}) { + ${3} + + $1 = function ($2) { + ${0} + }; + }; +# singleton +snippet sing + function ${1:Singleton} (${2:argument}) { + // the cached instance + var instance; + + // rewrite the constructor + $1 = function $1($2) { + return instance; + }; + + // carry over the prototype properties + $1.prototype = this; + + // the instance + instance = new $1(); + + // reset the constructor pointer + instance.constructor = $1; + + ${0} + + return instance; + } +# Crockford's object function +snippet obj + function object(o) { + function F() {} + F.prototype = o; + return new F(); + } +# Define multiple properties +snippet props + var ${1:my_object} = Object.defineProperties( + ${2:new Object()}, + { + ${3:property} : { + get : function $1_$3_getter() { + // getter code + }, + set : function $1_$3_setter(value) { + // setter code + }, + value : ${4:value}, + writeable : ${5:boolean}, + enumerable : ${6:boolean}, + configurable : ${0:boolean} + } + } + ); +# Define single property +snippet prop + Object.defineProperty( + ${1:object}, + "${2:property}", + { + get : function $1_$2_getter() { + // getter code + }, + set : function $1_$2_setter(value) { + // setter code + }, + value : ${3:value}, + writeable : ${4:boolean}, + enumerable : ${5:boolean}, + configurable : ${0:boolean} + } + ); From ac3ef260c8838af9d168bac588f0634d42e7590b Mon Sep 17 00:00:00 2001 From: amix Date: Fri, 18 Apr 2014 13:52:50 +0100 Subject: [PATCH 32/37] Removed PeepOpen (CTRLp is much better) --- vimrcs/plugins_config.vim | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vimrcs/plugins_config.vim b/vimrcs/plugins_config.vim index 73d96bc7..fc0072bd 100644 --- a/vimrcs/plugins_config.vim +++ b/vimrcs/plugins_config.vim @@ -45,19 +45,13 @@ endif let g:ctrlp_working_path_mode = 0 let g:ctrlp_map = '' +map j :CtrlP map :CtrlPBuffer let g:ctrlp_max_height = 20 let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee' -"""""""""""""""""""""""""""""" -" => Peepopen -"""""""""""""""""""""""""""""" -map j :PeepOpen - - - """""""""""""""""""""""""""""" " => ZenCoding """""""""""""""""""""""""""""" From 6a16a9393c145893e2cafd43a76423235cf69b0f Mon Sep 17 00:00:00 2001 From: amix Date: Fri, 18 Apr 2014 13:58:02 +0100 Subject: [PATCH 33/37] Updated plugins --- sources_non_forked/ack.vim/README.md | 125 +++---- sources_non_forked/ack.vim/Rakefile | 23 -- sources_non_forked/ack.vim/autoload/ack.vim | 143 ++++++++ sources_non_forked/ack.vim/doc/ack.txt | 149 +++++++- .../ack.vim/doc/ack_quick_help.txt | 14 + sources_non_forked/ack.vim/ftplugin/qf.vim | 9 + sources_non_forked/ack.vim/plugin/ack.vim | 149 +++----- sources_non_forked/goyo.vim/plugin/goyo.vim | 5 +- sources_non_forked/syntastic/CONTRIBUTING.md | 2 +- sources_non_forked/syntastic/README.markdown | 51 ++- .../autoload/syntastic/postprocess.vim | 19 -- .../autoload/syntastic/preprocess.vim | 39 +++ .../syntastic/autoload/syntastic/util.vim | 52 ++- .../syntastic/doc/syntastic.txt | 44 ++- .../syntastic/plugin/syntastic.vim | 8 +- .../syntastic/plugin/syntastic/checker.vim | 18 + .../syntastic/plugin/syntastic/loclist.vim | 4 + .../syntastic/plugin/syntastic/registry.vim | 1 + .../syntax_checkers/actionscript/mxmlc.vim | 2 +- .../syntastic/syntax_checkers/c/oclint.vim | 9 +- .../syntastic/syntax_checkers/c/splint.vim | 3 + .../syntax_checkers/css/prettycss.vim | 5 +- .../syntax_checkers/haskell/hdevtools.vim | 28 +- .../syntax_checkers/haskell/hlint.vim | 8 +- .../syntax_checkers/haskell/scan.vim | 43 +++ .../syntastic/syntax_checkers/html/jshint.vim | 3 +- .../syntastic/syntax_checkers/html/tidy.vim | 194 ++++++----- .../syntax_checkers/java/checkstyle.vim | 5 +- .../syntastic/syntax_checkers/java/javac.vim | 22 +- .../syntax_checkers/javascript/eslint.vim | 15 +- .../syntax_checkers/javascript/jscs.vim | 9 +- .../syntax_checkers/javascript/jshint.vim | 15 +- .../syntax_checkers/javascript/jsl.vim | 3 +- .../syntax_checkers/javascript/jsxhint.vim | 4 - .../syntax_checkers/python/pylama.vim | 5 +- .../syntax_checkers/python/pylint.vim | 10 +- .../syntastic/syntax_checkers/r/lint.vim | 78 +++++ .../syntastic/syntax_checkers/r/svtools.vim | 77 +++++ .../syntax_checkers/racket/code-ayatollah.vim | 5 +- .../syntastic/syntax_checkers/tex/chktex.vim | 9 +- .../syntax_checkers/typescript/tsc.vim | 9 +- .../syntastic/syntax_checkers/vim/vimlint.vim | 11 +- .../syntastic/syntax_checkers/xhtml/tidy.vim | 26 +- .../syntastic/syntax_checkers/xml/plutil.vim | 42 +++ .../tlib/autoload/tlib/World.vim | 4 +- .../tlib/autoload/tlib/cache.vim | 45 ++- .../tlib/autoload/tlib/input.vim | 7 +- .../tlib/autoload/tlib/list.vim | 40 ++- .../tlib/autoload/tlib/persistent.vim | 11 +- sources_non_forked/tlib/doc/tlib.txt | 8 + sources_non_forked/tlib/plugin/02tlib.vim | 10 +- .../autoload/airline/extensions.vim | 3 +- .../autoload/airline/extensions/branch.vim | 54 ++- .../autoload/airline/extensions/eclim.vim | 2 +- .../autoload/airline/extensions/tabline.vim | 8 +- .../airline/extensions/whitespace.vim | 10 +- .../autoload/airline/themes/luna.vim | 2 +- .../autoload/airline/themes/sol.vim | 10 +- .../vim-airline/doc/airline.txt | 9 +- .../vim-commentary/README.markdown | 10 +- .../vim-commentary/doc/commentary.txt | 19 +- .../vim-commentary/plugin/commentary.vim | 39 ++- .../vim-fugitive/doc/fugitive.txt | 2 + .../vim-fugitive/plugin/fugitive.vim | 126 ++++--- .../vim-markdown/ftplugin/markdown.vim | 28 ++ .../vim-snipmate/Contributors.md | 1 + sources_non_forked/vim-snipmate/README.md | 28 ++ .../vim-snipmate/autoload/snipMate.vim | 123 +++---- .../vim-snipmate/doc/snipMate.txt | 13 +- .../vim-snipmate/plugin/snipMate.vim | 77 +++-- .../vim-snipmate/plugin/snipMateInterface.vim | 2 - .../vim-snippets/UltiSnips/html.snippets | 2 +- .../vim-snippets/UltiSnips/java.snippets | 21 +- .../vim-snippets/UltiSnips/php.snippets | 12 +- .../vim-snippets/UltiSnips/proto.snippets | 52 +++ .../vim-snippets/UltiSnips/python.snippets | 80 ++++- .../vim-snippets/UltiSnips/r.snippets | 144 ++++++++ .../vim-snippets/UltiSnips/rnoweb.snippets | 3 + .../vim-snippets/UltiSnips/rst.snippets | 23 +- .../vim-snippets/UltiSnips/rust.snippets | 215 ++++++++++++ .../vim-snippets/UltiSnips/soy.snippets | 63 ++++ .../vim-snippets/plugin/vimsnippets.vim | 37 ++ .../vim-snippets/pythonx/vimsnippets.py | 20 ++ .../vim-snippets/snippets/django.snippets | 6 +- .../vim-snippets/snippets/erlang.snippets | 322 +++++++++++++++++- .../vim-snippets/snippets/eruby.snippets | 2 + .../vim-snippets/snippets/haskell.snippets | 2 + .../vim-snippets/snippets/jade.snippets | 18 + .../vim-snippets/snippets/python.snippets | 8 + .../vim-snippets/snippets/ruby.snippets | 43 +++ .../vim-snippets/snippets/scala.snippets | 3 +- 91 files changed, 2554 insertions(+), 708 deletions(-) delete mode 100644 sources_non_forked/ack.vim/Rakefile create mode 100644 sources_non_forked/ack.vim/autoload/ack.vim create mode 100644 sources_non_forked/ack.vim/doc/ack_quick_help.txt create mode 100644 sources_non_forked/ack.vim/ftplugin/qf.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haskell/scan.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/r/lint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/r/svtools.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/xml/plutil.vim delete mode 100644 sources_non_forked/vim-snipmate/plugin/snipMateInterface.vim create mode 100644 sources_non_forked/vim-snippets/UltiSnips/proto.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/r.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/rnoweb.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/rust.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/soy.snippets create mode 100644 sources_non_forked/vim-snippets/plugin/vimsnippets.vim create mode 100644 sources_non_forked/vim-snippets/pythonx/vimsnippets.py create mode 100644 sources_non_forked/vim-snippets/snippets/jade.snippets diff --git a/sources_non_forked/ack.vim/README.md b/sources_non_forked/ack.vim/README.md index e7182452..d9dbb929 100644 --- a/sources_non_forked/ack.vim/README.md +++ b/sources_non_forked/ack.vim/README.md @@ -1,101 +1,60 @@ -# ack.vim # +# ack.vim This plugin is a front for the Perl module [App::Ack](http://search.cpan.org/~petdance/ack/ack). Ack can be used as a replacement for 99% of the uses of _grep_. This plugin will allow you to run ack from vim, and shows the results in a split window. -The *Official Version* of this plugin is available at [vim.org](http://www.vim.org/scripts/script.php?script_id=2572). - -## Installation ## - +## Installation ### Ack -You have to install [ack](http://betterthangrep.com/), of course. - -Install on Debian / Ubuntu with: - - sudo apt-get install ack-grep - -Install on Fedora with: - - su -l -c 'yum install ack' - -Install on openSUSE with: - - sudo zypper install ack - -Install on Gentoo with: - - sudo emerge ack - -Install with Homebrew: - - brew install ack - -Install with MacPorts: - - sudo port install p5-app-ack - -Install with Gentoo Prefix: - - emerge ack - -Install on FreeBSD with: - - cd /usr/ports/textproc/p5-ack/ && make install clean - -You can specify a custom ack name and path in your .vimrc like so: - - let g:ackprg=" -H --nocolor --nogroup --column" - -Otherwise, you are on your own. +You will need the ack, of course, to install it follow the +[manual](http://beyondgrep.com/install/) ### The Plugin -If you have [Rake](http://rake.rubyforge.org/) installed, you can just run: `rake install`. +To install it is recommended to use one of the popular package managers for Vim, +rather than installing by drag and drop all required files into your `.vim` folder. -Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc. Be sure to run +#### Manual (not recommended) - :helptags ~/.vim/doc +Just +[download](https://github.com/mileszs/ack.vim/archive/kb-improve-readme.zip) the +plugin and put it in your `~/.vim/`(or `%PROGRAMFILES%/Vim/vimfiles` on windows) -afterwards. +#### Vundle + Bundle 'mileszs/ack.vim' -## Usage ## +#### NeoBundle - :Ack [options] {pattern} [{directory}] + NeoBundle 'mileszs/ack.vim' -Search recursively in {directory} (which defaults to the current directory) for the {pattern}. +## Usage + + :Ack [options] {pattern} [{directories}] + +Search recursively in {directory} (which defaults to the current directory) for +the {pattern}. Files containing the search term will be listed in the split window, along with the line number of the occurrence, once for each occurrence. [Enter] on a line in this window will open the file, and place the cursor on the matching line. -Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `doc/ack.txt`, or install and `:h Ack` for more information.) +Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use +`:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. +(See `doc/ack.txt`, or install and `:h Ack` for more information.) -**From the [ack docs](http://betterthangrep.com/)** (my favorite feature): +For more ack options see +[ack documentation](http://beyondgrep.com/documentation/) - --type=TYPE, --type=noTYPE - - Specify the types of files to include or exclude from a search. TYPE is a filetype, like perl or xml. --type=perl can also be specified as --perl, and --type=noperl can be done as --noperl. - - If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion. - - Type specifications can be repeated and are ORed together. - - See ack --help=types for a list of valid types. - -### Gotchas ### - -Some characters have special meaning, and need to be escaped your search pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define foo'` to search for `#define foo`. (From [blueyed in issue #5](https://github.com/mileszs/ack.vim/issues/5).) - -### Keyboard Shortcuts ### +### Keyboard Shortcuts In the quickfix window, you can use: o to open (same as enter) + O to open and close quickfix window go to preview file (open but maintain focus on ack.vim results) t to open in new tab T to open in new tab silently @@ -106,9 +65,29 @@ In the quickfix window, you can use: q to close the quickfix window This Vim plugin is derived (and by derived, I mean copied, essentially) from -Antoine Imbert's blog post [Ack and Vim -Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html) (in -particular, the function at the bottom of the post). I added a help file that +Antoine Imbert's blog post +[Ack and Vim Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html) +(in particular, the function at the bottom of the post). I added a help file that provides just enough reference to get you going. I also highly recommend you -check out the docs for the Perl script 'ack', for obvious reasons: [ack - -grep-like text finder](http://betterthangrep.com/). +check out the docs for the Perl script 'ack', for obvious reasons: +[ack - grep-like text finder](http://beyondgrep.com/). + +### Gotchas + +Some characters have special meaning, and need to be escaped your search +pattern. For instance, '#'. You have to escape it like this :Ack '\\\#define +foo' to search for #define foo. (From blueyed in issue #5.) + +## Changelog + +### 1.0 + +* Remove support to ack 1.x +* Start to use a Changelog +* Use `autoload` directory to define functions, instead of `plugin`. +* Add option to auto fold the results(`g:ack_autofold_results`) +* Improve documentation, list all options and shortcuts +* Improve highlight option to work when passes directories or use quotes. +* Add g:ack_mapping +* Add g:ack_default_options +* Add a help toggle `?`(like NERDTree) diff --git a/sources_non_forked/ack.vim/Rakefile b/sources_non_forked/ack.vim/Rakefile deleted file mode 100644 index af5a8695..00000000 --- a/sources_non_forked/ack.vim/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# Added by Josh Nichols, a.k.a. technicalpickles -require 'rake' - -files = ['doc/ack.txt', 'plugin/ack.vim'] - -desc 'Install plugin and documentation' -task :install do - vimfiles = if ENV['VIMFILES'] - ENV['VIMFILES'] - elsif RUBY_PLATFORM =~ /(win|w)32$/ - File.expand_path("~/vimfiles") - else - File.expand_path("~/.vim") - end - files.each do |file| - target_file = File.join(vimfiles, file) - FileUtils.mkdir_p File.dirname(target_file) - FileUtils.cp file, target_file - - puts " Copied #{file} to #{target_file}" - end - -end diff --git a/sources_non_forked/ack.vim/autoload/ack.vim b/sources_non_forked/ack.vim/autoload/ack.vim new file mode 100644 index 00000000..ff8d8eb6 --- /dev/null +++ b/sources_non_forked/ack.vim/autoload/ack.vim @@ -0,0 +1,143 @@ +function! ack#Ack(cmd, args) + redraw + echo "Searching ..." + + " If no pattern is provided, search for the word under the cursor + if empty(a:args) + let l:grepargs = expand("") + else + let l:grepargs = a:args . join(a:000, ' ') + end + let l:ackprg_run = g:ackprg + + " Format, used to manage column jump + if a:cmd =~# '-g$' + let g:ackformat="%f" + let l:ackprg_run = substitute(l:ackprg_run, '-H\|--column', '', 'g') + else + let g:ackformat="%f:%l:%c:%m,%f:%l:%m" + endif + + let grepprg_bak = &grepprg + let grepformat_bak = &grepformat + let &grepprg=l:ackprg_run + let &grepformat=g:ackformat + + try + " NOTE: we escape special chars, but not everything using shellescape to + " allow for passing arguments etc + silent execute a:cmd . " " . escape(l:grepargs, '|#%') + finally + let &grepprg=grepprg_bak + let &grepformat=grepformat_bak + endtry + + if a:cmd =~# '^l' + let s:handler = g:ack_lhandler + let s:apply_mappings = g:ack_apply_lmappings + let s:close_cmd = ':lclose' + else + let s:handler = g:ack_qhandler + let s:apply_mappings = g:ack_apply_qmappings + let s:close_cmd = ':cclose' + endif + + call ack#show_results() + call highlight(l:grepargs) + + redraw! +endfunction + +function! ack#show_results() + execute s:handler + call apply_maps() +endfunction + +function! s:apply_maps() + let g:ack_mappings.q = s:close_cmd + + execute "nnoremap ? :call ack#quick_help()" + + if s:apply_mappings && &ft == "qf" + if g:ack_autoclose + for key_map in items(g:ack_mappings) + execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1) . s:close_cmd) + endfor + execute "nnoremap " . s:close_cmd + else + for key_map in items(g:ack_mappings) + execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1)) + endfor + endif + + if exists("g:ackpreview") " if auto preview in on, remap j and k keys + execute "nnoremap j j" + execute "nnoremap k k" + endif + endif +endfunction + +function! ack#quick_help() + execute "edit " . globpath(&rtp, "doc/ack_quick_help.txt") + + silent normal gg + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal noswapfile + setlocal nobuflisted + setlocal nomodifiable + setlocal filetype=help + setlocal nonumber + setlocal norelativenumber + setlocal nowrap + setlocal foldlevel=20 + setlocal foldmethod=diff + nnoremap ? :q!:call ack#show_results() +endfunction + +function! s:highlight(args) + if !g:ackhighlight + return + endif + + let @/ = matchstr(a:args, "\\v\\w+\>|['\"]\\zs[^\"]+\\ze['\"]") + setlocal hlsearch + call feedkeys(":let v:hlsearch=1 \| echo \", "n") +endfunction + +function! ack#AckFromSearch(cmd, args) + let search = getreg('/') + " translate vim regular expression to perl regular expression. + let search = substitute(search, '\(\\<\|\\>\)', '\\b', 'g') + call ack#Ack(a:cmd, '"' . search . '" ' . a:args) +endfunction + +function! s:GetDocLocations() + let dp = '' + for p in split(&rtp, ',') + let p = p . '/doc/' + if isdirectory(p) + let dp = p . '*.txt ' . dp + endif + endfor + + return dp +endfunction + +function! ack#AckHelp(cmd, args) + let args = a:args . ' ' . s:GetDocLocations() + call ack#Ack(a:cmd, args) +endfunction + +function! ack#AckWindow(cmd, args) + let files = tabpagebuflist() + " remove duplicated filenames (files appearing in more than one window) + let files = filter(copy(sort(files)), 'index(files,v:val,v:key+1)==-1') + call map(files, "bufname(v:val)") + " remove unnamed buffers as quickfix (empty strings before shellescape) + call filter(files, 'v:val != ""') + " expand to full path (avoid problems with cd/lcd in au QuickFixCmdPre) + let files = map(files, "shellescape(fnamemodify(v:val, ':p'))") + let args = a:args . ' ' . join(files) + call ack#Ack(a:cmd, args) +endfunction diff --git a/sources_non_forked/ack.vim/doc/ack.txt b/sources_non_forked/ack.vim/doc/ack.txt index ec06da3a..33c10529 100644 --- a/sources_non_forked/ack.vim/doc/ack.txt +++ b/sources_non_forked/ack.vim/doc/ack.txt @@ -16,7 +16,7 @@ shows the results in a split window. Search recursively in {directory} (which defaults to the current directory) for the {pattern}. Behaves just like the |:grep| command, but will open the |Quickfix| window for you. If [!] is not given the first - error is jumped to. + occurence is jumped to. :AckAdd [options] {pattern} [{directory}] *:AckAdd* @@ -45,7 +45,7 @@ shows the results in a split window. :AckHelp[!] [options] {pattern} *:AckHelp* - Search vim documentation files for the {pattern}. Behaves just like the + Search vim documentation files for the {pattern}. Behaves just like the |:Ack| command, but searches only vim documentation .txt files :LAckHelp [options] {pattern} *:LAckHelp* @@ -53,6 +53,16 @@ shows the results in a split window. Just like |:AckHelp| but instead of the |quickfix| list, matches are placed in the current |location-list|. +:AckWindow[!] [options] {pattern} *:AckWindow* + + Search all buffers visible in the screen (current tab page only) files for + the {pattern}. + +:LAckWindow [options] {pattern} *:LAckWindow* + + Just like |:AckWindow| but instead of the |quickfix| list, matches are + placed in the current |location-list|. + Files containing the search term will be listed in the split window, along with the line number of the occurrence, once for each occurrence. on a line in this window will open the file, and place the cursor on the matching @@ -60,6 +70,139 @@ line. See http://betterthangrep.com/ for more information. + +============================================================================== +CONFIGURATION *ack-configuration* + + *g:ackprg* +g:ackprg +Default for ubuntu: "ack-grep" +Default for other systems: "ack" + +Use this option to specify the ack command and its options + +Example: +> + let g:ackprg = "other-bin-ack" +< + + g:ack_default_options* +g:ack_default_options +Default: " -s -H --nocolor --nogroup --column" + +Use this option to specify the options used by ack + +Example: +> + let g:ackprg = + \ " -s -H --nocolor --nogroup --column --smart-case --follow" +< + + *g:ack_apply_qmappings* +g:ack_apply_qmappings +Default: 1 + +This option enable mappings on quickview window. + + *g:ack_apply_lmappings* +g:ack_apply_lmappings +Default: 1 + +This option enable mappings on Location list window. + + *g:ack_mappings* +g:ack_mappings +Default: { + \ "t": "T", + \ "T": "TgTj", + \ "o": "", + \ "O": ":ccl", + \ "go": "j", + \ "h": "K", + \ "H": "Kb", + \ "v": "HbJt", + \ "gv": "HbJ" } + +This option list all maps create on quickfix/Location list window. + +Example, if you want to open the result in the middle of the screen: +> + let g:ack_mappings = { "o": "zz" } +< + + *g:ack_qhandler* +g:ack_qhandler +Default: "botright copen" + +Command to open the quickview window. + +If you want to open a quickview window with 30 lines you can do: +> + let g:ack_qhandler = "botright copen 30" +< + + *g:ack_lhandler* +g:ack_lhandler +Default: "botright lopen" + +Command to open the Location list window. + +If you want to open a Location list window with 30 lines you can do: +> + let g:ack_lhandler = "botright lopen 30" +< + + *g:ackhighlight* + +g:ackhighlight +Default: 0 + +Use this option to highlight the searched term. + +Example: +> + let g:ackhighlight = 1 +< + + *g:ack_autoclose* +g:ack_autoclose +Default: 0 + +Use this option to specify whether to close the quickfix window after +using any of the shortcuts. + +Example: +> + let g:ack_autoclose = 1 +< + + *g:ack_autofold_results* + +g:ack_autofold_results +Default: 0 + +Use this option to fold the results in quickfix by file name. Only the current +fold will be open by default and while you press 'j' and 'k' to move between the +results if you hit other fold the last one will be closed and the current will +be open. + +Example: +> + let g:ack_autofold_results = 1 +< + + *g:ackpreview* + +g:ackpreview +Default: 0 + +Use this option to automagically open the file with 'j' or 'k'. + +Example: +> + let g:ackpreview = 1 +< + ============================================================================== MAPPINGS *ack-mappings* @@ -67,6 +210,8 @@ The following keyboard shortcuts are available in the quickfix window: o open file (same as enter). +O open file and close quickfix window. + go preview file (open but maintain focus on ack.vim results). t open in a new tab. diff --git a/sources_non_forked/ack.vim/doc/ack_quick_help.txt b/sources_non_forked/ack.vim/doc/ack_quick_help.txt new file mode 100644 index 00000000..5c52f6cb --- /dev/null +++ b/sources_non_forked/ack.vim/doc/ack_quick_help.txt @@ -0,0 +1,14 @@ +==== ack.vim quick help =============== + + *?:* Show this help + *t:* Open in a new tab + *T:* Open in a new tab silently + *o:* Open + *O:* Open and close result window + *go:* Preview + *h:* Horizontal open + *H:* Horizontal open silently + *v:* Vertical open + *gv:* Vertical open silently + +======================================== diff --git a/sources_non_forked/ack.vim/ftplugin/qf.vim b/sources_non_forked/ack.vim/ftplugin/qf.vim new file mode 100644 index 00000000..7da45a4c --- /dev/null +++ b/sources_non_forked/ack.vim/ftplugin/qf.vim @@ -0,0 +1,9 @@ +if g:ack_autofold_results + setlocal foldlevel=0 + setlocal foldmethod=expr + setlocal foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')==#matchstr(getline(v:lnum+1),'^[^\|]\\+')?1:'<1' + setlocal foldenable + setlocal foldclose=all + setlocal foldopen=all + nnoremap j jzz +endif diff --git a/sources_non_forked/ack.vim/plugin/ack.vim b/sources_non_forked/ack.vim/plugin/ack.vim index 3c664bd5..e5d0507b 100644 --- a/sources_non_forked/ack.vim/plugin/ack.vim +++ b/sources_non_forked/ack.vim/plugin/ack.vim @@ -1,16 +1,17 @@ -" NOTE: You must, of course, install the ack script -" in your path. -" On Debian / Ubuntu: -" sudo apt-get install ack-grep -" With MacPorts: -" sudo port install p5-app-ack -" With Homebrew: -" brew install ack +if !exists("g:ack_default_options") + let g:ack_default_options = " -s -H --nocolor --nogroup --column" +endif " Location of the ack utility if !exists("g:ackprg") - let s:ackcommand = executable('ack-grep') ? 'ack-grep' : 'ack' - let g:ackprg=s:ackcommand." -H --nocolor --nogroup --column" + if executable('ack') + let g:ackprg = "ack" + elseif executable('ack-grep') + let g:ackprg = "ack-grep" + else + finish + endif + let g:ackprg .= g:ack_default_options endif if !exists("g:ack_apply_qmappings") @@ -21,102 +22,50 @@ if !exists("g:ack_apply_lmappings") let g:ack_apply_lmappings = !exists("g:ack_lhandler") endif +let s:ack_mappings = { + \ "t": "T", + \ "T": "TgTj", + \ "o": "", + \ "O": ":ccl", + \ "go": "j", + \ "h": "K", + \ "H": "Kb", + \ "v": "HbJt", + \ "gv": "HbJ" } + +if exists("g:ack_mappings") + let g:ack_mappings = extend(s:ack_mappings, g:ack_mappings) +else + let g:ack_mappings = s:ack_mappings +endif + if !exists("g:ack_qhandler") - let g:ack_qhandler="botright copen" + let g:ack_qhandler = "botright copen" endif if !exists("g:ack_lhandler") - let g:ack_lhandler="botright lopen" + let g:ack_lhandler = "botright lopen" endif -function! s:Ack(cmd, args) - redraw - echo "Searching ..." +if !exists("g:ackhighlight") + let g:ackhighlight = 0 +endif - " If no pattern is provided, search for the word under the cursor - if empty(a:args) - let l:grepargs = expand("") - else - let l:grepargs = a:args . join(a:000, ' ') - end +if !exists("g:ack_autoclose") + let g:ack_autoclose = 0 +endif - " Format, used to manage column jump - if a:cmd =~# '-g$' - let g:ackformat="%f" - else - let g:ackformat="%f:%l:%c:%m,%f:%l:%m" - end +if !exists("g:ack_autofold_results") + let g:ack_autofold_results = 0 +endif - let grepprg_bak=&grepprg - let grepformat_bak=&grepformat - try - let &grepprg=g:ackprg - let &grepformat=g:ackformat - silent execute a:cmd . " " . escape(l:grepargs, '|') - finally - let &grepprg=grepprg_bak - let &grepformat=grepformat_bak - endtry - - if a:cmd =~# '^l' - exe g:ack_lhandler - let l:apply_mappings = g:ack_apply_lmappings - let l:close_cmd = ':lclose' - else - exe g:ack_qhandler - let l:apply_mappings = g:ack_apply_qmappings - let l:close_cmd = ':cclose' - endif - - if l:apply_mappings - exec "nnoremap q " . l:close_cmd - exec "nnoremap t T" - exec "nnoremap T TgT" - exec "nnoremap o " - exec "nnoremap go " - exec "nnoremap h K" - exec "nnoremap H Kb" - exec "nnoremap v HbJt" - exec "nnoremap gv HbJ" - endif - - " If highlighting is on, highlight the search keyword. - if exists("g:ackhighlight") - let @/ = substitute(l:grepargs,'["'']','','g') - set hlsearch - end - - redraw! -endfunction - -function! s:AckFromSearch(cmd, args) - let search = getreg('/') - " translate vim regular expression to perl regular expression. - let search = substitute(search,'\(\\<\|\\>\)','\\b','g') - call s:Ack(a:cmd, '"' . search .'" '. a:args) -endfunction - -function! s:GetDocLocations() - let dp = '' - for p in split(&rtp,',') - let p = p.'/doc/' - if isdirectory(p) - let dp = p.'*.txt '.dp - endif - endfor - return dp -endfunction - -function! s:AckHelp(cmd,args) - let args = a:args.' '.s:GetDocLocations() - call s:Ack(a:cmd,args) -endfunction - -command! -bang -nargs=* -complete=file Ack call s:Ack('grep',) -command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd', ) -command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep', ) -command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep', ) -command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd', ) -command! -bang -nargs=* -complete=file AckFile call s:Ack('grep -g', ) -command! -bang -nargs=* -complete=help AckHelp call s:AckHelp('grep',) -command! -bang -nargs=* -complete=help LAckHelp call s:AckHelp('lgrep',) +command! -bang -nargs=* -complete=file Ack call ack#Ack('grep', ) +command! -bang -nargs=* -complete=file AckAdd call ack#Ack('grepadd', ) +command! -bang -nargs=* -complete=file AckFromSearch call ack#AckFromSearch('grep', ) +command! -bang -nargs=* -complete=file LAck call ack#Ack('lgrep', ) +command! -bang -nargs=* -complete=file LAckAdd call ack#Ack('lgrepadd', ) +command! -bang -nargs=* -complete=file AckFile call ack#Ack('grep -g', ) +command! -bang -nargs=* -complete=help AckHelp call ack#AckHelp('grep', ) +command! -bang -nargs=* -complete=help LAckHelp call ack#AckHelp('lgrep', ) +command! -bang -nargs=* -complete=help AckWindow call ack#AckWindow('grep', ) +command! -bang -nargs=* -complete=help LAckWindow call ack#AckWindow('lgrep', ) diff --git a/sources_non_forked/goyo.vim/plugin/goyo.vim b/sources_non_forked/goyo.vim/plugin/goyo.vim index 751162ce..311589ed 100644 --- a/sources_non_forked/goyo.vim/plugin/goyo.vim +++ b/sources_non_forked/goyo.vim/plugin/goyo.vim @@ -46,7 +46,7 @@ function! s:init_pad(command) execute a:command setlocal buftype=nofile bufhidden=wipe nomodifiable nobuflisted noswapfile - \ nonu nocursorline winfixwidth winfixheight statusline=\ + \ nonu nocursorline nocursorcolumn winfixwidth winfixheight statusline=\ if exists('&rnu') setlocal nornu endif @@ -115,6 +115,8 @@ function! s:tranquilize() endfunction function! s:goyo_on(width) + let s:orig_tab = tabpagenr() + " New tab tab split @@ -249,6 +251,7 @@ function! s:goyo_off() bd endif tabclose + execute 'normal! '.s:orig_tab.'gt' let wmh = remove(goyo_revert, 'winminheight') let wh = remove(goyo_revert, 'winheight') diff --git a/sources_non_forked/syntastic/CONTRIBUTING.md b/sources_non_forked/syntastic/CONTRIBUTING.md index 764ffffc..2eac8325 100644 --- a/sources_non_forked/syntastic/CONTRIBUTING.md +++ b/sources_non_forked/syntastic/CONTRIBUTING.md @@ -29,7 +29,7 @@ Following the coding conventions/styles used in the syntastic core: * Use 4 space indents. * Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!). * Don't use `l:` prefixes for variables unless actually required (i.e. almost never). -* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability. +* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/extractVariable.html) to aid readability. # Syntax checker style notes diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index 653bd7c6..cdb6f559 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -40,10 +40,11 @@ CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++, -OCaml, Perl, Perl POD, PHP, gettext Portable Object, Puppet, Python, Racket, -reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, -TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope -page templates, and zsh. +OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property +lists, Puppet, Python, Racket, R, reStructuredText, Ruby, Rust, SASS/SCSS, +Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, +xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the +[wiki][3] for details about the corresponding supported checkers. 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 @@ -111,6 +112,8 @@ If you get an error when you do this, then you probably didn't install ## 3\. FAQ +
    + __Q. I installed syntastic but it isn't reporting any errors...__ A. The most likely reason is that none of the syntax checkers that it requires @@ -125,6 +128,8 @@ error output for a 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. + + __Q. The `perl` checker has stopped working...__ A. The `perl` checker runs `perl -c` against your file, which in turn @@ -138,6 +143,8 @@ still producing useful results, the checker is now disabled by default. To let g:syntastic_enable_perl_checker = 1 ``` + + __Q. I run a checker and the location list is not updated...__ A. By default the location list is changed only when you run the `:Errors` @@ -148,6 +155,8 @@ your vimrc: let g:syntastic_always_populate_loc_list = 1 ``` + + __Q. How can I pass additional arguments to a checker?__ A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers @@ -162,6 +171,8 @@ let g:syntastic_ruby_mri_args = "--my --args --here" See `:help syntastic-checker-options` for more information. + + __Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ @@ -190,6 +201,32 @@ let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd'] This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`. +You can also run checkers explicitly by calling `:SyntasticCheck `. + +e.g. to run `phpcs` and `phpmd`: +```vim +:SyntasticCheck phpcs phpmd +``` + +This works for any checkers available for the current filetype, even if they +aren't listed in `g:syntastic__checkers`. You can't run checkers for +"foreign" filetypes though (e.g. you can't run, say, a Python checker if the +current filetype is `php`). + + + +__Q. How can I display together the errors found by all checkers enabled for +the current file?__ + +A. Set `g:syntastic_aggregate_errors` to 1 in your vimrc: +```vim +let g:syntastic_aggregate_errors = 1 +``` + +See `:help syntastic-aggregating-errors` for more details. + + + __Q. How can I jump between the different errors without using the location list at the bottom of the window?__ @@ -200,6 +237,8 @@ If you use these commands a lot then you may want to add shortcut mappings to your vimrc, or install something like [unimpaired][2], which provides such mappings (among other things). + + __Q. A syntax checker is giving me unwanted/strange style tips?__ A. Some filetypes (e.g. php) have style checkers as well as syntax @@ -214,6 +253,8 @@ let g:syntastic_quiet_messages = { "type": "style" } ``` See `:help syntastic_quiet_messages` for details. + + __Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ @@ -248,5 +289,5 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. [6]: http://stackoverflow.com/questions/tagged/syntastic [7]: https://github.com/davidhalter/jedi-vim [8]: https://github.com/klen/python-mode -[9]: https://github.com/Valloric/YouCompleteMe +[9]: http://valloric.github.io/YouCompleteMe/ [10]: http://perldoc.perl.org/perlrun.html#*-c* diff --git a/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim index 1558f0f8..377e64a7 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim @@ -8,25 +8,6 @@ set cpo&vim " Public functions {{{1 -function! s:compareErrorItems(a, b) " {{{2 - if a:a['bufnr'] != a:b['bufnr'] - " group by files - return a:a['bufnr'] - a:b['bufnr'] - elseif a:a['lnum'] != a:b['lnum'] - return a:a['lnum'] - a:b['lnum'] - elseif a:a['type'] !=? a:b['type'] - " errors take precedence over warnings - return a:a['type'] ==? 'e' ? -1 : 1 - else - return get(a:a, 'col', 0) - get(a:b, 'col', 0) - endif -endfunction " }}}2 - -" natural sort -function! syntastic#postprocess#sort(errors) " {{{2 - return sort(copy(a:errors), 's:compareErrorItems') -endfunction " }}}2 - " merge consecutive blanks function! syntastic#postprocess#compressWhitespace(errors) " {{{2 for e in a:errors diff --git a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim index f1af35be..4501e3ff 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim @@ -56,6 +56,45 @@ function! syntastic#preprocess#perl(errors) " {{{2 return syntastic#util#unique(out) endfunction " }}}2 +function! syntastic#preprocess#rparse(errors) " {{{2 + let errlist = copy(a:errors) + + " remove uninteresting lines and handle continuations + let i = 0 + while i < len(errlist) + if i > 0 && errlist[i][:1] == ' ' && errlist[i] !~ '\m\s\+\^$' + let errlist[i-1] .= errlist[i][1:] + call remove(errlist, i) + elseif errlist[i] !~ '\m^\(Lint:\|Lint checking:\|Error in\) ' + call remove(errlist, i) + else + let i += 1 + endif + endwhile + + let out = [] + let fname = '' + for e in errlist + if match(e, '\m^Lint: ') == 0 + let parts = matchlist(e, '\m^Lint: \(.*\): found on lines \([0-9, ]\+\)\(+\(\d\+\) more\)\=') + if len(parts) >= 3 + for line in split(parts[2], '\m,\s*') + call add(out, 'E:' . fname . ':' . line . ': ' . parts[1]) + endfor + endif + if len(parts) >= 5 && parts[4] != '' + call add(out, 'E:' . fname . ':0: ' . parts[1] . ' - ' . parts[4] . ' messages not shown') + endif + elseif match(e, '\m^Lint checking: ') == 0 + let fname = matchstr(e, '\m^Lint checking: \zs.*') + elseif match(e, '\m^Error in ') == 0 + call add(out, substitute(e, '\m^Error in .\+ : .\+\ze:\d\+:\d\+: ', 'E:' . fname, '')) + endif + endfor + + return out +endfunction " }}}2 + function! syntastic#preprocess#validator(errors) " {{{2 let out = [] for e in a:errors diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim index d1dc2618..d4fa034b 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/util.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -101,7 +101,7 @@ function! syntastic#util#wideMsg(msg) " {{{2 "convert tabs to spaces so that the tabs count towards the window "width as the proper amount of characters let chunks = split(msg, "\t", 1) - let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - s:width(v:val) % &ts)'), '') . chunks[-1] + let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &tabstop - s:width(v:val) % &tabstop)'), '') . chunks[-1] let msg = strpart(msg, 0, &columns - 1) set noruler noshowcmd @@ -218,6 +218,13 @@ function! syntastic#util#dictFilter(errors, filter) " {{{2 endtry endfunction " }}}2 +function! syntastic#util#sortLoclist(errors) " {{{2 + for e in a:errors + call s:setScreenColumn(e) + endfor + call sort(a:errors, 's:compareErrorItems') +endfunction " }}}2 + " }}}1 " Private functions {{{1 @@ -254,6 +261,49 @@ function! s:translateElement(key, term) " {{{2 return ret endfunction " }}}2 +function! s:screenWidth(str, tabstop) " {{{2 + let chunks = split(a:str, "\t", 1) + let width = s:width(chunks[-1]) + for c in chunks[:-2] + let cwidth = s:width(c) + let width += cwidth + a:tabstop - cwidth % a:tabstop + endfor + return width +endfunction " }}}2 + +function! s:setScreenColumn(item) " {{{2 + if !has_key(a:item, 'scol') + let col = get(a:item, 'col', 0) + if col != 0 && a:item['vcol'] == 0 + let buf = str2nr(a:item['bufnr']) + try + let line = getbufline(buf, a:item['lnum'])[0] + catch /\m^Vim\%((\a\+)\)\=:E684/ + let line = '' + endtry + let a:item['scol'] = s:screenWidth(strpart(line, 0, col), getbufvar(buf, '&tabstop')) + else + let a:item['scol'] = col + endif + endif +endfunction " }}}2 + +function! s:compareErrorItems(a, b) " {{{2 + if a:a['bufnr'] != a:b['bufnr'] + " group by file + return a:a['bufnr'] - a:b['bufnr'] + elseif a:a['lnum'] != a:b['lnum'] + " sort by line + return a:a['lnum'] - a:b['lnum'] + elseif a:a['type'] !=? a:b['type'] + " errors take precedence over warnings + return a:a['type'] ==? 'E' ? -1 : 1 + else + " sort by screen column + return a:a['scol'] - a:b['scol'] + endif +endfunction " }}}2 + " }}}1 let &cpo = s:save_cpo diff --git a/sources_non_forked/syntastic/doc/syntastic.txt b/sources_non_forked/syntastic/doc/syntastic.txt index 86a5ed2b..fd0fb2b9 100644 --- a/sources_non_forked/syntastic/doc/syntastic.txt +++ b/sources_non_forked/syntastic/doc/syntastic.txt @@ -39,6 +39,8 @@ CONTENTS *syntastic-contents* 6.2.Interaction with python-mode...........|syntastic-pymode| 6.3.Interaction with the fish shell........|syntastic-fish| 6.4.Using syntastic with the fizsh shell...|syntastic-fizsh| + 6.5.Interaction with Eclim.................|syntastic-eclim| + 6.6.Interaction with vim-virtualenv........|syntastic-vim-virtualenv| 7.About........................................|syntastic-about| 8.License......................................|syntastic-license| @@ -186,7 +188,12 @@ If |'syntastic_aggregate_errors'| is set, syntastic runs all checkers that apply (still cf. |syntastic-filetype-checkers|), then aggregates errors found by all checkers in a single list, and notifies you. In this mode each error message is labeled with the name of the checker that generated it, but you can -disable these labels by unsetting '|syntastic_id_checkers|'. +disable generation of these labels by turning off '|syntastic_id_checkers|'. + +If |'syntastic_sort_aggregated_errors'| is set (which is the default), messages +in the aggregated list are grouped by file, then sorted by line number, then +type, then column number. Otherwise messages produced by the same checker are +grouped together. ------------------------------------------------------------------------------ 2.6 Filtering errors *syntastic-filtering-errors* @@ -278,6 +285,14 @@ a file with a composite filetype), it might not be immediately obvious which checker has produced a given error message. This variable instructs syntastic to label error messages with the names of the checkers that created them. > let g:syntastic_id_checkers = 0 +< + *'syntastic_sort_aggregated_errors'* +Default: 1 +By default, when |syntastic_aggregate_errors| is enabled, errors are grouped +by file, then sorted by line number, then grouped by type (namely, errors take +precedence over warnings), then they are sorted by column number. If you want +to leave messages grouped by checker output, set this variable to 0. > + let g:syntastic_sort_aggregated_errors = 0 < *'syntastic_echo_current_error'* Default: 1 @@ -557,10 +572,10 @@ Use |:SyntasticInfo| to see which checkers are available for a given filetype. ------------------------------------------------------------------------------ 5.2 Choosing the executable *syntastic-config-exec* - *'syntastic___exec'* + *'syntastic___exec'* The executable used by a checker is normally defined automatically, when the checkers is registered. You can however override it by setting the variable -'g:syntastic___exec': > +'g:syntastic___exec': > let g:syntastic_ruby_mri_exec = '~/bin/ruby2' < ------------------------------------------------------------------------------ @@ -569,7 +584,7 @@ checkers is registered. You can however override it by setting the variable Most checkers use the 'makeprgBuild()' function and provide many options by default - in fact you can customise every part of the command that gets called. - *'syntastic___