diff --git a/.gitmodules b/.gitmodules index 5f13ed5..e048d4a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "vim/bundle/you-complete-me"] - path = vim/bundle/you-complete-me - url = https://github.com/Valloric/YouCompleteMe.git [submodule "editorconfig"] path = vim/bundle/editorconfig url = https://github.com/editorconfig/editorconfig-vim.git diff --git a/vim/bundle/auto-compl-pop/README b/vim/bundle/auto-compl-pop/README deleted file mode 100644 index 8a72261..0000000 --- a/vim/bundle/auto-compl-pop/README +++ /dev/null @@ -1,101 +0,0 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=1879 - -Repository: - https://bitbucket.org/ns9tks/vim-autocomplpop/ - -Issues: - http://bitbucket.org/ns9tks/vim-autocomplpop/issues/ - -Download latest(development) version - https://bitbucket.org/ns9tks/vim-autocomplpop/get/tip.zip - -============================================================================== -INTRODUCTION *acp-introduction* - -With this plugin, your vim comes to automatically opens popup menu for -completions when you enter characters or move the cursor in Insert mode. It -won't prevent you continuing entering characters. - - -============================================================================== -INSTALLATION *acp-installation* - -Put all files into your runtime directory. If you have the zip file, extract -it to your runtime directory. - -You should place the files as follows: -> - /plugin/acp.vim - /doc/acp.txt - ... -< -If you disgust to jumble up this plugin and other plugins in your runtime -directory, put the files into new directory and just add the directory path to -'runtimepath'. It's easy to uninstall the plugin. - -And then update your help tags files to enable fuzzyfinder help. See -|add-local-help| for details. - - -============================================================================== -USAGE *acp-usage* - -Once this plugin is installed, auto-popup is enabled at startup by default. - -Which completion method is used depends on the text before the cursor. The -default behavior is as follows: - - kind filetype text before the cursor ~ - Keyword * two keyword characters - Filename * a filename character + a path separator - + 0 or more filename character - Omni ruby ".", "::" or non-word character + ":" - (|+ruby| required.) - Omni python "." (|+python| required.) - Omni xml "<", "" characters + " ") - Omni html/xhtml "<", "" characters + " ") - Omni css (":", ";", "{", "^", "@", or "!") - + 0 or 1 space - -Also, you can make user-defined completion and snipMate's trigger completion -(|acp-snipMate|) auto-popup if the options are set. - -These behavior are customizable. - - *acp-snipMate* -snipMate's Trigger Completion ~ - -snipMate's trigger completion enables you to complete a snippet trigger -provided by snipMate plugin -(http://www.vim.org/scripts/script.php?script_id=2540) and expand it. - - -To enable auto-popup for this completion, add following function to -plugin/snipMate.vim: -> - fun! GetSnipsInCurrentScope() - let snips = {} - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - call extend(snips, get(s:snippets, scope, {}), 'keep') - call extend(snips, get(s:multi_snips, scope, {}), 'keep') - endfor - return snips - endf -< -And set |g:acp_behaviorSnipmateLength| option to 1. - -There is the restriction on this auto-popup, that the word before cursor must -consist only of uppercase characters. - - *acp-perl-omni* -Perl Omni-Completion ~ - -AutoComplPop supports perl-completion.vim -(http://www.vim.org/scripts/script.php?script_id=2852). - -To enable auto-popup for this completion, set |g:acp_behaviorPerlOmniLength| -option to 0 or more. - - -============================================================================== - diff --git a/vim/bundle/auto-compl-pop/autoload/acp.vim b/vim/bundle/auto-compl-pop/autoload/acp.vim deleted file mode 100644 index 827bbcc..0000000 --- a/vim/bundle/auto-compl-pop/autoload/acp.vim +++ /dev/null @@ -1,431 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA -" -"============================================================================= -" LOAD GUARD {{{1 - -if exists('g:loaded_autoload_acp') || v:version < 702 - finish -endif -let g:loaded_autoload_acp = 1 - -" }}}1 -"============================================================================= -" GLOBAL FUNCTIONS: {{{1 - -" -function acp#enable() - call acp#disable() - - augroup AcpGlobalAutoCommand - autocmd! - autocmd InsertEnter * unlet! s:posLast s:lastUncompletable - autocmd InsertLeave * call s:finishPopup(1) - augroup END - - if g:acp_mappingDriven - call s:mapForMappingDriven() - else - autocmd AcpGlobalAutoCommand CursorMovedI * call s:feedPopup() - endif - - nnoremap i i=feedPopup() - nnoremap a a=feedPopup() - nnoremap R R=feedPopup() -endfunction - -" -function acp#disable() - call s:unmapForMappingDriven() - augroup AcpGlobalAutoCommand - autocmd! - augroup END - nnoremap i | nunmap i - nnoremap a | nunmap a - nnoremap R | nunmap R -endfunction - -" -function acp#lock() - let s:lockCount += 1 -endfunction - -" -function acp#unlock() - let s:lockCount -= 1 - if s:lockCount < 0 - let s:lockCount = 0 - throw "AutoComplPop: not locked" - endif -endfunction - -" -function acp#meetsForSnipmate(context) - if g:acp_behaviorSnipmateLength < 0 - return 0 - endif - let matches = matchlist(a:context, '\(^\|\s\|\<\)\(\u\{' . - \ g:acp_behaviorSnipmateLength . ',}\)$') - return !empty(matches) && !empty(s:getMatchingSnipItems(matches[2])) -endfunction - -" -function acp#meetsForKeyword(context) - if g:acp_behaviorKeywordLength < 0 - return 0 - endif - let matches = matchlist(a:context, '\(\k\{' . g:acp_behaviorKeywordLength . ',}\)$') - if empty(matches) - return 0 - endif - for ignore in g:acp_behaviorKeywordIgnores - if stridx(ignore, matches[1]) == 0 - return 0 - endif - endfor - return 1 -endfunction - -" -function acp#meetsForFile(context) - if g:acp_behaviorFileLength < 0 - return 0 - endif - if has('win32') || has('win64') - let separator = '[/\\]' - else - let separator = '\/' - endif - if a:context !~ '\f' . separator . '\f\{' . g:acp_behaviorFileLength . ',}$' - return 0 - endif - return a:context !~ '[*/\\][/\\]\f*$\|[^[:print:]]\f*$' -endfunction - -" -function acp#meetsForRubyOmni(context) - if !has('ruby') - return 0 - endif - if g:acp_behaviorRubyOmniMethodLength >= 0 && - \ a:context =~ '[^. \t]\(\.\|::\)\k\{' . - \ g:acp_behaviorRubyOmniMethodLength . ',}$' - return 1 - endif - if g:acp_behaviorRubyOmniSymbolLength >= 0 && - \ a:context =~ '\(^\|[^:]\):\k\{' . - \ g:acp_behaviorRubyOmniSymbolLength . ',}$' - return 1 - endif - return 0 -endfunction - -" -function acp#meetsForPythonOmni(context) - return has('python') && g:acp_behaviorPythonOmniLength >= 0 && - \ a:context =~ '\k\.\k\{' . g:acp_behaviorPythonOmniLength . ',}$' -endfunction - -" -function acp#meetsForPerlOmni(context) - return g:acp_behaviorPerlOmniLength >= 0 && - \ a:context =~ '\w->\k\{' . g:acp_behaviorPerlOmniLength . ',}$' -endfunction - -" -function acp#meetsForXmlOmni(context) - return g:acp_behaviorXmlOmniLength >= 0 && - \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' . - \ g:acp_behaviorXmlOmniLength . ',}$' -endfunction - -" -function acp#meetsForHtmlOmni(context) - return g:acp_behaviorHtmlOmniLength >= 0 && - \ a:context =~ '\(<\|<\/\|<[^>]\+ \|<[^>]\+=\"\)\k\{' . - \ g:acp_behaviorHtmlOmniLength . ',}$' -endfunction - -" -function acp#meetsForCssOmni(context) - if g:acp_behaviorCssOmniPropertyLength >= 0 && - \ a:context =~ '\(^\s\|[;{]\)\s*\k\{' . - \ g:acp_behaviorCssOmniPropertyLength . ',}$' - return 1 - endif - if g:acp_behaviorCssOmniValueLength >= 0 && - \ a:context =~ '[:@!]\s*\k\{' . - \ g:acp_behaviorCssOmniValueLength . ',}$' - return 1 - endif - return 0 -endfunction - -" -function acp#completeSnipmate(findstart, base) - if a:findstart - let s:posSnipmateCompletion = len(matchstr(s:getCurrentText(), '.*\U')) - return s:posSnipmateCompletion - endif - let lenBase = len(a:base) - let items = filter(GetSnipsInCurrentScope(), - \ 'strpart(v:key, 0, lenBase) ==? a:base') - return map(sort(items(items)), 's:makeSnipmateItem(v:val[0], v:val[1])') -endfunction - -" -function acp#onPopupCloseSnipmate() - let word = s:getCurrentText()[s:posSnipmateCompletion :] - for trigger in keys(GetSnipsInCurrentScope()) - if word ==# trigger - call feedkeys("\=TriggerSnippet()\", "n") - return 0 - endif - endfor - return 1 -endfunction - -" -function acp#onPopupPost() - " to clear = expression on command-line - echo '' - if pumvisible() - inoremap acp#onBs() - inoremap acp#onBs() - " a command to restore to original text and select the first match - return (s:behavsCurrent[s:iBehavs].command =~# "\" ? "\\" - \ : "\\") - endif - let s:iBehavs += 1 - if len(s:behavsCurrent) > s:iBehavs - call s:setCompletefunc() - return printf("\%s\=acp#onPopupPost()\", - \ s:behavsCurrent[s:iBehavs].command) - else - let s:lastUncompletable = { - \ 'word': s:getCurrentWord(), - \ 'commands': map(copy(s:behavsCurrent), 'v:val.command')[1:], - \ } - call s:finishPopup(0) - return "\" - endif -endfunction - -" -function acp#onBs() - " using "matchstr" and not "strpart" in order to handle multi-byte - " characters - if call(s:behavsCurrent[s:iBehavs].meets, - \ [matchstr(s:getCurrentText(), '.*\ze.')]) - return "\" - endif - return "\\" -endfunction - -" }}}1 -"============================================================================= -" LOCAL FUNCTIONS: {{{1 - -" -function s:mapForMappingDriven() - call s:unmapForMappingDriven() - let s:keysMappingDriven = [ - \ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', - \ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - \ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', - \ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', - \ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - \ '-', '_', '~', '^', '.', ',', ':', '!', '#', '=', '%', '$', '@', '<', '>', '/', '\', - \ '', '', '', ] - for key in s:keysMappingDriven - execute printf('inoremap %s %s=feedPopup()', - \ key, key) - endfor -endfunction - -" -function s:unmapForMappingDriven() - if !exists('s:keysMappingDriven') - return - endif - for key in s:keysMappingDriven - execute 'iunmap ' . key - endfor - let s:keysMappingDriven = [] -endfunction - -" -function s:setTempOption(group, name, value) - call extend(s:tempOptionSet[a:group], { a:name : eval('&' . a:name) }, 'keep') - execute printf('let &%s = a:value', a:name) -endfunction - -" -function s:restoreTempOptions(group) - for [name, value] in items(s:tempOptionSet[a:group]) - execute printf('let &%s = value', name) - endfor - let s:tempOptionSet[a:group] = {} -endfunction - -" -function s:getCurrentWord() - return matchstr(s:getCurrentText(), '\k*$') -endfunction - -" -function s:getCurrentText() - return strpart(getline('.'), 0, col('.') - 1) -endfunction - -" -function s:getPostText() - return strpart(getline('.'), col('.') - 1) -endfunction - -" -function s:isModifiedSinceLastCall() - if exists('s:posLast') - let posPrev = s:posLast - let nLinesPrev = s:nLinesLast - let textPrev = s:textLast - endif - let s:posLast = getpos('.') - let s:nLinesLast = line('$') - let s:textLast = getline('.') - if !exists('posPrev') - return 1 - elseif posPrev[1] != s:posLast[1] || nLinesPrev != s:nLinesLast - return (posPrev[1] - s:posLast[1] == nLinesPrev - s:nLinesLast) - elseif textPrev ==# s:textLast - return 0 - elseif posPrev[2] > s:posLast[2] - return 1 - elseif has('gui_running') && has('multi_byte') - " NOTE: auto-popup causes a strange behavior when IME/XIM is working - return posPrev[2] + 1 == s:posLast[2] - endif - return posPrev[2] != s:posLast[2] -endfunction - -" -function s:makeCurrentBehaviorSet() - let modified = s:isModifiedSinceLastCall() - if exists('s:behavsCurrent[s:iBehavs].repeat') && s:behavsCurrent[s:iBehavs].repeat - let behavs = [ s:behavsCurrent[s:iBehavs] ] - elseif exists('s:behavsCurrent[s:iBehavs]') - return [] - elseif modified - let behavs = copy(exists('g:acp_behavior[&filetype]') - \ ? g:acp_behavior[&filetype] - \ : g:acp_behavior['*']) - else - return [] - endif - let text = s:getCurrentText() - call filter(behavs, 'call(v:val.meets, [text])') - let s:iBehavs = 0 - if exists('s:lastUncompletable') && - \ stridx(s:getCurrentWord(), s:lastUncompletable.word) == 0 && - \ map(copy(behavs), 'v:val.command') ==# s:lastUncompletable.commands - let behavs = [] - else - unlet! s:lastUncompletable - endif - return behavs -endfunction - -" -function s:feedPopup() - " NOTE: CursorMovedI is not triggered while the popup menu is visible. And - " it will be triggered when popup menu is disappeared. - if s:lockCount > 0 || pumvisible() || &paste - return '' - endif - if exists('s:behavsCurrent[s:iBehavs].onPopupClose') - if !call(s:behavsCurrent[s:iBehavs].onPopupClose, []) - call s:finishPopup(1) - return '' - endif - endif - let s:behavsCurrent = s:makeCurrentBehaviorSet() - if empty(s:behavsCurrent) - call s:finishPopup(1) - return '' - endif - " In case of dividing words by symbols (e.g. "for(int", "ab==cd") while a - " popup menu is visible, another popup is not available unless input - " or try popup once. So first completion is duplicated. - call insert(s:behavsCurrent, s:behavsCurrent[s:iBehavs]) - call s:setTempOption(s:GROUP0, 'spell', 0) - call s:setTempOption(s:GROUP0, 'completeopt', 'menuone' . (g:acp_completeoptPreview ? ',preview' : '')) - call s:setTempOption(s:GROUP0, 'complete', g:acp_completeOption) - call s:setTempOption(s:GROUP0, 'ignorecase', g:acp_ignorecaseOption) - " NOTE: With CursorMovedI driven, Set 'lazyredraw' to avoid flickering. - " With Mapping driven, set 'nolazyredraw' to make a popup menu visible. - call s:setTempOption(s:GROUP0, 'lazyredraw', !g:acp_mappingDriven) - " NOTE: 'textwidth' must be restored after . - call s:setTempOption(s:GROUP1, 'textwidth', 0) - call s:setCompletefunc() - call feedkeys(s:behavsCurrent[s:iBehavs].command . "\=acp#onPopupPost()\", 'n') - return '' " this function is called by = -endfunction - -" -function s:finishPopup(fGroup1) - inoremap | iunmap - inoremap | iunmap - let s:behavsCurrent = [] - call s:restoreTempOptions(s:GROUP0) - if a:fGroup1 - call s:restoreTempOptions(s:GROUP1) - endif -endfunction - -" -function s:setCompletefunc() - if exists('s:behavsCurrent[s:iBehavs].completefunc') - call s:setTempOption(0, 'completefunc', s:behavsCurrent[s:iBehavs].completefunc) - endif -endfunction - -" -function s:makeSnipmateItem(key, snip) - if type(a:snip) == type([]) - let descriptions = map(copy(a:snip), 'v:val[0]') - let snipFormatted = '[MULTI] ' . join(descriptions, ', ') - else - let snipFormatted = substitute(a:snip, '\(\n\|\s\)\+', ' ', 'g') - endif - return { - \ 'word': a:key, - \ 'menu': strpart(snipFormatted, 0, 80), - \ } -endfunction - -" -function s:getMatchingSnipItems(base) - let key = a:base . "\n" - if !exists('s:snipItems[key]') - let s:snipItems[key] = items(GetSnipsInCurrentScope()) - call filter(s:snipItems[key], 'strpart(v:val[0], 0, len(a:base)) ==? a:base') - call map(s:snipItems[key], 's:makeSnipmateItem(v:val[0], v:val[1])') - endif - return s:snipItems[key] -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -let s:GROUP0 = 0 -let s:GROUP1 = 1 -let s:lockCount = 0 -let s:behavsCurrent = [] -let s:iBehavs = 0 -let s:tempOptionSet = [{}, {}] -let s:snipItems = {} - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/vim/bundle/auto-compl-pop/doc/acp.jax b/vim/bundle/auto-compl-pop/doc/acp.jax deleted file mode 100644 index 12e55ce..0000000 --- a/vim/bundle/auto-compl-pop/doc/acp.jax +++ /dev/null @@ -1,298 +0,0 @@ -*acp.txt* 補完メニューの自動ポップアップ - - Copyright (c) 2007-2009 Takeshi NISHIDA - -AutoComplPop *autocomplpop* *acp* - -概要 |acp-introduction| -インストール |acp-installation| -使い方 |acp-usage| -コマンド |acp-commands| -オプション |acp-options| -SPECIAL THANKS |acp-thanks| -CHANGELOG |acp-changelog| -あばうと |acp-about| - - -============================================================================== -概要 *acp-introduction* - -このプラグインは、インサートモードで文字を入力したりカーソルを動かしたときに補 -完メニューを自動的に開くようにします。しかし、続けて文字を入力するのを妨げたり -はしません。 - - -============================================================================== -インストール *acp-installation* - -ZIPファイルをランタイムディレクトリに展開します。 - -以下のようにファイルが配置されるはずです。 -> - /plugin/acp.vim - /doc/acp.txt - ... -< -もしランタイムディレクトリが他のプラグインとごた混ぜになるのが嫌なら、ファイル -を新規ディレクトリに配置し、そのディレクトリのパスを 'runtimepath' に追加して -ください。アンインストールも楽になります。 - -その後 FuzzyFinder のヘルプを有効にするためにタグファイルを更新してください。 -詳しくは|add-local-help|を参照してください。 - - -============================================================================== -使い方 *acp-usage* - -このプラグインがインストールされていれば、自動ポップアップは vim の開始時から -有効になります。 - -カーソル直前のテキストに応じて、利用する補完の種類を切り替えます。デフォルトの -補完動作は次の通りです: - - 補完モード filetype カーソル直前のテキスト ~ - キーワード補完 * 2文字のキーワード文字 - ファイル名補完 * ファイル名文字 + パスセパレータ - + 0文字以上のファイル名文字 - オムニ補完 ruby ".", "::" or 単語を構成する文字以外 + ":" - オムニ補完 python "." - オムニ補完 xml "<", ""以外の文字列 + " ") - オムニ補完 html/xhtml "<", ""以外の文字列 + " ") - オムニ補完 css (":", ";", "{", "^", "@", or "!") - + 0個または1個のスペース - -さらに、設定を行うことで、ユーザー定義補完と snipMate トリガー補完 -(|acp-snipMate|) を自動ポップアップさせることができます。 - -これらの補完動作はカスタマイズ可能です。 - - *acp-snipMate* -snipMate トリガー補完 ~ - -snipMate トリガー補完では、snipMate プラグイン -(http://www.vim.org/scripts/script.php?script_id=2540) が提供するスニペットの -トリガーを補完してそれを展開することができます。 - -この自動ポップアップを有効にするには、次の関数を plugin/snipMate.vim に追加す -る必要があります: -> - fun! GetSnipsInCurrentScope() - let snips = {} - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - call extend(snips, get(s:snippets, scope, {}), 'keep') - call extend(snips, get(s:multi_snips, scope, {}), 'keep') - endfor - return snips - endf -< -そして|g:acp_behaviorSnipmateLength|オプションを 1 にしてください。 - -この自動ポップアップには制限があり、カーソル直前の単語は大文字英字だけで構成さ -れていなければなりません。 - - *acp-perl-omni* -Perl オムニ補完 ~ - -AutoComplPop は perl-completion.vim -(http://www.vim.org/scripts/script.php?script_id=2852) をサポートしています。 - -この自動ポップアップを有効にするには、|g:acp_behaviorPerlOmniLength|オプション -を 0 以上にしてください。 - - -============================================================================== -コマンド *acp-commands* - - *:AcpEnable* -:AcpEnable - 自動ポップアップを有効にします。 - - *:AcpDisable* -:AcpDisable - 自動ポップアップを無効にします。 - - *:AcpLock* -:AcpLock - 自動ポップアップを一時的に停止します。 - - 別のスクリプトへの干渉を回避する目的なら、このコマンドと|:AcpUnlock| - を利用することを、|:AcpDisable|と|:AcpEnable| を利用するよりも推奨しま - す。 - - *:AcpUnlock* -:AcpUnlock - |:AcpLock| で停止された自動ポップアップを再開します。 - - -============================================================================== -オプション *acp-options* - - *g:acp_enableAtStartup* > - let g:acp_enableAtStartup = 1 -< - 真なら vim 開始時から自動ポップアップが有効になります。 - - *g:acp_mappingDriven* > - let g:acp_mappingDriven = 0 -< - 真なら|CursorMovedI|イベントではなくキーマッピングで自動ポップアップを - 行うようにします。カーソルを移動するたびに補完が行われることで重いなど - の不都合がある場合に利用してください。ただし他のプラグインとの相性問題 - や日本語入力での不具合が発生する可能性があります。(逆も然り。) - - *g:acp_ignorecaseOption* > - let g:acp_ignorecaseOption = 1 -< - 自動ポップアップ時に、'ignorecase' に一時的に設定する値 - - *g:acp_completeOption* > - let g:acp_completeOption = '.,w,b,k' -< - 自動ポップアップ時に、'complete' に一時的に設定する値 - - *g:acp_completeoptPreview* > - let g:acp_completeoptPreview = 0 -< - 真なら自動ポップアップ時に、 'completeopt' へ "preview" を追加します。 - - *g:acp_behaviorUserDefinedFunction* > - let g:acp_behaviorUserDefinedFunction = '' -< - ユーザー定義補完の|g:acp_behavior-completefunc|。空ならこの補完は行わ - れません。。 - - *g:acp_behaviorUserDefinedMeets* > - let g:acp_behaviorUserDefinedMeets = '' -< - ユーザー定義補完の|g:acp_behavior-meets|。空ならこの補完は行われません - 。 - - *g:acp_behaviorSnipmateLength* > - let g:acp_behaviorSnipmateLength = -1 -< - snipMate トリガー補完の自動ポップアップを行うのに必要なカーソルの直前 - のパターン。 - - *g:acp_behaviorKeywordCommand* > - let g:acp_behaviorKeywordCommand = "\" -< - キーワード補完のコマンド。このオプションには普通 "\" か "\" - を設定します。 - - *g:acp_behaviorKeywordLength* > - let g:acp_behaviorKeywordLength = 2 -< - キーワード補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ - ード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorKeywordIgnores* > - let g:acp_behaviorKeywordIgnores = [] -< - 文字列のリスト。カーソル直前の単語がこれらの内いずれかの先頭部分にマッ - チする場合、この補完は行われません。 - - 例えば、 "get" で始まる補完キーワードが多過ぎて、"g", "ge", "get" を入 - 力したときの自動ポップアップがレスポンスの低下を引き起こしている場合、 - このオプションに ["get"] を設定することでそれを回避することができます。 - - *g:acp_behaviorFileLength* > - let g:acp_behaviorFileLength = 0 -< - ファイル名補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ - ード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorRubyOmniMethodLength* > - let g:acp_behaviorRubyOmniMethodLength = 0 -< - メソッド補完のための、Ruby オムニ補完の自動ポップアップを行うのに必要 - なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorRubyOmniSymbolLength* > - let g:acp_behaviorRubyOmniSymbolLength = 1 -< - シンボル補完のための、Ruby オムニ補完の自動ポップアップを行うのに必要 - なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorPythonOmniLength* > - let g:acp_behaviorPythonOmniLength = 0 -< - Python オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキ - ーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorPerlOmniLength* > - let g:acp_behaviorPerlOmniLength = -1 -< - Perl オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー - ワード文字数。負数ならこの補完は行われません。 - - See also: |acp-perl-omni| - - *g:acp_behaviorXmlOmniLength* > - let g:acp_behaviorXmlOmniLength = 0 -< - XML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキーワ - ード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorHtmlOmniLength* > - let g:acp_behaviorHtmlOmniLength = 0 -< - HTML オムニ補完の自動ポップアップを行うのに必要なカーソルの直前のキー - ワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorCssOmniPropertyLength* > - let g:acp_behaviorCssOmniPropertyLength = 1 -< - プロパティ補完のための、CSS オムニ補完の自動ポップアップを行うのに必要 - なカーソルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behaviorCssOmniValueLength* > - let g:acp_behaviorCssOmniValueLength = 0 -< - 値補完のための、CSS オムニ補完の自動ポップアップを行うのに必要なカーソ - ルの直前のキーワード文字数。負数ならこの補完は行われません。 - - *g:acp_behavior* > - let g:acp_behavior = {} -< - - これは内部仕様がわかっている人向けのオプションで、他のオプションでの設 - 定より優先されます。 - - |Dictionary|型で、キーはファイルタイプに対応します。 '*' はデフォルト - を表します。値はリスト型です。補完候補が得られるまでリストの先頭アイテ - ムから順に評価します。各要素は|Dictionary|で詳細は次の通り: - - "command": *g:acp_behavior-command* - 補完メニューをポップアップするためのコマンド。 - - "completefunc": *g:acp_behavior-completefunc* - 'completefunc' に設定する関数。 "command" が "" のときだけ - 意味があります。 - - "meets": *g:acp_behavior-meets* - この補完を行うかどうかを判断する関数の名前。この関数はカーソル直前の - テキストを引数に取り、補完を行うなら非 0 の値を返します。 - - "onPopupClose": *g:acp_behavior-onPopupClose* - この補完のポップアップメニューが閉じられたときに呼ばれる関数の名前。 - この関数が 0 を返した場合、続いて行われる予定の補完は抑制されます。 - - "repeat": *g:acp_behavior-repeat* - 真なら最後の補完が自動的に繰り返されます。 - - -============================================================================== -あばうと *acp-about* *acp-contact* *acp-author* - -作者: Takeshi NISHIDA -ライセンス: MIT Licence -URL: http://www.vim.org/scripts/script.php?script_id=1879 - http://bitbucket.org/ns9tks/vim-autocomplpop/ - -バグや要望など ~ - -こちらへどうぞ: http://bitbucket.org/ns9tks/vim-autocomplpop/issues/ - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: - diff --git a/vim/bundle/auto-compl-pop/doc/acp.txt b/vim/bundle/auto-compl-pop/doc/acp.txt deleted file mode 100644 index 324c88b..0000000 --- a/vim/bundle/auto-compl-pop/doc/acp.txt +++ /dev/null @@ -1,512 +0,0 @@ -*acp.txt* Automatically opens popup menu for completions. - - Copyright (c) 2007-2009 Takeshi NISHIDA - -AutoComplPop *autocomplpop* *acp* - -INTRODUCTION |acp-introduction| -INSTALLATION |acp-installation| -USAGE |acp-usage| -COMMANDS |acp-commands| -OPTIONS |acp-options| -SPECIAL THANKS |acp-thanks| -CHANGELOG |acp-changelog| -ABOUT |acp-about| - - -============================================================================== -INTRODUCTION *acp-introduction* - -With this plugin, your vim comes to automatically opens popup menu for -completions when you enter characters or move the cursor in Insert mode. It -won't prevent you continuing entering characters. - - -============================================================================== -INSTALLATION *acp-installation* - -Put all files into your runtime directory. If you have the zip file, extract -it to your runtime directory. - -You should place the files as follows: -> - /plugin/acp.vim - /doc/acp.txt - ... -< -If you disgust to jumble up this plugin and other plugins in your runtime -directory, put the files into new directory and just add the directory path to -'runtimepath'. It's easy to uninstall the plugin. - -And then update your help tags files to enable fuzzyfinder help. See -|add-local-help| for details. - - -============================================================================== -USAGE *acp-usage* - -Once this plugin is installed, auto-popup is enabled at startup by default. - -Which completion method is used depends on the text before the cursor. The -default behavior is as follows: - - kind filetype text before the cursor ~ - Keyword * two keyword characters - Filename * a filename character + a path separator - + 0 or more filename character - Omni ruby ".", "::" or non-word character + ":" - (|+ruby| required.) - Omni python "." (|+python| required.) - Omni xml "<", "" characters + " ") - Omni html/xhtml "<", "" characters + " ") - Omni css (":", ";", "{", "^", "@", or "!") - + 0 or 1 space - -Also, you can make user-defined completion and snipMate's trigger completion -(|acp-snipMate|) auto-popup if the options are set. - -These behavior are customizable. - - *acp-snipMate* -snipMate's Trigger Completion ~ - -snipMate's trigger completion enables you to complete a snippet trigger -provided by snipMate plugin -(http://www.vim.org/scripts/script.php?script_id=2540) and expand it. - - -To enable auto-popup for this completion, add following function to -plugin/snipMate.vim: -> - fun! GetSnipsInCurrentScope() - let snips = {} - for scope in [bufnr('%')] + split(&ft, '\.') + ['_'] - call extend(snips, get(s:snippets, scope, {}), 'keep') - call extend(snips, get(s:multi_snips, scope, {}), 'keep') - endfor - return snips - endf -< -And set |g:acp_behaviorSnipmateLength| option to 1. - -There is the restriction on this auto-popup, that the word before cursor must -consist only of uppercase characters. - - *acp-perl-omni* -Perl Omni-Completion ~ - -AutoComplPop supports perl-completion.vim -(http://www.vim.org/scripts/script.php?script_id=2852). - -To enable auto-popup for this completion, set |g:acp_behaviorPerlOmniLength| -option to 0 or more. - - -============================================================================== -COMMANDS *acp-commands* - - *:AcpEnable* -:AcpEnable - enables auto-popup. - - *:AcpDisable* -:AcpDisable - disables auto-popup. - - *:AcpLock* -:AcpLock - suspends auto-popup temporarily. - - For the purpose of avoiding interruption to another script, it is - recommended to insert this command and |:AcpUnlock| than |:AcpDisable| - and |:AcpEnable| . - - *:AcpUnlock* -:AcpUnlock - resumes auto-popup suspended by |:AcpLock| . - - -============================================================================== -OPTIONS *acp-options* - - *g:acp_enableAtStartup* > - let g:acp_enableAtStartup = 1 -< - If non-zero, auto-popup is enabled at startup. - - *g:acp_mappingDriven* > - let g:acp_mappingDriven = 0 -< - If non-zero, auto-popup is triggered by key mappings instead of - |CursorMovedI| event. This is useful to avoid auto-popup by moving - cursor in Insert mode. - - *g:acp_ignorecaseOption* > - let g:acp_ignorecaseOption = 1 -< - Value set to 'ignorecase' temporarily when auto-popup. - - *g:acp_completeOption* > - let g:acp_completeOption = '.,w,b,k' -< - Value set to 'complete' temporarily when auto-popup. - - *g:acp_completeoptPreview* > - let g:acp_completeoptPreview = 0 -< - If non-zero, "preview" is added to 'completeopt' when auto-popup. - - *g:acp_behaviorUserDefinedFunction* > - let g:acp_behaviorUserDefinedFunction = '' -< - |g:acp_behavior-completefunc| for user-defined completion. If empty, - this completion will be never attempted. - - *g:acp_behaviorUserDefinedMeets* > - let g:acp_behaviorUserDefinedMeets = '' -< - |g:acp_behavior-meets| for user-defined completion. If empty, this - completion will be never attempted. - - *g:acp_behaviorSnipmateLength* > - let g:acp_behaviorSnipmateLength = -1 -< - Pattern before the cursor, which are needed to attempt - snipMate-trigger completion. - - *g:acp_behaviorKeywordCommand* > - let g:acp_behaviorKeywordCommand = "\" -< - Command for keyword completion. This option is usually set "\" or - "\". - - *g:acp_behaviorKeywordLength* > - let g:acp_behaviorKeywordLength = 2 -< - Length of keyword characters before the cursor, which are needed to - attempt keyword completion. If negative value, this completion will be - never attempted. - - *g:acp_behaviorKeywordIgnores* > - let g:acp_behaviorKeywordIgnores = [] -< - List of string. If a word before the cursor matches to the front part - of one of them, keyword completion won't be attempted. - - E.g., when there are too many keywords beginning with "get" for the - completion and auto-popup by entering "g", "ge", or "get" causes - response degradation, set ["get"] to this option and avoid it. - - *g:acp_behaviorFileLength* > - let g:acp_behaviorFileLength = 0 -< - Length of filename characters before the cursor, which are needed to - attempt filename completion. If negative value, this completion will - be never attempted. - - *g:acp_behaviorRubyOmniMethodLength* > - let g:acp_behaviorRubyOmniMethodLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt ruby omni-completion for methods. If negative value, this - completion will be never attempted. - - *g:acp_behaviorRubyOmniSymbolLength* > - let g:acp_behaviorRubyOmniSymbolLength = 1 -< - Length of keyword characters before the cursor, which are needed to - attempt ruby omni-completion for symbols. If negative value, this - completion will be never attempted. - - *g:acp_behaviorPythonOmniLength* > - let g:acp_behaviorPythonOmniLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt python omni-completion. If negative value, this completion - will be never attempted. - - *g:acp_behaviorPerlOmniLength* > - let g:acp_behaviorPerlOmniLength = -1 -< - Length of keyword characters before the cursor, which are needed to - attempt perl omni-completion. If negative value, this completion will - be never attempted. - - See also: |acp-perl-omni| - - *g:acp_behaviorXmlOmniLength* > - let g:acp_behaviorXmlOmniLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt XML omni-completion. If negative value, this completion will - be never attempted. - - *g:acp_behaviorHtmlOmniLength* > - let g:acp_behaviorHtmlOmniLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt HTML omni-completion. If negative value, this completion will - be never attempted. - - *g:acp_behaviorCssOmniPropertyLength* > - let g:acp_behaviorCssOmniPropertyLength = 1 -< - Length of keyword characters before the cursor, which are needed to - attempt CSS omni-completion for properties. If negative value, this - completion will be never attempted. - - *g:acp_behaviorCssOmniValueLength* > - let g:acp_behaviorCssOmniValueLength = 0 -< - Length of keyword characters before the cursor, which are needed to - attempt CSS omni-completion for values. If negative value, this - completion will be never attempted. - - *g:acp_behavior* > - let g:acp_behavior = {} -< - This option is for advanced users. This setting overrides other - behavior options. This is a |Dictionary|. Each key corresponds to a - filetype. '*' is default. Each value is a list. These are attempted in - sequence until completion item is found. Each element is a - |Dictionary| which has following items: - - "command": *g:acp_behavior-command* - Command to be fed to open popup menu for completions. - - "completefunc": *g:acp_behavior-completefunc* - 'completefunc' will be set to this user-provided function during the - completion. Only makes sense when "command" is "". - - "meets": *g:acp_behavior-meets* - Name of the function which dicides whether or not to attempt this - completion. It will be attempted if this function returns non-zero. - This function takes a text before the cursor. - - "onPopupClose": *g:acp_behavior-onPopupClose* - Name of the function which is called when popup menu for this - completion is closed. Following completions will be suppressed if - this function returns zero. - - "repeat": *g:acp_behavior-repeat* - If non-zero, the last completion is automatically repeated. - - -============================================================================== -SPECIAL THANKS *acp-thanks* - -- Daniel Schierbeck -- Ingo Karkat - - -============================================================================== -CHANGELOG *acp-changelog* - -2.14.1 - - Changed the way of auto-popup for avoiding an issue about filename - completion. - - Fixed a bug that popup menu was opened twice when auto-popup was done. - -2.14 - - Added the support for perl-completion.vim. - -2.13 - - Changed to sort snipMate's triggers. - - Fixed a bug that a wasted character was inserted after snipMate's trigger - completion. - -2.12.1 - - Changed to avoid a strange behavior with Microsoft IME. - -2.12 - - Added g:acp_behaviorKeywordIgnores option. - - Added g:acp_behaviorUserDefinedMeets option and removed - g:acp_behaviorUserDefinedPattern. - - Changed to do auto-popup only when a buffer is modified. - - Changed the structure of g:acp_behavior option. - - Changed to reflect a change of behavior options (named g:acp_behavior*) - any time it is done. - - Fixed a bug that completions after omni completions or snipMate's trigger - completion were never attempted when no candidate for the former - completions was found. - -2.11.1 - - Fixed a bug that a snipMate's trigger could not be expanded when it was - completed. - -2.11 - - Implemented experimental feature which is snipMate's trigger completion. - -2.10 - - Improved the response by changing not to attempt any completion when - keyword characters are entered after a word which has been found that it - has no completion candidate at the last attempt of completions. - - Improved the response by changing to close popup menu when was - pressed and the text before the cursor would not match with the pattern of - current behavior. - -2.9 - - Changed default behavior to support XML omni completion. - - Changed default value of g:acp_behaviorKeywordCommand option. - The option with "\" cause a problem which inserts a match without - when 'dictionary' has been set and keyword completion is done. - - Changed to show error message when incompatible with a installed vim. - -2.8.1 - - Fixed a bug which inserted a selected match to the next line when - auto-wrapping (enabled with 'formatoptions') was performed. - -2.8 - - Added g:acp_behaviorUserDefinedFunction option and - g:acp_behaviorUserDefinedPattern option for users who want to make custom - completion auto-popup. - - Fixed a bug that setting 'spell' on a new buffer made typing go crazy. - -2.7 - - Changed naming conventions for filenames, functions, commands, and options - and thus renamed them. - - Added g:acp_behaviorKeywordCommand option. If you prefer the previous - behavior for keyword completion, set this option "\". - - Changed default value of g:acp_ignorecaseOption option. - - The following were done by Ingo Karkat: - - - ENH: Added support for setting a user-provided 'completefunc' during the - completion, configurable via g:acp_behavior. - - BUG: When the configured completion is or , the command to - restore the original text (in on_popup_post()) must be reverted, too. - - BUG: When using a custom completion function () that also uses - an s:...() function name, the s:GetSidPrefix() function dynamically - determines the wrong SID. Now calling s:DetermineSidPrefix() once during - sourcing and caching the value in s:SID. - - BUG: Should not use custom defined completion mappings. Now - consistently using unmapped completion commands everywhere. (Beforehand, - s:PopupFeeder.feed() used mappings via feedkeys(..., 'm'), but - s:PopupFeeder.on_popup_post() did not due to its invocation via - :map-expr.) - -2.6: - - Improved the behavior of omni completion for HTML/XHTML. - -2.5: - - Added some options to customize behavior easily: - g:AutoComplPop_BehaviorKeywordLength - g:AutoComplPop_BehaviorFileLength - g:AutoComplPop_BehaviorRubyOmniMethodLength - g:AutoComplPop_BehaviorRubyOmniSymbolLength - g:AutoComplPop_BehaviorPythonOmniLength - g:AutoComplPop_BehaviorHtmlOmniLength - g:AutoComplPop_BehaviorCssOmniPropertyLength - g:AutoComplPop_BehaviorCssOmniValueLength - -2.4: - - Added g:AutoComplPop_MappingDriven option. - -2.3.1: - - Changed to set 'lazyredraw' while a popup menu is visible to avoid - flickering. - - Changed a behavior for CSS. - - Added support for GetLatestVimScripts. - -2.3: - - Added a behavior for Python to support omni completion. - - Added a behavior for CSS to support omni completion. - -2.2: - - Changed not to work when 'paste' option is set. - - Fixed AutoComplPopEnable command and AutoComplPopDisable command to - map/unmap "i" and "R". - -2.1: - - Fixed the problem caused by "." command in Normal mode. - - Changed to map "i" and "R" to feed completion command after starting - Insert mode. - - Avoided the problem caused by Windows IME. - -2.0: - - Changed to use CursorMovedI event to feed a completion command instead of - key mapping. Now the auto-popup is triggered by moving the cursor. - - Changed to feed completion command after starting Insert mode. - - Removed g:AutoComplPop_MapList option. - -1.7: - - Added behaviors for HTML/XHTML. Now supports the omni completion for - HTML/XHTML. - - Changed not to show expressions for CTRL-R =. - - Changed not to set 'nolazyredraw' while a popup menu is visible. - -1.6.1: - - Changed not to trigger the filename completion by a text which has - multi-byte characters. - -1.6: - - Redesigned g:AutoComplPop_Behavior option. - - Changed default value of g:AutoComplPop_CompleteOption option. - - Changed default value of g:AutoComplPop_MapList option. - -1.5: - - Implemented continuous-completion for the filename completion. And added - new option to g:AutoComplPop_Behavior. - -1.4: - - Fixed the bug that the auto-popup was not suspended in fuzzyfinder. - - Fixed the bug that an error has occurred with Ruby-omni-completion unless - Ruby interface. - -1.3: - - Supported Ruby-omni-completion by default. - - Supported filename completion by default. - - Added g:AutoComplPop_Behavior option. - - Added g:AutoComplPop_CompleteoptPreview option. - - Removed g:AutoComplPop_MinLength option. - - Removed g:AutoComplPop_MaxLength option. - - Removed g:AutoComplPop_PopupCmd option. - -1.2: - - Fixed bugs related to 'completeopt'. - -1.1: - - Added g:AutoComplPop_IgnoreCaseOption option. - - Added g:AutoComplPop_NotEnableAtStartup option. - - Removed g:AutoComplPop_LoadAndEnable option. -1.0: - - g:AutoComplPop_LoadAndEnable option for a startup activation is added. - - AutoComplPopLock command and AutoComplPopUnlock command are added to - suspend and resume. - - 'completeopt' and 'complete' options are changed temporarily while - completing by this script. - -0.4: - - The first match are selected when the popup menu is Opened. You can insert - the first match with CTRL-Y. - -0.3: - - Fixed the problem that the original text is not restored if 'longest' is - not set in 'completeopt'. Now the plugin works whether or not 'longest' is - set in 'completeopt', and also 'menuone'. - -0.2: - - When completion matches are not found, insert CTRL-E to stop completion. - - Clear the echo area. - - Fixed the problem in case of dividing words by symbols, popup menu is - not opened. - -0.1: - - First release. - - -============================================================================== -ABOUT *acp-about* *acp-contact* *acp-author* - -Author: Takeshi NISHIDA -Licence: MIT Licence -URL: http://www.vim.org/scripts/script.php?script_id=1879 - http://bitbucket.org/ns9tks/vim-autocomplpop/ - -Bugs/Issues/Suggestions/Improvements ~ - -Please submit to http://bitbucket.org/ns9tks/vim-autocomplpop/issues/ . - -============================================================================== - vim:tw=78:ts=8:ft=help:norl: - diff --git a/vim/bundle/auto-compl-pop/plugin/acp.vim b/vim/bundle/auto-compl-pop/plugin/acp.vim deleted file mode 100644 index 0c01a31..0000000 --- a/vim/bundle/auto-compl-pop/plugin/acp.vim +++ /dev/null @@ -1,170 +0,0 @@ -"============================================================================= -" Copyright (c) 2007-2009 Takeshi NISHIDA -" -" GetLatestVimScripts: 1879 1 :AutoInstall: AutoComplPop -"============================================================================= -" LOAD GUARD {{{1 - -if exists('g:loaded_acp') - finish -elseif v:version < 702 - echoerr 'AutoComplPop does not support this version of vim (' . v:version . ').' - finish -endif -let g:loaded_acp = 1 - -" }}}1 -"============================================================================= -" FUNCTION: {{{1 - -" -function s:defineOption(name, default) - if !exists(a:name) - let {a:name} = a:default - endif -endfunction - -" -function s:makeDefaultBehavior() - let behavs = { - \ '*' : [], - \ 'ruby' : [], - \ 'python' : [], - \ 'perl' : [], - \ 'xml' : [], - \ 'html' : [], - \ 'xhtml' : [], - \ 'css' : [], - \ } - "--------------------------------------------------------------------------- - if !empty(g:acp_behaviorUserDefinedFunction) && - \ !empty(g:acp_behaviorUserDefinedMeets) - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : "\\", - \ 'completefunc' : g:acp_behaviorUserDefinedFunction, - \ 'meets' : g:acp_behaviorUserDefinedMeets, - \ 'repeat' : 0, - \ }) - endfor - endif - "--------------------------------------------------------------------------- - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : "\\", - \ 'completefunc' : 'acp#completeSnipmate', - \ 'meets' : 'acp#meetsForSnipmate', - \ 'onPopupClose' : 'acp#onPopupCloseSnipmate', - \ 'repeat' : 0, - \ }) - endfor - "--------------------------------------------------------------------------- - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : g:acp_behaviorKeywordCommand, - \ 'meets' : 'acp#meetsForKeyword', - \ 'repeat' : 0, - \ }) - endfor - "--------------------------------------------------------------------------- - for key in keys(behavs) - call add(behavs[key], { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForFile', - \ 'repeat' : 1, - \ }) - endfor - "--------------------------------------------------------------------------- - call add(behavs.ruby, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForRubyOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.python, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForPythonOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.perl, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForPerlOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.xml, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForXmlOmni', - \ 'repeat' : 1, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.html, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForHtmlOmni', - \ 'repeat' : 1, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.xhtml, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForHtmlOmni', - \ 'repeat' : 1, - \ }) - "--------------------------------------------------------------------------- - call add(behavs.css, { - \ 'command' : "\\", - \ 'meets' : 'acp#meetsForCssOmni', - \ 'repeat' : 0, - \ }) - "--------------------------------------------------------------------------- - return behavs -endfunction - -" }}}1 -"============================================================================= -" INITIALIZATION {{{1 - -"----------------------------------------------------------------------------- -call s:defineOption('g:acp_enableAtStartup', 1) -call s:defineOption('g:acp_mappingDriven', 0) -call s:defineOption('g:acp_ignorecaseOption', 1) -call s:defineOption('g:acp_completeOption', '.,w,b,k') -call s:defineOption('g:acp_completeoptPreview', 0) -call s:defineOption('g:acp_behaviorUserDefinedFunction', '') -call s:defineOption('g:acp_behaviorUserDefinedMeets', '') -call s:defineOption('g:acp_behaviorSnipmateLength', -1) -call s:defineOption('g:acp_behaviorKeywordCommand', "\") -call s:defineOption('g:acp_behaviorKeywordLength', 2) -call s:defineOption('g:acp_behaviorKeywordIgnores', []) -call s:defineOption('g:acp_behaviorFileLength', 0) -call s:defineOption('g:acp_behaviorRubyOmniMethodLength', 0) -call s:defineOption('g:acp_behaviorRubyOmniSymbolLength', 1) -call s:defineOption('g:acp_behaviorPythonOmniLength', 0) -call s:defineOption('g:acp_behaviorPerlOmniLength', -1) -call s:defineOption('g:acp_behaviorXmlOmniLength', 0) -call s:defineOption('g:acp_behaviorHtmlOmniLength', 0) -call s:defineOption('g:acp_behaviorCssOmniPropertyLength', 1) -call s:defineOption('g:acp_behaviorCssOmniValueLength', 0) -call s:defineOption('g:acp_behavior', {}) -"----------------------------------------------------------------------------- -call extend(g:acp_behavior, s:makeDefaultBehavior(), 'keep') -"----------------------------------------------------------------------------- -command! -bar -narg=0 AcpEnable call acp#enable() -command! -bar -narg=0 AcpDisable call acp#disable() -command! -bar -narg=0 AcpLock call acp#lock() -command! -bar -narg=0 AcpUnlock call acp#unlock() -"----------------------------------------------------------------------------- -" legacy commands -command! -bar -narg=0 AutoComplPopEnable AcpEnable -command! -bar -narg=0 AutoComplPopDisable AcpDisable -command! -bar -narg=0 AutoComplPopLock AcpLock -command! -bar -narg=0 AutoComplPopUnlock AcpUnlock -"----------------------------------------------------------------------------- -if g:acp_enableAtStartup - AcpEnable -endif -"----------------------------------------------------------------------------- - -" }}}1 -"============================================================================= -" vim: set fdm=marker: diff --git a/vim/bundle/checksyntax/.gitignore b/vim/bundle/checksyntax/.gitignore deleted file mode 100644 index 57c3562..0000000 --- a/vim/bundle/checksyntax/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -tags -archive -Makefile -TODO.TXT -TODO_archived.viki -*.vba -*.vmb -*.zip -.last_* -test -test_* diff --git a/vim/bundle/checksyntax/CHANGES.TXT b/vim/bundle/checksyntax/CHANGES.TXT deleted file mode 100644 index 1e0da62..0000000 --- a/vim/bundle/checksyntax/CHANGES.TXT +++ /dev/null @@ -1,195 +0,0 @@ -0.2 -php specific - -0.3 -generalized plugin; modes; support for ruby, phpp, tex (chktex) - -0.4 -use vim compilers if available (e.g., tidy, xmllint ...); makeprg was -restored in the wrong window - -0.5 -- Support for jsl (javascript lint). -- Support for jlint. -- Don't automatically check php files if eclim is installed. -- Allow auto_* parameters to be buffer local. -- FIX: Unlet current_compiler, use g:current_compiler -- FIX: garbled screen: use redraw! (thanks to Vincent de Lau) -- Support for lua (thanks to norman) - -0.6 -- checksyntax_compiler_{&ft} & checksyntax_cmd_{&ft} variables can be -buffer local - -1.0 -- The info maintained as g:checksyntax_* variables is now kept in a -dictionary named g:checksyntax -- Support for gjslint -- Some bug fixes (e.g. tidy) - -version: "1.01" - - Experimental support for python: pyflakes, pylint - - redraw before calling CheckSyntaxSucceed/CheckSyntaxFail - - Make sure we're in the right buffer - MD5 checksum: f94781c5748200e809a28562a692ed6b - -version: "1.02" - - checksyntax#Check: Check &modified before anything else - - .gitignore - - Support for "modified" property - - Check executable() when setting the *.auto property. - - When eclim is installed: Set g:checksyntax.php.auto, not b:checksyntax.php.auto - - Do not map `` if it is used already. - - Use either location list (default) or optionally the quickfix list - - CheckSyntaxFail(): call .Open(); fixes #6 - MD5 checksum: 4425f1434baa8795fbccec38721eef67 - -version: "1.03" - - checksyntax#Check: Check &modified before anything else - - .gitignore - - Support for "modified" property - - Check executable() when setting the *.auto property. - - When eclim is installed: Set g:checksyntax.php.auto, not b:checksyntax.php.auto - - Do not map `` if it is used already. - - Use either location list (default) or optionally the quickfix list - - CheckSyntaxFail(): call .Open(); fixes #6 - - Tackle issue #7 ... maybe - - php is now forced to display parse errors even when in production mode - - Rename s:prototypes to g:checksyntax#prototypes - MD5 checksum: dfe8b09008f5106fdf7886d4c4cd5fb6 - - - Enable syntax checks when loading a file (disabled by default) - - g:checksyntax#auto_mode: Default auto mode (fixes #10) - - g:checksyntax#debug - - s:GetDef(ft): Remove syntax checker definition if the command is not executable - - Fix duplicate errors (closes bug #7) - - checksyntax#auto_mode: 0 disable, 1 enable, 2 force (fixes #12) - - checksyntax: "if" and "alternatives" fields; removed g:checksyntax_javascript - - define g:checksyntax in plugin/checksyntax.vim in order to facilitate customisation - - s:GetDef(ft): If empty(rv), check if the rest of alternatives is empty - - Move syntax checker definitions to autoload/checksyntax/&filetype.vim - - php: run with php -l -d error_log= -d error_reporting=E_PARSE - - Remove outdated references to failrx and okrx - - Move syntax checker definitions to autoload/checksyntax/defs/ - - Experimental support for syntastic syntax checkers. - - debug message - - Support for SyntasticLoadChecker() - - checksyntax#Require(): Return 0 if filetype is empty - - efm for jruby (see https://github.com/tomtom/checksyntax_vim/pull/13) - - Run php with "-d display_errors=0" (fixes #7) - - php: Use -d display_errors=0 - - checksyntax#syntastic#Require(): Make sure not to replace existing defintions - - Experimental: Prepare for running all valid alternatives - - Prepare for run_alternatives == "all" - - Javascript: Support for jslint (fixes #14) - - Run multiple syntax checkers (fixes #15) - - javascript: Remove run_alternatives = all - - Improved running all alternatives - - Improved support for syntastic syntax checkers (in conjunction with run_alternatives == all) - - :CheckSyntax! runs all alternatives (not the alternative syntax checker); use g:checksyntax#preferred for selecting the preferred checker - - checksyntax#Name(): Also consider the value of compiler - - s:CompleteItem(): Improved display of error message - - checksyntax#Alternative(): Define an alternative - - Updated syntax checker definitions for java, php, python - - checksyntax#syntastic#Require(): Use checksyntax#Alternative() - - checksyntax#syntastic#Require(): handle yet undefined filetypes - - Syntastic: Improved display of the checker name - - Support for bash -n - - Call bash -n only if shell =~ bash - - Facilitate configuration of g:checksyntax#prototypes. - - Map to CheckSyntax! - MD5 checksum: dfe8b09008f5106fdf7886d4c4cd5fb6 -version: "2.00" - - - Enable syntax checks when loading a file (disabled by default) - - g:checksyntax#auto_mode: Default auto mode (fixes #10) - - g:checksyntax#debug - - s:GetDef(ft): Remove syntax checker definition if the command is not executable - - Fix duplicate errors (closes bug #7) - - checksyntax#auto_mode: 0 disable, 1 enable, 2 force (fixes #12) - - checksyntax: "if" and "alternatives" fields; removed g:checksyntax_javascript - - define g:checksyntax in plugin/checksyntax.vim in order to facilitate customisation - - s:GetDef(ft): If empty(rv), check if the rest of alternatives is empty - - Move syntax checker definitions to autoload/checksyntax/&filetype.vim - - php: run with php -l -d error_log= -d error_reporting=E_PARSE - - Remove outdated references to failrx and okrx - - Move syntax checker definitions to autoload/checksyntax/defs/ - - Experimental support for syntastic syntax checkers. - - debug message - - Support for SyntasticLoadChecker() - - checksyntax#Require(): Return 0 if filetype is empty - - efm for jruby (see https://github.com/tomtom/checksyntax_vim/pull/13) - - Run php with "-d display_errors=0" (fixes #7) - - php: Use -d display_errors=0 - - checksyntax#syntastic#Require(): Make sure not to replace existing defintions - - Experimental: Prepare for running all valid alternatives - - Prepare for run_alternatives == "all" - - Javascript: Support for jslint (fixes #14) - - Run multiple syntax checkers (fixes #15) - - javascript: Remove run_alternatives = all - - Improved running all alternatives - - Improved support for syntastic syntax checkers (in conjunction with run_alternatives == all) - - :CheckSyntax! runs all alternatives (not the alternative syntax checker); use g:checksyntax#preferred for selecting the preferred checker - - checksyntax#Name(): Also consider the value of compiler - - s:CompleteItem(): Improved display of error message - - checksyntax#Alternative(): Define an alternative - - Updated syntax checker definitions for java, php, python - - checksyntax#syntastic#Require(): Use checksyntax#Alternative() - - checksyntax#syntastic#Require(): handle yet undefined filetypes - - Syntastic: Improved display of the checker name - - Support for bash -n - - Call bash -n only if shell =~ bash - - Facilitate configuration of g:checksyntax#prototypes. - - Map to CheckSyntax! - MD5 checksum: dfe8b09008f5106fdf7886d4c4cd5fb6 -version: "2.00" - -version: "2.01" - - Extra syntax checker definitions was prematurely removed after running a single syntax checker - - Facilitate customization of maps (g:checksyntax_key_single, g:checksyntax_key_all) - - process_list attribute for syntax checker definitions - - Support for R (lint::lint, svTools::lint) - - s:Executable(): Run executable() only once - - SyntasticLoadChecker(): Accept filetype as optional argument - - Support for jshint - MD5 checksum: 617a9cc8fd1fac7533e75b721106f2ad - - - Support for perl (by TheAthlete) - - s:Make(): Echo v:exception & v:throwpoint - - checksyntax#Alternative(): Copy top-level properties - - Don't change the checker definition when dealing with alternatives (reported by techlivezheng) - MD5 checksum: d2d95bcff1d039497bc9c95cdb7a0ea1 -version: "2.02" - -version: "2.03" - - Included missing files in vba (fixes #16) - MD5 checksum: 40c9ea31d916db1ff5f22ec1c4af14c3 - -version: "3.00" - - addon-info - - Help template - - g:checksyntax#preferred defaults to {'xml': '.'} - - g:checksyntax['xml'] use auto: 0 for xmllint - - javascript: Support for esvalidate (esprima) - - javascript: default to jshint - - Support for running checkers asynchronously (requires the AsyncCommand vim plugin) - - Updated errorformat for jslint 0.2.7 - - Support for typescript compiler (requires https://github.com/leafgarland/typescript-vim) - - Experimental: Enable async processing when performing a full check (:CheckSyntax!) if AsyncCommand is installed - - checksyntax#Check(): When mixing async & sync processing, don't show issue list if a check is still pending - - When mixing sync & async & no pending checks: Include async results in sync results - - Removed support for syntastic - - async_handler.get(): Properly handle issues list when the last check yielded no new issues - - Use job_ids to check for pending tasks - - g:checksyntax#async_runner and related vars is set based on exists(':AsyncMake') - - Show info about pending jobs (also support toptions_vim) - - Correctly handle makeprgs with full filename - - GetList(): Correctly handle "process_list" property - - r options: Add --ess - - Reset pending tasks, when calling CheckSyntax before all async tasks were completed - - Improved integration with toptions_vim - - R checker defaults to codetools::checkUsage - - Tentative integration with airline - - Support for tstatus (replaces toptions) - MD5 checksum: c9a7ae5304038568ea2309ed13c8ed96 - diff --git a/vim/bundle/checksyntax/README b/vim/bundle/checksyntax/README deleted file mode 100644 index f1dc244..0000000 --- a/vim/bundle/checksyntax/README +++ /dev/null @@ -1,48 +0,0 @@ -The checksyntax plugin runs an external syntax checker for the current buffer -whenever the buffer is saved (by calling the |:CheckSyntax| command). Syntax -errors are managed as location or quickfix lists. If any syntax error occurs, -the |location-list| is opened (users can redefine |CheckSyntaxFail()| to change -this behaviour). You can use any |location-list| related command to navigate -the list of syntax errors. - -If vimscript #2584 is installed, lines containing syntax errors will be marked -with signs. - -By default, |:CheckSyntax| is mapped to (if not mapped already), -and automatically executed when saving the buffer. The |:CheckSyntax| -command takes one optional argument: the mode (default: &filetype). - will run all syntax checkers for a given filetype if multiple -alternatives are defined and installed on your computer. - -As the plugin doesn't provide syntax checks by its own. This is done by -an external syntax checker that has to be installed on your computer. - -For the following filetypes, syntax checkers are pre-defined: - - c, cpp :: Check syntax via splint - html :: Check syntax via tidy - javascript :: Check syntax via jslint, jshint, jsl, or gjslint - java :: Check syntax via jlint or javaCheckstyle - lua :: Parse file (luac -p) - php :: Check syntax (php -l) - python :: Check file with pyflakes or pylint - r :: Check syntax & style with lint::lint or svTools::lint - ruby :: Check syntax (ruby -c) - tex, latex :: Parse file (chktex -q -v0) - xml, docbk :: Check syntax via xmllint - -See the autoload/checksyntax/defs/ directory for a complete list of -supported syntax checkers. See |g:checksyntax| also for how to define -your own syntax checkers. - -This plugin was originally based on Klaus Horsten's php_console -(vimscript #779) and it is the successor of php_check_syntax.vim -(vimscript #1272). - - ------------------------------------------------------------------------ - -Status: Works for me (there may be some minor quirks) -Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT -See http://github.com/tomtom for related plugins. - diff --git a/vim/bundle/checksyntax/addon-info.json b/vim/bundle/checksyntax/addon-info.json deleted file mode 100644 index c8ccf1f..0000000 --- a/vim/bundle/checksyntax/addon-info.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name" : "checksyntax", - "version" : "dev", - "author" : "Tom Link ", - "maintainer" : "Tom Link ", - "repository" : {"type": "git", "url": "git://github.com/tomtom/checksyntax_vim.git"}, - "dependencies" : {}, - "description" : "Check syntax when saving a file (php etc.)" -} diff --git a/vim/bundle/checksyntax/autoload/airline/extensions/checksyntax.vim b/vim/bundle/checksyntax/autoload/airline/extensions/checksyntax.vim deleted file mode 100644 index 6c18fe5..0000000 --- a/vim/bundle/checksyntax/autoload/airline/extensions/checksyntax.vim +++ /dev/null @@ -1,31 +0,0 @@ -if !exists(':CheckSyntax') - finish -endif - - -function! airline#extensions#checksyntax#get_msg() - let errors = checksyntax#Status() - if !empty(errors) - return errors.(g:airline_symbols.space) - endif - return '' -endf - - -let s:spc = g:airline_symbols.space - - -function! airline#extensions#checksyntax#apply(...) - let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c) - let w:airline_section_c .= s:spc . g:airline_left_alt_sep . s:spc . '%{airline#extensions#checksyntax#get_msg()}' -endf - - -function! airline#extensions#checksyntax#init(ext) - call airline#parts#define_function('checksyntax', 'airline#extensions#checksyntax#get_msg') - " call airline#parts#define_raw('checksyntax', '%{airline#extensions#checksyntax#get_msg()}') - call a:ext.add_statusline_func('airline#extensions#checksyntax#apply') -endf - - -" vi: ft=vim:tw=72:ts=4 diff --git a/vim/bundle/checksyntax/autoload/checksyntax.vim b/vim/bundle/checksyntax/autoload/checksyntax.vim deleted file mode 100644 index c06fce3..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax.vim +++ /dev/null @@ -1,1087 +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) -" @Revision: 1393 - - -if !exists('g:checksyntax#auto_enable_rx') - " Enable automatic checking for filetypes matching this rx. - " Set to "." to enable for all filetypes. - " This requires |g:checksyntax_auto| to be > 0. - " This variable overrules any filetype-specific settings in - " |g:checksyntax|. - let g:checksyntax#auto_enable_rx = '' "{{{2 -endif - - -if !exists('g:checksyntax#auto_disable_rx') - " Disable automatic checking for filetypes matching this rx. - " Set to "." to disable for all filetypes. - " This requires |g:checksyntax_auto| to be > 0. - " This variable overrules any filetype-specific settings in - " |g:checksyntax|. - let g:checksyntax#auto_disable_rx = '' "{{{2 -endif - - -if !exists('g:checksyntax#show_cmd') - " A dictionary of VIM commands that are used to display the qf/loc - " lists. - " If empty, do nothing. - let g:checksyntax#show_cmd = {'qfl': 'copen', 'loc': 'lopen'} "{{{2 -endif - - -if !exists('g:checksyntax#lines_expr') - " A vim expression that determines the number of lines of the - " qfl/loc window. If empty, don't set the size. - " A useful value is: > - " let g:checksyntax#lines_expr = 'min([&previewheight, &lines / 2, len(getloclist(0))])' - let g:checksyntax#lines_expr = '' "{{{2 -endif - - -if !exists('g:checksyntax#debug') - let g:checksyntax#debug = 0 -endif - - -if !exists('g:checksyntax#preferred') - " A dictionary of 'filetype' => |regexp|. - " If only one alternative should be run (see - " |g:checksyntax#run_alternatives|), check only those syntax - " checkers whose names matches |regexp|. - let g:checksyntax#preferred = {'xml': '.'} "{{{2 -endif - - -if !exists('g:checksyntax#async_runner') - " Supported values: - " asynccommand ... Use the AsyncCommand plugin - let g:checksyntax#async_runner = has('clientserver') && !empty(v:servername) && exists(':AsyncMake') ? 'asynccommand' : '' "{{{2 - if has('clientserver') && empty(v:servername) - echohl WarningMsg - echom "CheckSyntax: Run vim with the --servername NAME command line option to enable use of AsyncCommand" - echohl NONE - endif -endif - - -if !empty(g:checksyntax#async_runner) - " Show status information (pending async tasks). - command! CheckSyntaxStatus call s:Status() -endif - - -if !exists('g:checksyntax#run_alternatives') - " How to handle alternatives. Possible values: - " - " first ... Use the first valid entry - " all ... Run all valid alternatives one after another - " - " Alternatively, the following flag can be added in order to change - " how the alternatives are run: - " - " async ... Run alternatives asynchronously (see also - " |g:checksyntax#async_runner|) - let g:checksyntax#run_alternatives = 'first' . (!empty(g:checksyntax#async_runner) ? ' async' : '') "{{{2 -endif - - -if !exists('g:checksyntax#run_all_alternatives') - " How to run "all" alternatives -- e.g., when calling the - " |:CheckSyntax| command with a bang. - let g:checksyntax#run_all_alternatives = 'all' . (!empty(g:checksyntax#async_runner) ? ' async' : '') "{{{2 -endif - - -if !exists('g:checksyntax#windows') - let g:checksyntax#windows = &shell !~ 'sh' && (has('win16') || has('win32') || has('win64')) "{{{2 -endif - - -if !exists('g:checksyntax#null') - let g:checksyntax#null = g:checksyntax#windows ? 'nul' : (filereadable('/dev/null') ? '/dev/null' : '') "{{{2 -endif - - -if !exists('g:checksyntax#cygwin_path_rx') - " If a full windows filename (with slashes instead of backslashes) - " matches this |regexp|, it is assumed to be a cygwin executable. - let g:checksyntax#cygwin_path_rx = '/cygwin/' "{{{2 -endif - - -if !exists('g:checksyntax#cygwin_expr') - " For cygwin binaries, convert command calls using this vim - " expression. - let g:checksyntax#cygwin_expr = '"bash -c ''". escape(%s, "''\\") ."''"' "{{{2 -endif - - -let s:cygwin = {} - -function! s:CygwinBin(cmd) "{{{3 - " TLogVAR a:cmd - if !g:checksyntax#windows - return 0 - elseif has_key(s:cygwin, a:cmd) - let rv = s:cygwin[a:cmd] - else - if !s:Executable('cygpath', 1) || !s:Executable('which', 1) - let rv = 0 - else - let which = substitute(system('which '. shellescape(a:cmd)), '\n$', '', '') - " echom "DBG which:" which - if which =~ '^/' - let filename = system('cygpath -ma '. shellescape(which)) - " echom "DBG filename:" filename - let rv = filename =~ g:checksyntax#cygwin_path_rx - else - let rv = 0 - endif - endif - let s:cygwin[a:cmd] = rv - endif - " TLogVAR rv - return rv -endf - - -let s:executables = {} - -function! s:Executable(cmd, ...) "{{{3 - " TLogVAR a:cmd - " echom "DBG has_key(s:executables, a:cmd)" has_key(s:executables, a:cmd) - if !has_key(s:executables, a:cmd) - let ignore_cyg = a:0 >= 1 ? a:1 : !g:checksyntax#windows - let s:executables[a:cmd] = executable(a:cmd) != 0 && (ignore_cyg || s:CygwinBin(a:cmd)) - endif - " echom "DBG s:executables[a:cmd]" s:executables[a:cmd] - return s:executables[a:cmd] -endf - - -if !exists('g:checksyntax#check_cygpath') - " If true, check whether we have to convert a path via cyppath -- - " see |checksyntax#MaybeUseCygpath| - let g:checksyntax#check_cygpath = g:checksyntax#windows && s:Executable('cygpath') "{{{2 -endif - - -if !exists('*CheckSyntaxSucceed') - " This function is called when no syntax errors were found. - function! CheckSyntaxSucceed(type, manually) - call g:checksyntax#prototypes[a:type].Close() - if a:manually - echo - echo 'Syntax ok.' - endif - endf -endif - - -if !exists('*CheckSyntaxFail') - " This function is called when a syntax error was found. - function! CheckSyntaxFail(type, manually, bg) - " TLogVAR a:type, a:manually, a:bg - call g:checksyntax#prototypes[a:type].Open(a:bg) - endf -endif - - -if !exists('g:checksyntax#prototypes') - " Contains prototype definitions for syntax checkers that use the - " |location-list| ("loc") or the |quixfix|-list. - let g:checksyntax#prototypes = {'loc': {}, 'qfl': {}} "{{{2 -endif - - -function! s:Open(bg, type) "{{{3 - " TLogVAR a:bg - let cmd = get(g:checksyntax#show_cmd, a:type, '') - if !empty(cmd) - if !empty(g:checksyntax#lines_expr) - let lines = eval(g:checksyntax#lines_expr) - else - let lines = '' - endif - " TLogVAR lines - if empty(g:checksyntax#lines_expr) || !empty(lines) - let bufnr = bufnr('%') - let winnr = winnr() - exec cmd lines - if a:bg && bufnr != bufnr('%') - wincmd p - endif - endif - endif -endf - - -if empty(g:checksyntax#prototypes.loc) - function! g:checksyntax#prototypes.loc.Close() dict "{{{3 - lclose - endf - - function! g:checksyntax#prototypes.loc.Open(bg) dict "{{{3 - call s:Open(a:bg, 'loc') - endf - - function! g:checksyntax#prototypes.loc.GetExpr(args) dict "{{{3 - " TLogDBG system(a:args) - return s:RunCmd('lgetexpr', 'system('. string(a:args). ')') - endf - - function! g:checksyntax#prototypes.loc.Make(args) dict "{{{3 - return s:RunCmd('lmake!', a:args) - endf - - function! g:checksyntax#prototypes.loc.Get() dict "{{{3 - return copy(getloclist(0)) - endf - - function! g:checksyntax#prototypes.loc.Set(list) dict "{{{3 - call setloclist(0, a:list) - endf -endif - - -if empty(g:checksyntax#prototypes.qfl) - function! g:checksyntax#prototypes.qfl.Close() dict "{{{3 - cclose - endf - - function! g:checksyntax#prototypes.qfl.Open(bg) dict "{{{3 - call s:Open(a:bg, 'qfl') - endf - - function! g:checksyntax#prototypes.qfl.GetExpr(args) dict "{{{3 - " TLogDBG system(a:args) - return s:RunCmd('cgetexpr', 'system('. string(a:args). ')') - endf - - function! g:checksyntax#prototypes.qfl.Make(args) dict "{{{3 - return s:RunCmd('make!', a:args) - endf - - function! g:checksyntax#prototypes.qfl.Get() dict "{{{3 - return copy(getqflist()) - endf - - function! g:checksyntax#prototypes.qfl.Set(list) dict "{{{3 - call setqflist(a:list) - endf -endif - - -function! s:RunCmd(cmd, args) "{{{3 - try - " TLogVAR a:cmd, a:args, &efm - exec 'silent' a:cmd a:args - return 1 - catch - echohl Error - echom v:exception - echohl NONE - return 0 - endtry -endf - - -let s:checkers = {} -let s:top_level_fields = ['modified', 'auto', 'run_alternatives', 'alternatives'] -let s:mandatory = ['cmd', 'cmdexpr', 'compiler', 'exec'] - - -" Define a syntax checker definition for a given filetype. -" If filetype ends with "?", add only if no checker with the given name -" is defined. -" -" A checker definition is a dictionary with the following fields: -" -" Mandatory (either one of the following): -" -" cmd ........ A shell command used as 'makeprg' to check the file. -" cmdexpr .... A vim expression that returns the cmd -" compiler ... A vim compiler that is used to check the file. -" exec ....... A vim command used to check the file (deprecated; use -" cmdexpr & process_list instead) -" -" Optional: -" -" efm ....... An 'errorformat' string. -" prepare .... An ex command that is run before doing anything. -" ignore_nr .. A list of error numbers that should be ignored. -" listtype ... Either loc (default) or qfl -" include .... Include another definition -" process_list .. Process a list of issues -" if ......... An expression to test *once* whether a syntax checker -" should be used. -" if_executable .. Test whether an application is executable. -" buffers .... Keep results only for either "current", "listed", or -" "all" buffers -" compiler_args .. Internal use -" cmd_args ... Internal use -" -" Optional top-level fields: -" -" auto ....... Run automatically when saving a file (see also -" |g:checksyntax#auto_enable_rx| and -" |g:checksyntax#auto_disable_rx|) -" modified ... The name of a pseudo-filetype that should be used if -" the buffer was modified -" run_alternatives ... A string that defines how to run -" alternatives (overrides -" |g:checksyntax#run_alternatives|). -" -" Top-level fields affect how syntax checkers for a filetype are run. -function! checksyntax#AddChecker(filetype, ...) "{{{3 - if a:0 == 1 && type(a:1) == 3 - let alternatives = a:1 - else - let alternatives = a:000 - endif - " TLogVAR alternatives - if !empty(alternatives) - let [update, filetype] = s:UpName(a:filetype) - " TLogVAR filetype, update, a:000, a:0, type(a:1) - if !has_key(s:checkers, filetype) - let s:checkers[filetype] = {'alternatives': {}, 'order': []} - endif - for make_def in alternatives - " Copy top_level_fields - for upkey in s:top_level_fields - let [kupdate, key] = s:UpName(upkey) - if has_key(make_def, key) && (kupdate || !has_key(s:checkers[filetype], key)) - let s:checkers[filetype][key] = remove(make_def, key) - endif - endfor - " If there are other fields, add make_def - if !empty(make_def) - if has_key(make_def, 'cmdexpr') - let make_def.cmd = eval(make_def.cmdexpr) - endif - " TLogVAR make_def - if !has_key(make_def, 'cmd') || !empty(make_def.cmd) - let [update_name, name] = s:UpNameFromDef(make_def) - if empty(name) - throw "CheckSyntax: Name must not be empty: ". filetype .': '. string(make_def) - elseif empty(filter(copy(s:mandatory), 'has_key(make_def, v:val)')) - throw "CheckSyntax: One of ". join(s:mandatory, ', ') ." must be defined: ". filetype .': '. string(make_def) - else - let new_item = !has_key(s:checkers[filetype].alternatives, name) - if update || update_name || new_item - let s:checkers[filetype].alternatives[name] = make_def - if new_item - call add(s:checkers[filetype].order, name) - endif - endif - endif - endif - endif - endfor - endif -endf - - -function! checksyntax#GetChecker(filetype, ...) "{{{3 - call checksyntax#Require(a:filetype) - let alts = get(get(s:checkers, a:filetype, {}), 'alternatives', {}) - if a:0 == 0 - return values(alts) - else - return values(filter(copy(alts), 'index(a:000, v:key) != -1')) - endif -endf - - -" :nodoc: -" Run |:make| based on a syntax checker definition. -function! s:RunSyncWithEFM(make_def) "{{{3 - " TLogVAR a:make_def - let type = get(a:make_def, 'listtype', 'loc') - let shellpipe = &shellpipe - let errorformat = &errorformat - if has_key(a:make_def, 'shellpipe') - let &shellpipe = get(a:make_def, 'shellpipe') - " TLogVAR &shellpipe - endif - if has_key(a:make_def, 'efm') - let &errorformat = get(a:make_def, 'efm') - " TLogVAR &errorformat - endif - try - if has_key(a:make_def, 'cmd') - let cmddef = s:ExtractCompilerParams(a:make_def, '%', a:make_def.cmd) - let cmd = s:NativeCmd(cmddef.cmd) - " TLogVAR cmd - let rv = g:checksyntax#prototypes[type].GetExpr(cmd) - " TLogVAR rv, getqflist() - return rv - elseif has_key(a:make_def, 'exec') - exec a:make_def.exec - return 1 - endif - finally - if &shellpipe != shellpipe - let &shellpipe = shellpipe - endif - if &errorformat != errorformat - let &errorformat = errorformat - endif - endtry -endf - - -let s:convert_filenames = {} - -function! s:ConvertFilenames(make_def, props) "{{{3 - for key in ['filename', 'altname'] - let filename = a:props[key] - let convert_filename = get(a:make_def, 'convert_filename', '') - if !empty(convert_filename) - if !has_key(s:convert_filenames, convert_filename) - let s:convert_filenames[convert_filename] = {} - endif - if has_key(s:convert_filenames[convert_filename], filename) - let filename = s:convert_filenames[convert_filename][filename] - else - " TLogVAR filename, convert_filename - let cmd = printf(convert_filename, shellescape(filename)) - " TLogVAR cmd - let filename = system(cmd) - let filename = substitute(filename, '\n$', '', '') - let s:convert_filenames[convert_filename][filename] = filename - endif - " TLogVAR filename - endif - let a:make_def[key] = filename - endfor - return a:make_def -endf - - -let s:loaded_checkers = {} - -" :nodoc: -function! checksyntax#Require(filetype) "{{{3 - if empty(a:filetype) - return 0 - else - if !has_key(s:loaded_checkers, a:filetype) - exec 'runtime! autoload/checksyntax/defs/'. a:filetype .'.vim' - let s:loaded_checkers[a:filetype] = 1 - endif - return has_key(s:checkers, a:filetype) - endif -endf - - -function! s:NativeCmd(cmd) "{{{3 - if !empty(g:checksyntax#cygwin_expr) && s:CygwinBin(matchstr(a:cmd, '^\S\+')) - let cmd = eval(printf(g:checksyntax#cygwin_expr, string(a:cmd))) - " TLogVAR cmd - return cmd - else - return a:cmd - endif -endf - - -" :nodoc: -function! s:Cmd(make_def) "{{{3 - if has_key(a:make_def, 'cmd') - let cmd = matchstr(a:make_def.cmd, '^\(\\\s\|\S\+\|"\([^"]\|\\"\)\+"\)\+') - else - let cmd = '' - endif - return cmd -endf - - -" :nodoc: -function! s:UpName(upname) "{{{3 - if a:upname =~ '?$' - let update = 0 - let name = substitute(a:upname, '?$', '', '') - else - let update = 1 - let name = a:upname - endif - return [update, name] -endf - - -" :nodoc: -function! s:UpNameFromDef(make_def) "{{{3 - let name = get(a:make_def, 'name', '') - if empty(name) - let name = get(a:make_def, 'compiler', '') - endif - if empty(name) - let name = s:Cmd(a:make_def) - endif - return s:UpName(name) -endf - - -function! s:ValidAlternative(make_def) "{{{3 - " TLogVAR a:make_def - if has_key(a:make_def, 'if') - return eval(a:make_def.if) - elseif has_key(a:make_def, 'if_executable') - return s:Executable(a:make_def.if_executable) - else - return 1 - endif -endf - - -function! s:GetValidAlternatives(filetype, run_alternatives, alternatives) "{{{3 - " TLogVAR a:filetype, a:run_alternatives, a:alternatives - let valid = {} - for name in get(get(s:checkers, a:filetype, {}), 'order', []) - let alternative = a:alternatives[name] - " TLogVAR alternative - if s:ValidAlternative(alternative) - if has_key(alternative, 'cmd') - let cmd = s:Cmd(alternative) - " TLogVAR cmd - if !empty(cmd) && !s:Executable(cmd) - continue - endif - endif - let valid[name] = alternative - if a:run_alternatives =~? '\' - break - endif - endif - endfor - return valid -endf - - -let s:run_alternatives_all = 0 - -" :nodoc: -function! checksyntax#RunAlternativesMode(make_def) "{{{3 - let rv = s:run_alternatives_all ? g:checksyntax#run_all_alternatives : get(a:make_def, 'run_alternatives', g:checksyntax#run_alternatives) - " TLogVAR a:make_def, rv - return rv -endf - - -function! s:GetDef(filetype) "{{{3 - " TLogVAR a:filetype - if has_key(s:checkers, a:filetype) - let dict = s:checkers - let rv = s:checkers[a:filetype] - else - let dict = {} - let rv = {} - endif - if !empty(dict) - let alternatives = get(rv, 'alternatives', {}) - " TLogVAR alternatives - if !empty(alternatives) - let alternatives = s:GetValidAlternatives(a:filetype, checksyntax#RunAlternativesMode(rv), alternatives) - " TLogVAR alternatives - if len(alternatives) == 0 - let rv = {} - else - let rv = copy(rv) - let rv.alternatives = alternatives - endif - endif - endif - return rv -endf - - -let s:async_pending = {} - - -let g:checksyntax#issues = {} - - -function! g:checksyntax#issues.Reset() dict "{{{3 - let self.issues = [] - let self.type = 'loc' -endf - -call g:checksyntax#issues.Reset() - - -function! g:checksyntax#issues.AddList(name, make_def, type) dict "{{{3 - if a:type == 'qfl' - let self.type = a:type - endif - let issues = checksyntax#GetList(a:name, a:make_def, a:type) - if !empty(issues) - let self.issues += issues - endif - return issues -endf - - -function! g:checksyntax#issues.Display(manually, bg) dict "{{{3 - if empty(self.issues) - call g:checksyntax#prototypes[self.type].Set(self.issues) - call CheckSyntaxSucceed(self.type, a:manually) - else - " TLogVAR self.issues - call sort(self.issues, 's:CompareIssues') - " TLogVAR self.issues - " TLogVAR self.type - call g:checksyntax#prototypes[self.type].Set(self.issues) - " TLogVAR self.type, a:manually, a:bg - call CheckSyntaxFail(self.type, a:manually, a:bg) - endif -endf - - -" :def: function! checksyntax#Check(manually, ?bang='', ?filetype=&ft, ?background=1) -" Perform a syntax check. -" If bang is not empty, run all alternatives (see -" |g:checksyntax#run_alternatives|). -" If filetype is empty, the current buffer's 'filetype' will be used. -" If background is true, display the list of issues in the background, -" i.e. the active window will keep the focus. -function! checksyntax#Check(manually, ...) - let bang = a:0 >= 1 ? !empty(a:1) : 0 - let filetype = a:0 >= 2 && a:2 != '' ? a:2 : &filetype - let bg = a:0 >= 3 && a:3 != '' ? a:3 : 0 - " TLogVAR a:manually, bang, filetype, bg - let s:run_alternatives_all = bang - if !&autochdir - let wd = getcwd() - exec 'lcd' fnameescape(expand('%:p')) - endif - try - let defs = s:GetDefsByFiletype(a:manually, filetype) - " TLogVAR defs - if !empty(defs.make_defs) - if !exists('b:checksyntax_runs') - let b:checksyntax_runs = 1 - else - let b:checksyntax_runs += 1 - endif - " TLogVAR &makeprg, &l:makeprg, &g:makeprg, &errorformat - if defs.run_alternatives =~? '\' && has_key(g:checksyntax#preferred, filetype) - let preferred_rx = g:checksyntax#preferred[filetype] - let defs.make_defs = filter(defs.make_defs, 's:UpNameFromDef(v:val)[1] =~ preferred_rx') - endif - let async = !empty(g:checksyntax#async_runner) && defs.run_alternatives =~? '\' - if !empty(s:async_pending) - if !a:manually && async - echohl WarningMsg - echo "CheckSyntax: Still waiting for async results ..." - echohl NONE - return - else - let s:async_pending = {} - endif - endif - let props = { - \ 'bg': bg, - \ 'bufnr': bufnr('%'), - \ 'filename': expand('%'), - \ 'altname': expand('#'), - \ 'manually': a:manually, - \ } - call g:checksyntax#issues.Reset() - for [name, make_def] in items(defs.make_defs) - " TLogVAR make_def, async - let make_def1 = copy(make_def) - let done = 0 - if async - call extend(make_def1, props) - let make_def1 = s:ConvertFilenames(make_def1, make_def1) - let make_def1.name = name - let make_def1.job_id = name .'_'. make_def1.bufnr - let done = s:Run_async(make_def1) - endif - if !done - let make_def1 = s:ConvertFilenames(make_def1, props) - let done = s:Run_sync(name, filetype, make_def1) - endif - endfor - " echom "DBG 1" string(list) - if empty(s:async_pending) - call g:checksyntax#issues.Display(a:manually, bg) - endif - endif - finally - if !&autochdir - exec 'lcd' fnameescape(wd) - endif - let s:run_alternatives_all = 0 - endtry - redraw! -endf - - -function! s:Status() "{{{3 - if empty(s:async_pending) - echo "CheckSyntax: No pending jobs" - else - echo "CheckSyntax: Pending jobs:" - for [job_id, make_def] in items(s:async_pending) - echo printf(" %s: bufnr=%s, cmd=%s", - \ job_id, - \ make_def.bufnr, - \ make_def.name - \ ) - endfor - endif -endf - - -function! s:GetDefsByFiletype(manually, filetype) "{{{3 - " TLogVAR a:manually, a:filetype - let defs = {'mode': '', 'make_defs': {}} - call checksyntax#Require(a:filetype) - " let defs.mode = 'auto' - let make_def = a:manually ? {} : s:GetDef(a:filetype .',auto') - " TLogVAR 1, make_def - if empty(make_def) - let make_def = s:GetDef(a:filetype) - " TLogVAR 2, make_def - endif - if &modified - if has_key(make_def, 'modified') - let make_def = s:GetDef(make_def.modified) - " TLogVAR 3, make_def - else - echohl WarningMsg - echom "Buffer was modified. Please save it before calling :CheckSyntax." - echohl NONE - return - endif - endif - " TLogVAR make_def - if empty(make_def) - return defs - endif - if !empty(g:checksyntax#auto_enable_rx) && a:filetype =~ g:checksyntax#auto_enable_rx - let auto = 1 - elseif !empty(g:checksyntax#auto_disable_rx) && a:filetype =~ g:checksyntax#auto_disable_rx - let auto = 0 - else - let auto = get(make_def, 'auto', 0) - endif - " TLogVAR auto - if !(a:manually || auto) - return defs - endif - let defs.run_alternatives = checksyntax#RunAlternativesMode(make_def) - " TLogVAR &makeprg, &l:makeprg, &g:makeprg, &errorformat - " TLogVAR make_def - let defs.make_defs = get(make_def, 'alternatives', {'*': make_def}) - return defs -endf - - -function! s:CompareIssues(i1, i2) "{{{3 - let l1 = get(a:i1, 'lnum', 0) - let l2 = get(a:i2, 'lnum', 0) - " TLogVAR l1, l2, type(l1), type(l2) - return l1 == l2 ? 0 : l1 > l2 ? 1 : -1 -endf - - -function! s:WithCompiler(compiler, exec, default) "{{{3 - if exists('g:current_compiler') - let cc = g:current_compiler - else - let cc = '' - endif - try - exec 'compiler '. a:compiler - exec a:exec - finally - if cc != '' - let g:current_compiler = cc - exec 'compiler '. cc - endif - endtry - return a:default -endf - - -function! s:RunSyncChecker(filetype, make_def) - let bufnr = bufnr('%') - let pos = getpos('.') - let type = get(a:make_def, 'listtype', 'loc') - try - if has_key(a:make_def, 'compiler') - " <+TODO+> Use s:ExtractCompilerParams and run s:RunSyncWithEFM - let args = get(a:make_def, 'compiler_args', '%') - let rv = s:WithCompiler(a:make_def.compiler, - \ 'call g:checksyntax#prototypes[type].Make('. string(args) .')', - \ 1) - else - let rv = s:RunSyncWithEFM(a:make_def) - endif - " TLogVAR rv - return rv - catch - echohl Error - echom "Exception" v:exception "from" v:throwpoint - echom v:errmsg - echohl NONE - finally - " TLogVAR pos, bufnr - if bufnr != bufnr('%') - exec bufnr 'buffer' - endif - call setpos('.', pos) - endtry - return 0 -endf - - -function! s:Run_async(make_def) "{{{3 - " TLogVAR a:make_def - let make_def = a:make_def - let cmd = '' - if has_key(make_def, 'cmd') - let cmd = get(make_def, 'cmd', '') - " let cmd .= ' '. shellescape(make_def.filename) - if has_key(a:make_def, 'cmd_args') - let cmddef = s:ExtractCompilerParams(a:make_def, '', a:make_def.cmd) - let cmd = cmddef.cmd - else - let cmd .= ' '. escape(make_def.filename, '"''\ ') - endif - elseif has_key(make_def, 'compiler') - let compiler_def = s:WithCompiler(make_def.compiler, - \ 'return s:ExtractCompilerParams('. string(a:make_def) .', "")', - \ {}) - " TLogVAR compiler_def - if !empty(compiler_def) - let cmd = compiler_def.cmd - let make_def.efm = compiler_def.efm - endif - endif - " TLogVAR cmd - if !empty(cmd) - try - let cmd = s:NativeCmd(cmd) - " TLogVAR cmd - let rv = checksyntax#async#{g:checksyntax#async_runner}#Run(cmd, make_def) - call checksyntax#AddJob(make_def) - return rv - catch /^Vim\%((\a\+)\)\=:E117/ - echohl Error - echom 'Checksyntax: Unsupported value for g:checksyntax#async_runner: '. string(g:checksyntax#async_runner) - echohl NONE - let g:checksyntax#async_runner = '' - return 0 - endtry - else - echohl WarningMsg - echom "CheckSyntax: Cannot run asynchronously: ". make_def.name - echohl NONE - return 0 - endif -endf - - -function! s:ReplaceMakeArgs(make_def, cmd, args) "{{{3 - let cmd = a:cmd - if !empty(a:args) && stridx(cmd, '$*') == -1 - let cmd .= ' '. a:args - endif - let replaced = [] - if stridx(cmd, '%') != -1 - let cmd = substitute(cmd, '%\(\%(:[phtre]\)\+\)\?', '\=s:Filename(a:make_def, "%", submatch(1))', 'g') - call add(replaced, '%') - endif - if stridx(cmd, '$*') != -1 - if index(replaced, '%') == -1 - let cmd = substitute(cmd, '\V$*', a:args .' '. escape(a:make_def['filename'], '\'), 'g') - call add(replaced, '%') - else - let cmd = substitute(cmd, '\V$*', a:args, 'g') - endif - call add(replaced, '$*') - endif - if stridx(cmd, '#') != -1 - let cmd = substitute(cmd, '#\(\%(:[phtre]\)\+\)\?', '\=s:Filename(a:make_def, "#", submatch(1))', 'g') - call add(replaced, '#') - endif - return cmd -endf - - -function! s:Filename(make_def, type, mod) "{{{3 - if a:type == '%' - let filename = a:make_def.filename - elseif a:type == '#' - let filename = a:make_def.altname - else - throw "CheckSyntax/s:Filename: Internal error: type = ". a:type - endif - if !empty(a:mod) - let filename = fnamemodify(filename, a:mod) - endif - return escape(filename, '\') -endf - - -function! s:ExtractCompilerParams(make_def, args, ...) "{{{3 - let cmd = a:0 >= 1 ? a:1 : &makeprg - let args = get(a:make_def, 'compiler_args', a:args) - let cmd = s:ReplaceMakeArgs(a:make_def, cmd, args) - let compiler_def = { - \ 'cmd': cmd, - \ 'efm': &errorformat - \ } - " TLogVAR compiler_def - return compiler_def -endf - - -let s:status_expr = 'checksyntax#Status()' - -function! checksyntax#AddJob(make_def) "{{{3 - let s:async_pending[a:make_def.job_id] = a:make_def - if exists('g:tstatus_exprs') - if index(g:tstatus_exprs, s:status_expr) == -1 - call add(g:tstatus_exprs, s:status_expr) - endif - endif -endf - - -function! checksyntax#RemoveJob(job_id) "{{{3 - let rv = has_key(s:async_pending, a:job_id) - if rv - call remove(s:async_pending, a:job_id) - if empty(s:async_pending) && exists('g:tstatus_exprs') - let idx = index(g:tstatus_exprs, s:status_expr) - if idx != -1 - call remove(g:tstatus_exprs, idx) - endif - endif - endif - return rv ? len(s:async_pending) : -1 -endf - - -function! checksyntax#Status() "{{{3 - let n = len(s:async_pending) - if n == 0 - return '' - else - return 'PendingChecks='. n - endif -endf - - -function! s:Run_sync(name, filetype, make_def) "{{{3 - " TLogVAR a:name, a:filetype, a:make_def - let make_def = a:make_def - if has_key(make_def, 'include') - let include = s:GetDef(make_def.include) - if !empty(include) - let make_def = extend(copy(make_def), include, 'keep') - endif - endif - exec get(make_def, 'prepare', '') - if s:RunSyncChecker(a:filetype, make_def) - let type = get(make_def, 'listtype', 'loc') - call g:checksyntax#issues.AddList(a:name, make_def, type) - return 1 - else - return 0 - endif -endf - - -function! checksyntax#GetList(name, make_def, type) "{{{3 - " TLogVAR a:type - let list = g:checksyntax#prototypes[a:type].Get() - " TLogVAR list - " TLogVAR 1, len(list), has_key(a:make_def, 'process_list') - if !empty(list) && has_key(a:make_def, 'process_list') - " TLogVAR a:make_def.process_list - let list = call(a:make_def.process_list, [list]) - " TLogVAR 2, len(list) - endif - if !empty(list) - let list = filter(list, 's:FilterItem(a:make_def, v:val)') - " TLogVAR 3, len(list) - " TLogVAR a:type, list - if !empty(list) - let list = map(list, 's:CompleteItem(a:name, a:make_def, v:val)') - " TLogVAR 4, len(list) - " TLogVAR a:type, list - endif - endif - " TLogVAR "return", list - return list -endf - - -function! s:CompleteItem(name, make_def, val) "{{{3 - " TLogVAR a:name, a:make_def, a:val - if get(a:val, 'bufnr', 0) == 0 - let a:val.bufnr = bufnr('%') - endif - let text = get(a:val, 'text', '') - let a:val.text = substitute(text, '^\s\+\|\s\+$', '', 'g') - let type = get(a:val, 'type', '') - if !empty(type) - let a:val.text = printf('[%s] %s', type, a:val.text) - endif - if !empty(a:name) - let text = get(a:val, 'text', '') - if !empty(text) - let a:val.text = a:name .': '. text - endif - endif - " TLogVAR a:val - return a:val -endf - - -function! s:FilterItem(make_def, val) "{{{3 - if a:val.lnum == 0 && a:val.pattern == '' - return 0 - elseif has_key(a:val, 'nr') && has_key(a:make_def, 'ignore_nr') && index(a:make_def.ignore_nr, a:val.nr) != -1 - return 0 - elseif has_key(a:make_def, 'buffers') - let buffers = a:make_def.buffers - if buffers == 'listed' && !buflisted(a:val.bufnr) - return 0 - elseif buffers == 'current' && a:val.bufnr != a:make_def.bufnr - return 0 - endif - endif - return 1 -endf - - -function! checksyntax#NullOutput(flag) "{{{3 - if empty(g:checksyntax#null) - return '' - else - return a:flag .' '. g:checksyntax#null - endif -endf - - -" If cmd seems to be a cygwin executable, use cygpath to convert -" filenames. This assumes that cygwin's which command returns full -" filenames for non-cygwin executables. -function! checksyntax#MaybeUseCygpath(cmd) "{{{3 - " echom "DBG" a:cmd - if g:checksyntax#check_cygpath && s:CygwinBin(a:cmd) - return 'cygpath -u %s' - endif - return '' -endf - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/async/asynccommand.vim b/vim/bundle/checksyntax/autoload/checksyntax/async/asynccommand.vim deleted file mode 100644 index 69e3658..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/async/asynccommand.vim +++ /dev/null @@ -1,68 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 37 - - -let s:async_handler = {} - - -function s:async_handler.get(temp_file_name) dict - " echom "DBG async_handler.get" self.name self.job_id - let jobs = checksyntax#RemoveJob(self.job_id) - if jobs != -1 - let errorformat = &errorformat - try - " TLogVAR self.async_type, self.bufnr, bufnr('%') - if self.async_type != 'loc' || self.bufnr == bufnr('%') - let &errorformat = self.async_efm - " TLogVAR self.async_efm - " TLogVAR self.async_cmd, a:temp_file_name - " let lines = readfile(a:temp_file_name) " DBG - " TLogVAR lines - exec self.async_cmd a:temp_file_name - let list = g:checksyntax#issues.AddList(self.name, self, self.async_type) - " TLogVAR list - " TLogVAR self.name, len(list) - if g:checksyntax#debug - echo - echom printf('CheckSyntax: Processing %s (%s items)', self.name, len(list)) - endif - if jobs == 0 - " let bg = self.bg - let bg = 1 - " let manually = self.manually - let manually = g:checksyntax#debug - call g:checksyntax#issues.Display(manually, bg) - endif - endif - finally - let &errorformat = errorformat - endtry - endif -endf - - -function! s:AsyncCommandHandler(make_def) - " TLogVAR a:make_def - let type = get(a:make_def, 'listtype', 'loc') - let async_handler = { - \ 'async_cmd': type == 'loc' ? 'lgetfile' : 'cgetfile', - \ 'async_type': type, - \ 'async_efm': get(a:make_def, 'efm', &errorformat), - \ } - call extend(async_handler, a:make_def) - call extend(async_handler, s:async_handler, 'keep') - " TLogVAR async_handler - return asynccommand#tab_restore(async_handler) -endf - - -function! checksyntax#async#asynccommand#Run(cmd, make_def) "{{{3 - " TLogVAR a:cmd, a:make_def - let @+ = a:cmd - let async_handler = s:AsyncCommandHandler(a:make_def) - " TLogVAR async_handler - call asynccommand#run(a:cmd, async_handler) - return 1 -endf - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/c.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/c.vim deleted file mode 100644 index e82ed4a..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/c.vim +++ /dev/null @@ -1,13 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 5 - - -call checksyntax#AddChecker('c?', - \ { - \ 'compiler': 'splint', - \ 'if_executable': 'splint', - \ 'convert_filename': checksyntax#MaybeUseCygpath('splint'), - \ } - \ ) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/cpp.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/cpp.vim deleted file mode 100644 index 93826e8..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/cpp.vim +++ /dev/null @@ -1,8 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 4 - - -call checksyntax#Require('c') -call checksyntax#AddChecker('cpp?', checksyntax#GetChecker('c')) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/docbk.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/docbk.vim deleted file mode 100644 index 3b2f7f7..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/docbk.vim +++ /dev/null @@ -1,7 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 3 - -call checksyntax#Require('xml') -call checksyntax#AddChecker('docbk?', checksyntax#GetChecker('xml')) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/html.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/html.vim deleted file mode 100644 index ff1d67a..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/html.vim +++ /dev/null @@ -1,14 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 4 - - -call checksyntax#AddChecker('html?', - \ { - \ 'cmd': 'tidy -eq', - \ 'efm': 'line %l column %c - %m', - \ 'convert_filename': checksyntax#MaybeUseCygpath('tidy'), - \ } - \ ) - - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/java.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/java.vim deleted file mode 100644 index cd4ab52..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/java.vim +++ /dev/null @@ -1,55 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 46 - - -if !exists('checksyntax#defs#java#pmd_rulesets') - " :read: let checksyntax#defs#java#pmd_rulesets = [...] "{{{2 - let checksyntax#defs#java#pmd_rulesets = [ - \ "basic", "braces", "clone", "codesize", "comments", - \ "design", "empty", "finalizers", "imports", "javabeans", - \ "logging-jakarta-commons", "logging-java", "migrating", - \ "optimizations", "strictexception", "strings", - \ "sunsecure", "typeresolution", "unnecessary", - \ "unusedcode"] - "android", "controversial", "coupling", "j2ee", "junit", "naming", -endif - - -if !exists('checksyntax#defs#java#pmd_args') - let checksyntax#defs#java#pmd_args = '' "{{{2 -endif - - -function! checksyntax#defs#java#Jlint() "{{{3 - let filename = expand('%:r') .'.class' - let dirname = expand('%:h') - return 'jlint +all -done -source '. shellescape(dirname) .' '. shellescape(filename) -endf - - -call checksyntax#AddChecker('java?', - \ { - \ 'if_executable': 'checkstyle', - \ 'compiler': 'checkstyle', - \ 'compiler_args': '%' - \ }) - " \ { - " \ 'name': 'jlint', - " \ 'if_executable': 'jlint', - " \ 'efm': '%m', - " \ 'cmdexpr': 'checksyntax#defs#java#Jlint()' - " \ }, - -if !empty(g:checksyntax#pmd#cmd) - call checksyntax#AddChecker('java?', - \ { - \ 'name': 'pmd', - \ 'type': 'qfl', - \ 'cmdexpr': 'checksyntax#pmd#Cmd("java", g:checksyntax#defs#java#pmd_args, g:checksyntax#defs#java#pmd_rulesets)', - \ 'cmd_args': '', - \ 'buffers': 'listed', - \ 'efm': '%f:%l:%m', - \ }) -endif - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/javascript.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/javascript.vim deleted file mode 100644 index 332a3f8..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/javascript.vim +++ /dev/null @@ -1,84 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 66 - - -if !exists('g:checksyntax#defs#javascript#closure') - " If non-empty, enable some checks via closure compiler. - let g:checksyntax#defs#javascript#closure = '' "{{{2 -endif - - -if !exists('g:checksyntax#defs#javascript#closure_warnings') - let g:checksyntax#defs#javascript#closure_warnings = ['const', 'constantProperty', 'checkRegExp', 'strictModuleDepCheck', 'visibility'] "{{{2 -endif - - -if !exists('checksyntax#defs#javascript#pmd_rulesets') - let checksyntax#defs#javascript#pmd_rulesets = ["basic", "braces", "unnecessary"] -endif - - -if !exists('checksyntax#defs#javascript#pmd_args') - let checksyntax#defs#javascript#pmd_args = '' "{{{2 -endif - - -call checksyntax#AddChecker('javascript?', - \ { - \ 'name': 'jshint', - \ 'cmd': 'jshint --verbose', - \ 'efm': '%f: line %l\, col %c\, %m (%t%n)', - \ }, - \ { - \ 'name': 'esprima', - \ 'cmd': 'esvalidate', - \ 'efm': '%f:%l: %m', - \ }, - \ { - \ 'name': 'gjslint', - \ 'cmd': 'gjslint', - \ 'ignore_nr': [1, 110], - \ 'efm': '%P%*[^F]FILE%*[^:]: %f %*[-],Line %l%\, %t:%n: %m,%Q', - \ }, - \ { - \ 'name': 'jslint', - \ 'cmd': 'jslint --terse', - \ 'efm': '%f:%l:%c: %m', - \ }, - \ { - \ 'name': 'jsl', - \ 'cmd': 'jsl -nofilelisting -nocontext -nosummary -nologo -process', - \ }, - \ ) - -if !empty(g:checksyntax#defs#javascript#closure) - if !empty(g:checksyntax#defs#javascript#closure_warnings) - let s:closure_warnings = ' --jscomp_warning '. join(g:checksyntax#defs#javascript#closure_warnings, ' --jscomp_warning ') - else - let s:closure_warnings = '' - endif - call checksyntax#AddChecker('javascript?', - \ { - \ 'name': 'closure', - \ 'cmd': g:checksyntax#defs#javascript#closure .' --warning_level VERBOSE '. checksyntax#NullOutput('--js_output_file') . s:closure_warnings, - \ 'efm': '%A%f:%l: %m,%-Cfound %#: %.%#,%+Crequired %#: %.%#,%-C%.%#,%-Z%p^', - \ }, - \ ) - unlet s:closure_warnings - " ,%-C%.%#,%+Z%p^ -endif - - -if !empty(g:checksyntax#pmd#cmd) - call checksyntax#AddChecker('javascript?', - \ { - \ 'name': 'pmd', - \ 'type': 'qfl', - \ 'cmdexpr': "checksyntax#pmd#Cmd('ecmascript', g:checksyntax#defs#javascript#pmd_args, g:checksyntax#defs#javascript#pmd_rulesets)", - \ 'cmd_args': '', - \ 'buffers': 'listed', - \ 'efm': '%f:%l:%m', - \ }) -endif - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/lua.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/lua.vim deleted file mode 100644 index 88a39cf..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/lua.vim +++ /dev/null @@ -1,14 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 5 - - -call checksyntax#AddChecker('lua?', - \ { - \ 'if_executable': 'luac', - \ 'cmd': 'luac -p', - \ 'efm': 'luac\:\ %f:%l:\ %m' - \ 'convert_filename': checksyntax#MaybeUseCygpath('luac'), - \ } - \ ) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/perl.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/perl.vim deleted file mode 100644 index a90f26a..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/perl.vim +++ /dev/null @@ -1,13 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 14 - - -call checksyntax#AddChecker('perl?', - \ { - \ 'cmd': 'perl -Wc %', - \ 'efm': '%-G%.%#had compilation errors.,%-G%.%#syntax OK,%m at %f line %l.,%+A%.%# at %f line %l\,%.%#,%+C%.%#', - \ 'convert_filename': checksyntax#MaybeUseCygpath('perl'), - \ }, - \ ) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/php.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/php.vim deleted file mode 100644 index b5eb960..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/php.vim +++ /dev/null @@ -1,15 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 13 - - -call checksyntax#AddChecker('php?', - \ { - \ 'name': 'php', - \ 'cmd': 'php -l -d display_errors=0 -d error_log= -d error_reporting=E_PARSE', - \ 'if_executable': 'php', - \ 'convert_filename': checksyntax#MaybeUseCygpath('php'), - \ 'efm': '%*[^:]: %m in %f on line %l', - \ } - \ ) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/python.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/python.vim deleted file mode 100644 index ae69470..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/python.vim +++ /dev/null @@ -1,20 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 16 - - -call checksyntax#AddChecker('python?', - \ { - \ 'cmd': 'pyflakes', - \ 'if_executable': 'pyflakes', - \ 'efm': '%f:%l: %m', - \ 'convert_filename': checksyntax#MaybeUseCygpath('pyflakes'), - \ }, - \ { - \ 'cmd': 'pylint -r n -f parseable', - \ 'if_executable': 'pylint', - \ 'efm': '%f:%l: [%t] %m', - \ 'convert_filename': checksyntax#MaybeUseCygpath('pylint'), - \ } - \ ) - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/r.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/r.vim deleted file mode 100644 index e9e2368..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/r.vim +++ /dev/null @@ -1,176 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 145 - -" :doc: -" Syntax checkers for R: -" -" codetools::checkUsageEnv ... Requires http://cran.r-project.org/web/packages/codetools/ -" lint::lint ... Requires http://cran.r-project.org/web/packages/lint/ -" svTools::lint ... Requires http://cran.r-project.org/web/packages/svTools/ - - -if !exists('g:checksyntax#defs#r#progname') - let g:checksyntax#defs#r#progname = executable('Rterm') ? 'Rterm' : 'R' "{{{2 -endif - -if !executable(g:checksyntax#defs#r#progname) - throw "Please set g:checksyntax#defs#r#progname to the full filename of Rterm/R first!" -endif - - -if !exists('g:checksyntax#defs#r#options') - let g:checksyntax#defs#r#options = '--slave --ess --restore --no-save -e "%s" --args' "{{{2 -endif - - -if !exists('g:checksyntax#defs#r#checkUsage_options') - " Optons passed to codetools::checkUsageEnv. - " Must not be empty. - let g:checksyntax#defs#r#checkUsage_options = 'all = TRUE' "{{{2 -endif - - -if !exists('g:checksyntax#defs#r#checkUsage_ignore_undefined_rx') - " A |/\V| regexp pattern of names that should be ignored, when - " codetools::checkUsageEnv reports "no visible global function - " definition". - let g:checksyntax#defs#r#checkUsage_ignore_undefined_rx = '' "{{{2 -endif - - -if !exists('g:checksyntax#defs#r#checkUsage_ignore_functions') - " A list of function names that will be ignored when parsing the - " result list from codetools::checkUsageEnv. - let g:checksyntax#defs#r#checkUsage_ignore_functions = [] "{{{2 -endif - - -if !exists('g:checksyntax#defs#r#checkUsage_search_other_buffers') - " If 2, also search other buffers for patterns returned by - " codetools::checkUsageEnv. This may cause unreponsive behaviour. - " - " If 1, show unidentifiable patterns as is. - " - " If 0, remove unidentifiable patterns. - let g:checksyntax#defs#r#checkUsage_search_other_buffers = 0 "{{{2 -endif - - -call checksyntax#AddChecker('r?', - \ { - \ 'listtype': 'qfl', - \ 'name': 'codetools', - \ 'cmd': g:checksyntax#defs#r#progname .' '. - \ printf(g:checksyntax#defs#r#options, 'try({library(codetools); source(commandArgs(TRUE)); checkUsageEnv(globalenv(),'. g:checksyntax#defs#r#checkUsage_options .')})'), - \ 'efm': '%m (%f:%l), %s : : %m, %s : %m, %s: %m', - \ 'process_list': 'checksyntax#defs#r#CheckUsageEnv' - \ }, - \ { - \ 'name': 'lint', - \ 'cmd': g:checksyntax#defs#r#progname .' '. - \ printf(g:checksyntax#defs#r#options, 'try(lint::lint(commandArgs(TRUE)))'), - \ 'efm': 'Lint: %m,%E%f:%l:%c,%Z%\\s\\+%m', - \ 'process_list': 'checksyntax#defs#r#LintLint' - \ }, - \ { - \ 'name': 'svTools::lint', - \ 'cmd': g:checksyntax#defs#r#progname .' '. - \ printf(g:checksyntax#defs#r#options, 'try(svTools::lint(commandArgs(TRUE),type=''flat''))'), - \ 'efm': '%t%\\w%\\++++%l+++%c+++%m', - \ } - \ ) - - -" :nodoc: -function! checksyntax#defs#r#LintLint(list) "{{{3 - " TLogVAR a:list - let list = [] - for issue in a:list - let text = get(issue, 'text', '') - if text =~ ': found on lines \d\+' - let message = matchstr(text, '^.\{-}\ze: found on lines \d\+') - let lines = split(matchstr(text, 'found on lines \zs\d\+.*$'), ', ') - " TLogVAR message, lines - for line in lines - if line[0] =~ '^\d\+' - let issue1 = copy(issue) - let issue1.text = message - let issue1.lnum = str2nr(line) - call add(list, issue1) - endif - endfor - else - call add(list, issue) - endif - endfor - " TLogVAR list - return list -endf - - -" :nodoc: -function! checksyntax#defs#r#CheckUsageEnv(list) "{{{3 - " TLogVAR a:list - let view = winsaveview() - try - let list = map(a:list, 's:CompleteCheckUsageEnvItem(v:val)') - unlet! s:lnum s:bufnr - let list = filter(list, '!empty(v:val)') - finally - call winrestview(view) - endtry - return list -endf - - -function! s:CompleteCheckUsageEnvItem(item) "{{{3 - " TLogVAR a:item - let item = a:item - let pattern = get(item, 'pattern', '') - if !empty(g:checksyntax#defs#r#checkUsage_ignore_functions) && !empty(pattern) - let ignored = filter(copy(g:checksyntax#defs#r#checkUsage_ignore_functions), - \ 'v:val =~ pattern') - if len(ignored) > 0 - return {} - endif - endif - if !empty(g:checksyntax#defs#r#checkUsage_ignore_undefined_rx) && - \ item.text =~ '\C\V\', '') - let s:bufnr = bufnr('%') - " let fn_rx = pattern .'\_s\*<-\_s\*function\_s\*(' - let fn_rx = pattern .'\_s\*<-\_s\*' - let s:lnum = search(fn_rx, 'cwn') - if s:lnum == 0 && g:checksyntax#defs#r#checkUsage_search_other_buffers == 2 - let bufnr0 = s:bufnr - let view = winsaveview() - try - bufdo! if &ft == 'r' | let s:lnum = search(fn_rx, 'cwn') | if s:lnum > 0 | let s:bufnr = bufnr('%') | throw "ok" | endif | endif - catch /ok/ - finally - exec 'buffer' bufnr0 - call winrestview(view) - endtry - endif - " TLogVAR pattern, s:lnum - if s:lnum > 0 - let item.bufnr = s:bufnr - let item.lnum = s:lnum - let item.pattern = '' - " TLogVAR item - elseif g:checksyntax#defs#r#checkUsage_search_other_buffers == 1 - let item.pattern = pattern - else - return {} - endif - elseif bufname(item.bufnr) == '' - return {} - endif - return item -endf - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/ruby.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/ruby.vim deleted file mode 100644 index e812757..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/ruby.vim +++ /dev/null @@ -1,25 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 10 - - -if !exists('g:checksyntax#defs#ruby#interpreter') - let g:checksyntax#defs#ruby#interpreter = system('ruby --version') "{{{2 -endif - - -let s:def = { - \ 'prepare': 'compiler ruby', - \ 'cmd': 'ruby -c', - \ } - -if g:checksyntax#defs#ruby#interpreter =~ '\' - call checksyntax#AddChecker('sh?', - \ { - \ 'cmd': 'bash -n', - \ 'efm': '%f: %\\w%\\+ %l: %m', - \ 'convert_filename': checksyntax#MaybeUseCygpath('bash'), - \ } - \ ) -endif - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/tex.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/tex.vim deleted file mode 100644 index b204137..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/tex.vim +++ /dev/null @@ -1,15 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 3 - - -call checksyntax#AddChecker('tex?', - \ { - \ 'cmd': 'chktex -q -v0', - \ 'if_executable': 'chktex', - \ 'convert_filename': checksyntax#MaybeUseCygpath('chktex'), - \ 'efm': '%f:%l:%m', - \ } - \ ) - - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/typescript.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/typescript.vim deleted file mode 100644 index 73b72a3..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/typescript.vim +++ /dev/null @@ -1,15 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 4 - - -call checksyntax#AddChecker('typescript?', - \ { - \ 'name': 'tsc', - \ 'args': checksyntax#NullOutput('--out'), - \ 'if_executable': 'tsc', - \ 'compiler': 'typescript', - \ } - \ ) - - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/viki.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/viki.vim deleted file mode 100644 index 64545dd..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/viki.vim +++ /dev/null @@ -1,13 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 4 - - -call checksyntax#AddChecker('viki?', - \ { - \ 'cmd': 'deplate -f null', - \ 'convert_filename': checksyntax#MaybeUseCygpath('deplate'), - \ } - \ ) - - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/xhtml.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/xhtml.vim deleted file mode 100644 index e08adcc..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/xhtml.vim +++ /dev/null @@ -1,10 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 2 - -call checksyntax#Require('html') - -call checksyntax#AddChecker('xhtml?', - \ checksyntax#GetChecker('html')) - - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/defs/xml.vim b/vim/bundle/checksyntax/autoload/checksyntax/defs/xml.vim deleted file mode 100644 index b611717..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/defs/xml.vim +++ /dev/null @@ -1,36 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 27 - - -if !exists('checksyntax#defs#xml#pmd_rulesets') - let checksyntax#defs#xml#pmd_rulesets = ["basic"] -endif - - -if !exists('checksyntax#defs#xml#pmd_args') - let checksyntax#defs#xml#pmd_args = '' "{{{2 -endif - - -call checksyntax#AddChecker('xml?', - \ { - \ 'compiler': 'xmllint', - \ 'compiler_args': '%', - \ 'convert_filename': checksyntax#MaybeUseCygpath('xmllint'), - \ } - \ ) - - -if !empty(g:checksyntax#pmd#cmd) - call checksyntax#AddChecker('xml?', - \ { - \ 'name': 'pmd', - \ 'type': 'qfl', - \ 'cmdexpr': "checksyntax#pmd#Cmd('xml', g:checksyntax#defs#xml#pmd_args, g:checksyntax#defs#xml#pmd_rulesets)", - \ 'cmd_args': '', - \ 'buffers': 'listed', - \ 'efm': '%f:%l:%m', - \ }) -endif - diff --git a/vim/bundle/checksyntax/autoload/checksyntax/pmd.vim b/vim/bundle/checksyntax/autoload/checksyntax/pmd.vim deleted file mode 100644 index b8239b8..0000000 --- a/vim/bundle/checksyntax/autoload/checksyntax/pmd.vim +++ /dev/null @@ -1,37 +0,0 @@ -" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Revision: 13 - - -if !exists('g:checksyntax#pmd#cmd') - " The command to run pmd. - let g:checksyntax#pmd#cmd = '' "{{{2 -endif - - -if !exists('g:checksyntax#pmd#args') - let g:checksyntax#pmd#args = '-f text' "{{{2 -endif - - -function! checksyntax#pmd#Cmd(language, args, rulesets) "{{{3 - if empty(g:checksyntax#pmd#cmd) - return '' - else - let args = [g:checksyntax#pmd#args, a:args, '-l', a:language] - if !exists('b:checksyntax_project_dir') - if exists('b:project_dir') - let b:checksyntax_project_dir = b:project_dir - else - let b:checksyntax_project_dir = expand('%:h') - endif - endif - call add(args, '-d '. shellescape(b:checksyntax_project_dir)) - let rulesets = join(map(copy(a:rulesets), 'a:language ."-". v:val'), ',') - let args += ['-R', rulesets] - return printf("%s %s", - \ g:checksyntax#pmd#cmd, - \ join(args)) - endif -endf - diff --git a/vim/bundle/checksyntax/doc/checksyntax.txt b/vim/bundle/checksyntax/doc/checksyntax.txt deleted file mode 100644 index aa81194..0000000 --- a/vim/bundle/checksyntax/doc/checksyntax.txt +++ /dev/null @@ -1,328 +0,0 @@ -*checksyntax.txt* checksyntax -- Check syntax when saving a file (php, ruby, tex ...) - Author: Tom Link, micathom at gmail com - -The checksyntax plugin runs an external syntax checker for the current buffer -whenever the buffer is saved (by calling the |:CheckSyntax| command). Syntax -errors are managed as location or quickfix lists. If any syntax error occurs, -the |location-list| is opened (users can redefine |CheckSyntaxFail()| to change -this behaviour). You can use any |location-list| related command to navigate -the list of syntax errors. - -If quickfixsigns (vimscript #2584) is installed, lines containing syntax errors -will be marked with signs. - -Experimental: If AsyncCommand (vimscript #3431) is installed, syntax checks can -be peformed asynchronously -- see also |g:checksyntax#run_alternatives|, -|g:checksyntax#run_all_alternatives| and |g:checksyntax#async_runner|. - -By default, |:CheckSyntax| is mapped to (if not mapped already), -and automatically executed when saving the buffer. :CheckSyntax! or will -run all syntax checkers for a given filetype if multiple alternatives are -defined and installed on your computer. - -The |:CheckSyntax| command takes one optional argument: the mode (default: -&filetype). - -As the plugin doesn't provide syntax checks by its own. This is done by -an external syntax checker that has to be installed on your computer. - -Pre-defined syntax checkers (the respective syntax checker has to -be installed): - - c, cpp ... Requires splint - html ... Requires tidy - java ... Requires - jlint (http://jlint.sourceforge.net), - checkstyle (http://checkstyle.sourceforge.net), - pmd (http://pmd.sourceforge.net) - javascript ... Syntax check; requires jshint, esprima, - gjslint, jslint, jsl, pmd - lua ... Requires luac (run luac -p) - php ... Syntax check; requires php (run php -l) - python ... Requires pyflakes or pylint - r ... Requires codetools::checkUsage, lint::lint, or - svTools::lint - ruby ... Requires ruby (run ruby -c) - tex, latex ... Requires chktex (run chktex -q -v0) - viki ... Requires deplate - xhtml ... Requires tidy - xml, docbk ... Requires xmllint, pmd - -Syntax checker definitions are kept in: -autoload/checksyntax/defs/{&filetype}.vim - -Run this command to find out, which filetypes are supported: > - :echo globpath(&rtp, 'autoload/checksyntax/defs/*.vim') - -This plugin was originally based on Klaus Horsten's php_console -(vimscript #779) and it is the successor of php_check_syntax.vim -(vimscript #1272). - - ------------------------------------------------------------------------ -Install~ - -Edit the vba file and type: > - - :so % - -See :help vimball for details. If you have difficulties or use vim 7.0, -please make sure, you have the current version of vimball (vimscript -#1502) installed or update your runtime. - -Optional enhancements: - quickfixsigns (vimscript #2584) ... Use signs - AsyncCommand (vimscript #3431) ... Run commands asynchronously - - -======================================================================== -Contents~ - - :CheckSyntax ......................... |:CheckSyntax| - g:checksyntax_key_single ............. |g:checksyntax_key_single| - g:checksyntax_key_all ................ |g:checksyntax_key_all| - g:checksyntax_auto ................... |g:checksyntax_auto| - g:checksyntax#auto_enable_rx ......... |g:checksyntax#auto_enable_rx| - g:checksyntax#auto_disable_rx ........ |g:checksyntax#auto_disable_rx| - g:checksyntax#preferred .............. |g:checksyntax#preferred| - g:checksyntax#async_runner ........... |g:checksyntax#async_runner| - :CheckSyntaxStatus ................... |:CheckSyntaxStatus| - g:checksyntax#run_alternatives ....... |g:checksyntax#run_alternatives| - g:checksyntax#run_all_alternatives ... |g:checksyntax#run_all_alternatives| - g:checksyntax#windows ................ |g:checksyntax#windows| - g:checksyntax#null ................... |g:checksyntax#null| - g:checksyntax#cygwin_path_rx ......... |g:checksyntax#cygwin_path_rx| - g:checksyntax#cygwin_expr ............ |g:checksyntax#cygwin_expr| - g:checksyntax#check_cygpath .......... |g:checksyntax#check_cygpath| - CheckSyntaxSucceed ................... |CheckSyntaxSucceed()| - CheckSyntaxFail ...................... |CheckSyntaxFail()| - g:checksyntax#prototypes ............. |g:checksyntax#prototypes| - checksyntax#AddChecker ............... |checksyntax#AddChecker()| - checksyntax#GetChecker ............... |checksyntax#GetChecker()| - checksyntax#Check .................... |checksyntax#Check()| - checksyntax#AddJob ................... |checksyntax#AddJob()| - checksyntax#RemoveJob ................ |checksyntax#RemoveJob()| - checksyntax#Status ................... |checksyntax#Status()| - checksyntax#GetList .................. |checksyntax#GetList()| - checksyntax#NullOutput ............... |checksyntax#NullOutput()| - checksyntax#MaybeUseCygpath .......... |checksyntax#MaybeUseCygpath()| - g:checksyntax#pmd#cmd ................ |g:checksyntax#pmd#cmd| - g:checksyntax#pmd#args ............... |g:checksyntax#pmd#args| - checksyntax#pmd#Cmd .................. |checksyntax#pmd#Cmd()| - - -======================================================================== -plugin/checksyntax.vim~ - - *:CheckSyntax* -CheckSyntax[!] [NAME] - Check the current buffer's syntax (type defaults to &filetype). - Or use NAME instead of &filetype. - - With the bang !, run all alternatives (see - |g:checksyntax#run_alternatives|). - - *g:checksyntax_key_single* -g:checksyntax_key_single (default: '') - Map for running the preferred syntax checkers on the current - buffer. - - *g:checksyntax_key_all* -g:checksyntax_key_all (default: '') - Map for running all suitable syntax checkers on the current - buffer. - - *g:checksyntax_auto* -g:checksyntax_auto (default: 1) - If 1, enable automatic syntax checks after saving a file. - If 2, enable automatic syntax checks when saving and loading a - file. - NOTE: This variable must be customized in vimrc before loading - this plugin. - - See also |g:checksyntax|, |g:checksyntax#auto_enable_rx| and - |g:checksyntax#auto_disable_rx|. - - -======================================================================== -autoload/checksyntax.vim~ - - *g:checksyntax#auto_enable_rx* -g:checksyntax#auto_enable_rx (default: '') - Enable automatic checking for filetypes matching this rx. - Set to "." to enable for all filetypes. - This requires |g:checksyntax_auto| to be > 0. - This variable overrules any filetype-specific settings in - |g:checksyntax|. - - *g:checksyntax#auto_disable_rx* -g:checksyntax#auto_disable_rx (default: '') - Disable automatic checking for filetypes matching this rx. - Set to "." to disable for all filetypes. - This requires |g:checksyntax_auto| to be > 0. - This variable overrules any filetype-specific settings in - |g:checksyntax|. - - *g:checksyntax#preferred* -g:checksyntax#preferred (default: {'xml': '.'}) - A dictionary of 'filetype' => |regexp|. - If only one alternative should be run (see - |g:checksyntax#run_alternatives|), check only those syntax - checkers whose names matches |regexp|. - - *g:checksyntax#async_runner* -g:checksyntax#async_runner (default: has('clientserver') && !empty(v:servername) && exists(':AsyncMake') ? 'asynccommand' : '') - Supported values: - asynccommand ... Use the AsyncCommand plugin - - *:CheckSyntaxStatus* -:CheckSyntaxStatus - Show status information (pending async tasks). - - *g:checksyntax#run_alternatives* -g:checksyntax#run_alternatives (default: 'first' . (!empty(g:checksyntax#async_runner) ? ' async' : '')) - How to handle alternatives. Possible values: - - first ... Use the first valid entry - all ... Run all valid alternatives one after another - - Alternatively, the following flag can be added in order to change - how the alternatives are run: - - async ... Run alternatives asynchronously (see also - |g:checksyntax#async_runner|) - - *g:checksyntax#run_all_alternatives* -g:checksyntax#run_all_alternatives (default: 'all' . (!empty(g:checksyntax#async_runner) ? ' async' : '')) - How to run "all" alternatives -- e.g., when calling the - |:CheckSyntax| command with a bang. - - *g:checksyntax#windows* -g:checksyntax#windows (default: &shell !~ 'sh' && (has('win16') || has('win32') || has('win64'))) - - *g:checksyntax#null* -g:checksyntax#null (default: g:checksyntax#windows ? 'nul' : (filereadable('/dev/null') ? '/dev/null' : '')) - - *g:checksyntax#cygwin_path_rx* -g:checksyntax#cygwin_path_rx (default: '/cygwin/') - If a full windows filename (with slashes instead of backslashes) - matches this |regexp|, it is assumed to be a cygwin executable. - - *g:checksyntax#cygwin_expr* -g:checksyntax#cygwin_expr (default: '"bash -c ''". escape(%s, "''\\") ."''"') - For cygwin binaries, convert command calls using this vim - expression. - - *g:checksyntax#check_cygpath* -g:checksyntax#check_cygpath (default: g:checksyntax#windows && s:Executable('cygpath')) - If true, check whether we have to convert a path via cyppath -- - see |checksyntax#MaybeUseCygpath| - - *CheckSyntaxSucceed()* -CheckSyntaxSucceed(type, manually) - This function is called when no syntax errors were found. - - *CheckSyntaxFail()* -CheckSyntaxFail(type, manually, bg) - This function is called when a syntax error was found. - - *g:checksyntax#prototypes* -g:checksyntax#prototypes (default: {'loc': {}, 'qfl': {}}) - Contains prototype definitions for syntax checkers that use the - |location-list| ("loc") or the |quixfix|-list. - - *checksyntax#AddChecker()* -checksyntax#AddChecker(filetype, ...) - Define a syntax checker definition for a given filetype. - If filetype ends with "?", add only if no checker with the given name - is defined. - - A checker definition is a dictionary with the following fields: - - Mandatory (either one of the following): - - cmd ........ A shell command used as 'makeprg' to check the file. - cmdexpr .... A vim expression that returns the cmd - compiler ... A vim compiler that is used to check the file. - exec ....... A vim command used to check the file (deprecated; use - cmdexpr & process_list instead) - - Optional: - - efm ....... An 'errorformat' string. - prepare .... An ex command that is run before doing anything. - ignore_nr .. A list of error numbers that should be ignored. - listtype ... Either loc (default) or qfl - include .... Include another definition - process_list .. Process a list of issues - if ......... An expression to test *once* whether a syntax checker - should be used. - if_executable .. Test whether an application is executable. - buffers .... Keep results only for either "current", "listed", or - "all" buffers - compiler_args .. Internal use - cmd_args ... Internal use - - Optional top-level fields: - - auto ....... Run automatically when saving a file (see also - |g:checksyntax#auto_enable_rx| and - |g:checksyntax#auto_disable_rx|) - modified ... The name of a pseudo-filetype that should be used if - the buffer was modified - run_alternatives ... A string that defines how to run - alternatives (overrides - |g:checksyntax#run_alternatives|). - - Top-level fields affect how syntax checkers for a filetype are run. - - *checksyntax#GetChecker()* -checksyntax#GetChecker(filetype, ...) - - *checksyntax#Check()* -checksyntax#Check(manually, ?bang='', ?filetype=&ft, ?background=1) - Perform a syntax check. - If bang is not empty, run all alternatives (see - |g:checksyntax#run_alternatives|). - If filetype is empty, the current buffer's 'filetype' will be used. - If background is true, display the list of issues in the background, - i.e. the active window will keep the focus. - - *checksyntax#AddJob()* -checksyntax#AddJob(make_def) - - *checksyntax#RemoveJob()* -checksyntax#RemoveJob(job_id) - - *checksyntax#Status()* -checksyntax#Status() - - *checksyntax#GetList()* -checksyntax#GetList(name, make_def, type) - - *checksyntax#NullOutput()* -checksyntax#NullOutput(flag) - - *checksyntax#MaybeUseCygpath()* -checksyntax#MaybeUseCygpath(cmd) - If cmd seems to be a cygwin executable, use cygpath to convert - filenames. This assumes that cygwin's which command returns full - filenames for non-cygwin executables. - - -======================================================================== -autoload/checksyntax/pmd.vim~ - - *g:checksyntax#pmd#cmd* -g:checksyntax#pmd#cmd (default: '') - The command to run pmd. - - *g:checksyntax#pmd#args* -g:checksyntax#pmd#args (default: '-f text') - - *checksyntax#pmd#Cmd()* -checksyntax#pmd#Cmd(language, args, rulesets) - - - -vim:tw=78:fo=tcq2:isk=!-~,^*,^|,^":ts=8:ft=help:norl: diff --git a/vim/bundle/checksyntax/etc/tpl_checksyntax.txt b/vim/bundle/checksyntax/etc/tpl_checksyntax.txt deleted file mode 100644 index d11233a..0000000 --- a/vim/bundle/checksyntax/etc/tpl_checksyntax.txt +++ /dev/null @@ -1,78 +0,0 @@ -*checksyntax.txt* checksyntax -- Check syntax when saving a file (php, ruby, tex ...) - Author: Tom Link, micathom at gmail com - -The checksyntax plugin runs an external syntax checker for the current buffer -whenever the buffer is saved (by calling the |:CheckSyntax| command). Syntax -errors are managed as location or quickfix lists. If any syntax error occurs, -the |location-list| is opened (users can redefine |CheckSyntaxFail()| to change -this behaviour). You can use any |location-list| related command to navigate -the list of syntax errors. - -If quickfixsigns (vimscript #2584) is installed, lines containing syntax errors -will be marked with signs. - -Experimental: If AsyncCommand (vimscript #3431) is installed, syntax checks can -be peformed asynchronously -- see also |g:checksyntax#run_alternatives|, -|g:checksyntax#run_all_alternatives| and |g:checksyntax#async_runner|. - -By default, |:CheckSyntax| is mapped to (if not mapped already), -and automatically executed when saving the buffer. :CheckSyntax! or will -run all syntax checkers for a given filetype if multiple alternatives are -defined and installed on your computer. - -The |:CheckSyntax| command takes one optional argument: the mode (default: -&filetype). - -As the plugin doesn't provide syntax checks by its own. This is done by -an external syntax checker that has to be installed on your computer. - -Pre-defined syntax checkers (the respective syntax checker has to -be installed): - - c, cpp ... Requires splint - html ... Requires tidy - java ... Requires - jlint (http://jlint.sourceforge.net), - checkstyle (http://checkstyle.sourceforge.net), - pmd (http://pmd.sourceforge.net) - javascript ... Syntax check; requires jshint, esprima, - gjslint, jslint, jsl, pmd - lua ... Requires luac (run luac -p) - php ... Syntax check; requires php (run php -l) - python ... Requires pyflakes or pylint - r ... Requires codetools::checkUsage, lint::lint, or - svTools::lint - ruby ... Requires ruby (run ruby -c) - tex, latex ... Requires chktex (run chktex -q -v0) - viki ... Requires deplate - xhtml ... Requires tidy - xml, docbk ... Requires xmllint, pmd - -Syntax checker definitions are kept in: -autoload/checksyntax/defs/{&filetype}.vim - -Run this command to find out, which filetypes are supported: > - :echo globpath(&rtp, 'autoload/checksyntax/defs/*.vim') - -This plugin was originally based on Klaus Horsten's php_console -(vimscript #779) and it is the successor of php_check_syntax.vim -(vimscript #1272). - - ------------------------------------------------------------------------ -Install~ - -Edit the vba file and type: > - - :so %% - -See :help vimball for details. If you have difficulties or use vim 7.0, -please make sure, you have the current version of vimball (vimscript -#1502) installed or update your runtime. - -Optional enhancements: - quickfixsigns (vimscript #2584) ... Use signs - AsyncCommand (vimscript #3431) ... Run commands asynchronously - - -%s diff --git a/vim/bundle/checksyntax/plugin/checksyntax.vim b/vim/bundle/checksyntax/plugin/checksyntax.vim deleted file mode 100644 index f007b24..0000000 --- a/vim/bundle/checksyntax/plugin/checksyntax.vim +++ /dev/null @@ -1,87 +0,0 @@ -" checksyntax.vim -- Check syntax when saving a file (php, ruby, tex ...) -" @Author: Tom Link (micathom AT gmail com) -" @License: GPL (see http://www.gnu.org/licenses/gpl.txt) -" @Created: 04-Mai-2005. -" @Last Change: 2012-08-28. -" GetLatestVimScripts: 1431 0 :AutoInstall: checksyntax.vim -" @Revision: 429 - -if exists('g:loaded_checksyntax') - finish -endif -let g:loaded_checksyntax = 300 - - -if !exists('g:checksyntax') - let g:checksyntax = {} -endif - - -" :display: CheckSyntax[!] [NAME] -" Check the current buffer's syntax (type defaults to &filetype). -" Or use NAME instead of &filetype. -" -" With the bang !, run all alternatives (see -" |g:checksyntax#run_alternatives|). -command! -bang -nargs=? CheckSyntax call checksyntax#Check(1, "", ) - - -" @TPluginInclude -if !exists('g:checksyntax_key_single') - " Map for running the preferred syntax checkers on the current - " buffer. - let g:checksyntax_key_single = '' "{{{2 -endif - - -" @TPluginInclude -if !exists('g:checksyntax_key_all') - " Map for running all suitable syntax checkers on the current - " buffer. - let g:checksyntax_key_all = '' "{{{2 -endif - - -if !exists('g:checksyntax_auto') - " If 1, enable automatic syntax checks after saving a file. - " If 2, enable automatic syntax checks when saving and loading a - " file. - " NOTE: This variable must be customized in vimrc before loading - " this plugin. - " - " See also |g:checksyntax|, |g:checksyntax#auto_enable_rx| and - " |g:checksyntax#auto_disable_rx|. - let g:checksyntax_auto = 1 "{{{2 -endif - - -" @TPluginInclude -augroup CheckSyntax - autocmd! - if !exists('g:checksyntax_auto') || g:checksyntax_auto >= 1 - autocmd BufWritePost * call checksyntax#Check(0) - endif - if exists('g:checksyntax_auto') && g:checksyntax_auto >= 2 - autocmd BufEnter * if !exists('b:checksyntax_runs') - \ | call checksyntax#Check(0, 0, &ft, 1) - \ | endif - endif -augroup END - - -" @TPluginInclude -if !hasmapto(':CheckSyntax') - if empty(maparg(g:checksyntax_key_single, 'n')) - exec 'noremap' g:checksyntax_key_single ':CheckSyntax' - endif - if empty(maparg(g:checksyntax_key_single, 'i')) - exec 'inoremap' g:checksyntax_key_single ':CheckSyntax' - endif - if empty(maparg(g:checksyntax_key_all, 'n')) - exec 'noremap' g:checksyntax_key_all ':CheckSyntax!' - endif - if empty(maparg(g:checksyntax_key_all, 'i')) - exec 'inoremap' g:checksyntax_key_all ':CheckSyntax!' - endif -endif - diff --git a/vim/bundle/coffee-script/.gitignore b/vim/bundle/coffee-script/.gitignore deleted file mode 100644 index 1ff7b05..0000000 --- a/vim/bundle/coffee-script/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.*.sw[a-z] -.*.un~ -doc/tags - diff --git a/vim/bundle/coffee-script/Copying.md b/vim/bundle/coffee-script/Copying.md deleted file mode 100644 index 51cf8d1..0000000 --- a/vim/bundle/coffee-script/Copying.md +++ /dev/null @@ -1,15 +0,0 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2010 to 2012 Mick Koch - - 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/vim/bundle/coffee-script/Makefile b/vim/bundle/coffee-script/Makefile deleted file mode 100644 index e6ef409..0000000 --- a/vim/bundle/coffee-script/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -REF = HEAD -VERSION = $(shell git describe --always $(REF)) - -ARCHIVE = vim-coffee-script-$(VERSION).zip -ARCHIVE_DIRS = after autoload compiler doc ftdetect ftplugin indent syntax - -# Don't do anything by default. -all: - -# Make vim.org zipball. -archive: - git archive $(REF) -o $(ARCHIVE) -- $(ARCHIVE_DIRS) - -# Remove zipball. -clean: - -rm -f $(ARCHIVE) - -# Build the list of syntaxes for @coffeeAll. -coffeeAll: - @grep -E 'syn (match|region)' syntax/coffee.vim |\ - grep -v 'contained' |\ - awk '{print $$3}' |\ - uniq - -.PHONY: all archive clean hash coffeeAll diff --git a/vim/bundle/coffee-script/News.md b/vim/bundle/coffee-script/News.md deleted file mode 100644 index 9706796..0000000 --- a/vim/bundle/coffee-script/News.md +++ /dev/null @@ -1,18 +0,0 @@ -### Version 002 (December 5, 2011) - -Added binary numbers (0b0101) and fixed some bugs (#9, #62, #63, #65). - -### Version 001 (October 18, 2011) - -Removed deprecated `coffee_folding` option, added `coffee_compile_vert` option, -split out compiler, fixed indentation and syntax bugs, and added Haml support -and omnicompletion. - - - The coffee compiler is now a proper vim compiler that can be loaded with - `:compiler coffee`. - - The `coffee_compile_vert` option can now be set to split the CoffeeCompile - buffer vertically by default. - - CoffeeScript is now highlighted inside the `:coffeescript` filter in Haml. - - Omnicompletion (`:help compl-omni`) now uses JavaScript's dictionary to - complete words. - - We now have a fancy version number. diff --git a/vim/bundle/coffee-script/Readme.md b/vim/bundle/coffee-script/Readme.md deleted file mode 100644 index d557848..0000000 --- a/vim/bundle/coffee-script/Readme.md +++ /dev/null @@ -1,599 +0,0 @@ -This project adds [CoffeeScript] support to vim. It covers syntax, indenting, -compiling, and more. - -![Screenshot](http://i.imgur.com/j1BhpZQ.png) - -[CoffeeScript]: http://coffeescript.org/ - -## Table of Contents - -- Installation - - [Requirements](#requirements) - - [Install using Pathogen](#install-using-pathogen) - - [Install using Vundle](#install-using-vundle) - - [Install from a Zip File](#install-from-a-zip-file) -- Coffee Commands - - [Compile to JavaScript](#compile-to-javascript) - - [Compile CoffeeScript Snippets](#coffeecompile-compile-coffeescript-snippets) - - [Live Preview Compiling](#coffeewatch-live-preview-compiling) - - [Run CoffeeScript Snippets](#coffeerun-run-coffeescript-snippets) - - [Lint your CoffeeScript](#coffeelint-lint-your-coffeescript) -- Extras - - [Literate CoffeeScript](#literate-coffeescript) - - [CoffeeScript in HTML](#coffeescript-in-html) - - [CoffeeScript in Haml](#coffeescript-in-haml) -- Configuration - - [Custom Autocmds](#custom-autocmds) - - [Configuration Variables](#configuration-variables) - - [Configure Syntax Highlighting](#configure-syntax-highlighting) - - [Tune Vim for CoffeeScript](#tune-vim-for-coffeescript) - -## Requirements - - - vim 7.4 or later - - coffee 1.2.0 or later - -## Install using Pathogen - -This project uses rolling releases based on git commits, so pathogen is a -natural fit for it. If you're already using pathogen, you can skip to step 4. - -1. Install [pathogen.vim] into `~/.vim/autoload/` (see [pathogen's - readme][install-pathogen] for more information.) - -[pathogen.vim]: http://www.vim.org/scripts/script.php?script_id=2332 -[install-pathogen]: https://github.com/tpope/vim-pathogen#installation - -2. Enable pathogen in your vimrc. Here's a bare-minimum vimrc that enables - all the features of `vim-coffee-script`: - - ```vim - call pathogen#infect() - syntax enable - filetype plugin indent on - ``` - - If you already have a vimrc built up, just make sure it contains these calls, - in this order. - -3. Create the directory `~/.vim/bundle/`: - - mkdir ~/.vim/bundle - -4. Clone the `vim-coffee-script` repo into `~/.vim/bundle/`: - - git clone https://github.com/kchmck/vim-coffee-script.git ~/.vim/bundle/vim-coffee-script/ - -Updating takes two steps: - -1. Change into `~/.vim/bundle/vim-coffee-script/`: - - cd ~/.vim/bundle/vim-coffee-script - -2. Pull in the latest changes: - - git pull - -## Install using Vundle - -1. [Install Vundle] into `~/.vim/bundle/`. - -[Install Vundle]: https://github.com/gmarik/vundle#quick-start - -2. Configure your vimrc for Vundle. Here's a bare-minimum vimrc that enables all - the features of `vim-coffee-script`: - - - ```vim - set nocompatible - filetype off - - set rtp+=~/.vim/bundle/vundle/ - call vundle#rc() - - Bundle 'kchmck/vim-coffee-script' - - syntax enable - filetype plugin indent on - ``` - - If you're adding Vundle to a built-up vimrc, just make sure all these calls - are in there and that they occur in this order. - -3. Open vim and run `:BundleInstall`. - -To update, open vim and run `:BundleInstall!` (notice the bang!) - -## Install from a Zip File - -1. Download the latest zip file from [vim.org][zip]. - -2. Extract the archive into `~/.vim/`: - - unzip -od ~/.vim/ ARCHIVE.zip - - This should create the files `~/.vim/autoload/coffee.vim`, - `~/.vim/compiler/coffee.vim`, etc. - -You can update the plugin using the same steps. - -[zip]: http://www.vim.org/scripts/script.php?script_id=3590 - -## Compile to JavaScript - -A `coffee` wrapper for use with `:make` is enabled automatically for coffee -files if no other compiler is loaded. To enable it manually, run - - :compiler coffee - -The `:make` command is then configured to use the `coffee` compiler and -recognize its errors. I've included a quick reference here but be sure to check -out [`:help :make`][make] for a full reference of the command. - - ![make](http://i.imgur.com/scUXmxR.png) - - ![make Result](http://i.imgur.com/eGIjEdn.png) - -[make]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#:make_makeprg - -Consider the full signature of a `:make` call as - - :[silent] make[!] [COFFEE-OPTIONS]... - -By default `:make` shows all compiler output and jumps to the first line -reported as an error. Compiler output can be hidden with a leading `:silent`: - - :silent make - -Line-jumping can be turned off by adding a bang: - - :make! - -`COFFEE-OPTIONS` given to `:make` are passed along to `coffee` (see also -[`coffee_make_options`](#coffee_make_options)): - - :make --bare --output /some/dir - -See the [full table of options](http://coffeescript.org/#usage) for a -list of all the options that `coffee` recognizes. - -*Configuration*: [`coffee_compiler`](#coffee_compiler), -[`coffee_make_options`](#coffee_make_options) - -#### The quickfix window - -Compiler errors are added to the [quickfix] list by `:make`, but the quickfix -window isn't automatically shown. The [`:cwindow`][cwindow] command will pop up -the quickfix window if there are any errors: - - :make - :cwindow - -This is usually the desired behavior, so you may want to add an autocmd to your -vimrc to do this automatically: - - autocmd QuickFixCmdPost * nested cwindow | redraw! - -The `redraw!` command is needed to fix a redrawing quirk in terminal vim, but -can removed for gVim. - -[quickfix]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix -[cwindow]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#:cwindow - -#### Recompile on write - -To recompile a file when it's written, add a `BufWritePost` autocmd to your -vimrc: - - autocmd BufWritePost *.coffee silent make! - -#### Cake and Cakefiles - -A `cake` compiler is also available with the call - - :compiler cake - -You can then use `:make` as above to run your Cakefile and capture any `coffee` -errors: - - :silent make build - -It runs within the current directory, so make sure you're in the directory of -your Cakefile before calling it. - -*Configuration*: [`coffee_cake`](#coffee_cake), -[`coffee_cake_options`](#coffee_cake_options) - -## CoffeeCompile: Compile CoffeeScript Snippets - -CoffeeCompile shows how the current file or a snippet of CoffeeScript is -compiled to JavaScript. - - :[RANGE] CoffeeCompile [vert[ical]] [WINDOW-SIZE] - -Calling `:CoffeeCompile` without a range compiles the whole file: - - ![CoffeeCompile](http://i.imgur.com/0zFG0l0.png) - - ![CoffeeCompile Result](http://i.imgur.com/bpiAxaa.png) - -Calling it with a range, like in visual mode, compiles only the selected snippet -of CoffeeScript: - - ![CoffeeCompile Snippet](http://i.imgur.com/x3OT3Ay.png) - - ![Compiled Snippet](http://i.imgur.com/J02j4T8.png) - -Each file gets its own CoffeeCompile buffer, and the same buffer is used for all -future calls of `:CoffeeCompile` on that file. It can be quickly closed by -hitting `q` in normal mode. - -Using `vert` opens the CoffeeCompile buffer vertically instead of horizontally -(see also [`coffee_compile_vert`](#coffee_compile_vert)): - - :CoffeeCompile vert - -By default the CoffeeCompile buffer splits the source buffer in half, but this -can be overridden by passing in a `WINDOW-SIZE`: - - :CoffeeCompile 4 - -*Configuration*: [`coffee_compiler`](#coffee_compiler`), -[`coffee_compile_vert`](#coffee_compile_vert) - -#### Quick syntax checking - -If compiling a snippet results in a compiler error, CoffeeCompile adds that -error to the [quickfix] list. - -[quickfix]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix - - ![Syntax Checking](http://i.imgur.com/RC8accF.png) - - ![Syntax Checking Result](http://i.imgur.com/gi1ON75.png) - -You can use this to quickly check the syntax of a snippet. - -## CoffeeWatch: Live Preview Compiling - -CoffeeWatch emulates using the Try CoffeeScript preview box on the [CoffeeScript -homepage][CoffeeScript]. - - ![CoffeeWatch](http://i.imgur.com/TRHdIMG.png) - - ![CoffeeWatch Result](http://i.imgur.com/rJbOeeS.png) - -CoffeeWatch takes the same options as CoffeeCompile: - - :CoffeeWatch [vert[ical]] [WINDOW-SIZE] - -After a source buffer is watched, leaving insert mode or saving the file fires -off a recompile of the CoffeeScript: - - ![Insert Mode](http://i.imgur.com/SBVcf4k.png) - - ![Recompile](http://i.imgur.com/pbPMog7.png) - -You can force recompilation by calling `:CoffeeWatch`. - -To get synchronized scrolling of the source buffer and CoffeeWatch buffer, set -[`'scrollbind'`](http://vimdoc.sourceforge.net/htmldoc/options.html#'scrollbind') -on each: - - :setl scrollbind - -*Configuration*: [`coffee_compiler`](#coffee_compiler), -[`coffee_watch_vert`](#coffee_watch_vert) - -## CoffeeRun: Run CoffeeScript Snippets - -CoffeeRun compiles the current file or selected snippet and runs the resulting -JavaScript. - - ![CoffeeRun](http://i.imgur.com/YSkHUuQ.png) - - ![CoffeeRun Output](http://i.imgur.com/wZQbggN.png) - -The command has two forms: - - :CoffeeRun [PROGRAM-OPTIONS]... - -This form applies when no `RANGE` is given or when the given range is `1,$` -(first line to last line). It allows passing `PROGRAM-OPTIONS` to your compiled -program. The filename is passed directly to `coffee` so you must save the file -for your changes to take effect. - - :RANGE CoffeeRun [COFFEE-OPTIONS]... - -This form applies with all other ranges. It compiles and runs the lines within -the given `RANGE` and any extra `COFFEE-OPTIONS` are passed to `coffee`. - -*Configuration*: [`coffee_compiler`](#coffee_compiler), -[`coffee_run_vert`](#coffee_run_vert) - -## CoffeeLint: Lint your CoffeeScript - -CoffeeLint runs [coffeelint](http://www.coffeelint.org/) (version 0.5.7 or later -required) on the current file and adds any issues to the [quickfix] list. - - ![CoffeeLint](http://i.imgur.com/UN8Nr5N.png) - - ![CoffeeLint Result](http://i.imgur.com/9hSIj3W.png) - - :[RANGE] CoffeeLint[!] [COFFEELINT-OPTIONS]... [ | cwindow] - -If a `RANGE` is given, only those lines are piped to `coffeelint`. Options given -in `COFFEELINT-OPTIONS` are passed to `coffeelint` (see also -[`coffee_lint_options`](#coffee_lint_options)): - - :CoffeeLint -f lint.json - -It behaves very similar to `:make`, described [above](#compile-to-javascript). - - :CoffeeLint! | cwindow - -*Configuration*: [`coffee_linter`](#coffee_linter), -[`coffee_lint_options`](#coffee_lint_options) - -## Literate CoffeeScript - -Literate CoffeeScript syntax and indent support is provided by -[vim-literate-coffeescript]. The `Coffee` commands detect when they're running -on a litcoffee file and pass the `--literate` flag to their respective tools, -but at this time the commands are not automatically loaded when a litcoffee file -is opened. - -[vim-literate-coffeescript]: https://github.com/mintplant/vim-literate-coffeescript - -To load them, run - - runtime ftplugin/coffee.vim - -while inside a litcoffee buffer. To do this automatically, add - - autocmd FileType litcoffee runtime ftplugin/coffee.vim - -to your vimrc. - -## CoffeeScript in HTML - -CoffeeScript is highlighted and indented within - -```html - -``` - -blocks in html files. - -## CoffeeScript in Haml - -CoffeeScript is highlighted within the `:coffeescript` filter in haml files: - -```haml -:coffeescript - console.log "hullo" -``` - -At this time, coffee indenting doesn't work in these blocks. - -## Custom Autocmds - -You can [define commands][autocmd-explain] to be ran automatically on these -custom events. - -In all cases, the name of the command running the event (`CoffeeCompile`, -`CoffeeWatch`, or `CoffeeRun`) is matched by the [`{pat}`][autocmd] argument. -You can match all commands with a `*` or only specific commands by separating -them with a comma: `CoffeeCompile,CoffeeWatch`. - -[autocmd-explain]: http://vimdoc.sourceforge.net/htmldoc/usr_40.html#40.3 -[autocmd]: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#:autocmd - -#### CoffeeBufNew - -CoffeeBufNew is ran when a new scratch buffer is created. It's called from the -new buffer, so it can be used to do additional set up. - -```vim -augroup CoffeeBufNew - autocmd User * set wrap -augroup END -``` - -*Used By*: CoffeeCompile, CoffeeWatch, CoffeeRun - -#### CoffeeBufUpdate - -CoffeeBufUpdate is ran when a scratch buffer is updated with output from -`coffee`. It's called from the scratch buffer, so it can be used to alter the -compiled output. - -```vim -" Switch back to the source buffer after updating. -augroup CoffeeBufUpdate - autocmd User CoffeeCompile,CoffeeRun exec bufwinnr(b:coffee_src_buf) 'wincmd w' -augroup END -``` - -For example, to strip off the "Generated by" comment on the first line, put this -in your vimrc: - -```vim -function! s:RemoveGeneratedBy() - " If there was an error compiling, there's no comment to remove. - if v:shell_error - return - endif - - " Save cursor position. - let pos = getpos('.') - - " Remove first line. - set modifiable - 1 delete _ - set nomodifiable - - " Restore cursor position. - call setpos('.', pos) -endfunction - -augroup CoffeeBufUpdate - autocmd User CoffeeCompile,CoffeeWatch call s:RemoveGeneratedBy() -augroup END -``` - -*Used By*: CoffeeCompile, CoffeeWatch, CoffeeRun - -## Configuration Variables - -This is the full list of configuration variables available, with example -settings and default values. Use these in your vimrc to control the default -behavior. - -#### coffee\_indent\_keep\_current - -By default, the indent function matches the indent of the previous line if it -doesn't find a reason to indent or outdent. To change this behavior so it -instead keeps the [current indent of the cursor][98], use - - let coffee_indent_keep_current = 1 - -[98]: https://github.com/kchmck/vim-coffee-script/pull/98 - -*Default*: `unlet coffee_indent_keep_current` - -Note that if you change this after a coffee file has been loaded, you'll have to -reload the indent script for the change to take effect: - - unlet b:did_indent | runtime indent/coffee.vim - -#### coffee\_compiler - -Path to the `coffee` executable used by the `Coffee` commands: - - let coffee_compiler = '/usr/bin/coffee' - -*Default*: `'coffee'` (search `$PATH` for executable) - -#### coffee\_make\_options - -Options to pass to `coffee` with `:make`: - - let coffee_make_options = '--bare' - -*Default*: `''` (nothing) - -Note that `coffee_make_options` is embedded into `'makeprg'`, so `:compiler -coffee` must be ran after changing `coffee_make_options` for the changes to take -effect. - -#### coffee\_cake - -Path to the `cake` executable: - - let coffee_cake = '/opt/bin/cake' - -*Default*: `'cake'` (search `$PATH` for executable) - -#### coffee\_cake\_options - -Options to pass to `cake` with `:make`: - - let coffee_cake_options = 'build' - -*Default*: `''` (nothing) - -#### coffee\_linter - -Path to the `coffeelint` executable: - - let coffee_linter = '/opt/bin/coffeelint' - -*Default*: `'coffeelint'` (search `$PATH` for executable) - -#### coffee\_lint\_options - -Options to pass to `coffeelint`: - - let coffee_lint_options = '-f lint.json' - -*Default*: `''` (nothing) - -#### coffee\_compile\_vert - -Open the CoffeeCompile buffer with a vertical split instead of a horizontal -one: - - let coffee_compile_vert = 1 - -*Default*: `unlet coffee_compile_vert` - -#### coffee\_watch\_vert - -Open the CoffeeWatch buffer with a vertical split instead of a horizontal -one: - - let coffee_watch_vert = 1 - -*Default*: `unlet coffee_watch_vert` - -#### coffee\_run\_vert - -Open the CoffeeRun buffer with a vertical split instead of a horizontal -one: - - let coffee_run_vert = 1 - -*Default*: `unlet coffee_run_vert` - -## Configure Syntax Highlighting - -Add these lines to your vimrc to disable the relevant syntax group. - -#### Disable trailing whitespace error - -Trailing whitespace is highlighted as an error by default. This can be disabled -with: - - hi link coffeeSpaceError NONE - -#### Disable trailing semicolon error - -Trailing semicolons are considered an error (for help transitioning from -JavaScript.) This can be disabled with: - - hi link coffeeSemicolonError NONE - -#### Disable reserved words error - -Reserved words like `function` and `var` are highlighted as an error where -they're not allowed in CoffeeScript. This can be disabled with: - - hi link coffeeReservedError NONE - -## Tune Vim for CoffeeScript - -Changing these core settings can make vim more CoffeeScript friendly. - -#### Fold by indentation - -Folding by indentation works well for CoffeeScript functions and classes: - - ![Folding](http://i.imgur.com/gDgUBdO.png) - -To fold by indentation in CoffeeScript files, add this line to your vimrc: - - autocmd BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable - -With this, folding is disabled by default but can be quickly toggled per-file -by hitting `zi`. To enable folding by default, remove `nofoldenable`: - - autocmd BufNewFile,BufReadPost *.coffee setl foldmethod=indent - -#### Two-space indentation - -To get standard two-space indentation in CoffeeScript files, add this line to -your vimrc: - - autocmd BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab diff --git a/vim/bundle/coffee-script/Thanks.md b/vim/bundle/coffee-script/Thanks.md deleted file mode 100644 index 8ddcf23..0000000 --- a/vim/bundle/coffee-script/Thanks.md +++ /dev/null @@ -1,44 +0,0 @@ -Thanks to all bug reporters, and special thanks to those who have contributed -code: - - Brian Egan (brianegan): - Initial compiling support - - Ches Martin (ches): - Initial vim docs - - Chris Hoffman (cehoffman): - Add new keywoards from, to, and do - Highlight the - in negative integers - Add here regex highlighting, increase fold level for here docs - - David Wilhelm (bigfish): - CoffeeRun command - - Jay Adkisson (jayferd): - Support for eco templates - - Karl Guertin (grayrest) - Cakefiles are coffeescript - - Maciej Konieczny (narfdotpl): - Fix funny typo - - Matt Sacks (mattsa): - Javascript omni-completion - coffee_compile_vert option - - Nick Stenning (nickstenning): - Fold by indentation for coffeescript - - Simon Lipp (sloonz): - Trailing spaces are not error on lines containing only spaces - - Stéphan Kochen (stephank): - Initial HTML CoffeeScript highlighting - - Sven Felix Oberquelle (Svelix): - Haml CoffeeScript highlighting - - Wei Dai (clvv): - Fix the use of Vim built-in make command. diff --git a/vim/bundle/coffee-script/Todo.md b/vim/bundle/coffee-script/Todo.md deleted file mode 100644 index 3d4ffaa..0000000 --- a/vim/bundle/coffee-script/Todo.md +++ /dev/null @@ -1 +0,0 @@ -- Don't highlight bad operator combinations diff --git a/vim/bundle/coffee-script/after/indent/html.vim b/vim/bundle/coffee-script/after/indent/html.vim deleted file mode 100644 index e637708..0000000 --- a/vim/bundle/coffee-script/after/indent/html.vim +++ /dev/null @@ -1,33 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Load the coffee and html indent functions. -silent! unlet b:did_indent -runtime indent/coffee.vim -let s:coffeeIndentExpr = &l:indentexpr - -" Load html last so it can overwrite coffee settings. -silent! unlet b:did_indent -runtime indent/html.vim -let s:htmlIndentExpr = &l:indentexpr - -" Inject our wrapper indent function. -setlocal indentexpr=GetCoffeeHtmlIndent(v:lnum) - -function! GetCoffeeHtmlIndent(curlinenum) - " See if we're inside a coffeescript block. - let scriptlnum = searchpair('', 'bWn') - let prevlnum = prevnonblank(a:curlinenum) - - " If we're in the script block and the previous line isn't the script tag - " itself, use coffee indenting. - if scriptlnum && scriptlnum != prevlnum - exec 'return ' s:coffeeIndentExpr - endif - - " Otherwise use html indenting. - exec 'return ' s:htmlIndentExpr -endfunction diff --git a/vim/bundle/coffee-script/after/syntax/haml.vim b/vim/bundle/coffee-script/after/syntax/haml.vim deleted file mode 100644 index 4c517eb..0000000 --- a/vim/bundle/coffee-script/after/syntax/haml.vim +++ /dev/null @@ -1,13 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Sven Felix Oberquelle -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Inherit coffee from html so coffeeComment isn't redefined and given higher -" priority than hamlInterpolation. -syn cluster hamlCoffeescript contains=@htmlCoffeeScript -syn region hamlCoffeescriptFilter matchgroup=hamlFilter -\ start="^\z(\s*\):coffee\z(script\)\?\s*$" -\ end="^\%(\z1 \| *$\)\@!" -\ contains=@hamlCoffeeScript,hamlInterpolation -\ keepend diff --git a/vim/bundle/coffee-script/after/syntax/html.vim b/vim/bundle/coffee-script/after/syntax/html.vim deleted file mode 100644 index 9e2eb3a..0000000 --- a/vim/bundle/coffee-script/after/syntax/html.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Syntax highlighting for text/coffeescript script tags -syn include @htmlCoffeeScript syntax/coffee.vim -syn region coffeeScript start=##me=s-1 keepend -\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc -\ containedin=htmlHead diff --git a/vim/bundle/coffee-script/autoload/coffee.vim b/vim/bundle/coffee-script/autoload/coffee.vim deleted file mode 100644 index 04d5efb..0000000 --- a/vim/bundle/coffee-script/autoload/coffee.vim +++ /dev/null @@ -1,54 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Set up some common global/buffer variables. -function! coffee#CoffeeSetUpVariables() - " Path to coffee executable - if !exists('g:coffee_compiler') - let g:coffee_compiler = 'coffee' - endif - - " Options passed to coffee with make - if !exists('g:coffee_make_options') - let g:coffee_make_options = '' - endif - - " Path to cake executable - if !exists('g:coffee_cake') - let g:coffee_cake = 'cake' - endif - - " Extra options passed to cake - if !exists('g:coffee_cake_options') - let g:coffee_cake_options = '' - endif - - " Path to coffeelint executable - if !exists('g:coffee_linter') - let g:coffee_linter = 'coffeelint' - endif - - " Options passed to CoffeeLint - if !exists('g:coffee_lint_options') - let g:coffee_lint_options = '' - endif - - " Pass the litcoffee flag to tools in this buffer if a litcoffee file is open. - " Let the variable be overwritten so it can be updated if a different filetype - " is set. - if &filetype == 'litcoffee' - let b:coffee_litcoffee = '--literate' - else - let b:coffee_litcoffee = '' - endif -endfunction - -function! coffee#CoffeeSetUpErrorFormat() - CompilerSet errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l, - \Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m, - \SyntaxError:\ In\ %f\\,\ %m, - \%f:%l:%c:\ error:\ %m, - \%-G%.%# -endfunction diff --git a/vim/bundle/coffee-script/compiler/cake.vim b/vim/bundle/coffee-script/compiler/cake.vim deleted file mode 100644 index 0a3c703..0000000 --- a/vim/bundle/coffee-script/compiler/cake.vim +++ /dev/null @@ -1,15 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('current_compiler') - finish -endif - -let current_compiler = 'cake' -call coffee#CoffeeSetUpVariables() - -exec 'CompilerSet makeprg=' . escape(g:coffee_cake . ' ' . -\ g:coffee_cake_options . ' $*', ' ') -call coffee#CoffeeSetUpErrorFormat() diff --git a/vim/bundle/coffee-script/compiler/coffee.vim b/vim/bundle/coffee-script/compiler/coffee.vim deleted file mode 100644 index 9a91d35..0000000 --- a/vim/bundle/coffee-script/compiler/coffee.vim +++ /dev/null @@ -1,82 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" All this is needed to support compiling filenames with spaces, quotes, and -" such. The filename is escaped and embedded into the `makeprg` setting. -" -" Because of this, `makeprg` must be updated on every file rename. And because -" of that, `CompilerSet` can't be used because it doesn't exist when the -" rename autocmd is ran. So, we have to do some checks to see whether `compiler` -" was called locally or globally, and respect that in the rest of the script. - -if exists('current_compiler') - finish -endif - -let current_compiler = 'coffee' -call coffee#CoffeeSetUpVariables() - -" Pattern to check if coffee is the compiler -let s:pat = '^' . current_compiler - -" Get a `makeprg` for the current filename. -function! s:GetMakePrg() - return g:coffee_compiler . - \ ' -c' . - \ ' ' . b:coffee_litcoffee . - \ ' ' . g:coffee_make_options . - \ ' $*' . - \ ' ' . fnameescape(expand('%')) -endfunction - -" Set `makeprg` and return 1 if coffee is still the compiler, else return 0. -function! s:SetMakePrg() - if &l:makeprg =~ s:pat - let &l:makeprg = s:GetMakePrg() - elseif &g:makeprg =~ s:pat - let &g:makeprg = s:GetMakePrg() - else - return 0 - endif - - return 1 -endfunction - -" Set a dummy compiler so we can check whether to set locally or globally. -exec 'CompilerSet makeprg=' . current_compiler -" Then actually set the compiler. -call s:SetMakePrg() -call coffee#CoffeeSetUpErrorFormat() - -function! s:CoffeeMakeDeprecated(bang, args) - echoerr 'CoffeeMake is deprecated! Please use :make instead, its behavior ' . - \ 'is identical.' - sleep 5 - exec 'make' . a:bang a:args -endfunction - -" Compile the current file. -command! -bang -bar -nargs=* CoffeeMake -\ call s:CoffeeMakeDeprecated(, ) - -" Set `makeprg` on rename since we embed the filename in the setting. -augroup CoffeeUpdateMakePrg - autocmd! - - " Update `makeprg` if coffee is still the compiler, else stop running this - " function. - function! s:UpdateMakePrg() - if !s:SetMakePrg() - autocmd! CoffeeUpdateMakePrg - endif - endfunction - - " Set autocmd locally if compiler was set locally. - if &l:makeprg =~ s:pat - autocmd BufWritePre,BufFilePost call s:UpdateMakePrg() - else - autocmd BufWritePre,BufFilePost call s:UpdateMakePrg() - endif -augroup END diff --git a/vim/bundle/coffee-script/doc/coffee-script.txt b/vim/bundle/coffee-script/doc/coffee-script.txt deleted file mode 100644 index 1b43cf3..0000000 --- a/vim/bundle/coffee-script/doc/coffee-script.txt +++ /dev/null @@ -1,4 +0,0 @@ -Please see the project readme for up-to-date docs: -https://github.com/kchmck/vim-coffee-script - - vim:tw=78:ts=8:ft=help:norl: diff --git a/vim/bundle/coffee-script/ftdetect/coffee.vim b/vim/bundle/coffee-script/ftdetect/coffee.vim deleted file mode 100644 index 5056929..0000000 --- a/vim/bundle/coffee-script/ftdetect/coffee.vim +++ /dev/null @@ -1,17 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -autocmd BufNewFile,BufRead *.coffee set filetype=coffee -autocmd BufNewFile,BufRead *Cakefile set filetype=coffee -autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee -autocmd BufNewFile,BufRead *._coffee set filetype=coffee - -function! s:DetectCoffee() - if getline(1) =~ '^#!.*\' - set filetype=coffee - endif -endfunction - -autocmd BufNewFile,BufRead * call s:DetectCoffee() diff --git a/vim/bundle/coffee-script/ftplugin/coffee.vim b/vim/bundle/coffee-script/ftplugin/coffee.vim deleted file mode 100644 index c44fe97..0000000 --- a/vim/bundle/coffee-script/ftplugin/coffee.vim +++ /dev/null @@ -1,404 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('b:did_ftplugin') - finish -endif - -let b:did_ftplugin = 1 -call coffee#CoffeeSetUpVariables() - -setlocal formatoptions-=t formatoptions+=croql -setlocal comments=:# commentstring=#\ %s -setlocal omnifunc=javascriptcomplete#CompleteJS - -" Create custom augroups. -augroup CoffeeBufUpdate | augroup END -augroup CoffeeBufNew | augroup END - -" Enable coffee compiler if a compiler isn't set already. -if !len(&l:makeprg) - compiler coffee -endif - -" Switch to the window for buf. -function! s:SwitchWindow(buf) - exec bufwinnr(a:buf) 'wincmd w' -endfunction - -" Create a new scratch buffer and return the bufnr of it. After the function -" returns, vim remains in the scratch buffer so more set up can be done. -function! s:ScratchBufBuild(src, vert, size) - if a:size <= 0 - if a:vert - let size = winwidth(bufwinnr(a:src)) / 2 - else - let size = winheight(bufwinnr(a:src)) / 2 - endif - endif - - if a:vert - vertical belowright new - exec 'vertical resize' size - else - belowright new - exec 'resize' size - endif - - setlocal bufhidden=wipe buftype=nofile nobuflisted noswapfile nomodifiable - nnoremap q :hide - - return bufnr('%') -endfunction - -" Replace buffer contents with text and delete the last empty line. -function! s:ScratchBufUpdate(buf, text) - " Move to the scratch buffer. - call s:SwitchWindow(a:buf) - - " Double check we're in the scratch buffer before overwriting. - if bufnr('%') != a:buf - throw 'unable to change to scratch buffer' - endif - - setlocal modifiable - silent exec '% delete _' - silent put! =a:text - silent exec '$ delete _' - setlocal nomodifiable -endfunction - -" Parse the output of coffee into a qflist entry for src buffer. -function! s:ParseCoffeeError(output, src, startline) - " Coffee error is always on first line? - let match = matchlist(a:output, - \ '^\(\f\+\|\[stdin\]\):\(\d\):\(\d\): error: \(.\{-}\)' . "\n") - - if !len(match) - return - endif - - " Consider the line number from coffee as relative and add it to the beginning - " line number of the range the command was called on, then subtract one for - " zero-based relativity. - call setqflist([{'bufnr': a:src, 'lnum': a:startline + str2nr(match[2]) - 1, - \ 'type': 'E', 'col': str2nr(match[3]), 'text': match[4]}], 'r') -endfunction - -" Reset source buffer variables. -function! s:CoffeeCompileResetVars() - " Variables defined in source buffer: - " b:coffee_compile_buf: bufnr of output buffer - " Variables defined in output buffer: - " b:coffee_src_buf: bufnr of source buffer - " b:coffee_compile_pos: previous cursor position in output buffer - - let b:coffee_compile_buf = -1 -endfunction - -function! s:CoffeeWatchResetVars() - " Variables defined in source buffer: - " b:coffee_watch_buf: bufnr of output buffer - " Variables defined in output buffer: - " b:coffee_src_buf: bufnr of source buffer - " b:coffee_watch_pos: previous cursor position in output buffer - - let b:coffee_watch_buf = -1 -endfunction - -function! s:CoffeeRunResetVars() - " Variables defined in CoffeeRun source buffer: - " b:coffee_run_buf: bufnr of output buffer - " Variables defined in CoffeeRun output buffer: - " b:coffee_src_buf: bufnr of source buffer - " b:coffee_run_pos: previous cursor position in output buffer - - let b:coffee_run_buf = -1 -endfunction - -" Clean things up in the source buffers. -function! s:CoffeeCompileClose() - " Switch to the source buffer if not already in it. - silent! call s:SwitchWindow(b:coffee_src_buf) - call s:CoffeeCompileResetVars() -endfunction - -function! s:CoffeeWatchClose() - silent! call s:SwitchWindow(b:coffee_src_buf) - silent! autocmd! CoffeeAuWatch * - call s:CoffeeWatchResetVars() -endfunction - -function! s:CoffeeRunClose() - silent! call s:SwitchWindow(b:coffee_src_buf) - call s:CoffeeRunResetVars() -endfunction - -" Compile the lines between startline and endline and put the result into buf. -function! s:CoffeeCompileToBuf(buf, startline, endline) - let src = bufnr('%') - let input = join(getline(a:startline, a:endline), "\n") - - " Coffee doesn't like empty input. - if !len(input) - " Function should still return within output buffer. - call s:SwitchWindow(a:buf) - return - endif - - " Pipe lines into coffee. - let output = system(g:coffee_compiler . - \ ' -scb' . - \ ' ' . b:coffee_litcoffee . - \ ' 2>&1', input) - - " Paste output into output buffer. - call s:ScratchBufUpdate(a:buf, output) - - " Highlight as JavaScript if there were no compile errors. - if v:shell_error - call s:ParseCoffeeError(output, src, a:startline) - setlocal filetype= - else - " Clear the quickfix list. - call setqflist([], 'r') - setlocal filetype=javascript - endif -endfunction - -" Peek at compiled CoffeeScript in a scratch buffer. We handle ranges like this -" to prevent the cursor from being moved (and its position saved) before the -" function is called. -function! s:CoffeeCompile(startline, endline, args) - if a:args =~ '\' - echoerr 'CoffeeCompile watch is deprecated! Please use CoffeeWatch instead' - sleep 5 - call s:CoffeeWatch(a:args) - return - endif - - " Switch to the source buffer if not already in it. - silent! call s:SwitchWindow(b:coffee_src_buf) - - " Bail if not in source buffer. - if !exists('b:coffee_compile_buf') - return - endif - - " Build the output buffer if it doesn't exist. - if bufwinnr(b:coffee_compile_buf) == -1 - let src = bufnr('%') - - let vert = exists('g:coffee_compile_vert') || a:args =~ '\' - let size = str2nr(matchstr(a:args, '\<\d\+\>')) - - " Build the output buffer and save the source bufnr. - let buf = s:ScratchBufBuild(src, vert, size) - let b:coffee_src_buf = src - - " Set the buffer name. - exec 'silent! file [CoffeeCompile ' . src . ']' - - " Clean up the source buffer when the output buffer is closed. - autocmd BufWipeout call s:CoffeeCompileClose() - " Save the cursor when leaving the output buffer. - autocmd BufLeave let b:coffee_compile_pos = getpos('.') - - " Run user-defined commands on new buffer. - silent doautocmd CoffeeBufNew User CoffeeCompile - - " Switch back to the source buffer and save the output bufnr. This also - " triggers BufLeave above. - call s:SwitchWindow(src) - let b:coffee_compile_buf = buf - endif - - " Fill the scratch buffer. - call s:CoffeeCompileToBuf(b:coffee_compile_buf, a:startline, a:endline) - " Reset cursor to previous position. - call setpos('.', b:coffee_compile_pos) - - " Run any user-defined commands on the scratch buffer. - silent doautocmd CoffeeBufUpdate User CoffeeCompile -endfunction - -" Update the scratch buffer and switch back to the source buffer. -function! s:CoffeeWatchUpdate() - call s:CoffeeCompileToBuf(b:coffee_watch_buf, 1, '$') - call setpos('.', b:coffee_watch_pos) - silent doautocmd CoffeeBufUpdate User CoffeeWatch - call s:SwitchWindow(b:coffee_src_buf) -endfunction - -" Continually compile a source buffer. -function! s:CoffeeWatch(args) - silent! call s:SwitchWindow(b:coffee_src_buf) - - if !exists('b:coffee_watch_buf') - return - endif - - if bufwinnr(b:coffee_watch_buf) == -1 - let src = bufnr('%') - - let vert = exists('g:coffee_watch_vert') || a:args =~ '\' - let size = str2nr(matchstr(a:args, '\<\d\+\>')) - - let buf = s:ScratchBufBuild(src, vert, size) - let b:coffee_src_buf = src - - exec 'silent! file [CoffeeWatch ' . src . ']' - - autocmd BufWipeout call s:CoffeeWatchClose() - autocmd BufLeave let b:coffee_watch_pos = getpos('.') - - silent doautocmd CoffeeBufNew User CoffeeWatch - - call s:SwitchWindow(src) - let b:coffee_watch_buf = buf - endif - - " Make sure only one watch autocmd is defined on this buffer. - silent! autocmd! CoffeeAuWatch * - - augroup CoffeeAuWatch - autocmd InsertLeave call s:CoffeeWatchUpdate() - autocmd BufWritePost call s:CoffeeWatchUpdate() - augroup END - - call s:CoffeeWatchUpdate() -endfunction - -" Run a snippet of CoffeeScript between startline and endline. -function! s:CoffeeRun(startline, endline, args) - silent! call s:SwitchWindow(b:coffee_src_buf) - - if !exists('b:coffee_run_buf') - return - endif - - if bufwinnr(b:coffee_run_buf) == -1 - let src = bufnr('%') - - let buf = s:ScratchBufBuild(src, exists('g:coffee_run_vert'), 0) - let b:coffee_src_buf = src - - exec 'silent! file [CoffeeRun ' . src . ']' - - autocmd BufWipeout call s:CoffeeRunClose() - autocmd BufLeave let b:coffee_run_pos = getpos('.') - - silent doautocmd CoffeeBufNew User CoffeeRun - - call s:SwitchWindow(src) - let b:coffee_run_buf = buf - endif - - if a:startline == 1 && a:endline == line('$') - let output = system(g:coffee_compiler . - \ ' ' . b:coffee_litcoffee . - \ ' ' . fnameescape(expand('%')) . - \ ' ' . a:args) - else - let input = join(getline(a:startline, a:endline), "\n") - - if !len(input) - return - endif - - let output = system(g:coffee_compiler . - \ ' -s' . - \ ' ' . b:coffee_litcoffee . - \ ' ' . a:args, input) - endif - - call s:ScratchBufUpdate(b:coffee_run_buf, output) - call setpos('.', b:coffee_run_pos) - - silent doautocmd CoffeeBufUpdate User CoffeeRun -endfunction - -" Run coffeelint on a file, and add any errors between startline and endline -" to the quickfix list. -function! s:CoffeeLint(startline, endline, bang, args) - let input = join(getline(a:startline, a:endline), "\n") - - if !len(input) - return - endif - - let output = system(g:coffee_linter . - \ ' -s --csv' . - \ ' ' . b:coffee_litcoffee . - \ ' ' . g:coffee_lint_options . - \ ' ' . a:args . - \ ' 2>&1', input) - - " Convert output into an array and strip off the csv header. - let lines = split(output, "\n")[1:] - let buf = bufnr('%') - let qflist = [] - - for line in lines - let match = matchlist(line, '^stdin,\(\d\+\),\d*,\(error\|warn\),\(.\+\)$') - - " Ignore unmatched lines. - if !len(match) - continue - endif - - " The 'type' will result in either 'E' or 'W'. - call add(qflist, {'bufnr': buf, 'lnum': a:startline + str2nr(match[1]) - 1, - \ 'type': toupper(match[2][0]), 'text': match[3]}) - endfor - - " Replace the quicklist with our items. - call setqflist(qflist, 'r') - - " If not given a bang, jump to first error. - if !len(a:bang) - silent! cc 1 - endif -endfunction - -" Complete arguments for Coffee* commands. -function! s:CoffeeComplete(cmd, cmdline, cursor) - let args = ['vertical'] - - " If no partial command, return all possibilities. - if !len(a:cmd) - return args - endif - - let pat = '^' . a:cmd - - for arg in args - if arg =~ pat - return [arg] - endif - endfor -endfunction - -" Set initial state variables if they don't exist -if !exists('b:coffee_compile_buf') - call s:CoffeeCompileResetVars() -endif - -if !exists('b:coffee_watch_buf') - call s:CoffeeWatchResetVars() -endif - -if !exists('b:coffee_run_buf') - call s:CoffeeRunResetVars() -endif - -command! -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete -\ CoffeeCompile call s:CoffeeCompile(, , ) -command! -bar -nargs=* -complete=customlist,s:CoffeeComplete -\ CoffeeWatch call s:CoffeeWatch() -command! -range=% -bar -nargs=* CoffeeRun -\ call s:CoffeeRun(, , ) -command! -range=% -bang -bar -nargs=* CoffeeLint -\ call s:CoffeeLint(, , , ) diff --git a/vim/bundle/coffee-script/indent/coffee.vim b/vim/bundle/coffee-script/indent/coffee.vim deleted file mode 100644 index 7bd82e3..0000000 --- a/vim/bundle/coffee-script/indent/coffee.vim +++ /dev/null @@ -1,428 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('b:did_indent') - finish -endif - -let b:did_indent = 1 - -setlocal autoindent -setlocal indentexpr=GetCoffeeIndent(v:lnum) -" Make sure GetCoffeeIndent is run when these are typed so they can be -" indented or outdented. -setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally - -" If no indenting or outdenting is needed, either keep the indent of the cursor -" (use autoindent) or match the indent of the previous line. -if exists('g:coffee_indent_keep_current') - let s:DEFAULT_LEVEL = '-1' -else - let s:DEFAULT_LEVEL = 'indent(prevnlnum)' -endif - -" Only define the function once. -if exists('*GetCoffeeIndent') - finish -endif - -" Keywords that begin a block -let s:BEGIN_BLOCK_KEYWORD = '\C^\%(if\|unless\|else\|for\|while\|until\|' -\ . 'loop\|switch\|when\|try\|catch\|finally\|' -\ . 'class\)\>\%(\s*:\)\@!' - -" An expression that uses the result of a statement -let s:COMPOUND_EXPRESSION = '\C\%([^-]-\|[^+]+\|[^/]/\|[:=*%&|^<>]\)\s*' -\ . '\%(if\|unless\|for\|while\|until\|loop\|switch\|' -\ . 'try\|class\)\>' - -" Combine the two above -let s:BEGIN_BLOCK = s:BEGIN_BLOCK_KEYWORD . '\|' . s:COMPOUND_EXPRESSION - -" Operators that begin a block but also count as a continuation -let s:BEGIN_BLOCK_OP = '[([{:=]$' - -" Begins a function block -let s:FUNCTION = '[-=]>$' - -" Operators that continue a line onto the next line -let s:CONTINUATION_OP = '\C\%(\<\%(is\|isnt\|and\|or\)\>\|' -\ . '[^-]-\|[^+]+\|[^-=]>\|[^.]\.\|[<*/%&|^,]\)$' - -" Ancestor operators that prevent continuation indenting -let s:CONTINUATION = s:CONTINUATION_OP . '\|' . s:BEGIN_BLOCK_OP - -" A closing bracket by itself on a line followed by a continuation -let s:BRACKET_CONTINUATION = '^\s*[}\])]\s*' . s:CONTINUATION_OP - -" A continuation dot access -let s:DOT_ACCESS = '^\.' - -" Keywords that break out of a block -let s:BREAK_BLOCK_OP = '\C^\%(return\|break\|continue\|throw\)\>' - -" A condition attached to the end of a statement -let s:POSTFIX_CONDITION = '\C\S\s\+\zs\<\%(if\|unless\|when\|while\|until\)\>' - -" A then contained in brackets -let s:CONTAINED_THEN = '\C[(\[].\{-}\.\{-\}[)\]]' - -" An else with a condition attached -let s:ELSE_COND = '\C^\s*else\s\+\<\%(if\|unless\)\>' - -" A single-line else statement (without a condition attached) -let s:SINGLE_LINE_ELSE = '\C^else\s\+\%(\<\%(if\|unless\)\>\)\@!' - -" Pairs of starting and ending keywords, with an initial pattern to match -let s:KEYWORD_PAIRS = [ -\ ['\C^else\>', '\C\<\%(if\|unless\|when\|else\s\+\%(if\|unless\)\)\>', -\ '\C\'], -\ ['\C^catch\>', '\C\', '\C\'], -\ ['\C^finally\>', '\C\', '\C\'] -\] - -" Pairs of starting and ending brackets -let s:BRACKET_PAIRS = {']': '\[', '}': '{', ')': '('} - -" Max lines to look back for a match -let s:MAX_LOOKBACK = 50 - -" Syntax names for strings -let s:SYNTAX_STRING = 'coffee\%(String\|AssignString\|Embed\|Regex\|Heregex\|' -\ . 'Heredoc\)' - -" Syntax names for comments -let s:SYNTAX_COMMENT = 'coffee\%(Comment\|BlockComment\|HeregexComment\)' - -" Syntax names for strings and comments -let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT - -" Compatibility code for shiftwidth() as recommended by the docs, but modified -" so there isn't as much of a penalty if shiftwidth() exists. -if exists('*shiftwidth') - let s:ShiftWidth = function('shiftwidth') -else - function! s:ShiftWidth() - return &shiftwidth - endfunction -endif - -" Get the linked syntax name of a character. -function! s:SyntaxName(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') -endfunction - -" Check if a character is in a comment. -function! s:IsComment(lnum, col) - return s:SyntaxName(a:lnum, a:col) =~ s:SYNTAX_COMMENT -endfunction - -" Check if a character is in a string. -function! s:IsString(lnum, col) - return s:SyntaxName(a:lnum, a:col) =~ s:SYNTAX_STRING -endfunction - -" Check if a character is in a comment or string. -function! s:IsCommentOrString(lnum, col) - return s:SyntaxName(a:lnum, a:col) =~ s:SYNTAX_STRING_COMMENT -endfunction - -" Search a line for a regex until one is found outside a string or comment. -function! s:SearchCode(lnum, regex) - " Start at the first column and look for an initial match (including at the - " cursor.) - call cursor(a:lnum, 1) - let pos = search(a:regex, 'c', a:lnum) - - while pos - if !s:IsCommentOrString(a:lnum, col('.')) - return 1 - endif - - " Move to the match and continue searching (don't accept matches at the - " cursor.) - let pos = search(a:regex, '', a:lnum) - endwhile - - return 0 -endfunction - -" Search for the nearest previous line that isn't a comment. -function! s:GetPrevNormalLine(startlnum) - let curlnum = a:startlnum - - while curlnum - let curlnum = prevnonblank(curlnum - 1) - - " Return the line if the first non-whitespace character isn't a comment. - if !s:IsComment(curlnum, indent(curlnum) + 1) - return curlnum - endif - endwhile - - return 0 -endfunction - -function! s:SearchPair(startlnum, lookback, skip, open, close) - " Go to the first column so a:close will be matched even if it's at the - " beginning of the line. - call cursor(a:startlnum, 1) - return searchpair(a:open, '', a:close, 'bnW', a:skip, max([1, a:lookback])) -endfunction - -" Skip if a match -" - is in a string or comment -" - is a single-line statement that isn't immediately -" adjacent -" - has a postfix condition and isn't an else statement or compound -" expression -function! s:ShouldSkip(startlnum, lnum, col) - return s:IsCommentOrString(a:lnum, a:col) || - \ s:SearchCode(a:lnum, '\C\') && a:startlnum - a:lnum > 1 || - \ s:SearchCode(a:lnum, s:POSTFIX_CONDITION) && - \ getline(a:lnum) !~ s:ELSE_COND && - \ !s:SearchCode(a:lnum, s:COMPOUND_EXPRESSION) -endfunction - -" Search for the nearest and farthest match for a keyword pair. -function! s:SearchMatchingKeyword(startlnum, open, close) - let skip = 's:ShouldSkip(' . a:startlnum . ", line('.'), line('.'))" - - " Search for the nearest match. - let nearestlnum = s:SearchPair(a:startlnum, a:startlnum - s:MAX_LOOKBACK, - \ skip, a:open, a:close) - - if !nearestlnum - return [] - endif - - " Find the nearest previous line with indent less than or equal to startlnum. - let ind = indent(a:startlnum) - let lookback = s:GetPrevNormalLine(a:startlnum) - - while lookback && indent(lookback) > ind - let lookback = s:GetPrevNormalLine(lookback) - endwhile - - " Search for the farthest match. If there are no other matches, then the - " nearest match is also the farthest one. - let matchlnum = nearestlnum - - while matchlnum - let lnum = matchlnum - let matchlnum = s:SearchPair(matchlnum, lookback, skip, a:open, a:close) - endwhile - - return [nearestlnum, lnum] -endfunction - -" Strip a line of a trailing comment and surrounding whitespace. -function! s:GetTrimmedLine(lnum) - " Try to find a comment starting at the first column. - call cursor(a:lnum, 1) - let pos = search('#', 'c', a:lnum) - - " Keep searching until a comment is found or search returns 0. - while pos - if s:IsComment(a:lnum, col('.')) - break - endif - - let pos = search('#', '', a:lnum) - endwhile - - if !pos - " No comment was found so use the whole line. - let line = getline(a:lnum) - else - " Subtract 1 to get to the column before the comment and another 1 for - " column indexing -> zero-based indexing. - let line = getline(a:lnum)[:col('.') - 2] - endif - - return substitute(substitute(line, '^\s\+', '', ''), - \ '\s\+$', '', '') -endfunction - -" Get the indent policy when no special rules are used. -function! s:GetDefaultPolicy(curlnum) - " Check whether equalprg is being ran on existing lines. - if strlen(getline(a:curlnum)) == indent(a:curlnum) - " If not indenting an existing line, use the default policy. - return s:DEFAULT_LEVEL - else - " Otherwise let autoindent determine what to do with an existing line. - return '-1' - endif -endfunction - -function! GetCoffeeIndent(curlnum) - " Get the previous non-blank line (may be a comment.) - let prevlnum = prevnonblank(a:curlnum - 1) - - " Bail if there's no code before. - if !prevlnum - return -1 - endif - - " Bail if inside a multiline string. - if s:IsString(a:curlnum, 1) - let prevnlnum = prevlnum - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " Get the code part of the current line. - let curline = s:GetTrimmedLine(a:curlnum) - " Get the previous non-comment line. - let prevnlnum = s:GetPrevNormalLine(a:curlnum) - - " Check if the current line is the closing bracket in a bracket pair. - if has_key(s:BRACKET_PAIRS, curline[0]) - " Search for a matching opening bracket. - let matchlnum = s:SearchPair(a:curlnum, a:curlnum - s:MAX_LOOKBACK, - \ "s:IsCommentOrString(line('.'), col('.'))", - \ s:BRACKET_PAIRS[curline[0]], curline[0]) - - if matchlnum - " Match the indent of the opening bracket. - return indent(matchlnum) - else - " No opening bracket found (bad syntax), so bail. - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Check if the current line is the closing keyword in a keyword pair. - for pair in s:KEYWORD_PAIRS - if curline =~ pair[0] - " Find the nearest and farthest matches within the same indent level. - let matches = s:SearchMatchingKeyword(a:curlnum, pair[1], pair[2]) - - if len(matches) - " Don't force indenting/outdenting as long as line is already lined up - " with a valid match - return max([min([indent(a:curlnum), indent(matches[0])]), - \ indent(matches[1])]) - else - " No starting keyword found (bad syntax), so bail. - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - endfor - - " Check if the current line is a `when` and not the first in a switch block. - if curline =~ '\C^when\>' && !s:SearchCode(prevnlnum, '\C\') - " Look back for a `when`. - while prevnlnum - if getline(prevnlnum) =~ '\C^\s*when\>' - " Indent to match the found `when`, but don't force indenting (for when - " indenting nested switch blocks.) - return min([indent(a:curlnum), indent(prevnlnum)]) - endif - - let prevnlnum = s:GetPrevNormalLine(prevnlnum) - endwhile - - " No matching `when` found (bad syntax), so bail. - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " If the previous line is a comment, use its indentation, but don't force - " indenting. - if prevlnum != prevnlnum - return min([indent(a:curlnum), indent(prevlnum)]) - endif - - let prevline = s:GetTrimmedLine(prevnlnum) - - " Always indent after these operators. - if prevline =~ s:BEGIN_BLOCK_OP - return indent(prevnlnum) + s:ShiftWidth() - endif - - " Indent if the previous line starts a function block, but don't force - " indenting if the line is non-blank (for empty function bodies.) - if prevline =~ s:FUNCTION - if strlen(getline(a:curlnum)) > indent(a:curlnum) - return min([indent(prevnlnum) + s:ShiftWidth(), indent(a:curlnum)]) - else - return indent(prevnlnum) + s:ShiftWidth() - endif - endif - - " Check if continuation indenting is needed. If the line ends in a slash, make - " sure it isn't a regex. - if prevline =~ s:CONTINUATION_OP && - \ !(prevline =~ '/$' && s:IsString(prevnlnum, col([prevnlnum, '$']) - 1)) - " Don't indent if the continuation follows a closing bracket. - if prevline =~ s:BRACKET_CONTINUATION - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - let prevprevnlnum = s:GetPrevNormalLine(prevnlnum) - - " Don't indent if not the first continuation. - if prevprevnlnum && s:GetTrimmedLine(prevprevnlnum) =~ s:CONTINUATION - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " Continuation indenting seems to vary between programmers, so if the line - " is non-blank, don't override the indentation - if strlen(getline(a:curlnum)) > indent(a:curlnum) - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " Otherwise indent a level. - return indent(prevnlnum) + s:ShiftWidth() - endif - - " Check if the previous line starts with a keyword that begins a block. - if prevline =~ s:BEGIN_BLOCK - " Indent if the current line doesn't start with `then` and the previous line - " isn't a single-line statement. - if curline !~ '\C^\' && !s:SearchCode(prevnlnum, '\C\') && - \ prevline !~ s:SINGLE_LINE_ELSE - return indent(prevnlnum) + s:ShiftWidth() - else - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Indent a dot access if it's the first. - if curline =~ s:DOT_ACCESS - if prevline !~ s:DOT_ACCESS - return indent(prevnlnum) + s:ShiftWidth() - else - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Outdent if a keyword breaks out of a block as long as it doesn't have a - " postfix condition (and the postfix condition isn't a single-line statement.) - if prevline =~ s:BREAK_BLOCK_OP - if !s:SearchCode(prevnlnum, s:POSTFIX_CONDITION) || - \ s:SearchCode(prevnlnum, '\C\') && - \ !s:SearchCode(prevnlnum, s:CONTAINED_THEN) - " Don't force indenting. - return min([indent(a:curlnum), indent(prevnlnum) - s:ShiftWidth()]) - else - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Check if inside brackets. - let matchlnum = s:SearchPair(a:curlnum, a:curlnum - s:MAX_LOOKBACK, - \ "s:IsCommentOrString(line('.'), col('.'))", - \ '\[\|(\|{', '\]\|)\|}') - - " If inside brackets, indent relative to the brackets, but don't outdent an - " already indented line. - if matchlnum - return max([indent(a:curlnum), indent(matchlnum) + s:ShiftWidth()]) - endif - - " No special rules applied, so use the default policy. - exec 'return' s:GetDefaultPolicy(a:curlnum) -endfunction diff --git a/vim/bundle/coffee-script/syntax/coffee.vim b/vim/bundle/coffee-script/syntax/coffee.vim deleted file mode 100755 index 7f8df73..0000000 --- a/vim/bundle/coffee-script/syntax/coffee.vim +++ /dev/null @@ -1,221 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Bail if our syntax is already loaded. -if exists('b:current_syntax') && b:current_syntax == 'coffee' - finish -endif - -" Include JavaScript for coffeeEmbed. -syn include @coffeeJS syntax/javascript.vim -silent! unlet b:current_syntax - -" Highlight long strings. -syntax sync fromstart - -" These are `matches` instead of `keywords` because vim's highlighting -" priority for keywords is higher than matches. This causes keywords to be -" highlighted inside matches, even if a match says it shouldn't contain them -- -" like with coffeeAssign and coffeeDot. -syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ display -hi def link coffeeStatement Statement - -syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ display -hi def link coffeeRepeat Repeat - -syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/ -\ display -hi def link coffeeConditional Conditional - -syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display -hi def link coffeeException Exception - -syn match coffeeKeyword /\<\%(new\|in\|of\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\)\>/ -\ display -" The `own` keyword is only a keyword after `for`. -syn match coffeeKeyword /\/ contained containedin=coffeeRepeat -\ display -hi def link coffeeKeyword Keyword - -syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display -hi def link coffeeOperator Operator - -" The first case matches symbol operators only if they have an operand before. -syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|[-=]>\|--\|++\|:/ -\ display -syn match coffeeExtendedOp /\<\%(and\|or\)=/ display -hi def link coffeeExtendedOp coffeeOperator - -" This is separate from `coffeeExtendedOp` to help differentiate commas from -" dots. -syn match coffeeSpecialOp /[,;]/ display -hi def link coffeeSpecialOp SpecialChar - -syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ display -hi def link coffeeBoolean Boolean - -syn match coffeeGlobal /\<\%(null\|undefined\)\>/ display -hi def link coffeeGlobal Type - -" A special variable -syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display -hi def link coffeeSpecialVar Special - -" An @-variable -syn match coffeeSpecialIdent /@\%(\%(\I\|\$\)\%(\i\|\$\)*\)\?/ display -hi def link coffeeSpecialIdent Identifier - -" A class-like name that starts with a capital letter -syn match coffeeObject /\<\u\w*\>/ display -hi def link coffeeObject Structure - -" A constant-like name in SCREAMING_CAPS -syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ display -hi def link coffeeConstant Constant - -" A variable name -syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeSpecialIdent, -\ coffeeObject,coffeeConstant - -" A non-interpolated string -syn cluster coffeeBasicString contains=@Spell,coffeeEscape -" An interpolated string -syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp - -" Regular strings -syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ -\ contains=@coffeeInterpString -syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ -\ contains=@coffeeBasicString -hi def link coffeeString String - -" A integer, including a leading plus or minus -syn match coffeeNumber /\%(\i\|\$\)\@/ display -syn match coffeeNumber /\<0[bB][01]\+\>/ display -syn match coffeeNumber /\<0[oO][0-7]\+\>/ display -syn match coffeeNumber /\<\%(Infinity\|NaN\)\>/ display -hi def link coffeeNumber Number - -" A floating-point number, including a leading plus or minus -syn match coffeeFloat /\%(\i\|\$\)\@/ -\ display -hi def link coffeeReservedError Error - -" A normal object assignment -syn match coffeeObjAssign /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ contains=@coffeeIdentifier display -hi def link coffeeObjAssign Identifier - -syn keyword coffeeTodo TODO FIXME XXX contained -hi def link coffeeTodo Todo - -syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo -hi def link coffeeComment Comment - -syn region coffeeBlockComment start=/####\@!/ end=/###/ -\ contains=@Spell,coffeeTodo -hi def link coffeeBlockComment coffeeComment - -" A comment in a heregex -syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ contained -\ contains=@Spell,coffeeTodo -hi def link coffeeHeregexComment coffeeComment - -" Embedded JavaScript -syn region coffeeEmbed matchgroup=coffeeEmbedDelim -\ start=/`/ skip=/\\\\\|\\`/ end=/`/ keepend -\ contains=@coffeeJS -hi def link coffeeEmbedDelim Delimiter - -syn region coffeeInterp matchgroup=coffeeInterpDelim start=/#{/ end=/}/ contained -\ contains=@coffeeAll -hi def link coffeeInterpDelim PreProc - -" A string escape sequence -syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display -hi def link coffeeEscape SpecialChar - -" A regex -- must not follow a parenthesis, number, or identifier, and must not -" be followed by a number -syn region coffeeRegex start=#\%(\%()\|\%(\i\|\$\)\@> #{ == { { { } } } == } << " -" >> #{ == { abc: { def: 42 } } == } << " diff --git a/vim/bundle/coffee-script/test/test-ops.coffee b/vim/bundle/coffee-script/test/test-ops.coffee deleted file mode 100644 index 54be8db..0000000 --- a/vim/bundle/coffee-script/test/test-ops.coffee +++ /dev/null @@ -1,90 +0,0 @@ -# Various operators -abc instanceof def -typeof abc -delete abc -abc::def - -abc + def -abc - def -abc * def -abc / def -abc % def -abc & def -abc | def -abc ^ def -abc >> def -abc << def -abc >>> def -abc ? def -abc && def -abc and def -abc || def -abc or def - -abc += def -abc -= def -abc *= def -abc /= def -abc %= def -abc &= def -abc |= def -abc ^= def -abc >>= def -abc <<= def -abc >>>= def -abc ?= def -abc &&= def -abc ||= def - -abc and= def -abc or= def - -abc.def.ghi -abc?.def?.ghi - -abc < def -abc > def -abc = def -abc == def -abc != def -abc <= def -abc >= def - -abc++ -abc-- -++abc ---abc - -# Nested operators -abc[def] = ghi -abc[def[ghi: jkl]] = 42 -@abc[def] = ghi - -abc["#{def = 42}"] = 42 -abc["#{def.ghi = 42}"] = 42 -abc["#{def[ghi] = 42}"] = 42 -abc["#{def['ghi']}"] = 42 - -# Object assignments -abc = - def: 123 - DEF: 123 - @def: 123 - Def: 123 - 'def': 123 - 42: 123 - -# Operators shouldn't be highlighted -vector= -wand= - -abc+++ -abc--- -abc ** def -abc &&& def -abc ^^ def -abc ===== def -abc <==== def -abc >==== def -abc +== def -abc =^= def diff --git a/vim/bundle/coffee-script/test/test-reserved.coffee b/vim/bundle/coffee-script/test/test-reserved.coffee deleted file mode 100644 index b841760..0000000 --- a/vim/bundle/coffee-script/test/test-reserved.coffee +++ /dev/null @@ -1,27 +0,0 @@ -# Should be an error -function = 42 -var = 42 - -# Shouldn't be an error -abc.with = 42 -function: 42 -var: 42 - -# Keywords shouldn't be highlighted -abc.function -abc.do -abc.break -abc.true - -abc::function -abc::do -abc::break -abc::true - -abc:: function -abc. function - -# Numbers should be highlighted -def.42 -def .42 -def::42 diff --git a/vim/bundle/coffee-script/test/test.haml b/vim/bundle/coffee-script/test/test.haml deleted file mode 100644 index ae19fba..0000000 --- a/vim/bundle/coffee-script/test/test.haml +++ /dev/null @@ -1,3 +0,0 @@ -:coffeescript - class Hello - # test diff --git a/vim/bundle/coffee-script/test/test.html b/vim/bundle/coffee-script/test/test.html deleted file mode 100644 index 3479145..0000000 --- a/vim/bundle/coffee-script/test/test.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/vim/bundle/ctrlp/.gitignore b/vim/bundle/ctrlp/.gitignore deleted file mode 100644 index 06fcd83..0000000 --- a/vim/bundle/ctrlp/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.markdown -*.zip -note.txt -tags -.hg* -tmp/* diff --git a/vim/bundle/ctrlp/autoload/ctrlp.vim b/vim/bundle/ctrlp/autoload/ctrlp.vim deleted file mode 100644 index 3677a71..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp.vim +++ /dev/null @@ -1,2113 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp.vim -" Description: Fuzzy file, buffer, mru, tag, etc finder. -" Author: Kien Nguyen -" Version: 1.79 -" ============================================================================= - -" ** Static variables {{{1 -" s:ignore() {{{2 -fu! s:ignore() - let igdirs = [ - \ '\.git', - \ '\.hg', - \ '\.svn', - \ '_darcs', - \ '\.bzr', - \ '\.cdv', - \ '\~\.dep', - \ '\~\.dot', - \ '\~\.nib', - \ '\~\.plst', - \ '\.pc', - \ '_MTN', - \ 'blib', - \ 'CVS', - \ 'RCS', - \ 'SCCS', - \ '_sgbak', - \ 'autom4te\.cache', - \ 'cover_db', - \ '_build', - \ ] - let igfiles = [ - \ '\~$', - \ '#.+#$', - \ '[._].*\.swp$', - \ 'core\.\d+$', - \ '\.exe$', - \ '\.so$', - \ '\.bak$', - \ '\.png$', - \ '\.jpg$', - \ '\.gif$', - \ '\.zip$', - \ '\.rar$', - \ '\.tar\.gz$', - \ ] - retu { - \ 'dir': '\v[\/]('.join(igdirs, '|').')$', - \ 'file': '\v'.join(igfiles, '|'), - \ } -endf -" Script local vars {{{2 -let [s:pref, s:bpref, s:opts, s:new_opts, s:lc_opts] = - \ ['g:ctrlp_', 'b:ctrlp_', { - \ 'abbrev': ['s:abbrev', {}], - \ 'arg_map': ['s:argmap', 0], - \ 'buffer_func': ['s:buffunc', {}], - \ 'by_filename': ['s:byfname', 0], - \ 'custom_ignore': ['s:usrign', s:ignore()], - \ 'default_input': ['s:deftxt', 0], - \ 'dont_split': ['s:nosplit', 'netrw'], - \ 'dotfiles': ['s:showhidden', 0], - \ 'extensions': ['s:extensions', []], - \ 'follow_symlinks': ['s:folsym', 0], - \ 'highlight_match': ['s:mathi', [1, 'CtrlPMatch']], - \ 'jump_to_buffer': ['s:jmptobuf', 'Et'], - \ 'key_loop': ['s:keyloop', 0], - \ 'lazy_update': ['s:lazy', 0], - \ 'match_func': ['s:matcher', {}], - \ 'match_window_bottom': ['s:mwbottom', 1], - \ 'match_window_reversed': ['s:mwreverse', 1], - \ 'max_depth': ['s:maxdepth', 40], - \ 'max_files': ['s:maxfiles', 10000], - \ 'max_height': ['s:mxheight', 10], - \ 'max_history': ['s:maxhst', exists('+hi') ? &hi : 20], - \ 'mruf_default_order': ['s:mrudef', 0], - \ 'open_func': ['s:openfunc', {}], - \ 'open_multi': ['s:opmul', '1v'], - \ 'open_new_file': ['s:newfop', 'v'], - \ 'prompt_mappings': ['s:urprtmaps', 0], - \ 'regexp_search': ['s:regexp', 0], - \ 'root_markers': ['s:rmarkers', []], - \ 'split_window': ['s:splitwin', 0], - \ 'status_func': ['s:status', {}], - \ 'tabpage_position': ['s:tabpage', 'ac'], - \ 'use_caching': ['s:caching', 1], - \ 'use_migemo': ['s:migemo', 0], - \ 'user_command': ['s:usrcmd', ''], - \ 'working_path_mode': ['s:pathmode', 'ra'], - \ }, { - \ 'open_multiple_files': 's:opmul', - \ 'regexp': 's:regexp', - \ 'reuse_window': 's:nosplit', - \ 'show_hidden': 's:showhidden', - \ 'switch_buffer': 's:jmptobuf', - \ }, { - \ 'root_markers': 's:rmarkers', - \ 'user_command': 's:usrcmd', - \ 'working_path_mode': 's:pathmode', - \ }] - -" Global options -let s:glbs = { 'magic': 1, 'to': 1, 'tm': 0, 'sb': 1, 'hls': 0, 'im': 0, - \ 'report': 9999, 'sc': 0, 'ss': 0, 'siso': 0, 'mfd': 200, 'mouse': 'n', - \ 'gcr': 'a:blinkon0', 'ic': 1, 'lmap': '', 'mousef': 0, 'imd': 1 } - -" Keymaps -let [s:lcmap, s:prtmaps] = ['nn ', { - \ 'PrtBS()': ['', ''], - \ 'PrtDelete()': [''], - \ 'PrtDeleteWord()': [''], - \ 'PrtClear()': [''], - \ 'PrtSelectMove("j")': ['', ''], - \ 'PrtSelectMove("k")': ['', ''], - \ 'PrtSelectMove("t")': ['', ''], - \ 'PrtSelectMove("b")': ['', ''], - \ 'PrtSelectMove("u")': ['', ''], - \ 'PrtSelectMove("d")': ['', ''], - \ 'PrtHistory(-1)': [''], - \ 'PrtHistory(1)': [''], - \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], - \ 'AcceptSelection("h")': ['', '', ''], - \ 'AcceptSelection("t")': [''], - \ 'AcceptSelection("v")': ['', ''], - \ 'ToggleFocus()': [''], - \ 'ToggleRegex()': [''], - \ 'ToggleByFname()': [''], - \ 'ToggleType(1)': ['', ''], - \ 'ToggleType(-1)': ['', ''], - \ 'PrtExpandDir()': [''], - \ 'PrtInsert("c")': ['', ''], - \ 'PrtInsert()': [''], - \ 'PrtCurStart()': [''], - \ 'PrtCurEnd()': [''], - \ 'PrtCurLeft()': ['', '', ''], - \ 'PrtCurRight()': ['', ''], - \ 'PrtClearCache()': [''], - \ 'PrtDeleteEnt()': [''], - \ 'CreateNewFile()': [''], - \ 'MarkToOpen()': [''], - \ 'OpenMulti()': [''], - \ 'PrtExit()': ['', '', ''], - \ }] - -if !has('gui_running') - cal add(s:prtmaps['PrtBS()'], remove(s:prtmaps['PrtCurLeft()'], 0)) -en - -let s:compare_lim = 3000 - -let s:ficounts = {} - -let s:ccex = s:pref.'clear_cache_on_exit' - -" Regexp -let s:fpats = { - \ '^\(\\|\)\|\(\\|\)$': '\\|', - \ '^\\\(zs\|ze\|<\|>\)': '^\\\(zs\|ze\|<\|>\)', - \ '^\S\*$': '\*', - \ '^\S\\?$': '\\?', - \ } - -" Keypad -let s:kprange = { - \ 'Plus': '+', - \ 'Minus': '-', - \ 'Divide': '/', - \ 'Multiply': '*', - \ 'Point': '.', - \ } - -" Highlight groups -let s:hlgrps = { - \ 'NoEntries': 'Error', - \ 'Mode1': 'Character', - \ 'Mode2': 'LineNr', - \ 'Stats': 'Function', - \ 'Match': 'Identifier', - \ 'PrtBase': 'Comment', - \ 'PrtText': 'Normal', - \ 'PrtCursor': 'Constant', - \ } -" s:opts() {{{2 -fu! s:opts(...) - unl! s:usrign s:usrcmd s:urprtmaps - for each in ['byfname', 'regexp', 'extensions'] | if exists('s:'.each) - let {each} = s:{each} - en | endfo - for [ke, va] in items(s:opts) - let {va[0]} = exists(s:pref.ke) ? {s:pref.ke} : va[1] - endfo - unl va - for [ke, va] in items(s:new_opts) - let {va} = {exists(s:pref.ke) ? s:pref.ke : va} - endfo - unl va - for [ke, va] in items(s:lc_opts) - if exists(s:bpref.ke) - unl {va} - let {va} = {s:bpref.ke} - en - endfo - if a:0 && a:1 != {} - unl va - for [ke, va] in items(a:1) - let opke = substitute(ke, '\(\w:\)\?ctrlp_', '', '') - if has_key(s:lc_opts, opke) - let sva = s:lc_opts[opke] - unl {sva} - let {sva} = va - en - endfo - en - for each in ['byfname', 'regexp'] | if exists(each) - let s:{each} = {each} - en | endfo - if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en - let s:maxdepth = min([s:maxdepth, 100]) - let s:mxheight = max([s:mxheight, 1]) - let s:glob = s:showhidden ? '.*\|*' : '*' - let s:igntype = empty(s:usrign) ? -1 : type(s:usrign) - let s:lash = ctrlp#utils#lash() - if s:keyloop - let [s:lazy, s:glbs['imd']] = [0, 0] - en - if s:lazy - cal extend(s:glbs, { 'ut': ( s:lazy > 1 ? s:lazy : 250 ) }) - en - " Extensions - if !( exists('extensions') && extensions == s:extensions ) - for each in s:extensions - exe 'ru autoload/ctrlp/'.each.'.vim' - endfo - en - " Keymaps - if type(s:urprtmaps) == 4 - cal extend(s:prtmaps, s:urprtmaps) - en -endf -"}}}1 -" * Open & Close {{{1 -fu! s:Open() - cal s:log(1) - cal s:getenv() - cal s:execextvar('enter') - sil! exe 'keepa' ( s:mwbottom ? 'bo' : 'to' ) '1new ControlP' - cal s:buffunc(1) - let [s:bufnr, s:winw] = [bufnr('%'), winwidth(0)] - let [s:focus, s:prompt] = [1, ['', '', '']] - abc - if !exists('s:hstry') - let hst = filereadable(s:gethistloc()[1]) ? s:gethistdata() : [''] - let s:hstry = empty(hst) || !s:maxhst ? [''] : hst - en - for [ke, va] in items(s:glbs) | if exists('+'.ke) - sil! exe 'let s:glb_'.ke.' = &'.ke.' | let &'.ke.' = '.string(va) - en | endfo - if s:opmul != '0' && has('signs') - sign define ctrlpmark text=+> texthl=Search - en - cal s:setupblank() -endf - -fu! s:Close() - cal s:buffunc(0) - try | bun! - cat | clo! | endt - cal s:unmarksigns() - for key in keys(s:glbs) | if exists('+'.key) - sil! exe 'let &'.key.' = s:glb_'.key - en | endfo - if exists('s:glb_acd') | let &acd = s:glb_acd | en - let g:ctrlp_lines = [] - if s:winres[1] >= &lines && s:winres[2] == winnr('$') - exe s:winres[0].s:winres[0] - en - unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:cline s:init s:savestr - \ s:mrbs s:did_exp - cal ctrlp#recordhist() - cal s:execextvar('exit') - cal s:log(0) - let v:errmsg = s:ermsg - ec -endf -" * Clear caches {{{1 -fu! ctrlp#clr(...) - let [s:matches, g:ctrlp_new{ a:0 ? a:1 : 'cache' }] = [1, 1] -endf - -fu! ctrlp#clra() - let cadir = ctrlp#utils#cachedir() - if isdirectory(cadir) - let cafiles = split(s:glbpath(s:fnesc(cadir, 'g', ','), '**', 1), "\n") - let eval = '!isdirectory(v:val) && fnamemodify(v:val, ":t") !~' - \ . ' ''\v^[.a-z]+$|\.log$''' - sil! cal map(filter(cafiles, eval), 'delete(v:val)') - en - cal ctrlp#clr() -endf - -fu! s:Reset(args) - let opts = has_key(a:args, 'opts') ? [a:args['opts']] : [] - cal call('s:opts', opts) - cal s:autocmds() - cal ctrlp#utils#opts() - cal s:execextvar('opts') -endf -" * Files {{{1 -fu! ctrlp#files() - let cafile = ctrlp#utils#cachefile() - if g:ctrlp_newcache || !filereadable(cafile) || s:nocache(cafile) - let [lscmd, s:initcwd, g:ctrlp_allfiles] = [s:lsCmd(), s:dyncwd, []] - " Get the list of files - if empty(lscmd) - cal s:GlobPath(s:fnesc(s:dyncwd, 'g', ','), 0) - el - sil! cal ctrlp#progress('Indexing...') - try | cal s:UserCmd(lscmd) - cat | retu [] | endt - en - " Remove base directory - cal ctrlp#rmbasedir(g:ctrlp_allfiles) - if len(g:ctrlp_allfiles) <= s:compare_lim - cal sort(g:ctrlp_allfiles, 'ctrlp#complen') - en - cal s:writecache(cafile) - let catime = getftime(cafile) - el - let catime = getftime(cafile) - if !( exists('s:initcwd') && s:initcwd == s:dyncwd ) - \ || get(s:ficounts, s:dyncwd, [0, catime])[1] != catime - let s:initcwd = s:dyncwd - let g:ctrlp_allfiles = ctrlp#utils#readfile(cafile) - en - en - cal extend(s:ficounts, { s:dyncwd : [len(g:ctrlp_allfiles), catime] }) - retu g:ctrlp_allfiles -endf - -fu! s:GlobPath(dirs, depth) - let entries = split(globpath(a:dirs, s:glob), "\n") - let [dnf, depth] = [ctrlp#dirnfile(entries), a:depth + 1] - cal extend(g:ctrlp_allfiles, dnf[1]) - if !empty(dnf[0]) && !s:maxf(len(g:ctrlp_allfiles)) && depth <= s:maxdepth - sil! cal ctrlp#progress(len(g:ctrlp_allfiles), 1) - cal s:GlobPath(join(map(dnf[0], 's:fnesc(v:val, "g", ",")'), ','), depth) - en -endf - -fu! s:UserCmd(lscmd) - let [path, lscmd] = [s:dyncwd, a:lscmd] - if exists('+ssl') && &ssl - let [ssl, &ssl, path] = [&ssl, 0, tr(path, '/', '\')] - en - if has('win32') || has('win64') - let lscmd = substitute(lscmd, '\v(^|&&\s*)\zscd (/d)@!', 'cd /d ', '') - en - let path = exists('*shellescape') ? shellescape(path) : path - let g:ctrlp_allfiles = split(system(printf(lscmd, path)), "\n") - if exists('+ssl') && exists('ssl') - let &ssl = ssl - cal map(g:ctrlp_allfiles, 'tr(v:val, "\\", "/")') - en - if exists('s:vcscmd') && s:vcscmd - cal map(g:ctrlp_allfiles, 'tr(v:val, "/", "\\")') - en - if type(s:usrcmd) == 4 && has_key(s:usrcmd, 'ignore') && s:usrcmd['ignore'] - if !empty(s:usrign) - let g:ctrlp_allfiles = ctrlp#dirnfile(g:ctrlp_allfiles)[1] - en - if &wig != '' - cal filter(g:ctrlp_allfiles, 'glob(v:val) != ""') - en - en -endf - -fu! s:lsCmd() - let cmd = s:usrcmd - if type(cmd) == 1 - retu cmd - elsei type(cmd) == 3 && len(cmd) >= 2 && cmd[:1] != ['', ''] - if s:findroot(s:dyncwd, cmd[0], 0, 1) == [] - retu len(cmd) == 3 ? cmd[2] : '' - en - let s:vcscmd = s:lash == '\' - retu cmd[1] - elsei type(cmd) == 4 && ( has_key(cmd, 'types') || has_key(cmd, 'fallback') ) - let fndroot = [] - if has_key(cmd, 'types') && cmd['types'] != {} - let [markrs, cmdtypes] = [[], values(cmd['types'])] - for pair in cmdtypes - cal add(markrs, pair[0]) - endfo - let fndroot = s:findroot(s:dyncwd, markrs, 0, 1) - en - if fndroot == [] - retu has_key(cmd, 'fallback') ? cmd['fallback'] : '' - en - for pair in cmdtypes - if pair[0] == fndroot[0] | brea | en - endfo - let s:vcscmd = s:lash == '\' - retu pair[1] - en -endf -" - Buffers {{{1 -fu! ctrlp#buffers(...) - let ids = sort(filter(range(1, bufnr('$')), 'empty(getbufvar(v:val, "&bt"))' - \ .' && getbufvar(v:val, "&bl") && strlen(bufname(v:val))'), 's:compmreb') - retu a:0 && a:1 == 'id' ? ids : map(ids, 'fnamemodify(bufname(v:val), ":.")') -endf -" * MatchedItems() {{{1 -fu! s:MatchIt(items, pat, limit, exc) - let [lines, id] = [[], 0] - let pat = - \ s:byfname ? map(split(a:pat, '^[^;]\+\\\@= 0 - cal add(lines, item) - en | cat | brea | endt - if a:limit > 0 && len(lines) >= a:limit | brea | en - endfo - let s:mdata = [s:dyncwd, s:itemtype, s:regexp, s:sublist(a:items, id, -1)] - retu lines -endf - -fu! s:MatchedItems(items, pat, limit) - let exc = exists('s:crfilerel') ? s:crfilerel : '' - let items = s:narrowable() ? s:matched + s:mdata[3] : a:items - if s:matcher != {} - let argms = [items, a:pat, a:limit, s:mmode(), s:ispath, exc, s:regexp] - let lines = call(s:matcher['match'], argms, s:matcher) - el - let lines = s:MatchIt(items, a:pat, a:limit, exc) - en - let s:matches = len(lines) - unl! s:did_exp - retu lines -endf - -fu! s:SplitPattern(str) - let str = a:str - if s:migemo && s:regexp && len(str) > 0 && executable('cmigemo') - let str = s:migemo(str) - en - let s:savestr = str - if s:regexp - let pat = s:regexfilter(str) - el - let lst = split(str, '\zs') - if exists('+ssl') && !&ssl - cal map(lst, 'escape(v:val, ''\'')') - en - for each in ['^', '$', '.'] - cal map(lst, 'escape(v:val, each)') - endfo - en - if exists('lst') - let pat = '' - if !empty(lst) - if s:byfname && index(lst, ';') > 0 - let fbar = index(lst, ';') - let lst_1 = s:sublist(lst, 0, fbar - 1) - let lst_2 = len(lst) - 1 > fbar ? s:sublist(lst, fbar + 1, -1) : [''] - let pat = s:buildpat(lst_1).';'.s:buildpat(lst_2) - el - let pat = s:buildpat(lst) - en - en - en - retu escape(pat, '~') -endf -" * BuildPrompt() {{{1 -fu! s:Render(lines, pat) - let [&ma, lines, s:height] = [1, a:lines, min([len(a:lines), s:winh])] - let pat = s:byfname ? split(a:pat, '^[^;]\+\\\@' ).( s:byfname ? 'd' : '>' ).'> ' - let str = escape(s:getinput(), '\') - let lazy = str == '' || exists('s:force') || !has('autocmd') ? 0 : s:lazy - if a:upd && !lazy && ( s:matches || s:regexp || exists('s:did_exp') - \ || str =~ '\(\\\(<\|>\)\|[*|]\)\|\(\\\:\([^:]\|\\:\)*$\)' ) - sil! cal s:Update(str) - en - sil! cal ctrlp#statusline() - " Toggling - let [hiactive, hicursor, base] = s:focus - \ ? ['CtrlPPrtText', 'CtrlPPrtCursor', base] - \ : ['CtrlPPrtBase', 'CtrlPPrtBase', tr(base, '>', '-')] - let hibase = 'CtrlPPrtBase' - " Build it - redr - let prt = copy(s:prompt) - cal map(prt, 'escape(v:val, ''"\'')') - exe 'echoh' hibase '| echon "'.base.'" - \ | echoh' hiactive '| echon "'.prt[0].'" - \ | echoh' hicursor '| echon "'.prt[1].'" - \ | echoh' hiactive '| echon "'.prt[2].'" | echoh None' - " Append the cursor at the end - if empty(prt[1]) && s:focus - exe 'echoh' hibase '| echon "_" | echoh None' - en -endf -" - SetDefTxt() {{{1 -fu! s:SetDefTxt() - if s:deftxt == '0' || ( s:deftxt == 1 && !s:ispath ) | retu | en - let txt = s:deftxt - if !type(txt) - let txt = txt && !stridx(s:crfpath, s:dyncwd) - \ ? ctrlp#rmbasedir([s:crfpath])[0] : '' - let txt = txt != '' ? txt.s:lash(s:crfpath) : '' - el - let txt = expand(txt, 1) - en - let s:prompt[0] = txt -endf -" ** Prt Actions {{{1 -" Editing {{{2 -fu! s:PrtClear() - if !s:focus | retu | en - unl! s:hstgot - let [s:prompt, s:matches] = [['', '', ''], 1] - cal s:BuildPrompt(1) -endf - -fu! s:PrtAdd(char) - unl! s:hstgot - let s:act_add = 1 - let s:prompt[0] .= a:char - cal s:BuildPrompt(1) - unl s:act_add -endf - -fu! s:PrtBS() - if !s:focus | retu | en - unl! s:hstgot - let [s:prompt[0], s:matches] = [substitute(s:prompt[0], '.$', '', ''), 1] - cal s:BuildPrompt(1) -endf - -fu! s:PrtDelete() - if !s:focus | retu | en - unl! s:hstgot - let [prt, s:matches] = [s:prompt, 1] - let prt[1] = matchstr(prt[2], '^.') - let prt[2] = substitute(prt[2], '^.', '', '') - cal s:BuildPrompt(1) -endf - -fu! s:PrtDeleteWord() - if !s:focus | retu | en - unl! s:hstgot - let [str, s:matches] = [s:prompt[0], 1] - let str = str =~ '\W\w\+$' ? matchstr(str, '^.\+\W\ze\w\+$') - \ : str =~ '\w\W\+$' ? matchstr(str, '^.\+\w\ze\W\+$') - \ : str =~ '\s\+$' ? matchstr(str, '^.*\S\ze\s\+$') - \ : str =~ '\v^(\S+|\s+)$' ? '' : str - let s:prompt[0] = str - cal s:BuildPrompt(1) -endf - -fu! s:PrtInsert(...) - if !s:focus | retu | en - let type = !a:0 ? '' : a:1 - if !a:0 - let type = s:insertstr() - if type == 'cancel' | retu | en - en - if type ==# 'r' - let regcont = s:getregs() - if regcont < 0 | retu | en - en - unl! s:hstgot - let s:act_add = 1 - let s:prompt[0] .= type ==# 'w' ? s:crword - \ : type ==# 'f' ? s:crgfile - \ : type ==# 's' ? s:regisfilter('/') - \ : type ==# 'v' ? s:crvisual - \ : type ==# 'c' ? s:regisfilter('+') - \ : type ==# 'r' ? regcont : '' - cal s:BuildPrompt(1) - unl s:act_add -endf - -fu! s:PrtExpandDir() - if !s:focus | retu | en - let str = s:getinput('c') - if str =~ '\v^\@(cd|lc[hd]?|chd)\s.+' && s:spi - let hasat = split(str, '\v^\@(cd|lc[hd]?|chd)\s*\zs') - let str = get(hasat, 1, '') - en - if str == '' | retu | en - unl! s:hstgot - let s:act_add = 1 - let [base, seed] = s:headntail(str) - let dirs = s:dircompl(base, seed) - if len(dirs) == 1 - let str = dirs[0] - elsei len(dirs) > 1 - let str .= s:findcommon(dirs, str) - en - let s:prompt[0] = exists('hasat') ? hasat[0].str : str - cal s:BuildPrompt(1) - unl s:act_add -endf -" Movement {{{2 -fu! s:PrtCurLeft() - if !s:focus | retu | en - let prt = s:prompt - if !empty(prt[0]) - let s:prompt = [substitute(prt[0], '.$', '', ''), matchstr(prt[0], '.$'), - \ prt[1] . prt[2]] - en - cal s:BuildPrompt(0) -endf - -fu! s:PrtCurRight() - if !s:focus | retu | en - let prt = s:prompt - let s:prompt = [prt[0] . prt[1], matchstr(prt[2], '^.'), - \ substitute(prt[2], '^.', '', '')] - cal s:BuildPrompt(0) -endf - -fu! s:PrtCurStart() - if !s:focus | retu | en - let str = join(s:prompt, '') - let s:prompt = ['', matchstr(str, '^.'), substitute(str, '^.', '', '')] - cal s:BuildPrompt(0) -endf - -fu! s:PrtCurEnd() - if !s:focus | retu | en - let s:prompt = [join(s:prompt, ''), '', ''] - cal s:BuildPrompt(0) -endf - -fu! s:PrtSelectMove(dir) - let wht = winheight(0) - let dirs = {'t': 'gg','b': 'G','j': 'j','k': 'k','u': wht.'k','d': wht.'j'} - exe 'keepj norm!' dirs[a:dir] - if s:nolim != 1 | let s:cline = line('.') | en - if line('$') > winheight(0) | cal s:BuildPrompt(0) | en -endf - -fu! s:PrtSelectJump(char) - let lines = copy(s:lines) - if s:byfname - cal map(lines, 'split(v:val, ''[\/]\ze[^\/]\+$'')[-1]') - en - " Cycle through matches, use s:jmpchr to store last jump - let chr = escape(matchstr(a:char, '^.'), '.~') - let smartcs = &scs && chr =~ '\u' ? '\C' : '' - if match(lines, smartcs.'^'.chr) >= 0 - " If not exists or does but not for the same char - let pos = match(lines, smartcs.'^'.chr) - if !exists('s:jmpchr') || ( exists('s:jmpchr') && s:jmpchr[0] != chr ) - let [jmpln, s:jmpchr] = [pos, [chr, pos]] - elsei exists('s:jmpchr') && s:jmpchr[0] == chr - " Start of lines - if s:jmpchr[1] == -1 | let s:jmpchr[1] = pos | en - let npos = match(lines, smartcs.'^'.chr, s:jmpchr[1] + 1) - let [jmpln, s:jmpchr] = [npos == -1 ? pos : npos, [chr, npos]] - en - exe 'keepj norm!' ( jmpln + 1 ).'G' - if s:nolim != 1 | let s:cline = line('.') | en - if line('$') > winheight(0) | cal s:BuildPrompt(0) | en - en -endf -" Misc {{{2 -fu! s:PrtFocusMap(char) - cal call(( s:focus ? 's:PrtAdd' : 's:PrtSelectJump' ), [a:char]) -endf - -fu! s:PrtClearCache() - if s:itemtype == 0 - cal ctrlp#clr() - elsei s:itemtype > 2 - cal ctrlp#clr(s:statypes[s:itemtype][1]) - en - if s:itemtype == 2 - let g:ctrlp_lines = ctrlp#mrufiles#refresh() - el - cal ctrlp#setlines() - en - let s:force = 1 - cal s:BuildPrompt(1) - unl s:force -endf - -fu! s:PrtDeleteEnt() - if s:itemtype == 2 - cal s:PrtDeleteMRU() - elsei type(s:getextvar('wipe')) == 1 - cal s:delent(s:getextvar('wipe')) - en -endf - -fu! s:PrtDeleteMRU() - if s:itemtype == 2 - cal s:delent('ctrlp#mrufiles#remove') - en -endf - -fu! s:PrtExit() - if bufnr('%') == s:bufnr && bufname('%') == 'ControlP' - if !has('autocmd') | cal s:Close() | en - exe ( winnr('$') == 1 ? 'bw!' : 'winc p' ) - en -endf - -fu! s:PrtHistory(...) - if !s:focus || !s:maxhst | retu | en - let [str, hst, s:matches] = [join(s:prompt, ''), s:hstry, 1] - " Save to history if not saved before - let [hst[0], hslen] = [exists('s:hstgot') ? hst[0] : str, len(hst)] - let idx = exists('s:hisidx') ? s:hisidx + a:1 : a:1 - " Limit idx within 0 and hslen - let idx = idx < 0 ? 0 : idx >= hslen ? hslen > 1 ? hslen - 1 : 0 : idx - let s:prompt = [hst[idx], '', ''] - let [s:hisidx, s:hstgot, s:force] = [idx, 1, 1] - cal s:BuildPrompt(1) - unl s:force -endf -"}}}1 -" * Mappings {{{1 -fu! s:MapNorms() - if exists('s:nmapped') && s:nmapped == s:bufnr | retu | en - let pcmd = "nn \ \ \ :\cal \%s(\"%s\")\" - let cmd = substitute(pcmd, 'k%s', 'char-%d', '') - let pfunc = 'PrtFocusMap' - let ranges = [32, 33, 125, 126] + range(35, 91) + range(93, 123) - for each in [34, 92, 124] - exe printf(cmd, each, pfunc, escape(nr2char(each), '"|\')) - endfo - for each in ranges - exe printf(cmd, each, pfunc, nr2char(each)) - endfo - for each in range(0, 9) - exe printf(pcmd, each, pfunc, each) - endfo - for [ke, va] in items(s:kprange) - exe printf(pcmd, ke, pfunc, va) - endfo - let s:nmapped = s:bufnr -endf - -fu! s:MapSpecs() - if !( exists('s:smapped') && s:smapped == s:bufnr ) - " Correct arrow keys in terminal - if ( has('termresponse') && v:termresponse =~ "\" ) - \ || &term =~? '\vxterm|','\B ','\C ','\D '] - exe s:lcmap.' ['.each - endfo - en - en - for [ke, va] in items(s:prtmaps) | for kp in va - exe s:lcmap kp ':cal '.ke.'' - endfo | endfo - let s:smapped = s:bufnr -endf - -fu! s:KeyLoop() - wh exists('s:init') && s:keyloop - redr - let nr = getchar() - let chr = !type(nr) ? nr2char(nr) : nr - if nr >=# 0x20 - cal s:PrtFocusMap(chr) - el - let cmd = matchstr(maparg(chr), ':\zs.\+\ze$') - exe ( cmd != '' ? cmd : 'norm '.chr ) - en - endw -endf -" * Toggling {{{1 -fu! s:ToggleFocus() - let s:focus = !s:focus - cal s:BuildPrompt(0) -endf - -fu! s:ToggleRegex() - let s:regexp = !s:regexp - cal s:PrtSwitcher() -endf - -fu! s:ToggleByFname() - if s:ispath - let s:byfname = !s:byfname - let s:mfunc = s:mfunc() - cal s:PrtSwitcher() - en -endf - -fu! s:ToggleType(dir) - let max = len(g:ctrlp_ext_vars) + 2 - let next = s:walker(max, s:itemtype, a:dir) - cal ctrlp#syntax() - cal ctrlp#setlines(next) - cal s:PrtSwitcher() -endf - -fu! s:ToggleKeyLoop() - let s:keyloop = !s:keyloop - if exists('+imd') - let &imd = !s:keyloop - en - if s:keyloop - let [&ut, s:lazy] = [0, 0] - cal s:KeyLoop() - elsei has_key(s:glbs, 'ut') - let [&ut, s:lazy] = [s:glbs['ut'], 1] - en -endf - -fu! s:PrtSwitcher() - let [s:force, s:matches] = [1, 1] - cal s:BuildPrompt(1) - unl s:force -endf -" - SetWD() {{{1 -fu! s:SetWD(args) - if has_key(a:args, 'args') && stridx(a:args['args'], '--dir') >= 0 - \ && exists('s:dyncwd') - cal ctrlp#setdir(s:dyncwd) | retu - en - if has_key(a:args, 'dir') && a:args['dir'] != '' - cal ctrlp#setdir(a:args['dir']) | retu - en - let pmode = has_key(a:args, 'mode') ? a:args['mode'] : s:pathmode - let [s:crfilerel, s:dyncwd] = [fnamemodify(s:crfile, ':.'), getcwd()] - if s:crfile =~ '^.\+://' | retu | en - if pmode =~ 'c' || ( pmode =~ 'a' && stridx(s:crfpath, s:cwd) < 0 ) - \ || ( !type(pmode) && pmode ) - if exists('+acd') | let [s:glb_acd, &acd] = [&acd, 0] | en - cal ctrlp#setdir(s:crfpath) - en - if pmode =~ 'r' || pmode == 2 - let markers = ['.git', '.hg', '.svn', '.bzr', '_darcs'] - let spath = pmode =~ 'd' ? s:dyncwd : pmode =~ 'w' ? s:cwd : s:crfpath - if type(s:rmarkers) == 3 && !empty(s:rmarkers) - if s:findroot(spath, s:rmarkers, 0, 0) != [] | retu | en - cal filter(markers, 'index(s:rmarkers, v:val) < 0') - en - cal s:findroot(spath, markers, 0, 0) - en -endf -" * AcceptSelection() {{{1 -fu! ctrlp#acceptfile(mode, line, ...) - let [md, filpath] = [a:mode, fnamemodify(a:line, ':p')] - cal s:PrtExit() - let [bufnr, tail] = [bufnr('^'.filpath.'$'), s:tail()] - let j2l = a:0 ? a:1 : matchstr(tail, '^ +\zs\d\+$') - if ( s:jmptobuf =~ md || ( s:jmptobuf && md =~ '[et]' ) ) && bufnr > 0 - \ && !( md == 'e' && bufnr == bufnr('%') ) - let [jmpb, bufwinnr] = [1, bufwinnr(bufnr)] - let buftab = ( s:jmptobuf =~# '[tTVH]' || s:jmptobuf > 1 ) - \ ? s:buftab(bufnr, md) : [0, 0] - en - " Switch to existing buffer or open new one - if exists('jmpb') && bufwinnr > 0 - \ && !( md == 't' && ( s:jmptobuf !~# toupper(md) || buftab[0] ) ) - exe bufwinnr.'winc w' - if j2l | cal ctrlp#j2l(j2l) | en - elsei exists('jmpb') && buftab[0] - \ && !( md =~ '[evh]' && s:jmptobuf !~# toupper(md) ) - exe 'tabn' buftab[0] - exe buftab[1].'winc w' - if j2l | cal ctrlp#j2l(j2l) | en - el - " Determine the command to use - let useb = bufnr > 0 && buflisted(bufnr) && empty(tail) - let cmd = - \ md == 't' || s:splitwin == 1 ? ( useb ? 'tab sb' : 'tabe' ) : - \ md == 'h' || s:splitwin == 2 ? ( useb ? 'sb' : 'new' ) : - \ md == 'v' || s:splitwin == 3 ? ( useb ? 'vert sb' : 'vne' ) : - \ call('ctrlp#normcmd', useb ? ['b', 'bo vert sb'] : ['e']) - " Reset &switchbuf option - let [swb, &swb] = [&swb, ''] - " Open new window/buffer - let [fid, tail] = [( useb ? bufnr : filpath ), ( a:0 ? ' +'.a:1 : tail )] - let args = [cmd, fid, tail, 1, [useb, j2l]] - cal call('s:openfile', args) - let &swb = swb - en -endf - -fu! s:SpecInputs(str) - if a:str =~ '\v^(\.\.([\/]\.\.)*[\/]?[.\/]*)$' && s:spi - let cwd = s:dyncwd - cal ctrlp#setdir(a:str =~ '^\.\.\.*$' ? - \ '../'.repeat('../', strlen(a:str) - 2) : a:str) - if cwd != s:dyncwd | cal ctrlp#setlines() | en - cal s:PrtClear() - retu 1 - elsei a:str == s:lash && s:spi - cal s:SetWD({ 'mode': 'rd' }) - cal ctrlp#setlines() - cal s:PrtClear() - retu 1 - elsei a:str =~ '^@.\+' && s:spi - retu s:at(a:str) - elsei a:str == '?' - cal s:PrtExit() - let hlpwin = &columns > 159 ? '| vert res 80' : '' - sil! exe 'bo vert h ctrlp-mappings' hlpwin '| norm! 0' - retu 1 - en - retu 0 -endf - -fu! s:AcceptSelection(mode) - if a:mode != 'e' && s:OpenMulti(a:mode) != -1 | retu | en - let str = s:getinput() - if a:mode == 'e' | if s:SpecInputs(str) | retu | en | en - " Get the selected line - let line = ctrlp#getcline() - if a:mode != 'e' && !s:itemtype && line == '' - \ && str !~ '\v^(\.\.([\/]\.\.)*[\/]?[.\/]*|/|\\|\?|\@.+)$' - cal s:CreateNewFile(a:mode) | retu - en - if empty(line) | retu | en - " Do something with it - if s:openfunc != {} && has_key(s:openfunc, s:ctype) - let actfunc = s:openfunc[s:ctype] - el - let actfunc = s:itemtype < 3 ? 'ctrlp#acceptfile' : s:getextvar('accept') - en - cal call(actfunc, [a:mode, line]) -endf -" - CreateNewFile() {{{1 -fu! s:CreateNewFile(...) - let [md, str] = ['', s:getinput('n')] - if empty(str) | retu | en - if s:argmap && !a:0 - " Get the extra argument - let md = s:argmaps(md, 1) - if md == 'cancel' | retu | en - en - let str = s:sanstail(str) - let [base, fname] = s:headntail(str) - if fname =~ '^[\/]$' | retu | en - if exists('s:marked') && len(s:marked) - " Use the first marked file's path - let path = fnamemodify(values(s:marked)[0], ':p:h') - let base = path.s:lash(path).base - let str = fnamemodify(base.s:lash.fname, ':.') - en - if base != '' | if isdirectory(ctrlp#utils#mkdir(base)) - let optyp = str | en | el | let optyp = fname - en - if !exists('optyp') | retu | en - let [filpath, tail] = [fnamemodify(optyp, ':p'), s:tail()] - if !stridx(filpath, s:dyncwd) | cal s:insertcache(str) | en - cal s:PrtExit() - let cmd = md == 'r' ? ctrlp#normcmd('e') : - \ s:newfop =~ '1\|t' || ( a:0 && a:1 == 't' ) || md == 't' ? 'tabe' : - \ s:newfop =~ '2\|h' || ( a:0 && a:1 == 'h' ) || md == 'h' ? 'new' : - \ s:newfop =~ '3\|v' || ( a:0 && a:1 == 'v' ) || md == 'v' ? 'vne' : - \ ctrlp#normcmd('e') - cal s:openfile(cmd, filpath, tail, 1) -endf -" * OpenMulti() {{{1 -fu! s:MarkToOpen() - if s:bufnr <= 0 || s:opmul == '0' - \ || ( s:itemtype > 2 && s:getextvar('opmul') != 1 ) - retu - en - let line = ctrlp#getcline() - if empty(line) | retu | en - let filpath = s:ispath ? fnamemodify(line, ':p') : line - if exists('s:marked') && s:dictindex(s:marked, filpath) > 0 - " Unmark and remove the file from s:marked - let key = s:dictindex(s:marked, filpath) - cal remove(s:marked, key) - if empty(s:marked) | unl s:marked | en - if has('signs') - exe 'sign unplace' key 'buffer='.s:bufnr - en - el - " Add to s:marked and place a new sign - if exists('s:marked') - let vac = s:vacantdict(s:marked) - let key = empty(vac) ? len(s:marked) + 1 : vac[0] - let s:marked = extend(s:marked, { key : filpath }) - el - let [key, s:marked] = [1, { 1 : filpath }] - en - if has('signs') - exe 'sign place' key 'line='.line('.').' name=ctrlpmark buffer='.s:bufnr - en - en - sil! cal ctrlp#statusline() -endf - -fu! s:OpenMulti(...) - let has_marked = exists('s:marked') - if ( !has_marked && a:0 ) || s:opmul == '0' || !s:ispath - \ || ( s:itemtype > 2 && s:getextvar('opmul') != 1 ) - retu -1 - en - " Get the options - let [nr, md] = [matchstr(s:opmul, '\d\+'), matchstr(s:opmul, '[thvi]')] - let [ur, jf] = [s:opmul =~ 'r', s:opmul =~ 'j'] - let md = a:0 ? a:1 : ( md == '' ? 'v' : md ) - let nopt = exists('g:ctrlp_open_multiple_files') - if !has_marked - let line = ctrlp#getcline() - if line == '' | retu | en - let marked = { 1 : fnamemodify(line, ':p') } - let [nr, ur, jf, nopt] = ['1', 0, 0, 1] - en - if ( s:argmap || !has_marked ) && !a:0 - let md = s:argmaps(md, !has_marked ? 2 : 0) - if md == 'c' - cal s:unmarksigns() - unl! s:marked - cal s:BuildPrompt(0) - elsei !has_marked && md =~ '[axd]' - retu s:OpenNoMarks(md, line) - en - if md =~ '\v^c(ancel)?$' | retu | en - let nr = nr == '0' ? ( nopt ? '' : '1' ) : nr - let ur = !has_marked && md == 'r' ? 1 : ur - en - let mkd = values(has_marked ? s:marked : marked) - cal s:sanstail(join(s:prompt, '')) - cal s:PrtExit() - if nr == '0' || md == 'i' - retu map(mkd, "s:openfile('bad', v:val, '', 0)") - en - let tail = s:tail() - let [emptytail, bufnr] = [empty(tail), bufnr('^'.mkd[0].'$')] - let useb = bufnr > 0 && buflisted(bufnr) && emptytail - " Move to a replaceable window - let ncmd = ( useb ? ['b', 'bo vert sb'] : ['e', 'bo vne'] ) - \ + ( ur ? [] : ['ignruw'] ) - let fst = call('ctrlp#normcmd', ncmd) - " Check if the current window has a replaceable buffer - let repabl = !( md == 't' && !ur ) && empty(bufname('%')) && empty(&l:ft) - " Commands for the rest of the files - let [ic, cmds] = [1, { 'v': ['vert sb', 'vne'], 'h': ['sb', 'new'], - \ 't': ['tab sb', 'tabe'] }] - let [swb, &swb] = [&swb, ''] - if md == 't' && ctrlp#tabcount() < tabpagenr() - let s:tabct = ctrlp#tabcount() - en - " Open the files - for va in mkd - let bufnr = bufnr('^'.va.'$') - if bufnr < 0 && getftype(va) == '' | con | en - let useb = bufnr > 0 && buflisted(bufnr) && emptytail - let snd = md != '' && has_key(cmds, md) ? - \ ( useb ? cmds[md][0] : cmds[md][1] ) : ( useb ? 'vert sb' : 'vne' ) - let cmd = ic == 1 && ( !( !ur && fst =~ '^[eb]$' ) || repabl ) ? fst : snd - let conds = [( nr != '' && nr > 1 && nr < ic ) || ( nr == '' && ic > 1 ), - \ nr != '' && nr < ic] - if conds[nopt] - if !buflisted(bufnr) | cal s:openfile('bad', va, '', 0) | en - el - cal s:openfile(cmd, useb ? bufnr : va, tail, ic == 1) - if jf | if ic == 1 - let crpos = [tabpagenr(), winnr()] - el - let crpos[0] += tabpagenr() <= crpos[0] - let crpos[1] += winnr() <= crpos[1] - en | en - let ic += 1 - en - endfo - if jf && exists('crpos') && ic > 2 - exe ( md == 't' ? 'tabn '.crpos[0] : crpos[1].'winc w' ) - en - let &swb = swb - unl! s:tabct -endf - -fu! s:OpenNoMarks(md, line) - if a:md == 'a' - let [s:marked, key] = [{}, 1] - for line in s:lines - let s:marked = extend(s:marked, { key : fnamemodify(line, ':p') }) - let key += 1 - endfo - cal s:remarksigns() - cal s:BuildPrompt(0) - elsei a:md == 'x' - cal call(s:openfunc[s:ctype], [a:md, a:line], s:openfunc) - elsei a:md == 'd' - let dir = fnamemodify(a:line, ':h') - if isdirectory(dir) - cal ctrlp#setdir(dir) - cal ctrlp#switchtype(0) - cal ctrlp#recordhist() - cal s:PrtClear() - en - en -endf -" ** Helper functions {{{1 -" Sorting {{{2 -fu! ctrlp#complen(...) - " By length - let [len1, len2] = [strlen(a:1), strlen(a:2)] - retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 -endf - -fu! s:compmatlen(...) - " By match length - let mln1 = s:shortest(s:matchlens(a:1, s:compat)) - let mln2 = s:shortest(s:matchlens(a:2, s:compat)) - retu mln1 == mln2 ? 0 : mln1 > mln2 ? 1 : -1 -endf - -fu! s:comptime(...) - " By last modified time - let [time1, time2] = [getftime(a:1), getftime(a:2)] - retu time1 == time2 ? 0 : time1 < time2 ? 1 : -1 -endf - -fu! s:compmreb(...) - " By last entered time (bufnr) - let [id1, id2] = [index(s:mrbs, a:1), index(s:mrbs, a:2)] - retu id1 == id2 ? 0 : id1 > id2 ? 1 : -1 -endf - -fu! s:compmref(...) - " By last entered time (MRU) - let [id1, id2] = [index(g:ctrlp_lines, a:1), index(g:ctrlp_lines, a:2)] - retu id1 == id2 ? 0 : id1 > id2 ? 1 : -1 -endf - -fu! s:comparent(...) - " By same parent dir - if !stridx(s:crfpath, s:dyncwd) - let [as1, as2] = [s:dyncwd.s:lash().a:1, s:dyncwd.s:lash().a:2] - let [loc1, loc2] = [s:getparent(as1), s:getparent(as2)] - if loc1 == s:crfpath && loc2 != s:crfpath | retu -1 | en - if loc2 == s:crfpath && loc1 != s:crfpath | retu 1 | en - retu 0 - en - retu 0 -endf - -fu! s:compfnlen(...) - " By filename length - let len1 = strlen(split(a:1, s:lash)[-1]) - let len2 = strlen(split(a:2, s:lash)[-1]) - retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 -endf - -fu! s:matchlens(str, pat, ...) - if empty(a:pat) || index(['^', '$'], a:pat) >= 0 | retu {} | en - let st = a:0 ? a:1 : 0 - let lens = a:0 >= 2 ? a:2 : {} - let nr = a:0 >= 3 ? a:3 : 0 - if nr > 20 | retu {} | en - if match(a:str, a:pat, st) >= 0 - let [mst, mnd] = [matchstr(a:str, a:pat, st), matchend(a:str, a:pat, st)] - let lens = extend(lens, { nr : [strlen(mst), mst] }) - let lens = s:matchlens(a:str, a:pat, mnd, lens, nr + 1) - en - retu lens -endf - -fu! s:shortest(lens) - retu min(map(values(a:lens), 'v:val[0]')) -endf - -fu! s:mixedsort(...) - let [cln, cml] = [ctrlp#complen(a:1, a:2), s:compmatlen(a:1, a:2)] - if s:ispath - let ms = [] - if s:height < 21 - let ms += [s:compfnlen(a:1, a:2)] - if s:itemtype !~ '^[12]$' | let ms += [s:comptime(a:1, a:2)] | en - if !s:itemtype | let ms += [s:comparent(a:1, a:2)] | en - en - if s:itemtype =~ '^[12]$' - let ms += [s:compmref(a:1, a:2)] - let cln = cml ? cln : 0 - en - let ms += [cml, 0, 0, 0] - let mp = call('s:multipliers', ms[:3]) - retu cln + ms[0] * mp[0] + ms[1] * mp[1] + ms[2] * mp[2] + ms[3] * mp[3] - en - retu cln + cml * 2 -endf - -fu! s:multipliers(...) - let mp0 = !a:1 ? 0 : 2 - let mp1 = !a:2 ? 0 : 1 + ( !mp0 ? 1 : mp0 ) - let mp2 = !a:3 ? 0 : 1 + ( !( mp0 + mp1 ) ? 1 : ( mp0 + mp1 ) ) - let mp3 = !a:4 ? 0 : 1 + ( !( mp0 + mp1 + mp2 ) ? 1 : ( mp0 + mp1 + mp2 ) ) - retu [mp0, mp1, mp2, mp3] -endf - -fu! s:compval(...) - retu a:1 - a:2 -endf -" Statusline {{{2 -fu! ctrlp#statusline() - if !exists('s:statypes') - let s:statypes = [ - \ ['files', 'fil'], - \ ['buffers', 'buf'], - \ ['mru files', 'mru'], - \ ] - if !empty(g:ctrlp_ext_vars) - cal map(copy(g:ctrlp_ext_vars), - \ 'add(s:statypes, [ v:val["lname"], v:val["sname"] ])') - en - en - let tps = s:statypes - let max = len(tps) - 1 - let nxt = tps[s:walker(max, s:itemtype, 1)][1] - let prv = tps[s:walker(max, s:itemtype, -1)][1] - let s:ctype = tps[s:itemtype][0] - let focus = s:focus ? 'prt' : 'win' - let byfname = s:byfname ? 'file' : 'path' - let marked = s:opmul != '0' ? - \ exists('s:marked') ? ' <'.s:dismrk().'>' : ' <->' : '' - if s:status != {} - let args = [focus, byfname, s:regexp, prv, s:ctype, nxt, marked] - let &l:stl = call(s:status['main'], args, s:status) - el - let item = '%#CtrlPMode1# '.s:ctype.' %*' - let focus = '%#CtrlPMode2# '.focus.' %*' - let byfname = '%#CtrlPMode1# '.byfname.' %*' - let regex = s:regexp ? '%#CtrlPMode2# regex %*' : '' - let slider = ' <'.prv.'>={'.item.'}=<'.nxt.'>' - let dir = ' %=%<%#CtrlPMode2# %{getcwd()} %*' - let &l:stl = focus.byfname.regex.slider.marked.dir - en -endf - -fu! s:dismrk() - retu has('signs') ? len(s:marked) : - \ '%<'.join(values(map(copy(s:marked), 'split(v:val, "[\\/]")[-1]')), ', ') -endf - -fu! ctrlp#progress(enum, ...) - if has('macunix') || has('mac') | sl 1m | en - let txt = a:0 ? '(press ctrl-c to abort)' : '' - let &l:stl = s:status != {} ? call(s:status['prog'], [a:enum], s:status) - \ : '%#CtrlPStats# '.a:enum.' %* '.txt.'%=%<%#CtrlPMode2# %{getcwd()} %*' - redraws -endf -" *** Paths {{{2 -" Line formatting {{{3 -fu! s:formatline(str) - let str = a:str - if s:itemtype == 1 - let bfnr = bufnr('^'.fnamemodify(str, ':p').'$') - let idc = ( bfnr == bufnr('#') ? '#' : '' ) - \ . ( getbufvar(bfnr, '&ma') ? '' : '-' ) - \ . ( getbufvar(bfnr, '&ro') ? '=' : '' ) - \ . ( getbufvar(bfnr, '&mod') ? '+' : '' ) - let str .= idc != '' ? ' '.idc : '' - en - let cond = s:ispath && ( s:winw - 4 ) < s:strwidth(str) - retu '> '.( cond ? s:pathshorten(str) : str ) -endf - -fu! s:pathshorten(str) - retu matchstr(a:str, '^.\{9}').'...' - \ .matchstr(a:str, '.\{'.( s:winw - 16 ).'}$') -endf -" Directory completion {{{3 -fu! s:dircompl(be, sd) - if a:sd == '' | retu [] | en - let [be, sd] = a:be == '' ? [s:dyncwd, a:sd] : [a:be, a:be.s:lash(a:be).a:sd] - let dirs = ctrlp#rmbasedir(split(globpath(s:fnesc(be, 'g', ','), a:sd.'*/'), "\n")) - cal filter(dirs, '!match(v:val, escape(sd, ''~$.\''))' - \ . ' && v:val !~ ''\v(^|[\/])\.{1,2}[\/]$''') - retu dirs -endf - -fu! s:findcommon(items, seed) - let [items, id, cmn, ic] = [copy(a:items), strlen(a:seed), '', 0] - cal map(items, 'strpart(v:val, id)') - for char in split(items[0], '\zs') - for item in items[1:] - if item[ic] != char | let brk = 1 | brea | en - endfo - if exists('brk') | brea | en - let cmn .= char - let ic += 1 - endfo - retu cmn -endf -" Misc {{{3 -fu! s:headntail(str) - let parts = split(a:str, '[\/]\ze[^\/]\+[\/:]\?$') - retu len(parts) == 1 ? ['', parts[0]] : len(parts) == 2 ? parts : [] -endf - -fu! s:lash(...) - retu ( a:0 ? a:1 : s:dyncwd ) !~ '[\/]$' ? s:lash : '' -endf - -fu! s:ispathitem() - retu s:itemtype < 3 || ( s:itemtype > 2 && s:getextvar('type') == 'path' ) -endf - -fu! ctrlp#dirnfile(entries) - let [items, cwd] = [[[], []], s:dyncwd.s:lash()] - for each in a:entries - let etype = getftype(each) - if s:igntype >= 0 && s:usrign(each, etype) | con | en - if etype == 'dir' - if s:showhidden | if each !~ '[\/]\.\{1,2}$' - cal add(items[0], each) - en | el - cal add(items[0], each) - en - elsei etype == 'link' - if s:folsym - let isfile = !isdirectory(each) - if s:folsym == 2 || !s:samerootsyml(each, isfile, cwd) - cal add(items[isfile], each) - en - en - elsei etype == 'file' - cal add(items[1], each) - en - endfo - retu items -endf - -fu! s:usrign(item, type) - retu s:igntype == 1 ? a:item =~ s:usrign - \ : s:igntype == 4 && has_key(s:usrign, a:type) && s:usrign[a:type] != '' - \ ? a:item =~ s:usrign[a:type] : 0 -endf - -fu! s:samerootsyml(each, isfile, cwd) - let resolve = fnamemodify(resolve(a:each), ':p:h') - let resolve .= s:lash(resolve) - retu !( stridx(resolve, a:cwd) && ( stridx(a:cwd, resolve) || a:isfile ) ) -endf - -fu! ctrlp#rmbasedir(items) - let cwd = s:dyncwd.( s:dyncwd !~ '[\/]$' ? s:lash : '' ) - if a:items != [] && !stridx(a:items[0], cwd) - let idx = strlen(cwd) - retu map(a:items, 'strpart(v:val, idx)') - en - retu a:items -endf -" Working directory {{{3 -fu! s:getparent(item) - let parent = substitute(a:item, '[\/][^\/]\+[\/:]\?$', '', '') - if parent == '' || parent !~ '[\/]' - let parent .= s:lash - en - retu parent -endf - -fu! s:findroot(curr, mark, depth, type) - let [depth, fnd] = [a:depth + 1, 0] - if type(a:mark) == 1 - let fnd = s:glbpath(s:fnesc(a:curr, 'g', ','), a:mark, 1) != '' - elsei type(a:mark) == 3 - for markr in a:mark - if s:glbpath(s:fnesc(a:curr, 'g', ','), markr, 1) != '' - let fnd = 1 - brea - en - endfo - en - if fnd - if !a:type | cal ctrlp#setdir(a:curr) | en - retu [exists('markr') ? markr : a:mark, a:curr] - elsei depth > s:maxdepth - cal ctrlp#setdir(s:cwd) - el - let parent = s:getparent(a:curr) - if parent != a:curr - retu s:findroot(parent, a:mark, depth, a:type) - en - en - retu [] -endf - -fu! ctrlp#setdir(path, ...) - let cmd = a:0 ? a:1 : 'lc!' - sil! exe cmd s:fnesc(a:path, 'c') - let [s:crfilerel, s:dyncwd] = [fnamemodify(s:crfile, ':.'), getcwd()] -endf -" Fallbacks {{{3 -fu! s:glbpath(...) - retu call('ctrlp#utils#globpath', a:000) -endf - -fu! s:fnesc(...) - retu call('ctrlp#utils#fnesc', a:000) -endf - -fu! ctrlp#setlcdir() - if exists('*haslocaldir') - cal ctrlp#setdir(getcwd(), haslocaldir() ? 'lc!' : 'cd!') - en -endf -" Highlighting {{{2 -fu! ctrlp#syntax() - if ctrlp#nosy() | retu | en - for [ke, va] in items(s:hlgrps) | cal ctrlp#hicheck('CtrlP'.ke, va) | endfo - if !hlexists('CtrlPLinePre') - \ && synIDattr(synIDtrans(hlID('Normal')), 'bg') !~ '^-1$\|^$' - sil! exe 'hi CtrlPLinePre '.( has("gui_running") ? 'gui' : 'cterm' ).'fg=bg' - en - sy match CtrlPNoEntries '^ == NO ENTRIES ==$' - if hlexists('CtrlPLinePre') - sy match CtrlPLinePre '^>' - en -endf - -fu! s:highlight(pat, grp) - if s:matcher != {} | retu | en - cal clearmatches() - if !empty(a:pat) && s:ispath - let pat = s:regexp ? substitute(a:pat, '\\\@ \\zs', 'g') : a:pat - if s:byfname - let pat = substitute(pat, '\[\^\(.\{-}\)\]\\{-}', '[^\\/\1]\\{-}', 'g') - let pat = substitute(pat, '\$\@') - en -endf - -fu! s:dohighlight() - retu s:mathi[0] && exists('*clearmatches') && !ctrlp#nosy() -endf -" Prompt history {{{2 -fu! s:gethistloc() - let utilcadir = ctrlp#utils#cachedir() - let cache_dir = utilcadir.s:lash(utilcadir).'hist' - retu [cache_dir, cache_dir.s:lash(cache_dir).'cache.txt'] -endf - -fu! s:gethistdata() - retu ctrlp#utils#readfile(s:gethistloc()[1]) -endf - -fu! ctrlp#recordhist() - let str = join(s:prompt, '') - if empty(str) || !s:maxhst | retu | en - let hst = s:hstry - if len(hst) > 1 && hst[1] == str | retu | en - cal extend(hst, [str], 1) - if len(hst) > s:maxhst | cal remove(hst, s:maxhst, -1) | en - cal ctrlp#utils#writecache(hst, s:gethistloc()[0], s:gethistloc()[1]) -endf -" Signs {{{2 -fu! s:unmarksigns() - if !s:dosigns() | retu | en - for key in keys(s:marked) - exe 'sign unplace' key 'buffer='.s:bufnr - endfo -endf - -fu! s:remarksigns() - if !s:dosigns() | retu | en - for ic in range(1, len(s:lines)) - let line = s:ispath ? fnamemodify(s:lines[ic - 1], ':p') : s:lines[ic - 1] - let key = s:dictindex(s:marked, line) - if key > 0 - exe 'sign place' key 'line='.ic.' name=ctrlpmark buffer='.s:bufnr - en - endfo -endf - -fu! s:dosigns() - retu exists('s:marked') && s:bufnr > 0 && s:opmul != '0' && has('signs') -endf -" Lists & Dictionaries {{{2 -fu! s:dictindex(dict, expr) - for key in keys(a:dict) - if a:dict[key] == a:expr | retu key | en - endfo - retu -1 -endf - -fu! s:vacantdict(dict) - retu filter(range(1, max(keys(a:dict))), '!has_key(a:dict, v:val)') -endf - -fu! s:sublist(l, s, e) - retu v:version > 701 ? a:l[(a:s):(a:e)] : s:sublist7071(a:l, a:s, a:e) -endf - -fu! s:sublist7071(l, s, e) - let [newlist, id, ae] = [[], a:s, a:e == -1 ? len(a:l) - 1 : a:e] - wh id <= ae - cal add(newlist, get(a:l, id)) - let id += 1 - endw - retu newlist -endf -" Buffers {{{2 -fu! s:buftab(bufnr, md) - for tabnr in range(1, tabpagenr('$')) - if tabpagenr() == tabnr && a:md == 't' | con | en - let buflist = tabpagebuflist(tabnr) - if index(buflist, a:bufnr) >= 0 - for winnr in range(1, tabpagewinnr(tabnr, '$')) - if buflist[winnr - 1] == a:bufnr | retu [tabnr, winnr] | en - endfo - en - endfo - retu [0, 0] -endf - -fu! s:bufwins(bufnr) - let winns = 0 - for tabnr in range(1, tabpagenr('$')) - let winns += count(tabpagebuflist(tabnr), a:bufnr) - endfo - retu winns -endf - -fu! ctrlp#normcmd(cmd, ...) - if a:0 < 2 && s:nosplit() | retu a:cmd | en - let norwins = filter(range(1, winnr('$')), - \ 'empty(getbufvar(winbufnr(v:val), "&bt"))') - for each in norwins - let bufnr = winbufnr(each) - if empty(bufname(bufnr)) && empty(getbufvar(bufnr, '&ft')) - let fstemp = each | brea - en - endfo - let norwin = empty(norwins) ? 0 : norwins[0] - if norwin - if index(norwins, winnr()) < 0 - exe ( exists('fstemp') ? fstemp : norwin ).'winc w' - en - retu a:cmd - en - retu a:0 ? a:1 : 'bo vne' -endf - -fu! ctrlp#modfilecond(w) - retu &mod && !&hid && &bh != 'hide' && s:bufwins(bufnr('%')) == 1 && !&cf && - \ ( ( !&awa && a:w ) || filewritable(fnamemodify(bufname('%'), ':p')) != 1 ) -endf - -fu! s:nosplit() - retu !empty(s:nosplit) && match([bufname('%'), &l:ft, &l:bt], s:nosplit) >= 0 -endf - -fu! s:setupblank() - setl noswf nonu nobl nowrap nolist nospell nocuc wfh - setl fdc=0 fdl=99 tw=0 bt=nofile bh=unload - if v:version > 702 - setl nornu noudf cc=0 - en -endf - -fu! s:leavepre() - if exists('s:bufnr') && s:bufnr == bufnr('%') | bw! | en - if !( exists(s:ccex) && !{s:ccex} ) - \ && !( has('clientserver') && len(split(serverlist(), "\n")) > 1 ) - cal ctrlp#clra() - en -endf - -fu! s:checkbuf() - if !exists('s:init') && exists('s:bufnr') && s:bufnr > 0 - exe s:bufnr.'bw!' - en -endf - -fu! s:iscmdwin() - let ermsg = v:errmsg - sil! noa winc p - sil! noa winc p - let [v:errmsg, ermsg] = [ermsg, v:errmsg] - retu ermsg =~ '^E11:' -endf -" Arguments {{{2 -fu! s:at(str) - if a:str =~ '\v^\@(cd|lc[hd]?|chd).*' - let str = substitute(a:str, '\v^\@(cd|lc[hd]?|chd)\s*', '', '') - if str == '' | retu 1 | en - let str = str =~ '^%:.\+' ? fnamemodify(s:crfile, str[1:]) : str - let path = fnamemodify(expand(str, 1), ':p') - if isdirectory(path) - if path != s:dyncwd - cal ctrlp#setdir(path) - cal ctrlp#setlines() - en - cal ctrlp#recordhist() - cal s:PrtClear() - en - retu 1 - en - retu 0 -endf - -fu! s:tail() - if exists('s:optail') && !empty('s:optail') - let tailpref = s:optail !~ '^\s*+' ? ' +' : ' ' - retu tailpref.s:optail - en - retu '' -endf - -fu! s:sanstail(str) - let str = s:spi ? - \ substitute(a:str, '^\(@.*$\|\\\\\ze@\|\.\.\zs[.\/]\+$\)', '', 'g') : a:str - let [str, pat] = [substitute(str, '\\\\', '\', 'g'), '\([^:]\|\\:\)*$'] - unl! s:optail - if str =~ '\\\@= 0 - retu char - elsei char =~# "\\v\|\|\|\|\|\" - cal s:BuildPrompt(0) - retu 'cancel' - elsei char =~# "\" && a:args != [] - retu a:args[0] - en - retu call(a:func, a:args) -endf - -fu! s:getregs() - let char = s:textdialog('Insert from register: ') - if char =~# "\\v\|\|\|\|\|\" - cal s:BuildPrompt(0) - retu -1 - elsei char =~# "\" - retu s:getregs() - en - retu s:regisfilter(char) -endf - -fu! s:regisfilter(reg) - retu substitute(getreg(a:reg), "[\t\n]", ' ', 'g') -endf -" Misc {{{2 -fu! s:modevar() - let s:matchtype = s:mtype() - let s:ispath = s:ispathitem() - if !s:ispath | let s:byfname = 0 | en - let s:mfunc = s:mfunc() - let s:nolim = s:getextvar('nolim') - let s:dosort = s:getextvar('sort') - let s:spi = !s:itemtype || s:getextvar('specinput') > 0 -endf - -fu! s:nosort() - retu s:matcher != {} || s:nolim == 1 || ( s:itemtype == 2 && s:mrudef ) - \ || ( s:itemtype =~ '\v^(1|2)$' && s:prompt == ['', '', ''] ) || !s:dosort -endf - -fu! s:narrowable() - retu exists('s:act_add') && exists('s:matched') && s:matched != [] - \ && exists('s:mdata') && s:mdata[:2] == [s:dyncwd, s:itemtype, s:regexp] - \ && s:matcher == {} && !exists('s:did_exp') -endf - -fu! s:getinput(...) - let [prt, spi] = [s:prompt, ( a:0 ? a:1 : '' )] - if s:abbrev != {} - let gmd = has_key(s:abbrev, 'gmode') ? s:abbrev['gmode'] : '' - let str = ( gmd =~ 't' && !a:0 ) || spi == 'c' ? prt[0] : join(prt, '') - if gmd =~ 't' && gmd =~ 'k' && !a:0 && matchstr(str, '.$') =~ '\k' - retu join(prt, '') - en - let [pf, rz] = [( s:byfname ? 'f' : 'p' ), ( s:regexp ? 'r' : 'z' )] - for dict in s:abbrev['abbrevs'] - let dmd = has_key(dict, 'mode') ? dict['mode'] : '' - let pat = escape(dict['pattern'], '~') - if ( dmd == '' || ( dmd =~ pf && dmd =~ rz && !a:0 ) - \ || dmd =~ '['.spi.']' ) && str =~ pat - let [str, s:did_exp] = [join(split(str, pat, 1), dict['expanded']), 1] - en - endfo - if gmd =~ 't' && !a:0 - let prt[0] = str - el - retu str - en - en - retu spi == 'c' ? prt[0] : join(prt, '') -endf - -fu! s:migemo(str) - let [str, rtp] = [a:str, s:fnesc(&rtp, 'g')] - let dict = s:glbpath(rtp, printf("dict/%s/migemo-dict", &enc), 1) - if !len(dict) - let dict = s:glbpath(rtp, "dict/migemo-dict", 1) - en - if len(dict) - let [tokens, str, cmd] = [split(str, '\s'), '', 'cmigemo -v -w %s -d %s'] - for token in tokens - let rtn = system(printf(cmd, shellescape(token), shellescape(dict))) - let str .= !v:shell_error && strlen(rtn) > 0 ? '.*'.rtn : token - endfo - en - retu str -endf - -fu! s:strwidth(str) - retu exists('*strdisplaywidth') ? strdisplaywidth(a:str) : strlen(a:str) -endf - -fu! ctrlp#j2l(nr) - exe 'norm!' a:nr.'G' - sil! norm! zvzz -endf - -fu! s:maxf(len) - retu s:maxfiles && a:len > s:maxfiles -endf - -fu! s:regexfilter(str) - let str = a:str - for key in keys(s:fpats) | if str =~ key - let str = substitute(str, s:fpats[key], '', 'g') - en | endfo - retu str -endf - -fu! s:walker(m, p, d) - retu a:d >= 0 ? a:p < a:m ? a:p + a:d : 0 : a:p > 0 ? a:p + a:d : a:m -endf - -fu! s:delent(rfunc) - if a:rfunc == '' | retu | en - let [s:force, tbrem] = [1, []] - if exists('s:marked') - let tbrem = values(s:marked) - cal s:unmarksigns() - unl s:marked - en - if tbrem == [] && ( has('dialog_gui') || has('dialog_con') ) && - \ confirm("Wipe all entries?", "&OK\n&Cancel") != 1 - unl s:force - cal s:BuildPrompt(0) - retu - en - let g:ctrlp_lines = call(a:rfunc, [tbrem]) - cal s:BuildPrompt(1) - unl s:force -endf -" Entering & Exiting {{{2 -fu! s:getenv() - let [s:cwd, s:winres] = [getcwd(), [winrestcmd(), &lines, winnr('$')]] - let [s:crfile, s:crfpath] = [expand('%:p', 1), expand('%:p:h', 1)] - let [s:crword, s:crline] = [expand('', 1), getline('.')] - let [s:winh, s:crcursor] = [min([s:mxheight, &lines]), getpos('.')] - let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()] - let [s:mrbs, s:crgfile] = [ctrlp#mrufiles#bufs(), expand('', 1)] -endf - -fu! s:lastvisual() - let cview = winsaveview() - let [ovreg, ovtype] = [getreg('v'), getregtype('v')] - let [oureg, outype] = [getreg('"'), getregtype('"')] - sil! norm! gv"vy - let selected = s:regisfilter('v') - cal setreg('v', ovreg, ovtype) - cal setreg('"', oureg, outype) - cal winrestview(cview) - retu selected -endf - -fu! s:log(m) - if exists('g:ctrlp_log') && g:ctrlp_log | if a:m - let cadir = ctrlp#utils#cachedir() - sil! exe 'redi! >' cadir.s:lash(cadir).'ctrlp.log' - el - sil! redi END - en | en -endf - -fu! s:buffunc(e) - if a:e && has_key(s:buffunc, 'enter') - cal call(s:buffunc['enter'], [], s:buffunc) - elsei !a:e && has_key(s:buffunc, 'exit') - cal call(s:buffunc['exit'], [], s:buffunc) - en -endf - -fu! s:openfile(cmd, fid, tail, chkmod, ...) - let cmd = a:cmd - if a:chkmod && cmd =~ '^[eb]$' && ctrlp#modfilecond(!( cmd == 'b' && &aw )) - let cmd = cmd == 'b' ? 'sb' : 'sp' - en - let cmd = cmd =~ '^tab' ? ctrlp#tabcount().cmd : cmd - let j2l = a:0 && a:1[0] ? a:1[1] : 0 - exe cmd.( a:0 && a:1[0] ? '' : a:tail ) s:fnesc(a:fid, 'f') - if j2l - cal ctrlp#j2l(j2l) - en - if !empty(a:tail) - sil! norm! zvzz - en - if cmd != 'bad' - cal ctrlp#setlcdir() - en -endf - -fu! ctrlp#tabcount() - if exists('s:tabct') - let tabct = s:tabct - let s:tabct += 1 - elsei !type(s:tabpage) - let tabct = s:tabpage - elsei type(s:tabpage) == 1 - let tabpos = - \ s:tabpage =~ 'c' ? tabpagenr() : - \ s:tabpage =~ 'f' ? 1 : - \ s:tabpage =~ 'l' ? tabpagenr('$') : - \ tabpagenr() - let tabct = - \ s:tabpage =~ 'a' ? tabpos : - \ s:tabpage =~ 'b' ? tabpos - 1 : - \ tabpos - en - retu tabct < 0 ? 0 : tabct -endf - -fu! s:settype(type) - retu a:type < 0 ? exists('s:itemtype') ? s:itemtype : 0 : a:type -endf -" Matching {{{2 -fu! s:matchfname(item, pat) - let parts = split(a:item, '[\/]\ze[^\/]\+$') - let mfn = match(parts[-1], a:pat[0]) - retu len(a:pat) == 1 ? mfn : len(a:pat) == 2 ? - \ ( mfn >= 0 && ( len(parts) == 2 ? match(parts[0], a:pat[1]) : -1 ) >= 0 - \ ? 0 : -1 ) : -1 - en -endf - -fu! s:matchtabs(item, pat) - retu match(split(a:item, '\t\+')[0], a:pat) -endf - -fu! s:matchtabe(item, pat) - retu match(split(a:item, '\t\+[^\t]\+$')[0], a:pat) -endf - -fu! s:buildpat(lst) - let pat = a:lst[0] - for item in range(1, len(a:lst) - 1) - let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item] - endfo - retu pat -endf - -fu! s:mfunc() - let mfunc = 'match' - if s:byfname && s:ispath - let mfunc = 's:matchfname' - elsei s:itemtype > 2 - let matchtypes = { 'tabs': 's:matchtabs', 'tabe': 's:matchtabe' } - if has_key(matchtypes, s:matchtype) - let mfunc = matchtypes[s:matchtype] - en - en - retu mfunc -endf - -fu! s:mmode() - let matchmodes = { - \ 'match': 'full-line', - \ 's:matchfname': 'filename-only', - \ 's:matchtabs': 'first-non-tab', - \ 's:matchtabe': 'until-last-tab', - \ } - retu matchmodes[s:mfunc] -endf -" Cache {{{2 -fu! s:writecache(cafile) - if ( g:ctrlp_newcache || !filereadable(a:cafile) ) && !s:nocache() - cal ctrlp#utils#writecache(g:ctrlp_allfiles) - let g:ctrlp_newcache = 0 - en -endf - -fu! s:nocache(...) - if !s:caching - retu 1 - elsei s:caching > 1 - if !( exists(s:ccex) && !{s:ccex} ) || has_key(s:ficounts, s:dyncwd) - retu get(s:ficounts, s:dyncwd, [0, 0])[0] < s:caching - elsei a:0 && filereadable(a:1) - retu len(ctrlp#utils#readfile(a:1)) < s:caching - en - retu 1 - en - retu 0 -endf - -fu! s:insertcache(str) - let [data, g:ctrlp_newcache, str] = [g:ctrlp_allfiles, 1, a:str] - if data == [] || strlen(str) <= strlen(data[0]) - let pos = 0 - elsei strlen(str) >= strlen(data[-1]) - let pos = len(data) - 1 - el - let pos = 0 - for each in data - if strlen(each) > strlen(str) | brea | en - let pos += 1 - endfo - en - cal insert(data, str, pos) - cal s:writecache(ctrlp#utils#cachefile()) -endf -" Extensions {{{2 -fu! s:mtype() - retu s:itemtype > 2 ? s:getextvar('type') : 'path' -endf - -fu! s:execextvar(key) - if !empty(g:ctrlp_ext_vars) - cal map(filter(copy(g:ctrlp_ext_vars), - \ 'has_key(v:val, a:key)'), 'eval(v:val[a:key])') - en -endf - -fu! s:getextvar(key) - if s:itemtype > 2 - let vars = g:ctrlp_ext_vars[s:itemtype - 3] - retu has_key(vars, a:key) ? vars[a:key] : -1 - en - retu -1 -endf - -fu! ctrlp#getcline() - retu !empty(s:lines) ? s:lines[line('.') - 1] : '' -endf - -fu! ctrlp#getmarkedlist() - retu exists('s:marked') ? values(s:marked) : [] -endf - -fu! ctrlp#exit() - cal s:PrtExit() -endf - -fu! ctrlp#prtclear() - cal s:PrtClear() -endf - -fu! ctrlp#switchtype(id) - cal s:ToggleType(a:id - s:itemtype) -endf - -fu! ctrlp#nosy() - retu !( has('syntax') && exists('g:syntax_on') ) -endf - -fu! ctrlp#hicheck(grp, defgrp) - if !hlexists(a:grp) - exe 'hi link' a:grp a:defgrp - en -endf - -fu! ctrlp#call(func, ...) - retu call(a:func, a:000) -endf -"}}}1 -" * Initialization {{{1 -fu! ctrlp#setlines(...) - if a:0 | let s:itemtype = a:1 | en - cal s:modevar() - let types = ['ctrlp#files()', 'ctrlp#buffers()', 'ctrlp#mrufiles#list()'] - if !empty(g:ctrlp_ext_vars) - cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val["init"])') - en - let g:ctrlp_lines = eval(types[s:itemtype]) -endf - -fu! ctrlp#init(type, ...) - if exists('s:init') || s:iscmdwin() | retu | en - let [s:ermsg, v:errmsg] = [v:errmsg, ''] - let [s:matches, s:init] = [1, 1] - cal s:Reset(a:0 ? a:1 : {}) - noa cal s:Open() - cal s:SetWD(a:0 ? a:1 : {}) - cal s:MapNorms() - cal s:MapSpecs() - cal ctrlp#syntax() - cal ctrlp#setlines(s:settype(a:type)) - cal s:SetDefTxt() - cal s:BuildPrompt(1) - if s:keyloop | cal s:KeyLoop() | en -endf -" - Autocmds {{{1 -if has('autocmd') - aug CtrlPAug - au! - au BufEnter ControlP cal s:checkbuf() - au BufLeave ControlP noa cal s:Close() - au VimLeavePre * cal s:leavepre() - aug END -en - -fu! s:autocmds() - if !has('autocmd') | retu | en - if exists('#CtrlPLazy') - au! CtrlPLazy - en - if s:lazy - aug CtrlPLazy - au! - au CursorHold ControlP cal s:ForceUpdate() - aug END - en -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/bookmarkdir.vim b/vim/bundle/ctrlp/autoload/ctrlp/bookmarkdir.vim deleted file mode 100644 index 7d955b5..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/bookmarkdir.vim +++ /dev/null @@ -1,140 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/bookmarkdir.vim -" Description: Bookmarked directories extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_bookmarkdir') && g:loaded_ctrlp_bookmarkdir - fini -en -let g:loaded_ctrlp_bookmarkdir = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#bookmarkdir#init()', - \ 'accept': 'ctrlp#bookmarkdir#accept', - \ 'lname': 'bookmarked dirs', - \ 'sname': 'bkd', - \ 'type': 'tabs', - \ 'opmul': 1, - \ 'nolim': 1, - \ 'wipe': 'ctrlp#bookmarkdir#remove', - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) -" Utilities {{{1 -fu! s:getinput(str, ...) - echoh Identifier - cal inputsave() - let input = call('input', a:0 ? [a:str] + a:000 : [a:str]) - cal inputrestore() - echoh None - retu input -endf - -fu! s:cachefile() - if !exists('s:cadir') || !exists('s:cafile') - let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'bkd' - let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt' - en - retu s:cafile -endf - -fu! s:writecache(lines) - cal ctrlp#utils#writecache(a:lines, s:cadir, s:cafile) -endf - -fu! s:getbookmarks() - retu ctrlp#utils#readfile(s:cachefile()) -endf - -fu! s:savebookmark(name, cwd) - let cwds = exists('+ssl') ? [tr(a:cwd, '\', '/'), tr(a:cwd, '/', '\')] : [a:cwd] - let entries = filter(s:getbookmarks(), 'index(cwds, s:parts(v:val)[1]) < 0') - cal s:writecache(insert(entries, a:name.' '.a:cwd)) -endf - -fu! s:setentries() - let time = getftime(s:cachefile()) - if !( exists('s:bookmarks') && time == s:bookmarks[0] ) - let s:bookmarks = [time, s:getbookmarks()] - en -endf - -fu! s:parts(str) - let mlist = matchlist(a:str, '\v([^\t]+)\t(.*)$') - retu mlist != [] ? mlist[1:2] : ['', ''] -endf - -fu! s:process(entries, type) - retu map(a:entries, 's:modify(v:val, a:type)') -endf - -fu! s:modify(entry, type) - let [name, dir] = s:parts(a:entry) - let dir = fnamemodify(dir, a:type) - retu name.' '.( dir == '' ? '.' : dir ) -endf - -fu! s:msg(name, cwd) - redr - echoh Identifier | echon 'Bookmarked ' | echoh Constant - echon a:name.' ' | echoh Directory | echon a:cwd - echoh None -endf - -fu! s:syntax() - if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPBookmark', 'Identifier') - cal ctrlp#hicheck('CtrlPTabExtra', 'Comment') - sy match CtrlPBookmark '^> [^\t]\+' contains=CtrlPLinePre - sy match CtrlPTabExtra '\zs\t.*\ze$' - en -endf -" Public {{{1 -fu! ctrlp#bookmarkdir#init() - cal s:setentries() - cal s:syntax() - retu s:process(copy(s:bookmarks[1]), ':.') -endf - -fu! ctrlp#bookmarkdir#accept(mode, str) - let parts = s:parts(s:modify(a:str, ':p')) - cal call('s:savebookmark', parts) - if a:mode =~ 't\|v\|h' - cal ctrlp#exit() - en - cal ctrlp#setdir(parts[1], a:mode =~ 't\|h' ? 'chd!' : 'lc!') - if a:mode == 'e' - cal ctrlp#switchtype(0) - cal ctrlp#recordhist() - cal ctrlp#prtclear() - en -endf - -fu! ctrlp#bookmarkdir#add(dir) - let str = 'Directory to bookmark: ' - let cwd = a:dir != '' ? a:dir : s:getinput(str, getcwd(), 'dir') - if cwd == '' | retu | en - let cwd = fnamemodify(cwd, ':p') - let name = s:getinput('Bookmark as: ', cwd) - if name == '' | retu | en - let name = tr(name, ' ', ' ') - cal s:savebookmark(name, cwd) - cal s:msg(name, cwd) -endf - -fu! ctrlp#bookmarkdir#remove(entries) - cal s:process(a:entries, ':p') - cal s:writecache(a:entries == [] ? [] : - \ filter(s:getbookmarks(), 'index(a:entries, v:val) < 0')) - cal s:setentries() - retu s:process(copy(s:bookmarks[1]), ':.') -endf - -fu! ctrlp#bookmarkdir#id() - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/buffertag.vim b/vim/bundle/ctrlp/autoload/ctrlp/buffertag.vim deleted file mode 100644 index 2af1fe0..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/buffertag.vim +++ /dev/null @@ -1,261 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/buffertag.vim -" Description: Buffer Tag extension -" Maintainer: Kien Nguyen -" Credits: Much of the code was taken from tagbar.vim by Jan Larres, plus -" a few lines from taglist.vim by Yegappan Lakshmanan and from -" buffertag.vim by Takeshi Nishida. -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_buftag') && g:loaded_ctrlp_buftag - fini -en -let g:loaded_ctrlp_buftag = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#buffertag#init(s:crfile)', - \ 'accept': 'ctrlp#buffertag#accept', - \ 'lname': 'buffer tags', - \ 'sname': 'bft', - \ 'exit': 'ctrlp#buffertag#exit()', - \ 'type': 'tabs', - \ 'opts': 'ctrlp#buffertag#opts()', - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) - -let [s:pref, s:opts] = ['g:ctrlp_buftag_', { - \ 'systemenc': ['s:enc', &enc], - \ 'ctags_bin': ['s:bin', ''], - \ 'types': ['s:usr_types', {}], - \ }] - -let s:bins = [ - \ 'ctags-exuberant', - \ 'exuberant-ctags', - \ 'exctags', - \ '/usr/local/bin/ctags', - \ '/opt/local/bin/ctags', - \ 'ctags', - \ 'ctags.exe', - \ 'tags', - \ ] - -let s:types = { - \ 'asm' : '%sasm%sasm%sdlmt', - \ 'aspperl': '%sasp%sasp%sfsv', - \ 'aspvbs' : '%sasp%sasp%sfsv', - \ 'awk' : '%sawk%sawk%sf', - \ 'beta' : '%sbeta%sbeta%sfsv', - \ 'c' : '%sc%sc%sdgsutvf', - \ 'cpp' : '%sc++%sc++%snvdtcgsuf', - \ 'cs' : '%sc#%sc#%sdtncEgsipm', - \ 'cobol' : '%scobol%scobol%sdfgpPs', - \ 'eiffel' : '%seiffel%seiffel%scf', - \ 'erlang' : '%serlang%serlang%sdrmf', - \ 'expect' : '%stcl%stcl%scfp', - \ 'fortran': '%sfortran%sfortran%spbceiklmntvfs', - \ 'html' : '%shtml%shtml%saf', - \ 'java' : '%sjava%sjava%spcifm', - \ 'javascript': '%sjavascript%sjavascript%sf', - \ 'lisp' : '%slisp%slisp%sf', - \ 'lua' : '%slua%slua%sf', - \ 'make' : '%smake%smake%sm', - \ 'pascal' : '%spascal%spascal%sfp', - \ 'perl' : '%sperl%sperl%sclps', - \ 'php' : '%sphp%sphp%scdvf', - \ 'python' : '%spython%spython%scmf', - \ 'rexx' : '%srexx%srexx%ss', - \ 'ruby' : '%sruby%sruby%scfFm', - \ 'scheme' : '%sscheme%sscheme%ssf', - \ 'sh' : '%ssh%ssh%sf', - \ 'csh' : '%ssh%ssh%sf', - \ 'zsh' : '%ssh%ssh%sf', - \ 'slang' : '%sslang%sslang%snf', - \ 'sml' : '%ssml%ssml%secsrtvf', - \ 'sql' : '%ssql%ssql%scFPrstTvfp', - \ 'tcl' : '%stcl%stcl%scfmp', - \ 'vera' : '%svera%svera%scdefgmpPtTvx', - \ 'verilog': '%sverilog%sverilog%smcPertwpvf', - \ 'vim' : '%svim%svim%savf', - \ 'yacc' : '%syacc%syacc%sl', - \ } - -cal map(s:types, 'printf(v:val, "--language-force=", " --", "-types=")') - -if executable('jsctags') - cal extend(s:types, { 'javascript': { 'args': '-f -', 'bin': 'jsctags' } }) -en - -fu! ctrlp#buffertag#opts() - for [ke, va] in items(s:opts) - let {va[0]} = exists(s:pref.ke) ? {s:pref.ke} : va[1] - endfo - " Ctags bin - if empty(s:bin) - for bin in s:bins | if executable(bin) - let s:bin = bin - brea - en | endfo - el - let s:bin = expand(s:bin, 1) - en - " Types - cal extend(s:types, s:usr_types) -endf -" Utilities {{{1 -fu! s:validfile(fname, ftype) - if ( !empty(a:fname) || !empty(a:ftype) ) && filereadable(a:fname) - \ && index(keys(s:types), a:ftype) >= 0 | retu 1 | en - retu 0 -endf - -fu! s:exectags(cmd) - if exists('+ssl') - let [ssl, &ssl] = [&ssl, 0] - en - if &sh =~ 'cmd\.exe' - let [sxq, &sxq, shcf, &shcf] = [&sxq, '"', &shcf, '/s /c'] - en - let output = system(a:cmd) - if &sh =~ 'cmd\.exe' - let [&sxq, &shcf] = [sxq, shcf] - en - if exists('+ssl') - let &ssl = ssl - en - retu output -endf - -fu! s:exectagsonfile(fname, ftype) - let [ags, ft] = ['-f - --sort=no --excmd=pattern --fields=nKs ', a:ftype] - if type(s:types[ft]) == 1 - let ags .= s:types[ft] - let bin = s:bin - elsei type(s:types[ft]) == 4 - let ags = s:types[ft]['args'] - let bin = expand(s:types[ft]['bin'], 1) - en - if empty(bin) | retu '' | en - let cmd = s:esctagscmd(bin, ags, a:fname) - if empty(cmd) | retu '' | en - let output = s:exectags(cmd) - if v:shell_error || output =~ 'Warning: cannot open' | retu '' | en - retu output -endf - -fu! s:esctagscmd(bin, args, ...) - if exists('+ssl') - let [ssl, &ssl] = [&ssl, 0] - en - let fname = a:0 ? shellescape(a:1) : '' - let cmd = shellescape(a:bin).' '.a:args.' '.fname - if &sh =~ 'cmd\.exe' - let cmd = substitute(cmd, '[&()@^<>|]', '^\0', 'g') - en - if exists('+ssl') - let &ssl = ssl - en - if has('iconv') - let last = s:enc != &enc ? s:enc : !empty( $LANG ) ? $LANG : &enc - let cmd = iconv(cmd, &enc, last) - en - retu cmd -endf - -fu! s:process(fname, ftype) - if !s:validfile(a:fname, a:ftype) | retu [] | endif - let ftime = getftime(a:fname) - if has_key(g:ctrlp_buftags, a:fname) - \ && g:ctrlp_buftags[a:fname]['time'] >= ftime - let lines = g:ctrlp_buftags[a:fname]['lines'] - el - let data = s:exectagsonfile(a:fname, a:ftype) - let [raw, lines] = [split(data, '\n\+'), []] - for line in raw - if line !~# '^!_TAG_' && len(split(line, ';"')) == 2 - let parsed_line = s:parseline(line) - if parsed_line != '' - cal add(lines, parsed_line) - en - en - endfo - let cache = { a:fname : { 'time': ftime, 'lines': lines } } - cal extend(g:ctrlp_buftags, cache) - en - retu lines -endf - -fu! s:parseline(line) - let vals = matchlist(a:line, - \ '\v^([^\t]+)\t(.+)\t[?/]\^?(.{-1,})\$?[?/]\;\"\t(.+)\tline(no)?\:(\d+)') - if vals == [] | retu '' | en - let [bufnr, bufname] = [bufnr('^'.vals[2].'$'), fnamemodify(vals[2], ':p:t')] - retu vals[1].' '.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'| '.vals[3] -endf - -fu! s:syntax() - if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPTagKind', 'Title') - cal ctrlp#hicheck('CtrlPBufName', 'Directory') - cal ctrlp#hicheck('CtrlPTabExtra', 'Comment') - sy match CtrlPTagKind '\zs[^\t|]\+\ze|\d\+:[^|]\+|\d\+|' - sy match CtrlPBufName '|\d\+:\zs[^|]\+\ze|\d\+|' - sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName,CtrlPTagKind - en -endf - -fu! s:chknearby(pat) - if match(getline('.'), a:pat) < 0 - let [int, forw, maxl] = [1, 1, line('$')] - wh !search(a:pat, 'W'.( forw ? '' : 'b' )) - if !forw - if int > maxl | brea | en - let int += int - en - let forw = !forw - endw - en -endf -" Public {{{1 -fu! ctrlp#buffertag#init(fname) - let bufs = exists('s:btmode') && s:btmode - \ ? filter(ctrlp#buffers(), 'filereadable(v:val)') - \ : [exists('s:bufname') ? s:bufname : a:fname] - let lines = [] - for each in bufs - let bname = fnamemodify(each, ':p') - let tftype = get(split(getbufvar('^'.bname.'$', '&ft'), '\.'), 0, '') - cal extend(lines, s:process(bname, tftype)) - endfo - cal s:syntax() - retu lines -endf - -fu! ctrlp#buffertag#accept(mode, str) - let vals = matchlist(a:str, - \ '\v^[^\t]+\t+[^\t|]+\|(\d+)\:[^\t|]+\|(\d+)\|\s(.+)$') - let bufnr = str2nr(get(vals, 1)) - if bufnr - cal ctrlp#acceptfile(a:mode, bufname(bufnr)) - exe 'norm!' str2nr(get(vals, 2, line('.'))).'G' - cal s:chknearby('\V\C'.get(vals, 3, '')) - sil! norm! zvzz - en -endf - -fu! ctrlp#buffertag#cmd(mode, ...) - let s:btmode = a:mode - if a:0 && !empty(a:1) - let s:bufname = fnamemodify(a:1, ':p') - en - retu s:id -endf - -fu! ctrlp#buffertag#exit() - unl! s:btmode s:bufname -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/changes.vim b/vim/bundle/ctrlp/autoload/ctrlp/changes.vim deleted file mode 100644 index c391aad..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/changes.vim +++ /dev/null @@ -1,95 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/changes.vim -" Description: Change list extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_changes') && g:loaded_ctrlp_changes - fini -en -let g:loaded_ctrlp_changes = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#changes#init(s:bufnr, s:crbufnr)', - \ 'accept': 'ctrlp#changes#accept', - \ 'lname': 'changes', - \ 'sname': 'chs', - \ 'exit': 'ctrlp#changes#exit()', - \ 'type': 'tabe', - \ 'sort': 0, - \ 'nolim': 1, - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) -" Utilities {{{1 -fu! s:changelist(bufnr) - sil! exe 'noa hid b' a:bufnr - redi => result - sil! changes - redi END - retu map(split(result, "\n")[1:], 'tr(v:val, " ", " ")') -endf - -fu! s:process(clines, ...) - let [clines, evas] = [[], []] - for each in a:clines - let parts = matchlist(each, '\v^.\s*\d+\s+(\d+)\s+(\d+)\s(.*)$') - if !empty(parts) - if parts[3] == '' | let parts[3] = ' ' | en - cal add(clines, parts[3].' |'.a:1.':'.a:2.'|'.parts[1].':'.parts[2].'|') - en - endfo - retu reverse(filter(clines, 'count(clines, v:val) == 1')) -endf - -fu! s:syntax() - if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPBufName', 'Directory') - cal ctrlp#hicheck('CtrlPTabExtra', 'Comment') - sy match CtrlPBufName '\t|\d\+:\zs[^|]\+\ze|\d\+:\d\+|$' - sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName - en -endf -" Public {{{1 -fu! ctrlp#changes#init(original_bufnr, bufnr) - let bufnr = exists('s:bufnr') ? s:bufnr : a:bufnr - let bufs = exists('s:clmode') && s:clmode ? ctrlp#buffers('id') : [bufnr] - cal filter(bufs, 'v:val > 0') - let [swb, &swb] = [&swb, ''] - let lines = [] - for each in bufs - let fnamet = fnamemodify(bufname(each), ':t') - cal extend(lines, s:process(s:changelist(each), each, fnamet)) - endfo - sil! exe 'noa hid b' a:original_bufnr - let &swb = swb - cal ctrlp#syntax() - cal s:syntax() - retu lines -endf - -fu! ctrlp#changes#accept(mode, str) - let info = matchlist(a:str, '\t|\(\d\+\):[^|]\+|\(\d\+\):\(\d\+\)|$') - let bufnr = str2nr(get(info, 1)) - if bufnr - cal ctrlp#acceptfile(a:mode, bufname(bufnr)) - cal cursor(get(info, 2), get(info, 3)) - sil! norm! zvzz - en -endf - -fu! ctrlp#changes#cmd(mode, ...) - let s:clmode = a:mode - if a:0 && !empty(a:1) - let s:bufnr = bufnr('^'.fnamemodify(a:1, ':p').'$') - en - retu s:id -endf - -fu! ctrlp#changes#exit() - unl! s:clmode s:bufnr -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/dir.vim b/vim/bundle/ctrlp/autoload/ctrlp/dir.vim deleted file mode 100644 index 2589a0b..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/dir.vim +++ /dev/null @@ -1,93 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/dir.vim -" Description: Directory extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_dir') && g:loaded_ctrlp_dir - fini -en -let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0] - -let s:ars = ['s:maxdepth', 's:maxfiles', 's:compare_lim', 's:glob', 's:caching'] - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#dir#init('.join(s:ars, ', ').')', - \ 'accept': 'ctrlp#dir#accept', - \ 'lname': 'dirs', - \ 'sname': 'dir', - \ 'type': 'path', - \ 'specinput': 1, - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) - -let s:dircounts = {} -" Utilities {{{1 -fu! s:globdirs(dirs, depth) - let entries = split(globpath(a:dirs, s:glob), "\n") - let [dirs, depth] = [ctrlp#dirnfile(entries)[0], a:depth + 1] - cal extend(g:ctrlp_alldirs, dirs) - let nr = len(g:ctrlp_alldirs) - if !empty(dirs) && !s:max(nr, s:maxfiles) && depth <= s:maxdepth - sil! cal ctrlp#progress(nr) - cal map(dirs, 'ctrlp#utils#fnesc(v:val, "g", ",")') - cal s:globdirs(join(dirs, ','), depth) - en -endf - -fu! s:max(len, max) - retu a:max && a:len > a:max -endf - -fu! s:nocache() - retu !s:caching || ( s:caching > 1 && get(s:dircounts, s:cwd) < s:caching ) -endf -" Public {{{1 -fu! ctrlp#dir#init(...) - let s:cwd = getcwd() - for each in range(len(s:ars)) - let {s:ars[each]} = a:{each + 1} - endfo - let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'dir' - let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile('dir') - if g:ctrlp_newdir || s:nocache() || !filereadable(cafile) - let [s:initcwd, g:ctrlp_alldirs] = [s:cwd, []] - cal s:globdirs(ctrlp#utils#fnesc(s:cwd, 'g', ','), 0) - cal ctrlp#rmbasedir(g:ctrlp_alldirs) - if len(g:ctrlp_alldirs) <= s:compare_lim - cal sort(g:ctrlp_alldirs, 'ctrlp#complen') - en - cal ctrlp#utils#writecache(g:ctrlp_alldirs, cadir, cafile) - let g:ctrlp_newdir = 0 - el - if !( exists('s:initcwd') && s:initcwd == s:cwd ) - let s:initcwd = s:cwd - let g:ctrlp_alldirs = ctrlp#utils#readfile(cafile) - en - en - cal extend(s:dircounts, { s:cwd : len(g:ctrlp_alldirs) }) - retu g:ctrlp_alldirs -endf - -fu! ctrlp#dir#accept(mode, str) - let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#utils#lash().a:str - if a:mode =~ 't\|v\|h' - cal ctrlp#exit() - en - cal ctrlp#setdir(path, a:mode =~ 't\|h' ? 'chd!' : 'lc!') - if a:mode == 'e' - sil! cal ctrlp#statusline() - cal ctrlp#setlines(s:id) - cal ctrlp#recordhist() - cal ctrlp#prtclear() - en -endf - -fu! ctrlp#dir#id() - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/line.vim b/vim/bundle/ctrlp/autoload/ctrlp/line.vim deleted file mode 100644 index a2e0dde..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/line.vim +++ /dev/null @@ -1,62 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/line.vim -" Description: Line extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_line') && g:loaded_ctrlp_line - fini -en -let g:loaded_ctrlp_line = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#line#init()', - \ 'accept': 'ctrlp#line#accept', - \ 'lname': 'lines', - \ 'sname': 'lns', - \ 'type': 'tabe', - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) -" Utilities {{{1 -fu! s:syntax() - if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPBufName', 'Directory') - cal ctrlp#hicheck('CtrlPTabExtra', 'Comment') - sy match CtrlPBufName '\t|\zs[^|]\+\ze|\d\+:\d\+|$' - sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName - en -endf -" Public {{{1 -fu! ctrlp#line#init() - let [bufs, lines] = [ctrlp#buffers('id'), []] - for bufnr in bufs - let [lfb, bufn] = [getbufline(bufnr, 1, '$'), bufname(bufnr)] - let lfb = lfb == [] ? ctrlp#utils#readfile(fnamemodify(bufn, ':p')) : lfb - cal map(lfb, 'tr(v:val, '' '', '' '')') - let [linenr, len_lfb, buft] = [1, len(lfb), fnamemodify(bufn, ':t')] - wh linenr <= len_lfb - let lfb[linenr - 1] .= ' |'.buft.'|'.bufnr.':'.linenr.'|' - let linenr += 1 - endw - cal extend(lines, filter(lfb, 'v:val !~ ''^\s*\t|[^|]\+|\d\+:\d\+|$''')) - endfo - cal s:syntax() - retu lines -endf - -fu! ctrlp#line#accept(mode, str) - let info = matchlist(a:str, '\t|[^|]\+|\(\d\+\):\(\d\+\)|$') - let bufnr = str2nr(get(info, 1)) - if bufnr - cal ctrlp#acceptfile(a:mode, bufname(bufnr), get(info, 2)) - en -endf - -fu! ctrlp#line#id() - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/mixed.vim b/vim/bundle/ctrlp/autoload/ctrlp/mixed.vim deleted file mode 100644 index cf01d10..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/mixed.vim +++ /dev/null @@ -1,83 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/mixed.vim -" Description: Mixing Files + MRU + Buffers -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_mixed') && g:loaded_ctrlp_mixed - fini -en -let [g:loaded_ctrlp_mixed, g:ctrlp_newmix] = [1, 0] - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#mixed#init(s:compare_lim)', - \ 'accept': 'ctrlp#acceptfile', - \ 'lname': 'fil + mru + buf', - \ 'sname': 'mix', - \ 'type': 'path', - \ 'opmul': 1, - \ 'specinput': 1, - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) -" Utilities {{{1 -fu! s:newcache(cwd) - if g:ctrlp_newmix || !has_key(g:ctrlp_allmixes, 'data') | retu 1 | en - retu g:ctrlp_allmixes['cwd'] != a:cwd - \ || g:ctrlp_allmixes['filtime'] < getftime(ctrlp#utils#cachefile()) - \ || g:ctrlp_allmixes['mrutime'] < getftime(ctrlp#mrufiles#cachefile()) - \ || g:ctrlp_allmixes['bufs'] < len(ctrlp#mrufiles#bufs()) -endf - -fu! s:getnewmix(cwd, clim) - if g:ctrlp_newmix - cal ctrlp#mrufiles#refresh('raw') - let g:ctrlp_newcache = 1 - en - let g:ctrlp_lines = copy(ctrlp#files()) - cal ctrlp#progress('Mixing...') - let mrufs = copy(ctrlp#mrufiles#list('raw')) - if exists('+ssl') && &ssl - cal map(mrufs, 'tr(v:val, "\\", "/")') - en - let bufs = map(ctrlp#buffers('id'), 'fnamemodify(bufname(v:val), ":p")') - let mrufs = bufs + filter(mrufs, 'index(bufs, v:val) < 0') - if len(mrufs) > len(g:ctrlp_lines) - cal filter(mrufs, 'stridx(v:val, a:cwd)') - el - let cwd_mrufs = filter(copy(mrufs), '!stridx(v:val, a:cwd)') - let cwd_mrufs = ctrlp#rmbasedir(cwd_mrufs) - for each in cwd_mrufs - let id = index(g:ctrlp_lines, each) - if id >= 0 | cal remove(g:ctrlp_lines, id) | en - endfo - en - cal map(mrufs, 'fnamemodify(v:val, ":.")') - let g:ctrlp_lines = len(mrufs) > len(g:ctrlp_lines) - \ ? g:ctrlp_lines + mrufs : mrufs + g:ctrlp_lines - if len(g:ctrlp_lines) <= a:clim - cal sort(g:ctrlp_lines, 'ctrlp#complen') - en - let g:ctrlp_allmixes = { 'filtime': getftime(ctrlp#utils#cachefile()), - \ 'mrutime': getftime(ctrlp#mrufiles#cachefile()), 'cwd': a:cwd, - \ 'bufs': len(ctrlp#mrufiles#bufs()), 'data': g:ctrlp_lines } -endf -" Public {{{1 -fu! ctrlp#mixed#init(clim) - let cwd = getcwd() - if s:newcache(cwd) - cal s:getnewmix(cwd, a:clim) - el - let g:ctrlp_lines = g:ctrlp_allmixes['data'] - en - let g:ctrlp_newmix = 0 - retu g:ctrlp_lines -endf - -fu! ctrlp#mixed#id() - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/mrufiles.vim b/vim/bundle/ctrlp/autoload/ctrlp/mrufiles.vim deleted file mode 100644 index 908052f..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/mrufiles.vim +++ /dev/null @@ -1,148 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/mrufiles.vim -" Description: Most Recently Used Files extension -" Author: Kien Nguyen -" ============================================================================= - -" Static variables {{{1 -let [s:mrbs, s:mrufs] = [[], []] - -fu! ctrlp#mrufiles#opts() - let [pref, opts] = ['g:ctrlp_mruf_', { - \ 'max': ['s:max', 250], - \ 'include': ['s:in', ''], - \ 'exclude': ['s:ex', ''], - \ 'case_sensitive': ['s:cseno', 1], - \ 'relative': ['s:re', 0], - \ 'save_on_update': ['s:soup', 1], - \ }] - for [ke, va] in items(opts) - let [{va[0]}, {pref.ke}] = [pref.ke, exists(pref.ke) ? {pref.ke} : va[1]] - endfo -endf -cal ctrlp#mrufiles#opts() -" Utilities {{{1 -fu! s:excl(fn) - retu !empty({s:ex}) && a:fn =~# {s:ex} -endf - -fu! s:mergelists() - let diskmrufs = ctrlp#utils#readfile(ctrlp#mrufiles#cachefile()) - cal filter(diskmrufs, 'index(s:mrufs, v:val) < 0') - let mrufs = s:mrufs + diskmrufs - retu s:chop(mrufs) -endf - -fu! s:chop(mrufs) - if len(a:mrufs) > {s:max} | cal remove(a:mrufs, {s:max}, -1) | en - retu a:mrufs -endf - -fu! s:reformat(mrufs) - let cwd = getcwd() - let cwd .= cwd !~ '[\/]$' ? ctrlp#utils#lash() : '' - if {s:re} - let cwd = exists('+ssl') ? tr(cwd, '/', '\') : cwd - cal filter(a:mrufs, '!stridx(v:val, cwd)') - en - let idx = strlen(cwd) - if exists('+ssl') && &ssl - let cwd = tr(cwd, '\', '/') - cal map(a:mrufs, 'tr(v:val, "\\", "/")') - en - retu map(a:mrufs, '!stridx(v:val, cwd) ? strpart(v:val, idx) : v:val') -endf - -fu! s:record(bufnr) - if s:locked | retu | en - let bufnr = a:bufnr + 0 - let bufname = bufname(bufnr) - if bufnr > 0 && !empty(bufname) - cal filter(s:mrbs, 'v:val != bufnr') - cal insert(s:mrbs, bufnr) - cal s:addtomrufs(bufname) - en -endf - -fu! s:addtomrufs(fname) - let fn = fnamemodify(a:fname, ':p') - let fn = exists('+ssl') ? tr(fn, '/', '\') : fn - if ( !empty({s:in}) && fn !~# {s:in} ) || ( !empty({s:ex}) && fn =~# {s:ex} ) - \ || !empty(getbufvar('^'.fn.'$', '&bt')) || !filereadable(fn) | retu - en - let idx = index(s:mrufs, fn, 0, !{s:cseno}) - if idx - cal filter(s:mrufs, 'v:val !='.( {s:cseno} ? '#' : '?' ).' fn') - cal insert(s:mrufs, fn) - if {s:soup} && idx < 0 - cal s:savetofile(s:mergelists()) - en - en -endf - -fu! s:savetofile(mrufs) - cal ctrlp#utils#writecache(a:mrufs, s:cadir, s:cafile) -endf -" Public {{{1 -fu! ctrlp#mrufiles#refresh(...) - let mrufs = s:mergelists() - cal filter(mrufs, '!empty(ctrlp#utils#glob(v:val, 1)) && !s:excl(v:val)') - if exists('+ssl') - cal map(mrufs, 'tr(v:val, "/", "\\")') - cal map(s:mrufs, 'tr(v:val, "/", "\\")') - let cond = 'count(mrufs, v:val, !{s:cseno}) == 1' - cal filter(mrufs, cond) - cal filter(s:mrufs, cond) - en - cal s:savetofile(mrufs) - retu a:0 && a:1 == 'raw' ? [] : s:reformat(mrufs) -endf - -fu! ctrlp#mrufiles#remove(files) - let mrufs = [] - if a:files != [] - let mrufs = s:mergelists() - let cond = 'index(a:files, v:val, 0, !{s:cseno}) < 0' - cal filter(mrufs, cond) - cal filter(s:mrufs, cond) - en - cal s:savetofile(mrufs) - retu s:reformat(mrufs) -endf - -fu! ctrlp#mrufiles#add(fn) - if !empty(a:fn) - cal s:addtomrufs(a:fn) - en -endf - -fu! ctrlp#mrufiles#list(...) - retu a:0 ? a:1 == 'raw' ? s:mergelists() : 0 : s:reformat(s:mergelists()) -endf - -fu! ctrlp#mrufiles#bufs() - retu s:mrbs -endf - -fu! ctrlp#mrufiles#cachefile() - if !exists('s:cadir') || !exists('s:cafile') - let s:cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru' - let s:cafile = s:cadir.ctrlp#utils#lash().'cache.txt' - en - retu s:cafile -endf - -fu! ctrlp#mrufiles#init() - if !has('autocmd') | retu | en - let s:locked = 0 - aug CtrlPMRUF - au! - au BufAdd,BufEnter,BufLeave,BufWritePost * cal s:record(expand('', 1)) - au QuickFixCmdPre *vimgrep* let s:locked = 1 - au QuickFixCmdPost *vimgrep* let s:locked = 0 - au VimLeavePre * cal s:savetofile(s:mergelists()) - aug END -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/quickfix.vim b/vim/bundle/ctrlp/autoload/ctrlp/quickfix.vim deleted file mode 100644 index 03ab921..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/quickfix.vim +++ /dev/null @@ -1,59 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/quickfix.vim -" Description: Quickfix extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_quickfix') && g:loaded_ctrlp_quickfix - fini -en -let g:loaded_ctrlp_quickfix = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#quickfix#init()', - \ 'accept': 'ctrlp#quickfix#accept', - \ 'lname': 'quickfix', - \ 'sname': 'qfx', - \ 'type': 'line', - \ 'sort': 0, - \ 'nolim': 1, - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) - -fu! s:lineout(dict) - retu printf('%s|%d:%d| %s', bufname(a:dict['bufnr']), a:dict['lnum'], - \ a:dict['col'], matchstr(a:dict['text'], '\s*\zs.*\S')) -endf -" Utilities {{{1 -fu! s:syntax() - if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPqfLineCol', 'Search') - sy match CtrlPqfLineCol '|\zs\d\+:\d\+\ze|' - en -endf -" Public {{{1 -fu! ctrlp#quickfix#init() - cal s:syntax() - retu map(getqflist(), 's:lineout(v:val)') -endf - -fu! ctrlp#quickfix#accept(mode, str) - let vals = matchlist(a:str, '^\([^|]\+\ze\)|\(\d\+\):\(\d\+\)|') - if vals == [] || vals[1] == '' | retu | en - cal ctrlp#acceptfile(a:mode, vals[1]) - let cur_pos = getpos('.')[1:2] - if cur_pos != [1, 1] && cur_pos != map(vals[2:3], 'str2nr(v:val)') - mark ' - en - cal cursor(vals[2], vals[3]) - sil! norm! zvzz -endf - -fu! ctrlp#quickfix#id() - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/rtscript.vim b/vim/bundle/ctrlp/autoload/ctrlp/rtscript.vim deleted file mode 100644 index eed21c6..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/rtscript.vim +++ /dev/null @@ -1,59 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/rtscript.vim -" Description: Runtime scripts extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_rtscript') && g:loaded_ctrlp_rtscript - fini -en -let [g:loaded_ctrlp_rtscript, g:ctrlp_newrts] = [1, 0] - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#rtscript#init(s:caching)', - \ 'accept': 'ctrlp#acceptfile', - \ 'lname': 'runtime scripts', - \ 'sname': 'rts', - \ 'type': 'path', - \ 'opmul': 1, - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) - -let s:filecounts = {} -" Utilities {{{1 -fu! s:nocache() - retu g:ctrlp_newrts || - \ !s:caching || ( s:caching > 1 && get(s:filecounts, s:cwd) < s:caching ) -endf -" Public {{{1 -fu! ctrlp#rtscript#init(caching) - let [s:caching, s:cwd] = [a:caching, getcwd()] - if s:nocache() || - \ !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[0] == &rtp ) - sil! cal ctrlp#progress('Indexing...') - let entries = split(globpath(ctrlp#utils#fnesc(&rtp, 'g'), '**/*.*'), "\n") - cal filter(entries, 'count(entries, v:val) == 1') - let [entries, echoed] = [ctrlp#dirnfile(entries)[1], 1] - el - let [entries, results] = g:ctrlp_rtscache[2:3] - en - if s:nocache() || - \ !( exists('g:ctrlp_rtscache') && g:ctrlp_rtscache[:1] == [&rtp, s:cwd] ) - if !exists('echoed') - sil! cal ctrlp#progress('Processing...') - en - let results = map(copy(entries), 'fnamemodify(v:val, '':.'')') - en - let [g:ctrlp_rtscache, g:ctrlp_newrts] = [[&rtp, s:cwd, entries, results], 0] - cal extend(s:filecounts, { s:cwd : len(results) }) - retu results -endf - -fu! ctrlp#rtscript#id() - retu s:id -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/tag.vim b/vim/bundle/ctrlp/autoload/ctrlp/tag.vim deleted file mode 100644 index cd4d909..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/tag.vim +++ /dev/null @@ -1,128 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/tag.vim -" Description: Tag file extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if exists('g:loaded_ctrlp_tag') && g:loaded_ctrlp_tag - fini -en -let g:loaded_ctrlp_tag = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#tag#init()', - \ 'accept': 'ctrlp#tag#accept', - \ 'lname': 'tags', - \ 'sname': 'tag', - \ 'enter': 'ctrlp#tag#enter()', - \ 'type': 'tabs', - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) -" Utilities {{{1 -fu! s:findcount(str) - let [tg, fname] = split(a:str, '\t\+\ze[^\t]\+$') - let tgs = taglist('^'.tg.'$') - if len(tgs) < 2 - retu [1, 1] - en - let bname = fnamemodify(bufname('%'), ':p') - let fname = expand(fnamemodify(simplify(fname), ':s?^[.\/]\+??:p:.'), 1) - let [fnd, ct, pos, idx] = [0, 0, 0, 0] - wh idx < len(tgs) - if bname == fnamemodify(tgs[idx]["filename"], ':p') - cal insert(tgs, remove(tgs, idx)) - brea - en - let idx += 1 - endw - for each in tgs - let ct += 1 - let fulname = fnamemodify(each["filename"], ':p') - if stridx(fulname, fname) >= 0 - \ && strlen(fname) + stridx(fulname, fname) == strlen(fulname) - let fnd += 1 - let pos = ct - en - if fnd > 1 | brea | en - endfo - retu [fnd, pos] -endf - -fu! s:filter(tags) - let nr = 0 - wh 0 < 1 - if a:tags == [] | brea | en - if a:tags[nr] =~ '^!' && a:tags[nr] !~# '^!_TAG_' - let nr += 1 - con - en - if a:tags[nr] =~# '^!_TAG_' && len(a:tags) > nr - cal remove(a:tags, nr) - el - brea - en - endw - retu a:tags -endf - -fu! s:syntax() - if !ctrlp#nosy() - cal ctrlp#hicheck('CtrlPTabExtra', 'Comment') - sy match CtrlPTabExtra '\zs\t.*\ze$' - en -endf -" Public {{{1 -fu! ctrlp#tag#init() - if empty(s:tagfiles) | retu [] | en - let g:ctrlp_alltags = [] - let tagfiles = sort(filter(s:tagfiles, 'count(s:tagfiles, v:val) == 1')) - for each in tagfiles - let alltags = s:filter(ctrlp#utils#readfile(each)) - cal extend(g:ctrlp_alltags, alltags) - endfo - cal s:syntax() - retu g:ctrlp_alltags -endf - -fu! ctrlp#tag#accept(mode, str) - cal ctrlp#exit() - let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t') - let [tg, fnd] = [split(str, '^[^\t]\+\zs\t')[0], s:findcount(str)] - let cmds = { - \ 't': ['tab sp', 'tab stj'], - \ 'h': ['sp', 'stj'], - \ 'v': ['vs', 'vert stj'], - \ 'e': ['', 'tj'], - \ } - let cmd = fnd[0] == 1 ? cmds[a:mode][0] : cmds[a:mode][1] - let cmd = a:mode == 'e' && ctrlp#modfilecond(!&aw) - \ ? ( cmd == 'tj' ? 'stj' : 'sp' ) : cmd - let cmd = a:mode == 't' ? ctrlp#tabcount().cmd : cmd - if fnd[0] == 1 - if cmd != '' - exe cmd - en - let save_cst = &cst - set cst& - cal feedkeys(":".fnd[1]."ta ".tg."\r", 'nt') - let &cst = save_cst - el - cal feedkeys(":".cmd." ".tg."\r", 'nt') - en - cal ctrlp#setlcdir() -endf - -fu! ctrlp#tag#id() - retu s:id -endf - -fu! ctrlp#tag#enter() - let tfs = tagfiles() - let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), - \ 'filereadable(v:val)') : [] -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/undo.vim b/vim/bundle/ctrlp/autoload/ctrlp/undo.vim deleted file mode 100644 index dee705e..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/undo.vim +++ /dev/null @@ -1,154 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/undo.vim -" Description: Undo extension -" Author: Kien Nguyen -" ============================================================================= - -" Init {{{1 -if ( exists('g:loaded_ctrlp_undo') && g:loaded_ctrlp_undo ) - fini -en -let g:loaded_ctrlp_undo = 1 - -cal add(g:ctrlp_ext_vars, { - \ 'init': 'ctrlp#undo#init()', - \ 'accept': 'ctrlp#undo#accept', - \ 'lname': 'undo', - \ 'sname': 'udo', - \ 'enter': 'ctrlp#undo#enter()', - \ 'exit': 'ctrlp#undo#exit()', - \ 'type': 'line', - \ 'sort': 0, - \ 'nolim': 1, - \ }) - -let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) - -let s:text = map(['second', 'seconds', 'minutes', 'hours', 'days', 'weeks', - \ 'months', 'years'], '" ".v:val." ago"') -" Utilities {{{1 -fu! s:getundo() - if exists('*undotree') - \ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) ) - retu [1, undotree()] - el - redi => result - sil! undol - redi END - retu [0, split(result, "\n")[1:]] - en -endf - -fu! s:flatten(tree, cur) - let flatdict = {} - for each in a:tree - let saved = has_key(each, 'save') ? 'saved' : '' - let current = each['seq'] == a:cur ? 'current' : '' - cal extend(flatdict, { each['seq'] : [each['time'], saved, current] }) - if has_key(each, 'alt') - cal extend(flatdict, s:flatten(each['alt'], a:cur)) - en - endfo - retu flatdict -endf - -fu! s:elapsed(nr) - let [text, time] = [s:text, localtime() - a:nr] - let mins = time / 60 - let hrs = time / 3600 - let days = time / 86400 - let wks = time / 604800 - let mons = time / 2592000 - let yrs = time / 31536000 - if yrs > 1 - retu yrs.text[7] - elsei mons > 1 - retu mons.text[6] - elsei wks > 1 - retu wks.text[5] - elsei days > 1 - retu days.text[4] - elsei hrs > 1 - retu hrs.text[3] - elsei mins > 1 - retu mins.text[2] - elsei time == 1 - retu time.text[0] - elsei time < 120 - retu time.text[1] - en -endf - -fu! s:syntax() - if ctrlp#nosy() | retu | en - for [ke, va] in items({'T': 'Directory', 'Br': 'Comment', 'Nr': 'String', - \ 'Sv': 'Comment', 'Po': 'Title'}) - cal ctrlp#hicheck('CtrlPUndo'.ke, va) - endfo - sy match CtrlPUndoT '\v\d+ \zs[^ ]+\ze|\d+:\d+:\d+' - sy match CtrlPUndoBr '\[\|\]' - sy match CtrlPUndoNr '\[\d\+\]' contains=CtrlPUndoBr - sy match CtrlPUndoSv 'saved' - sy match CtrlPUndoPo 'current' -endf - -fu! s:dict2list(dict) - for ke in keys(a:dict) - let a:dict[ke][0] = s:elapsed(a:dict[ke][0]) - endfo - retu map(keys(a:dict), 'eval(''[v:val, a:dict[v:val]]'')') -endf - -fu! s:compval(...) - retu a:2[0] - a:1[0] -endf - -fu! s:format(...) - let saved = !empty(a:1[1][1]) ? ' '.a:1[1][1] : '' - let current = !empty(a:1[1][2]) ? ' '.a:1[1][2] : '' - retu a:1[1][0].' ['.a:1[0].']'.saved.current -endf - -fu! s:formatul(...) - let parts = matchlist(a:1, - \ '\v^\s+(\d+)\s+\d+\s+([^ ]+\s?[^ ]+|\d+\s\w+\s\w+)(\s*\d*)$') - retu parts == [] ? '----' - \ : parts[2].' ['.parts[1].']'.( parts[3] != '' ? ' saved' : '' ) -endf -" Public {{{1 -fu! ctrlp#undo#init() - let entries = s:undos[0] ? s:undos[1]['entries'] : s:undos[1] - if empty(entries) | retu [] | en - if !exists('s:lines') - if s:undos[0] - let entries = s:dict2list(s:flatten(entries, s:undos[1]['seq_cur'])) - let s:lines = map(sort(entries, 's:compval'), 's:format(v:val)') - el - let s:lines = map(reverse(entries), 's:formatul(v:val)') - en - en - cal s:syntax() - retu s:lines -endf - -fu! ctrlp#undo#accept(mode, str) - let undon = matchstr(a:str, '\[\zs\d\+\ze\]') - if empty(undon) | retu | en - cal ctrlp#exit() - exe 'u' undon -endf - -fu! ctrlp#undo#id() - retu s:id -endf - -fu! ctrlp#undo#enter() - let s:undos = s:getundo() -endf - -fu! ctrlp#undo#exit() - unl! s:lines -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/autoload/ctrlp/utils.vim b/vim/bundle/ctrlp/autoload/ctrlp/utils.vim deleted file mode 100644 index d54fd38..0000000 --- a/vim/bundle/ctrlp/autoload/ctrlp/utils.vim +++ /dev/null @@ -1,120 +0,0 @@ -" ============================================================================= -" File: autoload/ctrlp/utils.vim -" Description: Utilities -" Author: Kien Nguyen -" ============================================================================= - -" Static variables {{{1 -fu! ctrlp#utils#lash() - retu &ssl || !exists('+ssl') ? '/' : '\' -endf - -fu! s:lash(...) - retu ( a:0 ? a:1 : getcwd() ) !~ '[\/]$' ? s:lash : '' -endf - -fu! ctrlp#utils#opts() - let s:lash = ctrlp#utils#lash() - let usrhome = $HOME . s:lash( $HOME ) - let cahome = exists('$XDG_CACHE_HOME') ? $XDG_CACHE_HOME : usrhome.'.cache' - let cadir = isdirectory(usrhome.'.ctrlp_cache') - \ ? usrhome.'.ctrlp_cache' : cahome.s:lash(cahome).'ctrlp' - if exists('g:ctrlp_cache_dir') - let cadir = expand(g:ctrlp_cache_dir, 1) - if isdirectory(cadir.s:lash(cadir).'.ctrlp_cache') - let cadir = cadir.s:lash(cadir).'.ctrlp_cache' - en - en - let s:cache_dir = cadir -endf -cal ctrlp#utils#opts() - -let s:wig_cond = v:version > 702 || ( v:version == 702 && has('patch051') ) -" Files and Directories {{{1 -fu! ctrlp#utils#cachedir() - retu s:cache_dir -endf - -fu! ctrlp#utils#cachefile(...) - let [tail, dir] = [a:0 == 1 ? '.'.a:1 : '', a:0 == 2 ? a:1 : getcwd()] - let cache_file = substitute(dir, '\([\/]\|^\a\zs:\)', '%', 'g').tail.'.txt' - retu a:0 == 1 ? cache_file : s:cache_dir.s:lash(s:cache_dir).cache_file -endf - -fu! ctrlp#utils#readfile(file) - if filereadable(a:file) - let data = readfile(a:file) - if empty(data) || type(data) != 3 - unl data - let data = [] - en - retu data - en - retu [] -endf - -fu! ctrlp#utils#mkdir(dir) - if exists('*mkdir') && !isdirectory(a:dir) - sil! cal mkdir(a:dir, 'p') - en - retu a:dir -endf - -fu! ctrlp#utils#writecache(lines, ...) - if isdirectory(ctrlp#utils#mkdir(a:0 ? a:1 : s:cache_dir)) - sil! cal writefile(a:lines, a:0 >= 2 ? a:2 : ctrlp#utils#cachefile()) - en -endf - -fu! ctrlp#utils#glob(...) - let path = ctrlp#utils#fnesc(a:1, 'g') - retu s:wig_cond ? glob(path, a:2) : glob(path) -endf - -fu! ctrlp#utils#globpath(...) - retu call('globpath', s:wig_cond ? a:000 : a:000[:1]) -endf - -fu! ctrlp#utils#fnesc(path, type, ...) - if exists('*fnameescape') - if exists('+ssl') - if a:type == 'c' - let path = escape(a:path, '%#') - elsei a:type == 'f' - let path = fnameescape(a:path) - elsei a:type == 'g' - let path = escape(a:path, '?*') - en - let path = substitute(path, '[', '[[]', 'g') - el - let path = fnameescape(a:path) - en - el - if exists('+ssl') - if a:type == 'c' - let path = escape(a:path, '%#') - elsei a:type == 'f' - let path = escape(a:path, " \t\n%#*?|<\"") - elsei a:type == 'g' - let path = escape(a:path, '?*') - en - let path = substitute(path, '[', '[[]', 'g') - el - let path = escape(a:path, " \t\n*?[{`$\\%#'\"|!<") - en - en - retu a:0 ? escape(path, a:1) : path -endf - -fu! ctrlp#utils#dircompl(...) - let [hsl, str] = [match(a:1, '[\/]'), ''] - let par = substitute(a:1, '[^\/]*$', '', '') - let path = !hsl ? par : hsl > 0 ? getcwd().s:lash().par : getcwd() - for dir in split(globpath(ctrlp#utils#fnesc(path, 'g', ','), '*/'), '\n') - let str .= par.split(dir, '[\/]')[-1]."\n" - endfo - retu str -endf -"}}} - -" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/doc/ctrlp.txt b/vim/bundle/ctrlp/doc/ctrlp.txt deleted file mode 100644 index 6a9ad8e..0000000 --- a/vim/bundle/ctrlp/doc/ctrlp.txt +++ /dev/null @@ -1,1406 +0,0 @@ -*ctrlp.txt* Fuzzy file, buffer, mru, tag, ... finder. v1.79 -*CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* -=============================================================================== -# # -# :::::::: ::::::::::: ::::::::: ::: ::::::::: # -# :+: :+: :+: :+: :+: :+: :+: :+: # -# +:+ +:+ +:+ +:+ +:+ +:+ +:+ # -# +#+ +#+ +#++:++#: +#+ +#++:++#+ # -# +#+ +#+ +#+ +#+ +#+ +#+ # -# #+# #+# #+# #+# #+# #+# #+# # -# ######## ### ### ### ########## ### # -# # -=============================================================================== -CONTENTS *ctrlp-contents* - - 1. Intro........................................|ctrlp-intro| - 2. Options......................................|ctrlp-options| - 3. Commands.....................................|ctrlp-commands| - 4. Mappings.....................................|ctrlp-mappings| - 5. Input Formats................................|ctrlp-input-formats| - 6. Extensions...................................|ctrlp-extensions| - -=============================================================================== -INTRO *ctrlp-intro* - -Full path fuzzy file, buffer, mru, tag, ... finder with an intuitive interface. -Written in pure Vimscript for MacVim, gVim and Vim version 7.0+. Has full -support for Vim's |regexp| as search pattern, built-in MRU files monitoring, -project's root finder, and more. - -To enable optional extensions (tag, dir, rtscript...), see |ctrlp-extensions|. - -=============================================================================== -OPTIONS *ctrlp-options* - -Overview:~ - - |loaded_ctrlp|................Disable the plugin. - |ctrlp_map|...................Default mapping. - |ctrlp_cmd|...................Default command used for the default mapping. - |ctrlp_by_filename|...........Default to filename mode or not. - |ctrlp_regexp|................Default to regexp mode or not. - |ctrlp_match_window_bottom|...Where to show the match window. - |ctrlp_match_window_reversed|.Sort order in the match window. - |ctrlp_max_height|............Max height of the match window. - |ctrlp_switch_buffer|.........Jump to an open buffer if already opened. - |ctrlp_reuse_window|..........Reuse special windows (help, quickfix, etc). - |ctrlp_tabpage_position|......Where to put the new tab page. - |ctrlp_working_path_mode|.....How to set CtrlP's local working directory. - |ctrlp_root_markers|..........Additional, high priority root markers. - |ctrlp_use_caching|...........Use per-session caching or not. - |ctrlp_clear_cache_on_exit|...Keep cache after exiting Vim or not. - |ctrlp_cache_dir|.............Location of the cache directory. - |ctrlp_show_hidden|...........Ignore dotfiles and dotdirs or not. - |ctrlp_custom_ignore|.........Hide stuff when using |globpath()|. - |ctrlp_max_files|.............Number of files to scan initially. - |ctrlp_max_depth|.............Directory depth to recurse into when scanning. - |ctrlp_user_command|..........Use an external scanner. - |ctrlp_max_history|...........Number of entries saved in the prompt history. - |ctrlp_open_new_file|.........How to open a file created by . - |ctrlp_open_multiple_files|...How to open files selected by . - |ctrlp_arg_map|...............Intercept and or not. - |ctrlp_follow_symlinks|.......Follow symbolic links or not. - |ctrlp_lazy_update|...........Only update when typing has stopped. - |ctrlp_default_input|.........Seed the prompt with an initial string. - |ctrlp_abbrev|................Input abbreviations. - |ctrlp_key_loop|..............Use input looping for multi-byte input. - |ctrlp_use_migemo|............Use Migemo patterns for Japanese filenames. - |ctrlp_prompt_mappings|.......Change the mappings inside the prompt. - - MRU mode: - |ctrlp_mruf_max|..............Max MRU entries to remember. - |ctrlp_mruf_exclude|..........Files that shouldn't be remembered. - |ctrlp_mruf_include|..........Files to be remembered. - |ctrlp_mruf_relative|.........Show only MRU files in the working directory. - |ctrlp_mruf_default_order|....Disable sorting. - |ctrlp_mruf_case_sensitive|...MRU files are case sensitive or not. - |ctrlp_mruf_save_on_update|...Save to disk whenever a new entry is added. - - Advanced options: - |ctrlp_open_func|.............Use custom file opening functions. - |ctrlp_status_func|...........Change CtrlP's two statuslines. - |ctrlp_buffer_func|...........Call custom functions in the CtrlP buffer. - |ctrlp_match_func|............Replace the built-in matching algorithm. - -------------------------------------------------------------------------------- -Detailed descriptions and default values:~ - - *'g:ctrlp_map'* -Use this option to change the mapping to invoke CtrlP in |Normal| mode: > - let g:ctrlp_map = '' -< - - *'g:ctrlp_cmd'* -Set the default opening command to use when pressing the above mapping: > - let g:ctrlp_cmd = 'CtrlP' -< - - *'g:loaded_ctrlp'* -Use this to disable the plugin completely: > - let g:loaded_ctrlp = 1 -< - - *'g:ctrlp_by_filename'* -Set this to 1 to set searching by filename (as opposed to full path) as the -default: > - let g:ctrlp_by_filename = 0 -< -Can be toggled on/off by pressing inside the prompt. - - *'g:ctrlp_regexp'* -Set this to 1 to set regexp search as the default: > - let g:ctrlp_regexp = 0 -< -Can be toggled on/off by pressing inside the prompt. - - *'g:ctrlp_match_window_bottom'* -Set this to 0 to show the match window at the top of the screen: > - let g:ctrlp_match_window_bottom = 1 -< - - *'g:ctrlp_match_window_reversed'* -Change the listing order of the files in the match window. The default setting -(1) is from bottom to top: > - let g:ctrlp_match_window_reversed = 1 -< - - *'g:ctrlp_max_height'* -Set the maximum height of the match window: > - let g:ctrlp_max_height = 10 -< - - *'g:ctrlp_switch_buffer'* -When opening a file, if it's already open in a window somewhere, CtrlP will try -to jump to it instead of opening a new instance: > - let g:ctrlp_switch_buffer = 'Et' -< - e - jump when is pressed, but only to windows in the current tab. - t - jump when is pressed, but only to windows in another tab. - v - like "e", but jump when is pressed. - h - like "e", but jump when is pressed. - E, T, V, H - like "e", "t", "v", and "h", but jump to windows anywhere. - 0 or - disable this feature. - - *'g:ctrlp_reuse_window'* -When opening a file with , CtrlP avoids opening it in windows created by -plugins, help and quickfix. Use this to setup some exceptions: > - let g:ctrlp_reuse_window = 'netrw' -< -Acceptable values are partial name, filetype or buftype of the special buffers. -Use regexp to specify the pattern. -Example: > - let g:ctrlp_reuse_window = 'netrw\|help\|quickfix' -< - - *'g:ctrlp_tabpage_position'* -Where to put the new tab page when opening one: > - let g:ctrlp_tabpage_position = 'ac' -< - a - after. - b - before. - c - the current tab page. - l - the last tab page. - f - the first tab page. - - *'g:ctrlp_working_path_mode'* -When starting up, CtrlP sets its local working directory according to this -variable: > - let g:ctrlp_working_path_mode = 'ra' -< - c - the directory of the current file. - a - like "c", but only applies when the current working directory outside of - CtrlP isn't a direct ancestor of the directory of the current file. - r - the nearest ancestor that contains one of these directories or files: - .git .hg .svn .bzr _darcs - w - begin finding a root from the current working directory outside of CtrlP - instead of from the directory of the current file (default). Only applies - when "r" is also present. - 0 or - disable this feature. - -Note #1: if "a" or "c" is included with "r", use the behavior of "a" or "c" (as -a fallback) when a root can't be found. - -Note #2: you can use a |b:var| to set this option on a per buffer basis. - - *'g:ctrlp_root_markers'* -Use this to set your own root markers in addition to the default ones (.git, -.hg, .svn, .bzr, and _darcs). Your markers will take precedence: > - let g:ctrlp_root_markers = [''] -< -Note: you can use a |b:var| to set this option on a per buffer basis. - - *'g:ctrlp_use_caching'* -Enable/Disable per-session caching: > - let g:ctrlp_use_caching = 1 -< - 0 - Disable caching. - 1 - Enable caching. - n - When bigger than 1, disable caching and use the number as the limit to - enable caching again. - -Note: you can quickly purge the cache by pressing while inside CtrlP. - - *'g:ctrlp_clear_cache_on_exit'* -Set this to 0 to enable cross-session caching by not deleting the cache files -upon exiting Vim: > - let g:ctrlp_clear_cache_on_exit = 1 -< - - *'g:ctrlp_cache_dir'* -Set the directory to store the cache files: > - let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' -< - - *'g:ctrlp_show_hidden'* -Set this to 1 if you want CtrlP to scan for dotfiles and dotdirs: > - let g:ctrlp_show_hidden = 0 -< -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'ctrlp-wildignore'* -You can use Vim's |'wildignore'| to exclude files and directories from the -results. -Examples: > - " Excluding version control directories - set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX - set wildignore+=*\\.git\\*,*\\.hg\\*,*\\.svn\\* " Windows ('noshellslash') -< -Note #1: the `*/` in front of each directory glob is required. - -Note #2: |wildignore| influences the result of |expand()|, |globpath()| and -|glob()| which many plugins use to find stuff on the system (e.g. VCS related -plugins look for .git/, .hg/,... some other plugins look for external *.exe -tools on Windows). So be a little mindful of what you put in your |wildignore|. - - *'g:ctrlp_custom_ignore'* -In addition to |'wildignore'|, use this for files and directories you want only -CtrlP to not show. Use regexp to specify the patterns: > - let g:ctrlp_custom_ignore = '' -< -Examples: > - let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' - let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/]\.(git|hg|svn)$', - \ 'file': '\v\.(exe|so|dll)$', - \ 'link': 'SOME_BAD_SYMBOLIC_LINKS', - \ } - let g:ctrlp_custom_ignore = { - \ 'file': '\v(\.cpp|\.h|\.hh|\.cxx)@ - let g:ctrlp_max_files = 10000 -< -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'g:ctrlp_max_depth'* -The maximum depth of a directory tree to recurse into: > - let g:ctrlp_max_depth = 40 -< -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'g:ctrlp_user_command'* -Specify an external tool to use for listing files instead of using Vim's -|globpath()|. Use %s in place of the target directory: > - let g:ctrlp_user_command = '' -< -Examples: > - let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux - let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows -< -You can also use 'grep', 'findstr' or something else to filter the results. -Examples: > - let g:ctrlp_user_command = - \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"' " MacOSX/Linux - let g:ctrlp_user_command = - \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows -< -Use a version control listing command when inside a repository, this is faster -when scanning large projects: > - let g:ctrlp_user_command = [root_marker, listing_command, fallback_command] - let g:ctrlp_user_command = { - \ 'types': { - \ 1: [root_marker_1, listing_command_1], - \ n: [root_marker_n, listing_command_n], - \ }, - \ 'fallback': fallback_command, - \ 'ignore': 0 or 1 - \ } -< -Some examples: > - " Single VCS, listing command does not list untracked files: - let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files'] - let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .'] - - " Multiple VCS's: - let g:ctrlp_user_command = { - \ 'types': { - \ 1: ['.git', 'cd %s && git ls-files'], - \ 2: ['.hg', 'hg --cwd %s locate -I .'], - \ }, - \ 'fallback': 'find %s -type f' - \ } - - " Single VCS, listing command lists untracked files (slower): - let g:ctrlp_user_command = - \ ['.git', 'cd %s && git ls-files . -co --exclude-standard'] - - let g:ctrlp_user_command = - \ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux - - let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') ' - \ . 'do hg --cwd %s status -numac -I . %%a'] " Windows -< -Note #1: if the fallback_command is empty or the 'fallback' key is not defined, -|globpath()| will then be used when scanning outside of a repository. - -Note #2: unless the |Dictionary| format is used and 'ignore' is defined and set -to 1, the |wildignore| and |g:ctrlp_custom_ignore| options do not apply when -these custom commands are being used. When not present, 'ignore' is set to 0 by -default to retain the performance advantage of using external commands. - -Note #3: when changing the option's variable type, remember to |:unlet| it -first or restart Vim to avoid the "E706: Variable type mismatch" error. - -Note #4: you can use a |b:var| to set this option on a per buffer basis. - - *'g:ctrlp_max_history'* -The maximum number of input strings you want CtrlP to remember. The default -value mirrors Vim's global |'history'| option: > - let g:ctrlp_max_history = &history -< -Set to 0 to disable prompt's history. Browse the history with and . - - *'g:ctrlp_open_new_file'* -Use this option to specify how the newly created file is to be opened when -pressing : > - let g:ctrlp_open_new_file = 'v' -< - t - in a new tab. - h - in a new horizontal split. - v - in a new vertical split. - r - in the current window. - - *'g:ctrlp_open_multiple_files'* -If non-zero, this will enable opening multiple files with and : > - let g:ctrlp_open_multiple_files = 'v' -< -Example: > - let g:ctrlp_open_multiple_files = '2vjr' -< -For the number: - - If given, it'll be used as the maximum number of windows or tabs to create - when opening the files (the rest will be opened as hidden buffers). - - If not given, will open all files, each in a new window or new tab. - -For the letters: - t - each file in a new tab. - h - each file in a new horizontal split. - v - each file in a new vertical split. - i - all files as hidden buffers. - j - after opening, jump to the first opened tab or window. - r - open the first file in the current window, then the remaining files in - new splits or new tabs depending on which of "h", "v" and "t" is also - present. - - *'g:ctrlp_arg_map'* -When this is set to 1, the and mappings will accept one extra key -as an argument to override their default behavior: > - let g:ctrlp_arg_map = 0 -< -Pressing or will then prompt for a keypress. The key can be: - t - open in tab(s) - h - open in horizontal split(s) - v - open in vertical split(s) - i - open as hidden buffers (for only) - c - clear the marked files (for only) - r - open in the current window (for only) - , , - cancel and go back to the prompt. - - use the default behavior specified with |g:ctrlp_open_new_file| and - |g:ctrlp_open_multiple_files|. - - *'g:ctrlp_follow_symlinks'* -If non-zero, CtrlP will follow symbolic links when listing files: > - let g:ctrlp_follow_symlinks = 0 -< - 0 - don't follow symbolic links. - 1 - follow but ignore looped internal symlinks to avoid duplicates. - 2 - follow all symlinks indiscriminately. - -Note: does not apply when a command defined with |g:ctrlp_user_command| is -being used. - - *'g:ctrlp_lazy_update'* -Set this to 1 to enable the lazy-update feature: only update the match window -after typing's been stopped for a certain amount of time: > - let g:ctrlp_lazy_update = 0 -< -If is 1, update after 250ms. If bigger than 1, the number will be used as the -delay time in milliseconds. - - *'g:ctrlp_default_input'* -Set this to 1 to enable seeding the prompt with the current file's relative -path: > - let g:ctrlp_default_input = 0 -< -Instead of 1 or 0, if the value of the option is a string, it'll be used as-is -as the default input: > - let g:ctrlp_default_input = 'anystring' -< - - *'g:ctrlp_abbrev'* -Define input abbreviations that can be expanded (either internally or visibly) -in the prompt: > - let g:ctrlp_abbrev = {} -< -Examples: > - let g:ctrlp_abbrev = { - \ 'gmode': 'i', - \ 'abbrevs': [ - \ { - \ 'pattern': '^cd b', - \ 'expanded': '@cd ~/.vim/bundle', - \ 'mode': 'pfrz', - \ }, - \ { - \ 'pattern': '\(^@.\+\|\\\@ (use the expanded string in the - new filename). - c - only when auto-completing directory names with (expand the pattern - immediately before doing the auto-completion). - or not defined - always enable. - -Note: the abbrev entries are evaluated in sequence, so a later entry can be -evaluated against the expanded result of a previous entry; this includes itself -when 'gmode' is "t". - - *'g:ctrlp_key_loop'* -An experimental feature. Set this to 1 to enable input looping for the typing -of multi-byte characters: > - let g:ctrlp_key_loop = 0 -< -Note #1: when set, this option resets the |g:ctrlp_lazy_update| option. - -Note #2: you can toggle this feature inside the prompt with a custom mapping: > - let g:ctrlp_prompt_mappings = { 'ToggleKeyLoop()': [''] } -< - - *'g:ctrlp_use_migemo'* -Set this to 1 to use Migemo Pattern for Japanese filenames. Migemo Search only -works in regexp mode. To split the pattern, separate words with space: > - let g:ctrlp_use_migemo = 0 -< - - *'g:ctrlp_prompt_mappings'* -Use this to customize the mappings inside CtrlP's prompt to your liking. You -only need to keep the lines that you've changed the values (inside []): > - let g:ctrlp_prompt_mappings = { - \ 'PrtBS()': ['', ''], - \ 'PrtDelete()': [''], - \ 'PrtDeleteWord()': [''], - \ 'PrtClear()': [''], - \ 'PrtSelectMove("j")': ['', ''], - \ 'PrtSelectMove("k")': ['', ''], - \ 'PrtSelectMove("t")': ['', ''], - \ 'PrtSelectMove("b")': ['', ''], - \ 'PrtSelectMove("u")': ['', ''], - \ 'PrtSelectMove("d")': ['', ''], - \ 'PrtHistory(-1)': [''], - \ 'PrtHistory(1)': [''], - \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], - \ 'AcceptSelection("h")': ['', '', ''], - \ 'AcceptSelection("t")': [''], - \ 'AcceptSelection("v")': ['', ''], - \ 'ToggleFocus()': [''], - \ 'ToggleRegex()': [''], - \ 'ToggleByFname()': [''], - \ 'ToggleType(1)': ['', ''], - \ 'ToggleType(-1)': ['', ''], - \ 'PrtExpandDir()': [''], - \ 'PrtInsert("c")': ['', ''], - \ 'PrtInsert()': [''], - \ 'PrtCurStart()': [''], - \ 'PrtCurEnd()': [''], - \ 'PrtCurLeft()': ['', '', ''], - \ 'PrtCurRight()': ['', ''], - \ 'PrtClearCache()': [''], - \ 'PrtDeleteEnt()': [''], - \ 'CreateNewFile()': [''], - \ 'MarkToOpen()': [''], - \ 'OpenMulti()': [''], - \ 'PrtExit()': ['', '', ''], - \ } -< -Note: if pressing moves the cursor one character to the left instead of -deleting a character for you, add this to your |.vimrc| to disable the plugin's -default mapping: > - let g:ctrlp_prompt_mappings = { 'PrtCurLeft()': ['', ''] } -< - ----------------------------------------- -MRU mode options:~ - - *'g:ctrlp_mruf_max'* -Specify the number of recently opened files you want CtrlP to remember: > - let g:ctrlp_mruf_max = 250 -< - - *'g:ctrlp_mruf_exclude'* -Files you don't want CtrlP to remember. Use regexp to specify the patterns: > - let g:ctrlp_mruf_exclude = '' -< -Examples: > - let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux - let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows -< - - *'g:ctrlp_mruf_include'* -And if you want CtrlP to only remember some files, specify them here: > - let g:ctrlp_mruf_include = '' -< -Example: > - let g:ctrlp_mruf_include = '\.py$\|\.rb$' -< - - *'g:ctrlp_mruf_relative'* -Set this to 1 to show only MRU files in the current working directory: > - let g:ctrlp_mruf_relative = 0 -< - - *'g:ctrlp_mruf_default_order'* -Set this to 1 to disable sorting when searching in MRU mode: > - let g:ctrlp_mruf_default_order = 0 -< - - *'g:ctrlp_mruf_case_sensitive'* -Match this with your file system case-sensitivity setting to avoid duplicate -MRU entries: > - let g:ctrlp_mruf_case_sensitive = 1 -< - - *'g:ctrlp_mruf_save_on_update'* -Set this to 0 to disable saving of the MRU list to hard drive whenever a new -entry is added, saving will then only occur when exiting Vim: > - let g:ctrlp_mruf_save_on_update = 1 -< - ----------------------------------------- -Advanced options:~ - - *'g:ctrlp_open_func'* -Define a custom function to open the selected file: > - let g:ctrlp_open_func = {} -< -Example: > - let g:ctrlp_open_func = { - \ 'files' : 'Function_Name_1', - \ 'buffers' : 'Function_Name_2', - \ 'mru files' : 'Function_Name_3', - \ } -< -Structure of the functions: > - function! Function_Name(action, line) - " Arguments: - " | - " +- a:action : The opening action: - " | + 'e' : user pressed (default) - " | + 'h' : user pressed (default) - " | + 'v' : user pressed (default) - " | + 't' : user pressed (default) - " | + 'x' : user used the console dialog (default) and - " | chose "e[x]ternal". - " | - " +- a:line : The selected line. - - endfunction -< -Note: does not apply when opening multiple files with and . - -Example: open HTML files in the default web browser when is pressed and -in Vim otherwise > - function! HTMLOpenFunc(action, line) - if a:action =~ '^[tx]$' && fnamemodify(a:line, ':e') =~? '^html\?$' - - " Get the filename - let filename = fnameescape(fnamemodify(a:line, ':p')) - - " Close CtrlP - call ctrlp#exit() - - " Open the file - silent! execute '!xdg-open' filename - - elseif a:action == 'x' && fnamemodify(a:line, ':e') !~? '^html\?$' - - " Not a HTML file, simulate pressing again and wait for new input - call feedkeys("\") - - else - - " Use CtrlP's default file opening function - call call('ctrlp#acceptfile', [a:action, a:line]) - - endif - endfunction - - let g:ctrlp_open_func = { 'files': 'HTMLOpenFunc' } -< - - *'g:ctrlp_status_func'* -Use this to customize the statuslines for the CtrlP window: > - let g:ctrlp_status_func = {} -< -Example: > - let g:ctrlp_status_func = { - \ 'main': 'Function_Name_1', - \ 'prog': 'Function_Name_2', - \ } -< -Structure of the functions: > - " Main statusline - function! Function_Name_1(focus, byfname, regex, prev, item, next, marked) - " Arguments: - " | - " +- a:focus : The focus of the prompt: "prt" or "win". - " | - " +- a:byfname : In filename mode or in full path mode: "file" or "path". - " | - " +- a:regex : In regex mode: 1 or 0. - " | - " +- a:prev : The previous search mode. - " | - " +- a:item : The current search mode. - " | - " +- a:next : The next search mode. - " | - " +- a:marked : The number of marked files, or a comma separated list of - " the marked filenames. - - return full_statusline - endfunction - - " Progress statusline - function! Function_Name_2(str) - " a:str : Either the number of files scanned so far, or a string indicating - " the current directory is being scanned with a user_command. - - return full_statusline - endfunction -< -See https://gist.github.com/1610859 for a working example. - - *'g:ctrlp_buffer_func'* -Specify the functions that will be called after entering and before exiting the -CtrlP buffer: > - let g:ctrlp_buffer_func = {} -< -Example: > - let g:ctrlp_buffer_func = { - \ 'enter': 'Function_Name_1', - \ 'exit': 'Function_Name_2', - \ } -< - - *'g:ctrlp_match_func'* -Set an external fuzzy matching function for CtrlP to use: > - let g:ctrlp_match_func = {} -< -Example: > - let g:ctrlp_match_func = { 'match': 'Function_Name' } -< -Structure of the function: > - function! Function_Name(items, str, limit, mmode, ispath, crfile, regex) - " Arguments: - " | - " +- a:items : The full list of items to search in. - " | - " +- a:str : The string entered by the user. - " | - " +- a:limit : The max height of the match window. Can be used to limit - " | the number of items to return. - " | - " +- a:mmode : The match mode. Can be one of these strings: - " | + "full-line": match the entire line. - " | + "filename-only": match only the filename. - " | + "first-non-tab": match until the first tab char. - " | + "until-last-tab": match until the last tab char. - " | - " +- a:ispath : Is 1 when searching in file, buffer, mru, mixed, dir, and - " | rtscript modes. Is 0 otherwise. - " | - " +- a:crfile : The file in the current window. Should be excluded from the - " | results when a:ispath == 1. - " | - " +- a:regex : In regex mode: 1 or 0. - - return list_of_matched_items - endfunction -< - -=============================================================================== -COMMANDS *ctrlp-commands* - - *:CtrlP* -:CtrlP [starting-directory] - Open CtrlP in find file mode. - - If no argument is given, the value of |g:ctrlp_working_path_mode| will be - used to determine the starting directory. - - You can use to auto-complete the [starting-directory] when typing it. - - *:CtrlPBuffer* -:CtrlPBuffer - Open CtrlP in find buffer mode. - - *:CtrlPMRU* -:CtrlPMRU - Open CtrlP in find Most-Recently-Used file mode. - - *:CtrlPLastMode* -:CtrlPLastMode [--dir] - Open CtrlP in the last mode used. When having the "--dir" argument, also - reuse the last working directory. - - *:CtrlPRoot* -:CtrlPRoot - This acts like |:CtrlP| with |g:ctrlp_working_path_mode| = 'r' and ignores - the variable's current value. - - *:CtrlPClearCache* -:CtrlPClearCache - Flush the cache for the current working directory. The same as pressing - inside CtrlP. - To enable or disable caching, use the |g:ctrlp_use_caching| option. - - *:CtrlPClearAllCaches* -:CtrlPClearAllCaches - Delete all the cache files saved in |g:ctrlp_cache_dir| location. - -------------------------------------------------------------------------------- -For commands provided by bundled extensions, see |ctrlp-extensions|. - -=============================================================================== -MAPPINGS *ctrlp-mappings* - - *'ctrlp-'* - - Default |Normal| mode mapping to open the CtrlP prompt in find file mode. - ----------------------------------------- -Once inside the prompt:~ - - - Toggle between full-path search and filename only search. - Note: in filename mode, the prompt's base is '>d>' instead of '>>>' - - *'ctrlp-fullregexp'* - Toggle between the string mode and full regexp mode. - Note: in full regexp mode, the prompt's base is 'r>>' instead of '>>>' - - See also: |input-formats| (guide) and |g:ctrlp_regexp_search| (option). - - , 'forward' - - Scroll to the 'next' search mode in the sequence. - - , 'backward' - - Scroll to the 'previous' search mode in the sequence. - - *'ctrlp-autocompletion'* - Auto-complete directory names under the current working directory inside - the prompt. - - - Toggle the focus between the match window and the prompt. - - , - - Exit CtrlP. - -Moving:~ - - , - - Move selection down. - - , - - Move selection up. - - - Move the cursor to the 'start' of the prompt. - - - Move the cursor to the 'end' of the prompt. - - , - , - - Move the cursor one character to the 'left'. - - , - - Move the cursor one character to the 'right'. - -Editing:~ - - , - - Delete the preceding character. - - - Delete the current character. - - - Delete a preceding inner word. - - - Clear the input field. - -Browsing input history:~ - - - Next string in the prompt's history. - - - Previous string in the prompt's history. - -Opening/Creating a file:~ - - - Open the selected file in the 'current' window if possible. - - - Open the selected file in a new 'tab'. - - - Open the selected file in a 'vertical' split. - - , - , - - Open the selected file in a 'horizontal' split. - - - Create a new file and its parent directories. - -Opening multiple files:~ - - - - Mark/unmark a file to be opened with . - - Mark/unmark a file to create a new file in its directory using . - - - - Open files marked by . - - When no file has been marked by , open a console dialog with the - following options: - - Open the selected file: - t - in a tab page. - v - in a vertical split. - h - in a horizontal split. - r - in the current window. - i - as a hidden buffer. - x - (optional) with the function defined in |g:ctrlp_open_func|. - - Other options (not shown): - a - mark all files in the match window. - d - change CtrlP's local working directory to the selected file's - directory and switch to find file mode. - -Function keys:~ - - - - Refresh the match window and purge the cache for the current directory. - - Remove deleted files from the MRU list. - - - - Wipe the MRU list. - - Delete MRU entries marked by . - -Pasting:~ - - , *'ctrlp-pasting'* - - Paste the clipboard content into the prompt. - - - Open a console dialog to paste , , the content of the search - register, the last visual selection, the clipboard or any register into the - prompt. - -Choose your own mappings with |g:ctrlp_prompt_mappings|. - ----------------------------------------- -When inside the match window (press to switch):~ - - a-z - 0-9 - ~^-=;`',.+!@#$%&_(){}[] - Cycle through the lines which have the matching first character. - -=============================================================================== -INPUT FORMATS *ctrlp-input-formats* - -Formats for inputting in the prompt:~ - -a) Simple string. - - E.g. 'abc' is understood internally as 'a[^a]\{-}b[^b]\{-}c' - -b) When in regexp mode, the input string's treated as a Vim's regexp |pattern| - without any modification. - - E.g. 'abc\d*efg' will be read as 'abc\d*efg'. - - See |ctrlp-fullregexp| (keymap) and |g:ctrlp_regexp_search| (option) for - how to enable regexp mode. - -c) End the string with a colon ':' followed by a Vim command to execute that - command after opening the file. If you need to use ':' literally, escape it - with a backslash: '\:'. When opening multiple files, the command will be - executed on each opening file. - - E.g. Use ':45' to jump to line 45. - - Use ':/any\:string' to jump to the first instance of 'any:string'. - - Use ':+setf\ myfiletype|50' to set the filetype to 'myfiletype', then - jump to line 50. - - Use ':diffthis' when opening multiple files to run |:diffthis| on the - first 4 files. - - See also: Vim's |++opt| and |+cmd|. - -d) Submit two dots '..' to go upward the directory tree by 1 level. To go up - multiple levels, use one extra dot for each extra level: -> - Raw input Interpreted as - .. ../ - ... ../../ - .... ../../../ -< - Note: if the parent directories are large and uncached, this can be slow. - - You can also use '@cd path/' to change CtrlP's local working directory. - Use '@cd %:h' to change to the directory of the current file. - -e) Similarly, submit '/' or '\' to find and go to the project's root. - - If the project is large, using a VCS listing command to look for files - might help speeding up the intial scan (see |g:ctrlp_user_command| for more - details). - - Note: d) and e) only work in file, directory and mixed modes. - -f) Type the name of a non-existent file and press to create it. Mark a - file with to create the new file in the same directory as the marked - file. - - E.g. Using 'newdir/newfile.txt' will create a directory named 'newdir' as - well as a file named 'newfile.txt'. - - If an entry 'some/old/dirs/oldfile.txt' is marked with , then - 'newdir' and 'newfile.txt' will be created under 'some/old/dirs'. The - final path will then be 'some/old/dirs/newdir/newfile.txt'. - - Note: use '\' in place of '/' on Windows (if |'shellslash'| is not set). - -g) In filename mode (toggle with ), you can use one primary pattern and - one refining pattern separated by a semicolon. Both patterns work like (a), - or (b) when in regexp mode. - -h) Submit ? to open this help file. - -=============================================================================== -EXTENSIONS *ctrlp-extensions* - -Extensions are optional. To enable an extension, add its name to the variable -g:ctrlp_extensions: > - let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', - \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] -< -The order of the items will be the order they appear on the statusline and when -using , . - -Available extensions:~ - - *:CtrlPTag* - * Tag mode:~ - - Name: 'tag' - - Command: ":CtrlPTag" - - Search for a tag within a generated central tags file, and jump to the - definition. Use the Vim's option |'tags'| to specify the names and the - locations of the tags file(s). - E.g. set tags+=doc/tags - - *:CtrlPBufTag* - *:CtrlPBufTagAll* - * Buffer Tag mode:~ - - Name: 'buffertag' - - Commands: ":CtrlPBufTag [buffer]", - ":CtrlPBufTagAll". - - Search for a tag within the current buffer or all listed buffers and jump - to the definition. Requires |exuberant_ctags| or compatible programs. - - *:CtrlPQuickfix* - * Quickfix mode:~ - - Name: 'quickfix' - - Command: ":CtrlPQuickfix" - - Search for an entry in the current quickfix errors and jump to it. - - *:CtrlPDir* - * Directory mode:~ - - Name: 'dir' - - Command: ":CtrlPDir [starting-directory]" - - Search for a directory and change the working directory to it. - - Mappings: - + change the local working directory for CtrlP and keep it open. - + change the global working directory (exit). - + change the local working directory for the current window (exit). - + change the global working directory to CtrlP's current local - working directory (exit). - - *:CtrlPRTS* - * Runtime script mode:~ - - Name: 'rtscript' - - Command: ":CtrlPRTS" - - Search for files (vimscripts, docs, snippets...) in runtimepath. - - *:CtrlPUndo* - * Undo mode:~ - - Name: 'undo' - - Command: ":CtrlPUndo" - - Browse undo history. - - *:CtrlPLine* - * Line mode:~ - - Name: 'line' - - Command: ":CtrlPLine" - - Search for a line in all listed buffers. - - *:CtrlPChange* - *:CtrlPChangeAll* - * Change list mode:~ - - Name: 'changes' - - Commands: ":CtrlPChange [buffer]", - ":CtrlPChangeAll". - - Search for and jump to a recent change in the current buffer or in all - listed buffers. - - *:CtrlPMixed* - * Mixed mode:~ - - Name: 'mixed' - - Command: ":CtrlPMixed" - - Search in files, buffers and MRU files at the same time. - - *:CtrlPBookmarkDir* - *:CtrlPBookmarkDirAdd* - * BookmarkDir mode:~ - - Name: 'bookmarkdir' - - Commands: ":CtrlPBookmarkDir", - ":CtrlPBookmarkDirAdd [directory]". - - Search for a bookmarked directory and change the working directory to it. - - Mappings: - + change the local working directory for CtrlP, keep it open and - switch to find file mode. - + change the global working directory (exit). - + change the local working directory for the current window (exit). - + - - Wipe bookmark list. - - Delete entries marked by . - ----------------------------------------- -Buffer Tag mode options:~ - - *'g:ctrlp_buftag_ctags_bin'* -If ctags isn't in your $PATH, use this to set its location: > - let g:ctrlp_buftag_ctags_bin = '' -< - - *'g:ctrlp_buftag_systemenc'* -Match this with your OS's encoding (not Vim's). The default value mirrors Vim's -global |'encoding'| option: > - let g:ctrlp_buftag_systemenc = &encoding -< - - *'g:ctrlp_buftag_types'* -Use this to set the arguments for ctags, jsctags... for a given filetype: > - let g:ctrlp_buftag_types = '' -< -Examples: > - let g:ctrlp_buftag_types = { - \ 'erlang' : '--language-force=erlang --erlang-types=drmf', - \ 'javascript' : { - \ 'bin': 'jsctags', - \ 'args': '-f -', - \ }, - \ } -< - -=============================================================================== -CUSTOMIZATION *ctrlp-customization* - -Highlighting:~ - * For the CtrlP buffer: - CtrlPNoEntries : the message when no match is found (Error) - CtrlPMatch : the matched pattern (Identifier) - CtrlPLinePre : the line prefix '>' in the match window - CtrlPPrtBase : the prompt's base (Comment) - CtrlPPrtText : the prompt's text (|hl-Normal|) - CtrlPPrtCursor : the prompt's cursor when moving over the text (Constant) - - * In extensions: - CtrlPTabExtra : the part of each line that's not matched against (Comment) - CtrlPBufName : the buffer name an entry belongs to (|hl-Directory|) - CtrlPTagKind : the kind of the tag in buffer-tag mode (|hl-Title|) - CtrlPqfLineCol : the line and column numbers in quickfix mode (Comment) - CtrlPUndoT : the elapsed time in undo mode (|hl-Directory|) - CtrlPUndoBr : the square brackets [] in undo mode (Comment) - CtrlPUndoNr : the undo number inside [] in undo mode (String) - CtrlPUndoSv : the point where the file was saved (Comment) - CtrlPUndoPo : the current position in the undo tree (|hl-Title|) - CtrlPBookmark : the name of the bookmark (Identifier) - -Statuslines:~ - * Highlight groups: - CtrlPMode1 : 'file' or 'path', and the current mode (Character) - CtrlPMode2 : 'prt' or 'win', 'regex', the working directory (|hl-LineNr|) - CtrlPStats : the scanning status (Function) - - For rebuilding the statuslines, see |g:ctrlp_status_func|. - -=============================================================================== -MISCELLANEOUS CONFIGS *ctrlp-miscellaneous-configs* - -* Using |wildignore| for |g:ctrlp_user_command|: -> - function! s:wig2cmd() - " Change wildignore into space or | separated groups - " e.g. .aux .out .toc .jpg .bmp .gif - " or .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$ - let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@) - -* A standalone function to set the working directory to the project's root, or - to the parent directory of the current file if a root can't be found: -> - function! s:setcwd() - let cph = expand('%:p:h', 1) - if cph =~ '^.\+://' | retu | en - for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects'] - let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';']) - if wd != '' | let &acd = 0 | brea | en - endfo - exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', '')) - endfunction - - autocmd BufEnter * call s:setcwd() -< -(requires Vim 7.1.299+) - -* Using a |count| to invoke different commands using the same mapping: -> - let g:ctrlp_cmd = 'exe "CtrlP".get(["", "Buffer", "MRU"], v:count)' -< - -=============================================================================== -CREDITS *ctrlp-credits* - -Developed by Kien Nguyen . - -Project's homepage: http://kien.github.com/ctrlp.vim -Git repository: https://github.com/kien/ctrlp.vim -Mercurial repository: https://bitbucket.org/kien/ctrlp.vim - -------------------------------------------------------------------------------- -Thanks to everyone that has submitted ideas, bug reports or helped debugging on -gibhub, bitbucket, and through email. - -Special thanks:~ - - * Woojong Koh - * Simon Ruderich - * Yasuhiro Matsumoto - * Ken Earley - * Kyo Nagashima - * Zak Johnson - * Diego Viola - * Piet Delport - * Thibault Duplessis - * Kent Sibilev - * Tacahiroy - * Luca Pette - * Seth Fowler - * Lowe Thiderman - * Christopher Fredén - * Zahary Karadjov - * Jo De Boeck - -=============================================================================== -CHANGELOG *ctrlp-changelog* - -Before 2012/11/30~ - - + New options: |g:ctrlp_abbrev|, - |g:ctrlp_key_loop|, - |g:ctrlp_open_func|, - |g:ctrlp_tabpage_position|, - |g:ctrlp_mruf_save_on_update| - + Rename: - *g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden|. - + Change |g:ctrlp_switch_buffer|'s and |g:ctrlp_working_path_mode|'s type - (old values still work). - + New key for |g:ctrlp_user_command| when it's a Dictionary: 'ignore'. - -Before 2012/06/15~ - - + New value for |g:ctrlp_follow_symlinks|: 2. - + New value for |g:ctrlp_open_multiple_files|: 'j'. - + Allow using , , to open files marked by . - + Extend '..' (|ctrlp-input-formats| (d)) - + New input format: '@cd' (|ctrlp-input-formats| (d)) - -Before 2012/04/30~ - - + New option: |g:ctrlp_mruf_default_order| - + New feature: Bookmarked directories extension. - + New commands: |:CtrlPBookmarkDir| - |:CtrlPBookmarkDirAdd| - -Before 2012/04/15~ - - + New option: |g:ctrlp_buffer_func|, callback functions for CtrlP buffer. - + Remove: g:ctrlp_mruf_last_entered, make it a default for MRU mode. - + New commands: |:CtrlPLastMode|, open CtrlP in the last mode used. - |:CtrlPMixed|, search in files, buffers and MRU files. - -Before 2012/03/31~ - - + New options: |g:ctrlp_default_input|, default input when entering CtrlP. - |g:ctrlp_match_func|, allow using a custom fuzzy matcher. - + Rename: - *ClearCtrlPCache* -> |CtrlPClearCache| - *ClearAllCtrlPCaches* -> |CtrlPClearAllCaches| - *ResetCtrlP* -> |CtrlPReload| - -Before 2012/03/02~ - - + Rename: - *g:ctrlp_regexp_search* -> |g:ctrlp_regexp|, - *g:ctrlp_dont_split* -> |g:ctrlp_reuse_window|, - *g:ctrlp_jump_to_buffer* -> |g:ctrlp_switch_buffer|. - + Rename and tweak: - *g:ctrlp_open_multi* -> |g:ctrlp_open_multiple_files|. - + Deprecate *g:ctrlp_highlight_match* - + Extend |g:ctrlp_user_command| to support multiple commands. - + New option: |g:ctrlp_mruf_last_entered| change MRU to Recently-Entered. - -Before 2012/01/15~ - - + New mapping: Switch and . is now used for completion - of directory names under the current working directory. - + New options: |g:ctrlp_arg_map| for , to accept an argument. - |g:ctrlp_status_func| custom statusline. - |g:ctrlp_mruf_relative| show only MRU files inside cwd. - + Extend g:ctrlp_open_multi with new optional values: tr, hr, vr. - + Extend |g:ctrlp_custom_ignore| to specifically filter dir, file and link. - -Before 2012/01/05~ - - + New feature: Buffer Tag extension. - + New commands: |:CtrlPBufTag|, |:CtrlPBufTagAll|. - + New options: |g:ctrlp_cmd|, - |g:ctrlp_custom_ignore| - -Before 2011/11/30~ - - + New features: Tag, Quickfix and Directory extensions. - + New commands: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|. - + New options: |g:ctrlp_use_migemo|, - |g:ctrlp_lazy_update|, - |g:ctrlp_follow_symlinks| - -Before 2011/11/13~ - - + New special input: '/' and '\' find root (|ctrlp-input-formats| (e)) - + Remove ctrlp#SetWorkingPath(). - + Remove *g:ctrlp_mru_files* and make MRU mode permanent. - + Extend g:ctrlp_open_multi, add new ways to open files. - + New option: g:ctrlp_dont_split, - |g:ctrlp_mruf_case_sensitive| - -Before 2011/10/30~ - - + New feature: Support for custom extensions. - also removes non-existent files from MRU list. - + New option: g:ctrlp_jump_to_buffer - -Before 2011/10/12~ - - + New features: Open multiple files. - Pass Vim's |++opt| and |+cmd| to the opening file - (|ctrlp-input-formats| (c)) - Auto-complete each dir for |:CtrlP| [starting-directory] - + New mappings: mark/unmark a file to be opened with . - open all marked files. - + New option: g:ctrlp_open_multi - + Remove *g:ctrlp_persistent_input* *g:ctrlp_live_update* and . - -Before 2011/09/29~ - - + New mappings: , next/prev string in the input history. - create a new file and its parent dirs. - + New options: |g:ctrlp_open_new_file|, - |g:ctrlp_max_history| - + Added a new open-in-horizontal-split mapping: - -Before 2011/09/19~ - - + New command: ResetCtrlP - + New options: |g:ctrlp_max_files|, - |g:ctrlp_max_depth|, - g:ctrlp_live_update - + New mapping: - -Before 2011/09/12~ - - + Ability to cycle through matched lines in the match window. - + Extend the behavior of g:ctrlp_persistent_input - + Extend the behavior of |:CtrlP| - + New options: |g:ctrlp_dotfiles|, - |g:ctrlp_clear_cache_on_exit|, - g:ctrlp_highlight_match, - |g:ctrlp_user_command| - + New special input: '..' (|ctrlp-input-formats| (d)) - + New mapping: . - + New commands: |:CtrlPCurWD|, - |:CtrlPCurFile|, - |:CtrlPRoot| - - + New feature: Search in most recently used (MRU) files - + New mapping: . - + Extended the behavior of . - + New options: g:ctrlp_mru_files, - |g:ctrlp_mruf_max|, - |g:ctrlp_mruf_exclude|, - |g:ctrlp_mruf_include| - + New command: |:CtrlPMRU| - -First public release: 2011/09/06~ - -=============================================================================== -vim:ft=help:et:ts=2:sw=2:sts=2:norl diff --git a/vim/bundle/ctrlp/plugin/ctrlp.vim b/vim/bundle/ctrlp/plugin/ctrlp.vim deleted file mode 100644 index 68cae86..0000000 --- a/vim/bundle/ctrlp/plugin/ctrlp.vim +++ /dev/null @@ -1,69 +0,0 @@ -" ============================================================================= -" File: plugin/ctrlp.vim -" Description: Fuzzy file, buffer, mru, tag, etc finder. -" Author: Kien Nguyen -" ============================================================================= -" GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip - -if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp - fini -en -let g:loaded_ctrlp = 1 - -let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs, - \ g:ctrlp_allmixes, g:ctrlp_buftags, g:ctrlp_ext_vars, g:ctrlp_builtins] - \ = [[], [], [], [], {}, {}, [], 2] - -if !exists('g:ctrlp_map') | let g:ctrlp_map = '' | en -if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en - -com! -n=? -com=custom,ctrlp#utils#dircompl CtrlP - \ cal ctrlp#init(0, { 'dir': }) - -com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPMRUFiles - \ cal ctrlp#init(2, { 'dir': }) - -com! -bar CtrlPBuffer cal ctrlp#init(1) -com! -n=? CtrlPLastMode cal ctrlp#init(-1, { 'args': }) - -com! -bar CtrlPClearCache cal ctrlp#clr() -com! -bar CtrlPClearAllCaches cal ctrlp#clra() - -com! -bar ClearCtrlPCache cal ctrlp#clr() -com! -bar ClearAllCtrlPCaches cal ctrlp#clra() - -com! -bar CtrlPCurWD cal ctrlp#init(0, { 'mode': '' }) -com! -bar CtrlPCurFile cal ctrlp#init(0, { 'mode': 'c' }) -com! -bar CtrlPRoot cal ctrlp#init(0, { 'mode': 'r' }) - -if g:ctrlp_map != '' && !hasmapto(':'.g:ctrlp_cmd.'', 'n') - exe 'nn ' g:ctrlp_map ':'.g:ctrlp_cmd.'' -en - -cal ctrlp#mrufiles#init() - -com! -bar CtrlPTag cal ctrlp#init(ctrlp#tag#id()) -com! -bar CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id()) - -com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPDir - \ cal ctrlp#init(ctrlp#dir#id(), { 'dir': }) - -com! -n=? -com=buffer CtrlPBufTag - \ cal ctrlp#init(ctrlp#buffertag#cmd(0, )) - -com! -bar CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1)) -com! -bar CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id()) -com! -bar CtrlPUndo cal ctrlp#init(ctrlp#undo#id()) -com! -bar CtrlPLine cal ctrlp#init(ctrlp#line#id()) - -com! -n=? -com=buffer CtrlPChange - \ cal ctrlp#init(ctrlp#changes#cmd(0, )) - -com! -bar CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1)) -com! -bar CtrlPMixed cal ctrlp#init(ctrlp#mixed#id()) -com! -bar CtrlPBookmarkDir cal ctrlp#init(ctrlp#bookmarkdir#id()) - -com! -n=? -com=custom,ctrlp#utils#dircompl CtrlPBookmarkDirAdd - \ cal ctrlp#call('ctrlp#bookmarkdir#add', ) - -" vim:ts=2:sw=2:sts=2 diff --git a/vim/bundle/ctrlp/readme.md b/vim/bundle/ctrlp/readme.md deleted file mode 100644 index 2525b83..0000000 --- a/vim/bundle/ctrlp/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -# ctrlp.vim -Full path fuzzy __file__, __buffer__, __mru__, __tag__, __...__ finder for Vim. - -* Written in pure Vimscript for MacVim, gVim and Vim 7.0+. -* Full support for Vim's regexp as search patterns. -* Built-in Most Recently Used (MRU) files monitoring. -* Built-in project's root finder. -* Open multiple files at once. -* Create new files and directories. -* [Extensible][2]. - -![ctrlp][1] - -## Basic Usage -* Run `:CtrlP` or `:CtrlP [starting-directory]` to invoke CtrlP in find file mode. -* Run `:CtrlPBuffer` or `:CtrlPMRU` to invoke CtrlP in find buffer or find MRU file mode. -* Run `:CtrlPMixed` to search in Files, Buffers and MRU files at the same time. - -Check `:help ctrlp-commands` and `:help ctrlp-extensions` for other commands. - -##### Once CtrlP is open: -* Press `` to purge the cache for the current directory to get new files, remove deleted files and apply new ignore options. -* Press `` and `` to cycle between modes. -* Press `` to switch to filename only search instead of full path. -* Press `` to switch to regexp mode. -* Use ``, `` to select the next/previous string in the prompt's history. -* Use `` to create a new file and its parent directories. -* Use `` to mark/unmark multiple files and `` to open them. - -Run `:help ctrlp-mappings` or submit `?` in CtrlP for more mapping help. - -* Submit two or more dots `..` to go up the directory tree by one or multiple levels. -* End the input string with a colon `:` followed by a command to execute it on the opening file(s): -Use `:25` to jump to line 25. -Use `:diffthis` when opening multiple files to run `:diffthis` on the first 4 files. - -## Basic Options -* Change the default mapping and the default command to invoke CtrlP: - - ```vim - let g:ctrlp_map = '' - let g:ctrlp_cmd = 'CtrlP' - ``` - -* When invoked, unless a starting directory is specified, CtrlP will set its local working directory according to this variable: - - ```vim - let g:ctrlp_working_path_mode = 'ra' - ``` - - `'c'` - the directory of the current file. - `'r'` - the nearest ancestor that contains one of these directories or files: `.git` `.hg` `.svn` `.bzr` `_darcs` - `'a'` - like c, but only if the current working directory outside of CtrlP is not a direct ancestor of the directory of the current file. - `0` or `''` (empty string) - disable this feature. - - Define additional root markers with the `g:ctrlp_root_markers` option. - -* Exclude files and directories using Vim's `wildignore` and CtrlP's own `g:ctrlp_custom_ignore`: - - ```vim - set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux - set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows - - let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' - let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/]\.(git|hg|svn)$', - \ 'file': '\v\.(exe|so|dll)$', - \ 'link': 'some_bad_symbolic_links', - \ } - ``` - -* Use a custom file listing command: - - ```vim - let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux - let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows - ``` - -Check `:help ctrlp-options` for other options. - -## Installation -Use your favorite method or check the homepage for a [quick installation guide][3]. - -[1]: http://i.imgur.com/yIynr.png -[2]: https://github.com/kien/ctrlp.vim/tree/extensions -[3]: http://kien.github.com/ctrlp.vim#installation diff --git a/vim/bundle/dart/AUTHORS b/vim/bundle/dart/AUTHORS deleted file mode 100644 index 6cccc06..0000000 --- a/vim/bundle/dart/AUTHORS +++ /dev/null @@ -1,12 +0,0 @@ -# Below is a list of people and organizations that have contributed -# to the Dart project. Names should be added to the list like so: -# -# If you contributed to the project(s) in this repository, and would -# like your name included here, please contact misc@dartlang.org mailing list. -# -# Name/Organization - -Google Inc. - -Ladislav Thon -Nishino Naruhiko (@rbtnn) diff --git a/vim/bundle/dart/LICENSE b/vim/bundle/dart/LICENSE deleted file mode 100644 index 81764fd..0000000 --- a/vim/bundle/dart/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2012, the Dart project authors. 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 Google Inc. 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 -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vim/bundle/dart/README.md b/vim/bundle/dart/README.md deleted file mode 100644 index 2e482eb..0000000 --- a/vim/bundle/dart/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Dart plugin for VIM - -This is an (unsupported) plugin for using Dart with Vim. Pull requests welcome! - -Looking for an IDE experience? Try [Dart Editor][1], -[Dart plugin for Eclipse][2], or [Dart plugin for IntelliJ/WebStorm][3]. - -License: - - Copyright 2012, the Dart project authors. 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 Google Inc. 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 - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -[1]: http://www.dartlang.org/editor -[2]: http://news.dartlang.org/2012/08/dart-plugin-for-eclipse-is-ready-for.html -[3]: http://plugins.intellij.net/plugin/?id=6351 \ No newline at end of file diff --git a/vim/bundle/dart/ftdetect/dart.vim b/vim/bundle/dart/ftdetect/dart.vim deleted file mode 100644 index a3938b6..0000000 --- a/vim/bundle/dart/ftdetect/dart.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd BufRead,BufNewFile *.dart set filetype=dart diff --git a/vim/bundle/dart/ftplugin/dart.vim b/vim/bundle/dart/ftplugin/dart.vim deleted file mode 100644 index 2300950..0000000 --- a/vim/bundle/dart/ftplugin/dart.vim +++ /dev/null @@ -1,25 +0,0 @@ -if exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -" Enable automatic indentation (2 spaces) -setlocal expandtab -setlocal shiftwidth=2 -setlocal softtabstop=2 - -setlocal formatoptions-=t - -" Set 'comments' to format dashed lists in comments. -setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// - -setlocal commentstring=//%s -let s:win_sep = (has('win32') || has('win64')) ? '/' : '' -let &l:errorformat = - \ join([ - \ ' %#''file://' . s:win_sep . '%f'': %s: line %l pos %c:%m', - \ '%m' - \ ], ',') - - -let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms<' diff --git a/vim/bundle/dart/indent/dart.vim b/vim/bundle/dart/indent/dart.vim deleted file mode 100644 index 81a7b91..0000000 --- a/vim/bundle/dart/indent/dart.vim +++ /dev/null @@ -1,9 +0,0 @@ -if exists('b:did_indent') - finish -endif -let b:did_indent = 1 - -setlocal cindent -setlocal cinoptions+=j1,J1 - -let b:undo_indent = 'setl cin< cino<' diff --git a/vim/bundle/dart/syntax/dart.vim b/vim/bundle/dart/syntax/dart.vim deleted file mode 100644 index b288dcb..0000000 --- a/vim/bundle/dart/syntax/dart.vim +++ /dev/null @@ -1,106 +0,0 @@ -" Vim syntax file " Language: Dart -" Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -" for details. 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("g:main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish - endif - let g:main_syntax = 'dart' - syntax region dartFold start="{" end="}" transparent fold -endif - -" Ensure long multiline strings are highlighted. -syntax sync fromstart - -" keyword definitions -syntax keyword dartConditional if else switch -syntax keyword dartRepeat do while for -syntax keyword dartBoolean true false -syntax keyword dartConstant null -syntax keyword dartTypedef this super class typedef -syntax keyword dartOperator new is as in factory -syntax match dartOperator "+=\=\|-=\=\|*=\=\|/=\=\|%=\=\|\~/=\=\|<<=\=\|>>=\=\|[<>]=\=\|===\=\|\!==\=\|&=\=\|\^=\=\||=\=\|||\|&&\|\[\]=\=\|=>\|!\|\~\|?\|:" -syntax keyword dartType void var bool int double num dynamic -syntax keyword dartStatement return -syntax keyword dartStorageClass static abstract final const -syntax keyword dartExceptions throw rethrow try on catch finally -syntax keyword dartAssert assert -syntax keyword dartClassDecl extends with implements -syntax keyword dartBranch break continue nextgroup=dartUserLabelRef skipwhite -syntax keyword dartKeyword get set operator call external -syntax match dartUserLabelRef "\k\+" contained - -syntax region dartLabelRegion transparent matchgroup=dartLabel start="\" matchgroup=NONE end=":" -syntax keyword dartLabel default - -syntax match dartLibrary "^\(import\|part of\|part\|export\|library\|show\|hide\)\s" - -" Comments -syntax keyword dartTodo contained TODO FIXME XXX -syntax region dartComment start="/\*" end="\*/" contains=dartTodo,dartDocLink,@Spell -syntax match dartLineComment "//.*" contains=dartTodo,@Spell -syntax match dartLineDocComment "///.*" contains=dartTodo,dartDocLink,@Spell -syntax region dartDocLink contained start=+\[+ end=+\]+ - -" Strings -syntax region dartString start=+\z(["']\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar -syntax region dartRawString start=+r\z(["']\)+ end=+\z1+ contains=@Spell -syntax region dartMultilineString start=+\z("\{3\}\|'\{3\}\)+ end=+\z1+ contains=@Spell,dartInterpolation,dartSpecialChar -syntax region dartRawMultilineString start=+r\z("\{3\}\|'\{3\}\)+ end=+\z1+ contains=@Spell -syntax match dartInterpolation contained "\$\(\w\+\|{[^}]\+}\)" -syntax match dartSpecialChar contained "\\\(u\x\{4\}\|u{\x\+}\|x\x\x\|x{\x\+}\|.\)" - -" Numbers -syntax match dartNumber "\<\d\+\(\.\d\+\)\=\>" - -" TODO(antonm): consider conditional highlighting of corelib classes. -syntax keyword dartCoreClasses BidirectionalIterator Comparable DateTime Duration Expando Function Invocation Iterable Iterator List Map Match Object Pattern RegExp RuneIterator Runes Set StackTrace Stopwatch String StringBuffer StringSink Symbol Type -syntax keyword dartCoreTypedefs Comparator -syntax keyword dartCoreExceptions AbstractClassInstantiationError ArgumentError AssertionError CastError ConcurrentModificationError Error Exception FallThroughError FormatException IntegerDivisionByZeroException NoSuchMethodError NullThrownError OutOfMemoryError RangeError RuntimeError StackOverflowError StateError TypeError UnimplementedError UnsupportedError - - -" The default highlighting. -highlight default link dartBranch Conditional -highlight default link dartUserLabelRef dartUserLabel -highlight default link dartLabel Label -highlight default link dartUserLabel Label -highlight default link dartConditional Conditional -highlight default link dartRepeat Repeat -highlight default link dartExceptions Exception -highlight default link dartAssert Statement -highlight default link dartStorageClass StorageClass -highlight default link dartClassDecl dartStorageClass -highlight default link dartBoolean Boolean -highlight default link dartString String -highlight default link dartRawString String -highlight default link dartMultilineString String -highlight default link dartRawMultilineString String -highlight default link dartNumber Number -highlight default link dartStatement Statement -highlight default link dartOperator Operator -highlight default link dartComment Comment -highlight default link dartLineComment Comment -highlight default link dartLineDocComment Comment -highlight default link dartConstant Constant -highlight default link dartTypedef Typedef -highlight default link dartTodo Todo -highlight default link dartKeyword Keyword -highlight default link dartType Type -highlight default link dartInterpolation PreProc -highlight default link dartDocLink SpecialComment -highlight default link dartSpecialChar SpecialChar -highlight default link dartLibrary Include -highlight default link dartCoreClasses Type -highlight default link dartCoreTypedefs Typedef -highlight default link dartCoreExceptions Exception - -let b:current_syntax = "dart" -let b:spell_options = "contained" - -if g:main_syntax is# 'dart' - unlet g:main_syntax -endif diff --git a/vim/bundle/desert/colors/README b/vim/bundle/desert/colors/README deleted file mode 100644 index 6e48351..0000000 --- a/vim/bundle/desert/colors/README +++ /dev/null @@ -1,13 +0,0 @@ -I started with the evening colorscheme included in the distro, and tweaked a -few colors to my liking. Then I decided to do a major overhaul and give the -whole thing a desert evening sort of feel. I find it a very pleasing, -easy-on-the-eyes theme. - -Screenshot: http://hans.fugal.net/vim/colors/desert.html - -Get the latest version at https://github.com/fugalh/desert.vim -Put in ~/.vim/colors or (\vimfiles\colors on Windows) and do -:colorscheme desert - -I mostly don't maintain this anymore. Occasionally someone has a tweak -suggestion - I recommend forking this and sending a pull request, or not. diff --git a/vim/bundle/desert/colors/desert.vim b/vim/bundle/desert/colors/desert.vim deleted file mode 100644 index 65d45a5..0000000 --- a/vim/bundle/desert/colors/desert.vim +++ /dev/null @@ -1,110 +0,0 @@ -" Vim color file -" Maintainer: Hans Fugal -" Last Change: $Date: 2003/07/24 00:57:11 $ -" Last Change: $Date: 2003/07/24 00:57:11 $ -" URL: http://hans.fugal.net/vim/colors/desert.vim -" Version: $Id: desert.vim,v 1.7 2003/07/24 00:57:11 fugalh Exp $ - -" cool help screens -" :he group-name -" :he highlight-groups -" :he cterm-colors - -set background=dark -if version > 580 - " no guarantees for version 5.8 and below, but this makes it stop - " complaining - hi clear - if exists("syntax_on") - syntax reset - endif -endif -let g:colors_name="desert" - -hi Normal guifg=White guibg=grey20 - -" highlight groups -hi Cursor guibg=indianred guifg=khaki -"hi CursorIM -"hi Directory -"hi DiffAdd -"hi DiffChange -"hi DiffDelete -"hi DiffText -"hi ErrorMsg -hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none -hi Folded guibg=grey30 guifg=gold -hi FoldColumn guibg=grey30 guifg=tan -hi IncSearch guifg=slategrey guibg=khaki -"hi LineNr -hi ModeMsg guifg=goldenrod -hi MoreMsg guifg=SeaGreen -hi NonText guifg=LightBlue guibg=grey30 -hi Question guifg=springgreen -hi Search guibg=grey30 guifg=#dfffdf -hi SpecialKey guifg=yellowgreen -hi StatusLine guibg=#c2bfa5 guifg=black gui=none -hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none -hi Title guifg=indianred -hi Visual gui=none guifg=khaki guibg=olivedrab -"hi VisualNOS -hi WarningMsg guifg=salmon -"hi WildMenu -"hi Menu -"hi Scrollbar -"hi Tooltip -hi MatchParen guibg=grey30 guifg=#dfffdf - -" syntax highlighting groups -hi Comment guifg=SkyBlue -hi Constant guifg=#ffa0a0 -hi Identifier guifg=palegreen -hi Statement guifg=khaki -hi PreProc guifg=indianred -hi Type guifg=darkkhaki -hi Special guifg=navajowhite -"hi Underlined -hi Ignore guifg=grey40 -"hi Error -hi Todo guifg=orangered guibg=yellow2 - -" color terminal definitions -hi SpecialKey ctermfg=darkgreen -hi NonText cterm=bold ctermfg=darkblue -hi Directory ctermfg=darkcyan -hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1 -hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green -hi Search cterm=NONE ctermfg=grey ctermbg=blue -hi MoreMsg ctermfg=darkgreen -hi ModeMsg cterm=NONE ctermfg=brown -hi LineNr ctermfg=3 -hi Question ctermfg=green -hi StatusLine cterm=bold,reverse -hi StatusLineNC cterm=reverse -hi VertSplit cterm=reverse -hi Title ctermfg=5 -hi Visual cterm=reverse -hi VisualNOS cterm=bold,underline -hi WarningMsg ctermfg=1 -hi WildMenu ctermfg=0 ctermbg=3 -hi Folded ctermfg=darkgrey ctermbg=NONE -hi FoldColumn ctermfg=darkgrey ctermbg=NONE -hi DiffAdd ctermbg=4 -hi DiffChange ctermbg=5 -hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 -hi DiffText cterm=bold ctermbg=1 -hi Comment ctermfg=darkcyan -hi Constant ctermfg=brown -hi Special ctermfg=5 -hi Identifier ctermfg=6 -hi Statement ctermfg=3 -hi PreProc ctermfg=5 -hi Todo ctermfg=red ctermbg=NONE -hi Type ctermfg=2 -hi Underlined cterm=underline ctermfg=5 -hi Ignore cterm=bold ctermfg=7 -hi Ignore ctermfg=darkgrey -hi Error cterm=bold ctermfg=7 ctermbg=1 - - -"vim: sw=4 diff --git a/vim/bundle/dockerfile/LICENSE b/vim/bundle/dockerfile/LICENSE deleted file mode 100644 index e67cdab..0000000 --- a/vim/bundle/dockerfile/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 Honza Pokorny -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. 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. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vim/bundle/dockerfile/README.md b/vim/bundle/dockerfile/README.md deleted file mode 100644 index b782466..0000000 --- a/vim/bundle/dockerfile/README.md +++ /dev/null @@ -1,23 +0,0 @@ -dockerfile.vim -============== - -Syntax highlighting for Dockerfiles - -Installation ------------- - -Via pathogen, the usual way... - -Features --------- - -The syntax highlighting includes: - -* The directives (e.g. `FROM`) -* Strings -* Comments - -License -------- - -BSD, short and sweet diff --git a/vim/bundle/dockerfile/doc/dockerfile.txt b/vim/bundle/dockerfile/doc/dockerfile.txt deleted file mode 100644 index 37cc7be..0000000 --- a/vim/bundle/dockerfile/doc/dockerfile.txt +++ /dev/null @@ -1,18 +0,0 @@ -*dockerfile.txt* Syntax highlighting for Dockerfiles - -Author: Honza Pokorny -License: BSD - -INSTALLATION *installation* - -Drop it on your Pathogen path and you're all set. - -FEATURES *features* - -The syntax highlighting includes: - -* The directives (e.g. FROM) -* Strings -* Comments - - vim:tw=78:et:ft=help:norl: diff --git a/vim/bundle/dockerfile/ftdetect/dockerfile.vim b/vim/bundle/dockerfile/ftdetect/dockerfile.vim deleted file mode 100644 index 83281d3..0000000 --- a/vim/bundle/dockerfile/ftdetect/dockerfile.vim +++ /dev/null @@ -1 +0,0 @@ -au BufNewFile,BufRead Dockerfile set filetype=dockerfile diff --git a/vim/bundle/dockerfile/syntax/dockerfile.vim b/vim/bundle/dockerfile/syntax/dockerfile.vim deleted file mode 100644 index 90e0651..0000000 --- a/vim/bundle/dockerfile/syntax/dockerfile.vim +++ /dev/null @@ -1,22 +0,0 @@ -" dockerfile.vim - Syntax highlighting for Dockerfiles -" Maintainer: Honza Pokorny -" Version: 0.5 - - -if exists("b:current_syntax") - finish -endif - -let b:current_syntax = "dockerfile" - -syntax case ignore - -syntax match dockerfileKeyword /\v^\s*(FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD)\s/ -syntax match dockerfileKeyword /\v^\s*(ENTRYPOINT|VOLUME|USER|WORKDIR)\s/ -highlight link dockerfileKeyword Keyword - -syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/ -highlight link dockerfileString String - -syntax match dockerfileComment "\v^\s*#.*$" -highlight link dockerfileComment Comment diff --git a/vim/bundle/flex-4/README b/vim/bundle/flex-4/README deleted file mode 100644 index e209024..0000000 --- a/vim/bundle/flex-4/README +++ /dev/null @@ -1,9 +0,0 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=3225 - -Syntax highlighting for Adobe Flex 4 - mxml, actionscript 3 programming languages. -(Modified version 1.1) - -Thanks to previous authors: -Johannes Zellner -Paul Siegmann -Abdul Qabiz diff --git a/vim/bundle/flex-4/syntax/actionscript.vim b/vim/bundle/flex-4/syntax/actionscript.vim deleted file mode 100644 index cc39149..0000000 --- a/vim/bundle/flex-4/syntax/actionscript.vim +++ /dev/null @@ -1,167 +0,0 @@ -" Vim syntax file -" Language: actionScript -" Maintainer: Abdul Qabiz (mail at abdulqabiz.com) -" Author and previous maintainer: -" Igor Dvorsky -" URL: http://www.abdulqabiz.com/files/vim/actionscript.vim -" Original URL: http://www.modesite.net/vim/actionscript.vim -" Last Change: 2006 Jun 20 -" Updated to support AS 2.0 2004 Mar 12 by Richard Leider (richard@appliedrhetoric.com) -" Updated to support new AS 2.0 Flash 8 Language Elements 2005 September 29 (richard@appliedrhetoric.com) -" Updated to support new AS 3.0 Language Elements 2006 June 20 by Abdul Qabiz (mail at abdulqabiz.com) - - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif - let main_syntax = 'actionscript' -endif - -" based on "JavaScript" VIM syntax by Claudio Fleiner - -syn case ignore -syn match actionScriptLineComment "\/\/.*$" -syn match actionScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)" -syn region actionScriptCommentString start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1,he=s-1 contains=actionScriptSpecial,actionScriptCommentSkip,@htmlPreproc -syn region actionScriptComment2String start=+"+ skip=+\\\\\|\\"+ end=+$\|"+ contains=actionScriptSpecial,@htmlPreproc -syn region actionScriptComment start="/\*" end="\*/" contains=actionScriptCommentString,actionScriptCharacter,actionScriptNumber -syn match actionScriptSpecial "\\\d\d\d\|\\." -syn region actionScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=actionScriptSpecial,@htmlPreproc -syn region actionScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=actionScriptSpecial,@htmlPreproc -syn match actionScriptSpecialCharacter "'\\.'" -syn match actionScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>" -syn keyword actionScriptConditional if else and or not -syn keyword actionScriptRepeat do while for in -syn keyword actionScriptCase break continue switch case default -syn keyword actionScriptConstructor new -syn keyword actionScriptObjects arguments Array Boolean Date _global Math Number Object String super var this Accessibility Color Key _level Mouse _root Selection Sound Stage System TextFormat LoadVars XML XMLSocket XMLNode LoadVars Button TextField TextSnapshot CustomActions Error ContextMenu ContextMenuItem NetConnection NetStream Video PrintJob MovieClipLoader StyleSheet Camera LocalConnection Microphone SharedObject MovieClip -syn keyword actionScriptStatement return with -syn keyword actionScriptFunction function on onClipEvent -syn keyword actionScriptValue true false undefined null NaN void -syn keyword actionScriptArray concat join length pop push reverse shift slice sort sortOn splice toString unshift -syn keyword actionScriptDate getDate getDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getYear setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setYear UTC -syn keyword actionScriptMath abs acos asin atan atan2 ceil cos E exp floor log LOG2E LOG10E LN2 LN10 max min PI pow random round sin sqrt SQRT1_2 SQRT2 tan -Infinity Infinity -syn keyword actionScriptNumberObj MAX_VALUE MIN_VALUE NaN NEGATIVE_INFINITY POSITIVE_INFINITY valueOf -syn keyword actionScriptObject addProperty __proto__ registerClass toString unwatch valueOf watch -syn keyword actionScriptString charAt charCodeAt concat fromCharCode indexOf lastIndexOf length slice split substr substring toLowerCase toUpperCase add le lt gt ge eq ne chr mbchr mblength mbord mbsubstring ord -syn keyword actionScriptColor getRGB getTransform setRGB setTransform -syn keyword actionScriptKey addListener BACKSPACE CAPSLOCK CONTROL DELETEKEY DOWN END ENTER ESCAPE getAscii getCode HOME INSERT isDown isToggled LEFT onKeyDown onKeyUp PGDN PGUP removeListener RIGHT SHIFT SPACE TAB UP ALT -syn keyword actionScriptMouse hide onMouseDown onMouseUp onMouseMove show onMouseWheel -syn keyword actionScriptSelection getBeginIndex getCaretIndex getEndIndex getFocus setFocus setSelection -syn keyword actionScriptSound attachSound duration getBytesLoaded getBytesTotal getPan getTransform getVolume loadSound onLoad onSoundComplete position setPan setTransform setVolume start stop onID3 -syn keyword actionScriptStage align height onResize scaleMode width -syn keyword actionScriptSystem capabilities hasAudioEncoder hasAccessibility hasAudio hasMP3 language manufacturer os pixelAspectRatio screenColor screenDPI screenResolution.x screenResolution.y version hasVideoEncoder security useCodepage exactSettings hasEmbeddedVideo screenResolutionX screenResolutionY input isDebugger serverString hasPrinting playertype hasStreamingAudio hasScreenBroadcast hasScreenPlayback hasStreamingVideo avHardwareDisable localFileReadDisable windowlesDisable -syn keyword actionScriptTextFormat align blockIndent bold bullet color font getTextExtent indent italic leading leftMargin rightMargin size tabStops target underline url -syn keyword actionScriptCommunication contentType getBytesLoaded getBytesTotal load loaded onLoad send sendAndLoad toString addRequestHeader fscommand MMExecute -syn keyword actionScriptXMLSocket close connect onClose onConnect onData onXML -syn keyword actionScriptTextField autoSize background backgroundColor border borderColor bottomScroll embedFonts _focusrect getDepth getFontList getNewTextFormat getTextFormat hscroll html htmlText maxChars maxhscroll maxscroll multiline onChanged onScroller onSetFocus _parent password _quality removeTextField replaceSel replaceText restrict selectable setNewTextFormat setTextFormat text textColor textHeight textWidth type variable wordWrap condenseWhite mouseWheelEnabled textFieldHeight textFieldWidth ascent descent -syn keyword actionScriptMethods callee caller _alpha attachMovie beginFill beginGradientFill clear createEmptyMovieClip createTextField _currentframe curveTo _droptarget duplicateMovieClip enabled endFill focusEnabled _framesloaded getBounds globalToLocal gotoAndPlay gotoAndStop _height _highquality hitArea hitTest lineStyle lineTo loadMovie loadMovieNum loadVariables loadVariablesNum localToGlobal moveTo _name nextFrame onDragOut onDragOver onEnterFrame onKeyDown onKeyUp onKillFocus onMouseDown onMouseMove onMouseUp onPress onRelease onReleaseOutside onRollOut onRollOver onUnload play prevFrame removeMovieClip _rotation setMask _soundbuftime startDrag stopDrag swapDepths tabChildren tabIndex _target _totalframes trackAsMenu unloadMovie unloadMovieNum updateAfterEvent _url useHandCursor _visible _width _x _xmouse _xscale _y _ymouse _yscale tabEnabled asfunction call setInterval clearInterval setProperty stopAllSounds #initclip #endinitclip delete unescape escape eval apply prototype getProperty getTimer getURL getVersion ifFrameLoaded #include instanceof int new nextScene parseFloat parseInt prevScene print printAsBitmap printAsBitmapNum printNum scroll set targetPath tellTarget toggleHighQuality trace typeof isActive getInstanceAtDepth getNextHighestDepth getNextDepth getSWFVersion getTextSnapshot isFinite isNAN updateProperties _lockroot get install list uninstall showMenu onSelect builtInItems save zoom quality loop rewind forward_back customItems caption separatorBefore visible attachVideo bufferLength bufferTime currentFps onStatus pause seek setBuffertime smoothing time bytesLoaded bytesTotal addPage paperWidth paperHeight pageWidth pageHeight orientation loadClip unloadClip getProgress onLoadStart onLoadProgress onLoadComplete onLoadInit onLoadError styleSheet copy hideBuiltInItem transform activityLevel allowDomain allowInsecureDomain attachAudio bandwidth deblocking domain flush fps gain getLocal getRemote getSize index isConnected keyFrameInterval liveDelay loopback motionLevel motionTimeOut menu muted names onActivity onSync publish rate receiveAudio receiveVideo setFps setGain setKeyFrameInterval setLoopback setMode setMotionLevel setQuality setRate setSilenceLevel setUseEchoSuppression showSettings setClipboard silenceLevel silenceTimeOut useEchoSuppression -syn match actionScriptBraces "([{}])" -syn keyword actionScriptException try catch finally throw name message -syn keyword actionScriptXML attributes childNodes cloneNode createElement createTextNode docTypeDecl status firstChild hasChildNodes lastChild insertBefore nextSibling nodeName nodeType nodeValue parentNode parseXML previousSibling removeNode xmlDecl ignoreWhite -syn keyword actionScriptArrayConstant CASEINSENSITIVE DESCENDING UNIQUESORT RETURNINDEXEDARRAY NUMERIC -syn keyword actionScriptStringConstant newline -syn keyword actionScriptEventConstant press release releaseOutside rollOver rollOut dragOver dragOut enterFrame unload mouseMove mouseDown mouseUp keyDown keyUp data -syn keyword actionScriptTextSnapshot getCount setSelected getSelected getText getSelectedText hitTestTextNearPos findText setSelectColor -syn keyword actionScriptID3 id3 artist album songtitle year genre track comment COMM TALB TBPM TCOM TCON TCOP TDAT TDLY TENC TEXT TFLT TIME TIT1 TIT2 TIT3 TKEY TLAN TLEN TMED TOAL TOFN TOLY TOPE TORY TOWN TPE1 TPE2 TPE3 TPE4 TPOS TPUB TRCK TRDA TRSN TRSO TSIZ TSRX TSSE TYER WXXX -syn keyword actionScriptAS2 class extends public private static interface implements import dynamic -syn keyword actionScriptStyleSheet parse parseCSS getStyle setStyle getStyleNames -syn keyword flash8Functions onMetaData onCuePoint flashdisplay flashexternal flashfilters flashgeom flashnet flashtext addCallback applyFilter browse cancel clone colorTransform containsPoint containsRectangle copyChannel copyPixels createBox createGradientBox deltaTransformPoint dispose download draw equals fillRect floodFill generateFilterRect getColorBoundsRect getPixel getPixel32 identity inflate inflatePoint interpolate intersection intersects invert isEmpty loadBitmap merge noise normalize offsetPoint paletteMap perlinNoise pixelDissolve polar rotate scale setAdvancedAntialiasingTable setEmpty setPixel setPixel32 subtract threshold transformPoint translate union upload -syn keyword flash8Constants ALPHANUMERIC_FULL ALPHANUMERIC_HALF CHINESE JAPANESE_HIRAGANA JAPANESE_KATAKANA_FULL JAPANESE_KATAKANA_HALF KOREAN UNKNOWN -syn keyword flash8Properties appendChild cacheAsBitmap opaqueBackground scrollRect keyPress #initclip #endinitclip kerning letterSpacing onHTTPStatus lineGradientStyle IME windowlessDisable hasIME hideBuiltInItems onIMEComposition getEnabled setEnabled getConversionMode setConversionMode setCompositionString doConversion idMap antiAliasType available bottom bottomRight concatenatedColorTransform concatenatedMatrix creationDate creator fileList maxLevel modificationDate pixelBounds rectangle rgb top topLeft attachBitmap beginBitmapFill blendMode filters getRect scale9Grid gridFitType sharpness thickness -syn keyword flash8Classes BevelFilter BitmapData BitmapFilter BlurFilter ColorMatrixFilter ColorTransform ConvolutionFilter DisplacementMapFilter DropShadowFilter ExternalInterface FileReference FileReferenceList GlowFilter GradientBevelFilter GradientGlowFilter Matrix Point Rectangle TextRenderer -syn keyword actionScriptInclude #include #initClip #endInitClip include -syn keyword actionScriptAS3 class extends public private static interface implements import dynamic protected -syn keyword flash9Constants Infinity -Infinity NaN undefined -syn keyword flash9Functions Array Boolean decodeURI decodeURIComponent encodeURI encodeURIComponent escape int isFinite isNaN isXMLName Number Object parseFloat parseInt String trace uint unescape XML XMLList -syn keyword flash9Classes AbstractEvent AbstractInvoker AbstractMessage AbstractOperation AbstractService AbstractTarget Accessibility AccessibilityProperties AccessPrivileges AccessPrivilegesPrivilege Accordion AccordionHeader AccordionHeaderSkin AcknowledgeMessage ActionEffectInstance ActionScriptVersion ActivatorSkin ActivityEvent AddChild AddChildAction AddChildActionInstance Alert AMFChannel AnimateProperty AnimatePropertyInstance AntiAliasType Application ApplicationControlBar ApplicationDomain AreaChart AreaRenderer AreaSeries AreaSeriesItem AreaSeriesRenderData AreaSet ArgumentError arguments Array ArrayCollection ArrayUtil AssociationDefinition AsyncMessage AsyncRequest AsyncToken AVM1Movie AxisBase AxisLabel AxisLabelSet AxisRenderer Back BarChart BarSeries BarSeriesItem BarSeriesRenderData BarSet BaseListData BevelFilter BindingUtils Bitmap BitmapAsset BitmapData BitmapDataChannel BitmapFill BitmapFilter BitmapFilterQuality BitmapFilterType BlendMode Blur BlurFilter BlurInstance Boolean Border Bounce BoundedValue Box BoxDirection BoxItemRenderer BubbleChart BubbleSeries BubbleSeriesItem BubbleSeriesRenderData Button ButtonAsset ButtonBar ButtonBarButtonSkin ButtonLabelPlacement ButtonSkin ByteArray CalendarLayoutChangeEvent Camera CandlestickChart CandlestickItemRenderer CandlestickSeries Canvas Capabilities CapsStyle CartesianChart CartesianTransform CategoryAxis ChangeWatcher Channel ChannelError ChannelEvent ChannelFaultEvent ChannelSet ChartBase ChartElement ChartItem ChartItemEvent ChartLabel ChartState CheckBox CheckBoxIcon ChildExistenceChangedEvent CircleItemRenderer Circular Class ClassFactory ClientInputError CloseEvent CollectionEvent CollectionEventKind CollectionViewError ColorMatrixFilter ColorPicker ColorPickerEvent ColorPickerSkin ColorTransform ColorUtil ColumnChart ColumnSeries ColumnSeriesItem ColumnSeriesRenderData ColumnSet ComboBase ComboBox ComboBoxArrowSkin CommandMessage ComponentDescriptor CompositeEffect CompositeEffectInstance ConcreteDataService Conflict ConflictDetector Conflicts Consumer Container ContainerCreationPolicy ContextMenu ContextMenuBuiltInItems ContextMenuEvent ContextMenuItem ControlBar ConvolutionFilter CreditCardValidator CreditCardValidatorCardType CrossItemRenderer CSMSettings CSSStyleDeclaration Cubic CuePointEvent CuePointManager CurrencyFormatter CurrencyValidator CurrencyValidatorAlignSymbol CursorBookmark CursorError CursorEvent CursorManager CursorManagerPriority DataAssociationMessage DataConflictEvent DataConsumer DataDescription DataErrorMessage DataEvent DataGrid DataGridBase DataGridColumn DataGridColumnDropIndicator DataGridColumnResizeSkin DataGridDragProxy DataGridEvent DataGridEventReason DataGridHeaderSeparator DataGridItemRenderer DataGridListData DataGridSortArrow DataList DataListError DataService DataServiceError DataServiceFaultEvent DataStore DataTip DataTransform Date DateBase DateChooser DateChooserEvent DateChooserEventDetail DateChooserIndicator DateChooserMonthArrowSkin DateChooserYearArrowSkin DateField DateFormatter DateTimeAxis DateValidator DefaultDataDescriptor DeferredInstanceFromClass DeferredInstanceFromFunction DefinitionError DiamondItemRenderer Dictionary DirectHTTPChannel DisplacementMapFilter DisplacementMapFilterMode DisplayObject DisplayObjectContainer Dissolve DissolveInstance DividedBox DividerEvent DownloadProgressBar DragEvent DragManager DragSource DropdownEvent DropShadowFilter DualStyleObject DynamicEvent EdgeMetrics Effect EffectEvent EffectInstance EffectManager EffectTargetFilter Elastic EmailValidator EncodingError Endian EOFError Error ErrorEvent ErrorMessage EvalError Event EventDispatcher EventPhase EventPriority Exponential ExternalInterface Fade FadeInstance Fault FaultEvent FileFilter FileReference FileReferenceList FlexBitmap FlexEvent FlexMovieClip FlexPrintJob FlexPrintJobScaleType FlexShape FlexSimpleButton FlexSprite FlexTextField FocusEvent FocusManager Font FontStyle FontType Form Formatter FormHeading FormItem FormItemDirection FormItemLabel FrameLabel Function Glow GlowFilter GlowInstance GradientBase GradientBevelFilter GradientEntry GradientGlowFilter GradientType Graphics Grid GridFitType GridItem GridLines GridRow HaloBorder HaloColors HaloFocusRect HBox HDividedBox HeaderEvent HistoryManager HitData HLOCChart HLOCItemRenderer HLOCSeries HLOCSeriesBase HLOCSeriesItem HLOCSeriesRenderData HorizontalList HRule HScrollBar HSlider HTTPChannel HTTPRequestMessage HTTPService HTTPService HTTPStatusEvent IAccessPrivileges IAutomationObject IAutomationObjectContainer IAxis IBar IBitmapDrawable IChangeObject IChartElement IChildList ICollectionView IColumn IContainer ID3Info IDataInput IDataOutput IDataRenderer IDeferredInstance IDeferredInstantiationUIComponent IDropInListItemRenderer IDynamicPropertyOutput IDynamicPropertyWriter IEventDispatcher IExternalizable IFactory IFill IFlexAsset IFlexDisplayObject IFocusManager IFocusManagerComponent IFocusManagerContainer IFocusManagerGroup IHistoryManagerClient IIMESupport IInvalidating ILayoutManagerClient IList IListItemRenderer IllegalOperationError ILogger ILoggingTarget Image IManaged IME IMEConversionMode IMEEvent IMenuDataDescriptor IMenuItemRenderer IMessage IMXMLObject IMXMLSupport IndexChangedEvent InstanceCache int InteractiveObject InterpolationMethod InvalidCategoryError InvalidChannelError InvalidDestinationError InvalidFilterError InvalidSWFError IOError IOErrorEvent IOverride IPreloaderDisplay IPropertyChangeNotifier IRawChildrenContainer IRepeater IRepeaterClient IResponder Iris IrisInstance ISimpleStyleClient IStackable IStroke IStyleClient ISystemManager ItemClickEvent ItemPendingError ItemResponder IToolTip IToolTipManagerClient ITreeDataDescriptor IUIComponent IUID IViewCursor JointStyle Keyboard KeyboardEvent KeyLocation Label LayoutManager Legend LegendData LegendItem LegendMouseEvent Linear LinearAxis LinearGradient LinearGradientStroke LineChart LineFormattedTarget LineRenderer LineScaleMode LineSeries LineSeriesItem LineSeriesRenderData LineSeriesSegment LinkBar LinkButton LinkButtonSkin LinkSeparator List ListBase ListBaseSeekPending ListBaseSelectionData ListCollectionView ListData ListDropIndicator ListEvent ListEventReason ListItemDragProxy ListItemRenderer ListItemSelectEvent ListRowInfo Loader LoaderConfig LoaderContext LoaderInfo LoadEvent LocalConnection Locale Log LogAxis LogEvent LogEventLevel LogLogger MaskEffect MaskEffectInstance Math Matrix MBeanAttributeInfo MBeanFeatureInfo MBeanInfo MBeanOperationInfo MBeanParameterInfo MemoryError Menu MenuBar MenuBarBackgroundSkin MenuBarItem MenuEvent MenuItemRenderer MessageAckEvent MessageAgent MessageCacheItem MessageEvent MessageFaultEvent MessagePersister MessagePersisterEvent MessageResponder MessageSerializationError MessageStore MessageStoreEvent MessagingError Metadata MetadataEvent Microphone MiniDebugTarget MorphShape Mouse MouseEvent Move MoveEvent MoveInstance MovieClip MovieClipAsset MovieClipLoaderAsset Namespace NavBar NetConnection NetConnectionChannel NetStatusEvent NetStream NoChannelAvailableError NoDataAvailableError NoSuchChannelError Number NumberBase NumberBaseRoundType NumberFormatter NumberValidator NumericAxis NumericStepper NumericStepperDownSkin NumericStepperEvent NumericStepperUpSkin Object ObjectEncoding ObjectName ObjectProxy ObjectUtil Operation Operation Operation Operation PagedMessage Panel Parallel ParallelInstance Pause PauseInstance PhoneFormatter PhoneNumberValidator PieChart PieSeries PieSeriesItem PieSeriesRenderData PixelSnapping PlotChart PlotSeries PlotSeriesItem PlotSeriesRenderData Point PolarChart PolarTransform PollingChannel PopUpButton PopUpButtonSkin PopUpIcon PopUpManager PopUpManagerChildList PopUpMenuButton PopUpMenuIcon Preloader PrintDataGrid PrintJob PrintJobOptions PrintJobOrientation PriorityQueue Producer ProgrammaticSkin ProgressBar ProgressBarDirection ProgressBarLabelPlacement ProgressBarMode ProgressBarSkin ProgressEvent ProgressIndeterminateSkin ProgressTrackSkin PropertyChangeEvent PropertyChangeEventKind PropertyChanges Proxy QName Quadratic Quartic Quintic RadialGradient RadioButton RadioButtonGroup RadioButtonIcon RangeError Rectangle RectangularBorder RectangularDropShadow ReferenceError RegExp RegExpValidationResult RegExpValidator RemoteObject RemoteObject RemotingMessage RemoveChild RemoveChildAction RemoveChildActionInstance RenderData Repeater Resize ResizeEvent ResizeInstance ResourceBundle Responder ResultEvent RichTextEditor Rotate RotateInstance RoundedRectangle RPCMessage RSLEvent RTMPChannel Scene ScriptTimeoutError ScrollArrowSkin ScrollBar ScrollBarDirection ScrollControlBase ScrollEvent ScrollEventDetail ScrollEventDirection ScrollPolicy ScrollThumb ScrollThumbSkin ScrollTrackSkin SecureAMFChannel Security SecurityDomain SecurityError SecurityErrorEvent SecurityPanel Sequence SequencedMessage SequenceInstance Series SeriesEffect SeriesEffectInstance SeriesInterpolate SeriesInterpolateInstance SeriesSlide SeriesSlideInstance SeriesZoom SeriesZoomInstance SetEventHandler SetProperty SetPropertyAction SetPropertyActionInstance SetStyle SetStyleAction SetStyleActionInstance ShadowBoxItemRenderer ShadowLineRenderer Shape SharedObject SharedObjectFlushStatus SimpleButton SimpleXMLDecoder SimpleXMLEncoder Sine Slider SliderDataTip SliderDirection SliderEvent SliderEventClickTarget SliderHighlightSkin SliderLabel SliderThumb SliderThumbSkin SliderTrackSkin SOAPHeader SOAPMessage SocialSecurityValidator Socket SolidColor Sort SortError SortField Sound SoundAsset SoundChannel SoundEffect SoundEffectInstance SoundLoaderContext SoundMixer SoundTransform Spacer SpreadMethod Sprite SpriteAsset StackedSeries StackOverflowError Stage StageAlign StageQuality StageScaleMode State StateChangeEvent StaticText StatusEvent String StringUtil StringValidator Stroke StyleManager StyleSheet SwatchPanelSkin SwatchSkin SWFLoader SWFVersion SwitchSymbolFormatter SyncEvent SyntaxError System SystemManager TabBar TabNavigator TabSkin Text TextArea TextColorType TextDisplayMode TextEvent TextField TextFieldAsset TextFieldAutoSize TextFieldType TextFormat TextFormatAlign TextInput TextLineMetrics TextRange TextRenderer TextSnapshot Tile TileBase TileBaseDirection TileDirection TileListItemRenderer Timer TimerEvent TitleBackground TitleWindow ToggleButtonBar ToolTip ToolTipBorder ToolTipManager TraceTarget Transform Transition Tree TreeEvent TreeItemRenderer TreeListData TriangleItemRenderer Tween TweenEffect TweenEffectInstance TweenEvent TypeError UIComponent UIComponentCachePolicy UIComponentDescriptor UIDUtil uint UITextField UITextFormat UnresolvedConflictsError UnresolvedConflictsEvent UpdateCollectionMessage UpdateCollectionRange URIError URLLoader URLLoaderDataFormat URLRequest URLRequestHeader URLRequestMethod URLStream URLUtil URLVariables ValidationResult ValidationResultEvent Validator VBox VDividedBox VerifyError Video VideoDisplay VideoError VideoEvent ViewStack VRule VScrollBar VSlider WeakFunctionClosure WeakMethodClosure WebService WebService WedgeItemRenderer WipeDown WipeDownInstance WipeLeft WipeLeftInstance WipeRight WipeRightInstance WipeUp WipeUpInstance WSDLError XML XMLDocument XMLList XMLListCollection XMLNode XMLNodeType XMLUtil ZipCodeFormatter ZipCodeValidatorDomainType Zoom ZoomInstance - -" catch errors caused by wrong parenthesis -syn match actionScriptInParen contained "[{}]" -syn region actionScriptParen transparent start="(" end=")" contains=actionScriptParen,actionScript.* -syn match actionScrParenError ")" - -if main_syntax == "actionscript" - syn sync ccomment actionScriptComment -endif - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_actionscript_syn_inits") - if version < 508 - let did_actionscript_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink actionScriptComment Comment - HiLink actionScriptLineComment Comment - HiLink actionScriptSpecial Special - HiLink actionScriptStringS String - HiLink actionScriptStringD String - HiLink actionScriptCharacter Character - HiLink actionScriptSpecialCharacter actionScriptSpecial - HiLink actionScriptNumber actionScriptValue - HiLink actionScriptBraces Function - HiLink actionScriptError Error - HiLink actionScrParenError actionScriptError - HiLink actionScriptInParen actionScriptError - HiLink actionScriptConditional Conditional - HiLink actionScriptRepeat Repeat - HiLink actionScriptCase Label - HiLink actionScriptConstructor Operator - HiLink actionScriptObjects Operator - HiLink actionScriptStatement Statement - HiLink actionScriptFunction Function - HiLink actionScriptValue Boolean - HiLink actionScriptArray Type - HiLink actionScriptDate Type - HiLink actionScriptMath Type - HiLink actionScriptNumberObj Type - HiLink actionScriptObject Function - HiLink actionScriptString Type - HiLink actionScriptColor Type - HiLink actionScriptKey Type - HiLink actionScriptMouse Type - HiLink actionScriptSelection Type - HiLink actionScriptSound Type - HiLink actionScriptStage Type - HiLink actionScriptSystem Type - HiLink actionScriptTextFormat Type - HiLink actionScriptCommunication Type - HiLink actionScriptXMLSocket Type - HiLink actionScriptTextField Type - HiLink actionScriptMethods Statement - HiLink actionScriptException Exception - HiLink actionScriptXML Type - HiLink actionScriptArrayConstant Constant - HiLink actionScriptStringConstant Constant - HiLink actionScriptEventConstant Constant - HiLink actionScriptTextSnapshot Type - HiLink actionScriptID3 Type - HiLink actionScriptAS2 Function - HiLink actionScriptStyleSheet Type - HiLink flash8Constants Constant - HiLink flash8Functions Function - HiLink flash8Properties Type - HiLink flash8Classes Type - HiLink actionScriptInclude Include - HiLink flash9Classes Type - HiLink flash9Constants Function - HiLink flash9Functions Function - HiLink actionscriptAS3 Function - delcommand HiLink -endif - -let b:current_syntax = "actionscript" -if main_syntax == 'actionscript' - unlet main_syntax -endif - -" vim: ts=8 diff --git a/vim/bundle/flex-4/syntax/mxml.vim b/vim/bundle/flex-4/syntax/mxml.vim deleted file mode 100644 index df5c392..0000000 --- a/vim/bundle/flex-4/syntax/mxml.vim +++ /dev/null @@ -1,407 +0,0 @@ -" Vim syntax file -" Language: MXML (Adobe Flex 4) -" Maintainer: Abdul Qabiz -" Modified: Jaseem V V -" URL: http://www.abdulqabiz.com/files/vim/mxml.vim -" Author and previous maintainer: -" Johannes Zellner -" Paul Siegmann -" Last Change: Monday, August 30, 2010 05:54 AM IST -" Filenames: *.mxml -" $Id: mxml.vim,v 1.1 2010/08/30 05:54 jaseemvv Exp $ - -" CHANGE LOG: -" Added support for highlighting Adobe Flex 4 -" -" USAGE: -" Open your _vimrc file and add the below three lines: -" autocmd BufRead *.as set filetype=actionscript -" autocmd BufRead *.mxml set filetype=mxml -" syntax on -" -" CONFIGURATION: -" syntax folding can be turned on by -" -" let g:mxml_syntax_folding = 1 -" -" before the syntax file gets loaded (e.g. in ~/.vimrc). -" This might slow down syntax highlighting significantly, -" especially for large files. -" -" CREDITS: -" The original version was derived by Johannes Zellner from -" Paul Siegmann's xml.vim. -" I have modified the file which inturn was modified by Abdul Quabiz. -" -" REFERENCES: -" [1] http://www.w3.org/TR/2000/REC-xml-20001006 -" [2] http://www.w3.org/XML/1998/06/xmlspec-report-19980910.htm -" -" -" 2.3 Common Syntactic Constructs -" [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender -" [5] Name ::= (Letter | '_' | ':') (NameChar)* -" -" NOTE: -" 1) empty tag delimiters "/>" inside attribute values (strings) -" confuse syntax highlighting. -" 2) for large files, folding can be pretty slow, especially when -" loading a file the first time and viewoptions contains 'folds' -" so that folds of previous sessions are applied. -" Don't use 'foldmethod=syntax' in this case. - - -" Quit when a syntax file was already loaded - -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish - endif - let main_syntax = 'mxml' -endif - -" don't use standard HiLink, it will not work with included syntax files -if version < 508 - command! -nargs=+ MXMLHiLink hi link -else - command! -nargs=+ MXMLHiLink hi def link -endif - -let s:mxml_cpo_save = &cpo -set cpo&vim - -syn case match - -" mark illegal characters -syn match xmlError "[<&]" - -" strings (inside tags) aka VALUES -" -" EXAMPLE: -" -" -" ^^^^^^^ -syn region xmlString contained start=+"+ end=+"+ contains=xmlEntity display -syn region xmlString contained start=+'+ end=+'+ contains=xmlEntity display - - -" punctuation (within attributes) e.g. -" ^ ^ -" syn match xmlAttribPunct +[-:._]+ contained display -syn match xmlAttribPunct +[:.]+ contained display - -" no highlighting for xmlEqual (xmlEqual has no highlighting group) -syn match xmlEqual +=+ display - - -" attribute, everything before the '=' -" -" PROVIDES: @xmlAttribHook -" -" EXAMPLE: -" -" -" ^^^^^^^^^^^^^ -" -syn match xmlAttrib - \ +[-'"<]\@\(['">]\@!\|$\)+ - \ contained - \ contains=xmlAttribPunct,@xmlAttribHook - \ display - - -" namespace spec -" -" PROVIDES: @xmlNamespaceHook -" -" EXAMPLE: -" -" -" ^^^ -" -if exists("g:mxml_namespace_transparent") -syn match xmlNamespace - \ +\(<\|"':]\+[:]\@=+ - \ contained - \ contains=@xmlNamespaceHook - \ transparent - \ display -else -syn match xmlNamespace - \ +\(<\|"':]\+[:]\@=+ - \ contained - \ contains=@xmlNamespaceHook - \ display -endif - - -" tag name -" -" PROVIDES: @xmlTagHook -" -" EXAMPLE: -" -" -" ^^^ -" -syn match xmlTagName - \ +[<]\@<=[^ /!?<>"']\++ - \ contained - \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook - \ display - - -if exists('g:mxml_syntax_folding') - - " start tag - " use matchgroup=xmlTag to skip over the leading '<' - " - " PROVIDES: @xmlStartTagHook - " - " EXAMPLE: - " - " - " s^^^^^^^^^^^^^^^e - " - syn region xmlTag - \ matchgroup=xmlTag start=+<[^ /!?<>"']\@=+ - \ matchgroup=xmlTag end=+>+ - \ contained - \ contains=xmlError,xmlTagName,xmlAttrib,xmlEqual,xmlString,@xmlStartTagHook - - - " highlight the end tag - " - " PROVIDES: @xmlTagHook - " (should we provide a separate @xmlEndTagHook ?) - " - " EXAMPLE: - " - " - " ^^^^^^ - " - syn match xmlEndTag - \ +"']\+>+ - \ contained - \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook - - - " tag elements with syntax-folding. - " NOTE: NO HIGHLIGHTING -- highlighting is done by contained elements - " - " PROVIDES: @xmlRegionHook - " - " EXAMPLE: - " - " - " - " - " - " some data - " - " - syn region xmlRegion - \ start=+<\z([^ /!?<>"']\+\)+ - \ skip=++ - \ end=++ - \ matchgroup=xmlEndTag end=+/>+ - \ fold - \ contains=xmlTag,xmlEndTag,xmlCdata,xmlRegion,xmlComment,xmlEntity,xmlProcessing,@xmlRegionHook - \ keepend - \ extend - -else - - " no syntax folding: - " - contained attribute removed - " - xmlRegion not defined - " - syn region xmlTag - \ matchgroup=xmlTag start=+<[^ /!?<>"']\@=+ - \ matchgroup=xmlTag end=+>+ - \ contains=xmlError,xmlTagName,xmlAttrib,xmlEqual,xmlString,@xmlStartTagHook - - syn match xmlEndTag - \ +"']\+>+ - \ contains=xmlNamespace,xmlAttribPunct,@xmlTagHook - -endif - - -" &entities; compare with dtd -syn match xmlEntity "&[^; \t]*;" contains=xmlEntityPunct -syn match xmlEntityPunct contained "[&.;]" - -if exists('g:mxml_syntax_folding') - - " The real comments (this implements the comments as defined by xml, - " but not all xml pages actually conform to it. Errors are flagged. - syn region xmlComment - \ start=++ - \ contains=xmlCommentPart,xmlCommentError - \ extend - \ fold - -else - - " no syntax folding: - " - fold attribute removed - " - syn region xmlComment - \ start=++ - \ contains=xmlCommentPart,xmlCommentError - \ extend - -endif - -syn keyword xmlTodo contained TODO FIXME XXX -syn match xmlCommentError contained "[^>+ - \ contains=xmlCdataStart,xmlCdataEnd,@xmlCdataHook - \ keepend - \ extend - -" using the following line instead leads to corrupt folding at CDATA regions -" syn match xmlCdata ++ contains=xmlCdataStart,xmlCdataEnd,@xmlCdataHook -syn match xmlCdataStart ++ contained - - -" Processing instructions -" This allows "?>" inside strings -- good idea? -syn region xmlProcessing matchgroup=xmlProcessingDelim start="" contains=xmlAttrib,xmlEqual,xmlString - - -if exists('g:mxml_syntax_folding') - - " DTD -- we use dtd.vim here - syn region xmlDocType matchgroup=xmlDocTypeDecl - \ start="" - \ fold - \ contains=xmlDocTypeKeyword,xmlInlineDTD,xmlString -else - - " no syntax folding: - " - fold attribute removed - " - syn region xmlDocType matchgroup=xmlDocTypeDecl - \ start="" - \ contains=xmlDocTypeKeyword,xmlInlineDTD,xmlString - -endif - -syn keyword xmlDocTypeKeyword contained DOCTYPE PUBLIC SYSTEM -syn region xmlInlineDTD contained matchgroup=xmlDocTypeDecl start="\[" end="]" contains=@xmlDTD -syn include @xmlDTD :p:h/dtd.vim -unlet b:current_syntax - - -" synchronizing -" TODO !!! to be improved !!! - -syn sync match xmlSyncDT grouphere xmlDocType +\_.\(+ - -if exists('g:mxml_syntax_folding') - syn sync match xmlSync grouphere xmlRegion +\_.\(<[^ /!?<>"']\+\)\@=+ - " syn sync match xmlSync grouphere xmlRegion "<[^ /!?<>"']*>" - syn sync match xmlSync groupthere xmlRegion +"']\+>+ -endif - -syn keyword mxmlSpecialTagName contained fx:Script fx:Style mx:Script mx:Style -if main_syntax != 'actionscript' || exists("actionscript") - " JAVA SCRIPT - syn include @mxmlScript syntax/actionscript.vim - unlet b:current_syntax - syn region Script start=+]*>+ keepend end=++me=s-1 contains=@mxmlScript,mxmlCssStyleComment,mxmlScriptTag,@htmlPreproc - syn region mxmlScriptTag contained start=++ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent - syn region Script start=+]*>+ keepend end=++me=s-1 contains=@mxmlScript,mxmlCssStyleComment,mxmlScriptTag,@htmlPreproc - syn region mxmlScriptTag contained start=++ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent - MXMLHiLink mxmlScriptTag xmlTag - - syn region mxmlEvent contained start=+\ I installed the plugin and started Vim. Why don't any of the commands -> exist? - -Fugitive cares about the current file, not the current working -directory. Edit a file from the repository. - -> I opened a new tab. Why don't any of the commands exist? - -Fugitive cares about the current file, not the current working -directory. Edit a file from the repository. - -> Why is `:Gbrowse` not using the right browser? - -`:Gbrowse` delegates to `git web--browse`, which is less than perfect -when it comes to finding the right browser. You can tell it the correct -browser to use with `git config --global web.browser ...`. On OS X, for -example, you might want to set this to `open`. See `git web--browse --help` -for details. - -> Here's a patch that automatically opens the quickfix window after -> `:Ggrep`. - -This is a great example of why I recommend asking before patching. -There are valid arguments to be made both for and against automatically -opening the quickfix window. Whenever I have to make an arbitrary -decision like this, I ask what Vim would do. And Vim does not open a -quickfix window after `:grep`. - -Luckily, it's easy to implement the desired behavior without changing -fugitive.vim. The following autocommand will cause the quickfix window -to open after any grep invocation: - - autocmd QuickFixCmdPost *grep* cwindow - -## Self-Promotion - -Like fugitive.vim? Follow the repository on -[GitHub](https://github.com/tpope/vim-fugitive) and vote for it on -[vim.org](http://www.vim.org/scripts/script.php?script_id=2975). And if -you're feeling especially charitable, follow [tpope](http://tpo.pe/) on -[Twitter](http://twitter.com/tpope) and -[GitHub](https://github.com/tpope). - -## License - -Copyright (c) Tim Pope. Distributed under the same terms as Vim itself. -See `:help license`. diff --git a/vim/bundle/fugitive/doc/fugitive.txt b/vim/bundle/fugitive/doc/fugitive.txt deleted file mode 100644 index f40afcf..0000000 --- a/vim/bundle/fugitive/doc/fugitive.txt +++ /dev/null @@ -1,317 +0,0 @@ -*fugitive.txt* A Git wrapper so awesome, it should be illegal - -Author: Tim Pope -License: Same terms as Vim itself (see |license|) - -This plugin is only available if 'compatible' is not set. - -INTRODUCTION *fugitive* - -Whenever you edit a file from a Git repository, a set of commands is defined -that serve as a gateway to Git. - -COMMANDS *fugitive-commands* - -These commands are local to the buffers in which they work (generally, buffers -that are part of Git repositories). - - *fugitive-:Git* -:Git [args] Run an arbitrary git command. Similar to :!git [args] - but chdir to the repository tree first. - - *fugitive-:Git!* -:Git! [args] Like |:Git|, but capture the output into a temp file, - and edit that temp file. - - *fugitive-:Gcd* -:Gcd [directory] |:cd| relative to the repository. - - *fugitive-:Glcd* -:Glcd [directory] |:lcd| relative to the repository. - - *fugitive-:Gstatus* -:Gstatus Bring up the output of git-status in the preview - window. The following maps, which work on the cursor - line file where sensible, are provided: - - next file - previous file - |:Gedit| - - |:Git| add - - |:Git| reset (staged files) - cA |:Gcommit| --amend --reuse-message=HEAD - ca |:Gcommit| --amend - cc |:Gcommit| - cva |:Gcommit| --amend --verbose - cvc |:Gcommit| --verbose - D |:Gdiff| - ds |:Gsdiff| - dp |:Git!| diff (p for patch; use :Gw to apply) - dp |:Git| add --intent-to-add (untracked files) - dv |:Gvdiff| - O |:Gtabedit| - o |:Gsplit| - p |:Git| add --patch - p |:Git| reset --patch (staged files) - q close status - R reload status - S |:Gvsplit| - - *fugitive-:Gcommit* -:Gcommit [args] A wrapper around git-commit. If there is nothing - to commit, |:Gstatus| is called instead. Unless the - arguments given would skip the invocation of an editor - (e.g., -m), a split window will be used to obtain a - commit message. Write and close that window (:wq or - |:Gwrite|) to finish the commit. Unlike when running - the actual git-commit command, it is possible (but - unadvisable) to muck with the index with commands like - git-add and git-reset while a commit message is - pending. - - *fugitive-:Ggrep* -:Ggrep [args] |:grep| with git-grep as 'grepprg'. - - *fugitive-:Glgrep* -:Glgrep [args] |:lgrep| with git-grep as 'grepprg'. - - *fugitive-:Glog* -:Glog [args] Load all previous revisions of the current file into - the quickfix list. Additional git-log arguments can - be given (for example, --reverse). If "--" appears as - an argument, no file specific filtering is done, and - previous commits rather than previous file revisions - are loaded. - - *fugitive-:Gllog* -:Gllog [args] Like |:Glog|, but use the location list instead of the - quickfix list. - - *fugitive-:Gedit* *fugitive-:Ge* -:Gedit [revision] |:edit| a |fugitive-revision|. - - *fugitive-:Gsplit* -:Gsplit [revision] |:split| a |fugitive-revision|. - - *fugitive-:Gvsplit* -:Gvsplit [revision] |:vsplit| a |fugitive-revision|. - - *fugitive-:Gtabedit* -:Gtabedit [revision] |:tabedit| a |fugitive-revision|. - - *fugitive-:Gpedit* -:Gpedit [revision] |:pedit| a |fugitive-revision|. - -:Gsplit! [args] *fugitive-:Gsplit!* *fugitive-:Gvsplit!* -:Gvsplit! [args] *fugitive-:Gtabedit!* *fugitive-:Gpedit!* -:Gtabedit! [args] Like |:Git!|, but open the resulting temp file in a -:Gpedit! [args] split, tab, or preview window. - - *fugitive-:Gread* -:Gread [revision] Empty the buffer and |:read| a |fugitive-revision|. - When the argument is omitted, this is similar to - git-checkout on a work tree file or git-add on a stage - file, but without writing anything to disk. - -:{range}Gread [revision] - |:read| in a |fugitive-revision| after {range}. - - *fugitive-:Gread!* -:Gread! [args] Empty the buffer and |:read| the output of a Git - command. For example, :Gread! show HEAD:%. - -:{range}Gread! [args] |:read| the output of a Git command after {range}. - - *fugitive-:Gw* *fugitive-:Gwrite* -:Gwrite Write to the current file's path and stage the results. - When run in a work tree file, it is effectively git - add. Elsewhere, it is effectively git-checkout. A - great deal of effort is expended to behave sensibly - when the work tree or index version of the file is - open in another buffer. - -:Gwrite {path} You can give |:Gwrite| an explicit path of where in - the work tree to write. You can also give a path like - :0:foo.txt or even :0 to write to just that stage in - the index. - - *fugitive-:Gwq* -:Gwq [path] Like |:Gwrite| followed by |:quit| if the write - succeeded. - -:Gwq! [path] Like |:Gwrite|! followed by |:quit|! if the write - succeeded. - - *fugitive-:Gdiff* -:Gdiff [revision] Perform a |vimdiff| against the current file in the - given revision. With no argument, the version in the - index is used (which means a three-way diff during a - merge conflict, making it a git-mergetool - alternative). The newer of the two files is placed - to the right. Use |do| and |dp| and write to the - index file to simulate "git add --patch". - - *fugitive-:Gsdiff* -:Gsdiff [revision] Like |:Gdiff|, but split horizontally. - - *fugitive-:Gvdiff* -:Gvdiff [revision] Identical to |:Gdiff|. For symmetry with |:Gsdiff|. - - *fugitive-:Gmove* -:Gmove {destination} Wrapper around git-mv that renames the buffer - afterward. The destination is relative to the current - directory except when started with a /, in which case - it is relative to the work tree. Add a ! to pass -f. - - *fugitive-:Gremove* -:Gremove Wrapper around git-rm that deletes the buffer - afterward. When invoked in an index file, --cached is - passed. Add a ! to pass -f and forcefully discard the - buffer. - - *fugitive-:Gblame* -:Gblame [flags] Run git-blame on the file and open the results in a - scroll bound vertical split. Press enter on a line to - reblame the file as it was in that commit. You can - give any of ltfnsewMC as flags and they will be passed - along to git-blame. The following maps, which work on - the cursor line commit where sensible, are provided: - - A resize to end of author column - C resize to end of commit column - D resize to end of date/time column - q close blame and return to blamed window - gq q, then |:Gedit| to return to work tree version - q, then open commit - o open commit in horizontal split - O open commit in new tab - - reblame at commit - ~ reblame at [count]th first grandparent - P reblame at [count]th parent (like HEAD^[count]) - -:[range]Gblame [flags] Run git-blame on the given range. - - *fugitive-:Gbrowse* -:[range]Gbrowse If the remote for the current branch is on GitHub, - open the current file, blob, tree, commit, or tag - (with git-web--browse) on GitHub. Otherwise, open the - current file, blob, tree, commit, or tag in - git-instaweb (if you have issues, verify you can run - "git instaweb" from a terminal). If a range is given, - it is appropriately appended to the URL as an anchor. - - To use with GitHub FI, point g:fugitive_github_domains - at a list of domains: -> - let g:fugitive_github_domains = ['https://example.com'] -~ -:[range]Gbrowse! Like :Gbrowse, but put the URL on the clipboard rather - than opening it. - -:[range]Gbrowse {revision} - Like :Gbrowse, but for a given |fugitive-revision|. A - useful value here is -, which ties the URL to the - latest commit rather than a volatile branch. - -:[range]Gbrowse [...]@{remote} - Force using the given remote rather than the remote - for the current branch. The remote is used to - determine which GitHub repository to link to. - -MAPPINGS *fugitive-mappings* - -These maps are available everywhere. - - *fugitive-c_CTRL-R_CTRL-G* - On the command line, recall the path to the current - object (that is, a representation of the object - recognized by |:Gedit|). - - *fugitive-y_CTRL-G* -["x]y Yank the commit SHA and path to the current object. - -These maps are available in Git objects. - - *fugitive-* - Jump to the revision under the cursor. - - *fugitive-o* -o Jump to the revision under the cursor in a new split. - - *fugitive-S* -S Jump to the revision under the cursor in a new - vertical split. - - *fugitive-O* -O Jump to the revision under the cursor in a new tab. - - *fugitive--* -- Go to the tree containing the current tree or blob. - - *fugitive-~* -~ Go to the current file in the [count]th first - ancestor. - - *fugitive-P* -P Go to the current file in the [count]th parent. - - *fugitive-C* -C Go to the commit containing the current file. - - *fugitive-.* -. Start a |:| command line with the current revision - prepopulated at the end of the line. - - *fugitive-a* -a Show the current tag, commit, or tree in an alternate - format. - -SPECIFYING REVISIONS *fugitive-revision* - -Fugitive revisions are similar to Git revisions as defined in the "SPECIFYING -REVISIONS" section in the git-rev-parse man page. For commands that accept an -optional revision, the default is the file in the index for work tree files -and the work tree file for everything else. Example revisions follow. - -Revision Meaning ~ -HEAD .git/HEAD -master .git/refs/heads/master -HEAD^{} The commit referenced by HEAD -HEAD^ The parent of the commit referenced by HEAD -HEAD: The tree referenced by HEAD -/HEAD The file named HEAD in the work tree -Makefile The file named Makefile in the work tree -HEAD^:Makefile The file named Makefile in the parent of HEAD -:Makefile The file named Makefile in the index (writable) -- The current file in HEAD -^ The current file in the previous commit -~3 The current file 3 commits ago -: .git/index (Same as |:Gstatus|) -:0 The current file in the index -:1 The current file's common ancestor during a conflict -:2 The current file in the target branch during a conflict -:3 The current file in the merged branch during a conflict -:/foo The most recent commit with "foo" in the message - -STATUSLINE *fugitive-statusline* - - *fugitive#statusline()* -Add %{fugitive#statusline()} to your statusline to get an indicator including -the current branch and the currently edited file's commit. If you don't have -a statusline, this one matches the default when 'ruler' is set: -> - set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P -< - *fugitive#head(...)* -Use fugitive#head() to return the name of the current branch. If the current -HEAD is detached, fugitive#head() will return the empty string, unless the -optional argument is given, in which case the hash of the current commit will -be truncated to the given number of characters. - -ABOUT *fugitive-about* - -Grab the latest version or report a bug on GitHub: - -http://github.com/tpope/vim-fugitive - - vim:tw=78:et:ft=help:norl: diff --git a/vim/bundle/fugitive/plugin/fugitive.vim b/vim/bundle/fugitive/plugin/fugitive.vim deleted file mode 100644 index 8ddb28d..0000000 --- a/vim/bundle/fugitive/plugin/fugitive.vim +++ /dev/null @@ -1,2598 +0,0 @@ -" fugitive.vim - A Git wrapper so awesome, it should be illegal -" Maintainer: Tim Pope -" Version: 2.0 -" GetLatestVimScripts: 2975 1 :AutoInstall: fugitive.vim - -if exists('g:loaded_fugitive') || &cp - finish -endif -let g:loaded_fugitive = 1 - -if !exists('g:fugitive_git_executable') - let g:fugitive_git_executable = 'git' -endif - -" Utility {{{1 - -function! s:function(name) abort - return function(substitute(a:name,'^s:',matchstr(expand(''), '\d\+_'),'')) -endfunction - -function! s:sub(str,pat,rep) abort - return substitute(a:str,'\v\C'.a:pat,a:rep,'') -endfunction - -function! s:gsub(str,pat,rep) abort - return substitute(a:str,'\v\C'.a:pat,a:rep,'g') -endfunction - -function! s:shellesc(arg) abort - if a:arg =~ '^[A-Za-z0-9_/.-]\+$' - return a:arg - elseif &shell =~# 'cmd' - return '"'.s:gsub(s:gsub(a:arg, '"', '""'), '\%', '"%"').'"' - else - return shellescape(a:arg) - endif -endfunction - -function! s:fnameescape(file) abort - if exists('*fnameescape') - return fnameescape(a:file) - else - return escape(a:file," \t\n*?[{`$\\%#'\"|!<") - endif -endfunction - -function! s:throw(string) abort - let v:errmsg = 'fugitive: '.a:string - throw v:errmsg -endfunction - -function! s:warn(str) - echohl WarningMsg - echomsg a:str - echohl None - let v:warningmsg = a:str -endfunction - -function! s:shellslash(path) - if exists('+shellslash') && !&shellslash - return s:gsub(a:path,'\\','/') - else - return a:path - endif -endfunction - -let s:git_versions = {} - -function! fugitive#git_version(...) abort - if !has_key(s:git_versions, g:fugitive_git_executable) - let s:git_versions[g:fugitive_git_executable] = matchstr(system(g:fugitive_git_executable.' --version'), "\\S\\+\n") - endif - return s:git_versions[g:fugitive_git_executable] -endfunction - -function! s:recall() - let rev = s:sub(s:buffer().rev(), '^/', '') - if rev ==# ':' - return matchstr(getline('.'),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$\|^\d\{6} \x\{40\} \d\t\zs.*') - elseif s:buffer().type('tree') - let file = matchstr(getline('.'), '\t\zs.*') - if empty(file) && line('.') > 2 - let file = s:sub(getline('.'), '/$', '') - endif - if !empty(file) && rev !~# ':$' - return rev . '/' . file - else - return rev . file - endif - endif - return rev -endfunction - -function! s:add_methods(namespace, method_names) abort - for name in a:method_names - let s:{a:namespace}_prototype[name] = s:function('s:'.a:namespace.'_'.name) - endfor -endfunction - -let s:commands = [] -function! s:command(definition) abort - let s:commands += [a:definition] -endfunction - -function! s:define_commands() - for command in s:commands - exe 'command! -buffer '.command - endfor -endfunction - -augroup fugitive_utility - autocmd! - autocmd User Fugitive call s:define_commands() -augroup END - -let s:abstract_prototype = {} - -" }}}1 -" Initialization {{{1 - -function! fugitive#is_git_dir(path) abort - let path = s:sub(a:path, '[\/]$', '') . '/' - return isdirectory(path.'objects') && isdirectory(path.'refs') && getfsize(path.'HEAD') > 10 -endfunction - -function! fugitive#extract_git_dir(path) abort - if s:shellslash(a:path) =~# '^fugitive://.*//' - return matchstr(s:shellslash(a:path), '\C^fugitive://\zs.\{-\}\ze//') - endif - 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 - 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) - return dir - elseif type ==# 'link' && fugitive#is_git_dir(dir) - return resolve(dir) - elseif type !=# '' && filereadable(dir) - let line = get(readfile(dir, '', 1), 0, '') - if line =~# '^gitdir: \.' && fugitive#is_git_dir(root.'/'.line[8:-1]) - return simplify(root.'/'.line[8:-1]) - elseif line =~# '^gitdir: ' && fugitive#is_git_dir(line[8:-1]) - return line[8:-1] - endif - elseif fugitive#is_git_dir(root) - return root - endif - let previous = root - let root = fnamemodify(root, ':h') - endwhile - return '' -endfunction - -function! fugitive#detect(path) - if exists('b:git_dir') && (b:git_dir ==# '' || b:git_dir =~# '/$') - unlet b:git_dir - endif - if !exists('b:git_dir') - let dir = fugitive#extract_git_dir(a:path) - if dir !=# '' - let b:git_dir = dir - endif - endif - if exists('b:git_dir') - silent doautocmd User FugitiveBoot - cnoremap fnameescape(recall()) - nnoremap y :call setreg(v:register, recall()) - let buffer = fugitive#buffer() - if expand('%:p') =~# '//' - call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', '')) - endif - if stridx(buffer.getvar('&tags'), escape(b:git_dir.'/tags', ', ')) == -1 - call buffer.setvar('&tags', escape(b:git_dir.'/tags', ', ').','.buffer.getvar('&tags')) - if &filetype !=# '' - call buffer.setvar('&tags', escape(b:git_dir.'/'.&filetype.'.tags', ', ').','.buffer.getvar('&tags')) - endif - endif - silent doautocmd User Fugitive - endif -endfunction - -augroup fugitive - autocmd! - autocmd BufNewFile,BufReadPost * call fugitive#detect(expand(':p')) - autocmd FileType netrw call fugitive#detect(expand('%:p')) - autocmd User NERDTreeInit,NERDTreeNewRoot call fugitive#detect(b:NERDTreeRoot.path.str()) - autocmd VimEnter * if expand('')==''|call fugitive#detect(getcwd())|endif - autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('')), 'fugitive_leave') -augroup END - -" }}}1 -" Repository {{{1 - -let s:repo_prototype = {} -let s:repos = {} - -function! s:repo(...) abort - let dir = a:0 ? a:1 : (exists('b:git_dir') && b:git_dir !=# '' ? b:git_dir : fugitive#extract_git_dir(expand('%:p'))) - if dir !=# '' - if has_key(s:repos, dir) - let repo = get(s:repos, dir) - else - let repo = {'git_dir': dir} - let s:repos[dir] = repo - endif - return extend(extend(repo, s:repo_prototype, 'keep'), s:abstract_prototype, 'keep') - endif - call s:throw('not a git repository: '.expand('%:p')) -endfunction - -function! fugitive#repo(...) - return call('s:repo', a:000) -endfunction - -function! s:repo_dir(...) dict abort - return join([self.git_dir]+a:000,'/') -endfunction - -function! s:repo_configured_tree() dict abort - if !has_key(self,'_tree') - let self._tree = '' - if filereadable(self.dir('config')) - let config = readfile(self.dir('config'),'',10) - call filter(config,'v:val =~# "^\\s*worktree *="') - if len(config) == 1 - let self._tree = matchstr(config[0], '= *\zs.*') - endif - endif - endif - if self._tree =~# '^\.' - return simplify(self.dir(self._tree)) - else - return self._tree - endif -endfunction - -function! s:repo_tree(...) dict abort - if self.dir() =~# '/\.git$' - let dir = self.dir()[0:-6] - else - let dir = self.configured_tree() - endif - if dir ==# '' - call s:throw('no work tree') - else - return join([dir]+a:000,'/') - endif -endfunction - -function! s:repo_bare() dict abort - if self.dir() =~# '/\.git$' - return 0 - else - return self.configured_tree() ==# '' - endif -endfunction - -function! s:repo_translate(spec) dict abort - if a:spec ==# '.' || a:spec ==# '/.' - return self.bare() ? self.dir() : self.tree() - elseif a:spec =~# '^/\=\.git$' && self.bare() - return self.dir() - elseif a:spec =~# '^/\=\.git/' - return self.dir(s:sub(a:spec, '^/=\.git/', '')) - elseif a:spec =~# '^/' - return self.tree().a:spec - elseif a:spec =~# '^:[0-3]:' - return 'fugitive://'.self.dir().'//'.a:spec[1].'/'.a:spec[3:-1] - elseif a:spec ==# ':' - if $GIT_INDEX_FILE =~# '/[^/]*index[^/]*\.lock$' && fnamemodify($GIT_INDEX_FILE,':p')[0:strlen(self.dir())] ==# self.dir('') && filereadable($GIT_INDEX_FILE) - return fnamemodify($GIT_INDEX_FILE,':p') - else - return self.dir('index') - endif - elseif a:spec =~# '^:/' - let ref = self.rev_parse(matchstr(a:spec,'.[^:]*')) - return 'fugitive://'.self.dir().'//'.ref - elseif a:spec =~# '^:' - return 'fugitive://'.self.dir().'//0/'.a:spec[1:-1] - elseif a:spec =~# 'HEAD\|^refs/' && a:spec !~ ':' && filereadable(self.dir(a:spec)) - return self.dir(a:spec) - elseif filereadable(self.dir('refs/'.a:spec)) - return self.dir('refs/'.a:spec) - elseif filereadable(self.dir('refs/tags/'.a:spec)) - return self.dir('refs/tags/'.a:spec) - elseif filereadable(self.dir('refs/heads/'.a:spec)) - return self.dir('refs/heads/'.a:spec) - elseif filereadable(self.dir('refs/remotes/'.a:spec)) - return self.dir('refs/remotes/'.a:spec) - elseif filereadable(self.dir('refs/remotes/'.a:spec.'/HEAD')) - return self.dir('refs/remotes/'.a:spec,'/HEAD') - else - try - let ref = self.rev_parse(matchstr(a:spec,'[^:]*')) - let path = s:sub(matchstr(a:spec,':.*'),'^:','/') - return 'fugitive://'.self.dir().'//'.ref.path - catch /^fugitive:/ - return self.tree(a:spec) - endtry - endif -endfunction - -function! s:repo_head(...) dict abort - let head = s:repo().head_ref() - - if head =~# '^ref: ' - let branch = s:sub(head,'^ref: %(refs/%(heads/|remotes/|tags/)=)=','') - elseif head =~# '^\x\{40\}$' - " truncate hash to a:1 characters if we're in detached head mode - let len = a:0 ? a:1 : 0 - let branch = len ? head[0:len-1] : '' - endif - - return branch -endfunction - -call s:add_methods('repo',['dir','configured_tree','tree','bare','translate','head']) - -function! s:repo_git_command(...) dict abort - let git = g:fugitive_git_executable . ' --git-dir='.s:shellesc(self.git_dir) - return git.join(map(copy(a:000),'" ".s:shellesc(v:val)'),'') -endfunction - -function! s:repo_git_chomp(...) dict abort - return s:sub(system(call(self.git_command,a:000,self)),'\n$','') -endfunction - -function! s:repo_git_chomp_in_tree(...) dict abort - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd.'`=s:repo().tree()`' - return call(s:repo().git_chomp, a:000, s:repo()) - finally - execute cd.'`=dir`' - endtry -endfunction - -function! s:repo_rev_parse(rev) dict abort - let hash = self.git_chomp('rev-parse','--verify',a:rev) - if hash =~ '\<\x\{40\}$' - return matchstr(hash,'\<\x\{40\}$') - endif - call s:throw('rev-parse '.a:rev.': '.hash) -endfunction - -call s:add_methods('repo',['git_command','git_chomp','git_chomp_in_tree','rev_parse']) - -function! s:repo_dirglob(base) dict abort - let base = s:sub(a:base,'^/','') - let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*/')),"\n") - call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]') - return matches -endfunction - -function! s:repo_superglob(base) dict abort - if a:base =~# '^/' || a:base !~# ':' - let results = [] - if a:base !~# '^/' - let heads = ["HEAD","ORIG_HEAD","FETCH_HEAD","MERGE_HEAD"] - let heads += sort(split(s:repo().git_chomp("rev-parse","--symbolic","--branches","--tags","--remotes"),"\n")) - call filter(heads,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base') - let results += heads - endif - if !self.bare() - let base = s:sub(a:base,'^/','') - let matches = split(glob(self.tree(s:gsub(base,'/','*&').'*')),"\n") - call map(matches,'s:shellslash(v:val)') - call map(matches,'v:val !~ "/$" && isdirectory(v:val) ? v:val."/" : v:val') - call map(matches,'v:val[ strlen(self.tree())+(a:base !~ "^/") : -1 ]') - let results += matches - endif - return results - - elseif a:base =~# '^:' - let entries = split(self.git_chomp('ls-files','--stage'),"\n") - call map(entries,'s:sub(v:val,".*(\\d)\\t(.*)",":\\1:\\2")') - if a:base !~# '^:[0-3]\%(:\|$\)' - call filter(entries,'v:val[1] == "0"') - call map(entries,'v:val[2:-1]') - endif - call filter(entries,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base') - return entries - - else - let tree = matchstr(a:base,'.*[:/]') - let entries = split(self.git_chomp('ls-tree',tree),"\n") - call map(entries,'s:sub(v:val,"^04.*\\zs$","/")') - call map(entries,'tree.s:sub(v:val,".*\t","")') - return filter(entries,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base') - endif -endfunction - -call s:add_methods('repo',['dirglob','superglob']) - -function! s:repo_config(conf) dict abort - return matchstr(system(s:repo().git_command('config').' '.a:conf),"[^\r\n]*") -endfun - -function! s:repo_user() dict abort - let username = s:repo().config('user.name') - let useremail = s:repo().config('user.email') - return username.' <'.useremail.'>' -endfun - -function! s:repo_aliases() dict abort - if !has_key(self,'_aliases') - let self._aliases = {} - for line in split(self.git_chomp('config','--get-regexp','^alias[.]'),"\n") - let self._aliases[matchstr(line,'\.\zs\S\+')] = matchstr(line,' \zs.*') - endfor - endif - return self._aliases -endfunction - -call s:add_methods('repo',['config', 'user', 'aliases']) - -function! s:repo_keywordprg() dict abort - let args = ' --git-dir='.escape(self.dir(),"\\\"' ") - if has('gui_running') && !has('win32') - return g:fugitive_git_executable . ' --no-pager' . args . ' log -1' - else - return g:fugitive_git_executable . args . ' show' - endif -endfunction - -call s:add_methods('repo',['keywordprg']) - -" }}}1 -" Buffer {{{1 - -let s:buffer_prototype = {} - -function! s:buffer(...) abort - let buffer = {'#': bufnr(a:0 ? a:1 : '%')} - call extend(extend(buffer,s:buffer_prototype,'keep'),s:abstract_prototype,'keep') - if buffer.getvar('git_dir') !=# '' - return buffer - endif - call s:throw('not a git repository: '.expand('%:p')) -endfunction - -function! fugitive#buffer(...) abort - return s:buffer(a:0 ? a:1 : '%') -endfunction - -function! s:buffer_getvar(var) dict abort - return getbufvar(self['#'],a:var) -endfunction - -function! s:buffer_setvar(var,value) dict abort - return setbufvar(self['#'],a:var,a:value) -endfunction - -function! s:buffer_getline(lnum) dict abort - return getbufline(self['#'],a:lnum)[0] -endfunction - -function! s:buffer_repo() dict abort - return s:repo(self.getvar('git_dir')) -endfunction - -function! s:buffer_type(...) dict abort - if self.getvar('fugitive_type') != '' - let type = self.getvar('fugitive_type') - elseif fnamemodify(self.spec(),':p') =~# '.\git/refs/\|\.git/\w*HEAD$' - let type = 'head' - elseif self.getline(1) =~ '^tree \x\{40\}$' && self.getline(2) == '' - let type = 'tree' - elseif self.getline(1) =~ '^\d\{6\} \w\{4\} \x\{40\}\>\t' - let type = 'tree' - elseif self.getline(1) =~ '^\d\{6\} \x\{40\}\> \d\t' - let type = 'index' - elseif isdirectory(self.spec()) - let type = 'directory' - elseif self.spec() == '' - let type = 'null' - else - let type = 'file' - endif - if a:0 - return !empty(filter(copy(a:000),'v:val ==# type')) - else - return type - endif -endfunction - -if has('win32') - - function! s:buffer_spec() dict abort - let bufname = bufname(self['#']) - let retval = '' - for i in split(bufname,'[^:]\zs\\') - let retval = fnamemodify((retval==''?'':retval.'\').i,':.') - endfor - return s:shellslash(fnamemodify(retval,':p')) - endfunction - -else - - function! s:buffer_spec() dict abort - let bufname = bufname(self['#']) - return s:shellslash(bufname == '' ? '' : fnamemodify(bufname,':p')) - endfunction - -endif - -function! s:buffer_name() dict abort - return self.spec() -endfunction - -function! s:buffer_commit() dict abort - return matchstr(self.spec(),'^fugitive://.\{-\}//\zs\w*') -endfunction - -function! s:buffer_path(...) dict abort - let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*') - if rev != '' - let rev = s:sub(rev,'\w*','') - elseif self.spec()[0 : len(self.repo().dir())] ==# self.repo().dir() . '/' - let rev = '/.git'.self.spec()[strlen(self.repo().dir()) : -1] - elseif !self.repo().bare() && self.spec()[0 : len(self.repo().tree())] ==# self.repo().tree() . '/' - let rev = self.spec()[strlen(self.repo().tree()) : -1] - endif - return s:sub(s:sub(rev,'.\zs/$',''),'^/',a:0 ? a:1 : '') -endfunction - -function! s:buffer_rev() dict abort - let rev = matchstr(self.spec(),'^fugitive://.\{-\}//\zs.*') - if rev =~ '^\x/' - return ':'.rev[0].':'.rev[2:-1] - elseif rev =~ '.' - return s:sub(rev,'/',':') - elseif self.spec() =~ '\.git/index$' - return ':' - elseif self.spec() =~ '\.git/refs/\|\.git/.*HEAD$' - return self.spec()[strlen(self.repo().dir())+1 : -1] - else - return self.path('/') - endif -endfunction - -function! s:buffer_sha1() dict abort - if self.spec() =~ '^fugitive://' || self.spec() =~ '\.git/refs/\|\.git/.*HEAD$' - return self.repo().rev_parse(self.rev()) - else - return '' - endif -endfunction - -function! s:buffer_expand(rev) dict abort - if a:rev =~# '^:[0-3]$' - let file = a:rev.self.path(':') - elseif a:rev =~# '^[-:]/$' - let file = '/'.self.path() - elseif a:rev =~# '^-' - let file = 'HEAD^{}'.a:rev[1:-1].self.path(':') - elseif a:rev =~# '^@{' - let file = 'HEAD'.a:rev.self.path(':') - elseif a:rev =~# '^[~^]' - let commit = s:sub(self.commit(),'^\d=$','HEAD') - let file = commit.a:rev.self.path(':') - else - let file = a:rev - endif - return s:sub(s:sub(file,'\%$',self.path()),'\.\@<=/$','') -endfunction - -function! s:buffer_containing_commit() dict abort - if self.commit() =~# '^\d$' - return ':' - elseif self.commit() =~# '.' - return self.commit() - else - return 'HEAD' - endif -endfunction - -function! s:buffer_up(...) dict abort - let rev = self.rev() - let c = a:0 ? a:1 : 1 - while c - if rev =~# '^[/:]$' - let rev = 'HEAD' - elseif rev =~# '^:' - let rev = ':' - elseif rev =~# '^refs/[^^~:]*$\|^[^^~:]*HEAD$' - let rev .= '^{}' - elseif rev =~# '^/\|:.*/' - let rev = s:sub(rev, '.*\zs/.*', '') - elseif rev =~# ':.' - let rev = matchstr(rev, '^[^:]*:') - elseif rev =~# ':$' - let rev = rev[0:-2] - else - return rev.'~'.c - endif - let c -= 1 - endwhile - return rev -endfunction - -call s:add_methods('buffer',['getvar','setvar','getline','repo','type','spec','name','commit','path','rev','sha1','expand','containing_commit','up']) - -" }}}1 -" Git {{{1 - -call s:command("-bang -nargs=? -complete=customlist,s:GitComplete Git :execute s:Git(0,)") - -function! s:ExecuteInTree(cmd) abort - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd.'`=s:repo().tree()`' - execute a:cmd - finally - execute cd.'`=dir`' - endtry -endfunction - -function! s:Git(bang,cmd) abort - if a:bang - return s:Edit('edit',1,a:cmd) - endif - let git = s:repo().git_command() - if has('gui_running') && !has('win32') - let git .= ' --no-pager' - endif - let cmd = matchstr(a:cmd,'\v\C.{-}%($|\\@ `=s:repo().bare() ? s:repo().dir() : s:repo().tree()`") -call s:command("-bar -bang -nargs=? -complete=customlist,s:DirComplete Glcd :lcd `=s:repo().bare() ? s:repo().dir() : s:repo().tree()`") - -" }}}1 -" Gstatus {{{1 - -call s:command("-bar Gstatus :execute s:Status()") -augroup fugitive_status - autocmd! - if !has('win32') - autocmd FocusGained,ShellCmdPost * call fugitive#reload_status() - endif -augroup END - -function! s:Status() abort - try - Gpedit : - wincmd P - setlocal foldmethod=syntax foldlevel=1 - nnoremap q :bdelete - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry - return '' -endfunction - -function! fugitive#reload_status() abort - if exists('s:reloading_status') - return - endif - try - let s:reloading_status = 1 - let mytab = tabpagenr() - for tab in [mytab] + range(1,tabpagenr('$')) - for winnr in range(1,tabpagewinnr(tab,'$')) - if getbufvar(tabpagebuflist(tab)[winnr-1],'fugitive_type') ==# 'index' - execute 'tabnext '.tab - if winnr != winnr() - execute winnr.'wincmd w' - let restorewinnr = 1 - endif - try - if !&modified - call s:BufReadIndex() - endif - finally - if exists('restorewinnr') - wincmd p - endif - execute 'tabnext '.mytab - endtry - endif - endfor - endfor - finally - unlet! s:reloading_status - endtry -endfunction - -function! s:stage_info(lnum) abort - let filename = matchstr(getline(a:lnum),'^#\t\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$') - let lnum = a:lnum - if has('multi_byte_encoding') - let colon = '\%(:\|\%uff1a\)' - else - let colon = ':' - endif - while lnum && getline(lnum) !~# colon.'$' - let lnum -= 1 - endwhile - if !lnum - return ['', ''] - elseif getline(lnum+1) =~# '^# .*\ ' - let [old, new] = split(filename,' -> ') - execute 'Gedit '.s:fnameescape(':0:'.new) - return a:diff.' HEAD:'.s:fnameescape(old) - elseif section ==# 'staged' - execute 'Gedit '.s:fnameescape(':0:'.filename) - return a:diff.' -' - else - execute 'Gedit '.s:fnameescape('/'.filename) - return a:diff - endif -endfunction - -function! s:StageDiffEdit() abort - let [filename, section] = s:stage_info(line('.')) - let arg = (filename ==# '' ? '.' : filename) - if section ==# 'staged' - return 'Git! diff --no-ext-diff --cached '.s:shellesc(arg) - elseif section ==# 'untracked' - let repo = s:repo() - call repo.git_chomp_in_tree('add','--intent-to-add',arg) - if arg ==# '.' - silent! edit! - 1 - if !search('^# .*:\n#.*\n# .*"git checkout \|^# Changes not staged for commit:$','W') - call search('^# .*:$','W') - endif - else - call s:StageReloadSeek(arg,line('.'),line('.')) - endif - return '' - else - return 'Git! diff --no-ext-diff '.s:shellesc(arg) - endif -endfunction - -function! s:StageToggle(lnum1,lnum2) abort - if a:lnum1 == 1 && a:lnum2 == 1 - return 'Gedit /.git|call search("^index$", "wc")' - endif - try - let output = '' - for lnum in range(a:lnum1,a:lnum2) - let [filename, section] = s:stage_info(lnum) - let repo = s:repo() - if getline('.') =~# '^# .*:$' - if section ==# 'staged' - call repo.git_chomp_in_tree('reset','-q') - silent! edit! - 1 - if !search('^# .*:\n# .*"git add .*\n#\n\|^# Untracked files:$','W') - call search('^# .*:$','W') - endif - return '' - elseif section ==# 'unstaged' - call repo.git_chomp_in_tree('add','-u') - silent! edit! - 1 - if !search('^# .*:\n# .*"git add .*\n#\n\|^# Untracked files:$','W') - call search('^# .*:$','W') - endif - return '' - else - call repo.git_chomp_in_tree('add','.') - silent! edit! - 1 - call search('^# .*:$','W') - return '' - endif - endif - if filename ==# '' - continue - endif - if !exists('first_filename') - let first_filename = filename - endif - execute lnum - if filename =~ ' -> ' - let cmd = ['mv','--'] + reverse(split(filename,' -> ')) - let filename = cmd[-1] - elseif section ==# 'staged' - let cmd = ['reset','-q','--',filename] - elseif getline(lnum) =~# '^#\tdeleted:' - let cmd = ['rm','--',filename] - elseif getline(lnum) =~# '^#\tmodified:' - let cmd = ['add','--',filename] - else - let cmd = ['add','-A','--',filename] - endif - let output .= call(repo.git_chomp_in_tree,cmd,s:repo())."\n" - endfor - if exists('first_filename') - call s:StageReloadSeek(first_filename,a:lnum1,a:lnum2) - endif - echo s:sub(s:gsub(output,'\n+','\n'),'\n$','') - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry - return 'checktime' -endfunction - -function! s:StagePatch(lnum1,lnum2) abort - let add = [] - let reset = [] - - for lnum in range(a:lnum1,a:lnum2) - let [filename, section] = s:stage_info(lnum) - if getline('.') =~# '^# .*:$' && section ==# 'staged' - return 'Git reset --patch' - elseif getline('.') =~# '^# .*:$' && section ==# 'unstaged' - return 'Git add --patch' - elseif getline('.') =~# '^# .*:$' && section ==# 'untracked' - return 'Git add -N .' - elseif filename ==# '' - continue - endif - if !exists('first_filename') - let first_filename = filename - endif - execute lnum - if filename =~ ' -> ' - let reset += [split(filename,' -> ')[1]] - elseif section ==# 'staged' - let reset += [filename] - elseif getline(lnum) !~# '^#\tdeleted:' - let add += [filename] - endif - endfor - try - if !empty(add) - execute "Git add --patch -- ".join(map(add,'s:shellesc(v:val)')) - endif - if !empty(reset) - execute "Git reset --patch -- ".join(map(add,'s:shellesc(v:val)')) - endif - if exists('first_filename') - silent! edit! - 1 - redraw - call search('^#\t\%([[:alpha:] ]\+: *\)\=\V'.first_filename.'\%( ([^()[:digit:]]\+)\)\=\$','W') - endif - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry - return 'checktime' -endfunction - -" }}}1 -" Gcommit {{{1 - -call s:command("-nargs=? -complete=customlist,s:CommitComplete Gcommit :execute s:Commit()") - -function! s:Commit(args) abort - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - let msgfile = s:repo().dir('COMMIT_EDITMSG') - let outfile = tempname() - let errorfile = tempname() - try - try - execute cd.s:fnameescape(s:repo().tree()) - if &shell =~# 'cmd' - let command = '' - let old_editor = $GIT_EDITOR - let $GIT_EDITOR = 'false' - else - let command = 'env GIT_EDITOR=false ' - endif - let command .= s:repo().git_command('commit').' '.a:args - if &shell =~# 'csh' - noautocmd silent execute '!('.command.' > '.outfile.') >& '.errorfile - elseif a:args =~# '\%(^\| \)--interactive\>' - noautocmd execute '!'.command.' 2> '.errorfile - else - noautocmd silent execute '!'.command.' > '.outfile.' 2> '.errorfile - endif - finally - execute cd.'`=dir`' - endtry - if !has('gui_running') - redraw! - endif - if !v:shell_error - if filereadable(outfile) - for line in readfile(outfile) - echo line - endfor - endif - return '' - else - let errors = readfile(errorfile) - let error = get(errors,-2,get(errors,-1,'!')) - if error =~# 'false''\=\.$' - let args = a:args - let args = s:gsub(args,'%(%(^| )-- )@' - let args = '--cleanup=strip '.args - endif - if bufname('%') == '' && line('$') == 1 && getline(1) == '' && !&mod - execute 'keepalt edit '.s:fnameescape(msgfile) - elseif s:buffer().type() ==# 'index' - execute 'keepalt edit '.s:fnameescape(msgfile) - execute (search('^#','n')+1).'wincmd+' - setlocal nopreviewwindow - else - execute 'keepalt split '.s:fnameescape(msgfile) - endif - let b:fugitive_commit_arguments = args - setlocal bufhidden=wipe filetype=gitcommit - return '1' - elseif error ==# '!' - return s:Status() - else - call s:throw(error) - endif - endif - catch /^fugitive:/ - return 'echoerr v:errmsg' - finally - if exists('old_editor') - let $GIT_EDITOR = old_editor - endif - call delete(outfile) - call delete(errorfile) - call fugitive#reload_status() - endtry -endfunction - -function! s:CommitComplete(A,L,P) abort - if a:A =~ '^-' || type(a:A) == type(0) " a:A is 0 on :Gcommit - - let args = ['-C', '-F', '-a', '-c', '-e', '-i', '-m', '-n', '-o', '-q', '-s', '-t', '-u', '-v', '--all', '--allow-empty', '--amend', '--author=', '--cleanup=', '--dry-run', '--edit', '--file=', '--include', '--interactive', '--message=', '--no-verify', '--only', '--quiet', '--reedit-message=', '--reuse-message=', '--signoff', '--template=', '--untracked-files', '--verbose'] - return filter(args,'v:val[0 : strlen(a:A)-1] ==# a:A') - else - return s:repo().superglob(a:A) - endif -endfunction - -function! s:FinishCommit() - let args = getbufvar(+expand(''),'fugitive_commit_arguments') - if !empty(args) - call setbufvar(+expand(''),'fugitive_commit_arguments','') - return s:Commit(args) - endif - return '' -endfunction - -augroup fugitive_commit - autocmd! - autocmd VimLeavePre,BufDelete COMMIT_EDITMSG execute s:sub(s:FinishCommit(), '^echoerr (.*)', 'echohl ErrorMsg|echo \1|echohl NONE') -augroup END - -" }}}1 -" Ggrep, Glog {{{1 - -if !exists('g:fugitive_summary_format') - let g:fugitive_summary_format = '%s' -endif - -call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Ggrep :execute s:Grep('grep',0,)") -call s:command("-bang -nargs=? -complete=customlist,s:EditComplete Glgrep :execute s:Grep('lgrep',0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Glog :execute s:Log('grep',)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gllog :execute s:Log('lgrep',)") - -function! s:Grep(cmd,bang,arg) abort - let grepprg = &grepprg - let grepformat = &grepformat - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd.'`=s:repo().tree()`' - let &grepprg = s:repo().git_command('--no-pager', 'grep', '-n') - let &grepformat = '%f:%l:%m' - exe a:cmd.'! '.escape(matchstr(a:arg,'\v\C.{-}%($|[''" ]\@=\|)@='),'|') - let list = a:cmd =~# '^l' ? getloclist(0) : getqflist() - for entry in list - if bufname(entry.bufnr) =~ ':' - let entry.filename = s:repo().translate(bufname(entry.bufnr)) - unlet! entry.bufnr - elseif a:arg =~# '\%(^\| \)--cached\>' - let entry.filename = s:repo().translate(':0:'.bufname(entry.bufnr)) - unlet! entry.bufnr - endif - endfor - if a:cmd =~# '^l' - call setloclist(0, list, 'r') - else - call setqflist(list, 'r') - endif - if !a:bang && !empty(list) - return (a:cmd =~# '^l' ? 'l' : 'c').'first'.matchstr(a:arg,'\v\C[''" ]\zs\|.*') - else - return matchstr(a:arg,'\v\C[''" ]\|\zs.*') - endif - finally - let &grepprg = grepprg - let &grepformat = grepformat - execute cd.'`=dir`' - endtry -endfunction - -function! s:Log(cmd,...) - let path = s:buffer().path('/') - if path =~# '^/\.git\%(/\|$\)' || index(a:000,'--') != -1 - let path = '' - endif - let cmd = ['--no-pager', 'log', '--no-color'] - let cmd += ['--pretty=format:fugitive://'.s:repo().dir().'//%H'.path.'::'.g:fugitive_summary_format] - if empty(filter(a:000[0 : index(a:000,'--')],'v:val !~# "^-"')) - if s:buffer().commit() =~# '\x\{40\}' - let cmd += [s:buffer().commit()] - elseif s:buffer().path() =~# '^\.git/refs/\|^\.git/.*HEAD$' - let cmd += [s:buffer().path()[5:-1]] - endif - end - let cmd += map(copy(a:000),'s:sub(v:val,"^\\%(%(:\\w)*)","\\=fnamemodify(s:buffer().path(),submatch(1))")') - if path =~# '/.' - let cmd += ['--',path[1:-1]] - endif - let grepformat = &grepformat - let grepprg = &grepprg - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - try - execute cd.'`=s:repo().tree()`' - let &grepprg = escape(call(s:repo().git_command,cmd,s:repo()),'%#') - let &grepformat = '%f::%m' - exe a:cmd - finally - let &grepformat = grepformat - let &grepprg = grepprg - execute cd.'`=dir`' - endtry -endfunction - -" }}}1 -" Gedit, Gpedit, Gsplit, Gvsplit, Gtabedit, Gread {{{1 - -function! s:Edit(cmd,bang,...) abort - let buffer = s:buffer() - if a:cmd !~# 'read' - if &previewwindow && getbufvar('','fugitive_type') ==# 'index' - wincmd p - if &diff - let mywinnr = winnr() - for winnr in range(winnr('$'),1,-1) - if winnr != mywinnr && getwinvar(winnr,'&diff') - execute winnr.'wincmd w' - close - wincmd p - endif - endfor - endif - endif - endif - - if a:bang - let args = s:gsub(join(a:000, ' '), '\\@>>>>>> - if getline(1) !~# '^diff ' - setlocal readonly nomodifiable - endif - if a:cmd =~# 'pedit' - wincmd p - endif - return echo - endif - return '' - endif - - if a:0 && a:1 == '' - return '' - elseif a:0 - let file = buffer.expand(join(a:000, ' ')) - elseif expand('%') ==# '' - let file = ':' - elseif buffer.commit() ==# '' && buffer.path('/') !~# '^/.git\>' - let file = buffer.path(':') - else - let file = buffer.path('/') - endif - try - let file = buffer.repo().translate(file) - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry - if a:cmd ==# 'read' - return 'silent %delete_|read '.s:fnameescape(file).'|silent 1delete_|diffupdate|'.line('.') - else - return a:cmd.' '.s:fnameescape(file) - endif -endfunction - -function! s:EditComplete(A,L,P) abort - return map(s:repo().superglob(a:A), 'fnameescape(v:val)') -endfunction - -function! s:EditRunComplete(A,L,P) abort - if a:L =~# '^\w\+!' - return s:GitComplete(a:A,a:L,a:P) - else - return s:repo().superglob(a:A) - endif -endfunction - -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Ge :execute s:Edit('edit',0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gedit :execute s:Edit('edit',0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gpedit :execute s:Edit('pedit',0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gsplit :execute s:Edit('split',0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gvsplit :execute s:Edit('vsplit',0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gtabedit :execute s:Edit('tabedit',0,)") -call s:command("-bar -bang -nargs=* -count -complete=customlist,s:EditRunComplete Gread :execute s:Edit((! && ? '' : ).'read',0,)") - -" }}}1 -" Gwrite, Gwq {{{1 - -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gwrite :execute s:Write(0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gw :execute s:Write(0,)") -call s:command("-bar -bang -nargs=* -complete=customlist,s:EditComplete Gwq :execute s:Wq(0,)") - -function! s:Write(force,...) abort - if exists('b:fugitive_commit_arguments') - return 'write|bdelete' - elseif expand('%:t') == 'COMMIT_EDITMSG' && $GIT_INDEX_FILE != '' - return 'wq' - elseif s:buffer().type() == 'index' - return 'Gcommit' - elseif s:buffer().path() ==# '' && getline(4) =~# '^+++ ' - let filename = getline(4)[6:-1] - setlocal buftype= - silent write - setlocal buftype=nowrite - if matchstr(getline(2),'index [[:xdigit:]]\+\.\.\zs[[:xdigit:]]\{7\}') ==# s:repo().rev_parse(':0:'.filename)[0:6] - let err = s:repo().git_chomp('apply','--cached','--reverse',s:buffer().spec()) - else - let err = s:repo().git_chomp('apply','--cached',s:buffer().spec()) - endif - if err !=# '' - let v:errmsg = split(err,"\n")[0] - return 'echoerr v:errmsg' - elseif a:force - return 'bdelete' - else - return 'Gedit '.fnameescape(filename) - endif - endif - let mytab = tabpagenr() - let mybufnr = bufnr('') - let path = a:0 ? join(a:000, ' ') : s:buffer().path() - if path =~# '^:\d\>' - return 'write'.(a:force ? '! ' : ' ').s:fnameescape(s:repo().translate(s:buffer().expand(path))) - endif - let always_permitted = (s:buffer().path() ==# path && s:buffer().commit() =~# '^0\=$') - if !always_permitted && !a:force && s:repo().git_chomp_in_tree('diff','--name-status','HEAD','--',path) . s:repo().git_chomp_in_tree('ls-files','--others','--',path) !=# '' - let v:errmsg = 'fugitive: file has uncommitted changes (use ! to override)' - return 'echoerr v:errmsg' - endif - let file = s:repo().translate(path) - let treebufnr = 0 - for nr in range(1,bufnr('$')) - if fnamemodify(bufname(nr),':p') ==# file - let treebufnr = nr - endif - endfor - - if treebufnr > 0 && treebufnr != bufnr('') - let temp = tempname() - silent execute '%write '.temp - for tab in [mytab] + range(1,tabpagenr('$')) - for winnr in range(1,tabpagewinnr(tab,'$')) - if tabpagebuflist(tab)[winnr-1] == treebufnr - execute 'tabnext '.tab - if winnr != winnr() - execute winnr.'wincmd w' - let restorewinnr = 1 - endif - try - let lnum = line('.') - let last = line('$') - silent execute '$read '.temp - silent execute '1,'.last.'delete_' - silent write! - silent execute lnum - let did = 1 - finally - if exists('restorewinnr') - wincmd p - endif - execute 'tabnext '.mytab - endtry - endif - endfor - endfor - if !exists('did') - call writefile(readfile(temp,'b'),file,'b') - endif - else - execute 'write! '.s:fnameescape(s:repo().translate(path)) - endif - - if a:force - let error = s:repo().git_chomp_in_tree('add', '--force', file) - else - let error = s:repo().git_chomp_in_tree('add', file) - endif - if v:shell_error - let v:errmsg = 'fugitive: '.error - return 'echoerr v:errmsg' - endif - if s:buffer().path() ==# path && s:buffer().commit() =~# '^\d$' - set nomodified - endif - - let one = s:repo().translate(':1:'.path) - let two = s:repo().translate(':2:'.path) - let three = s:repo().translate(':3:'.path) - for nr in range(1,bufnr('$')) - let name = fnamemodify(bufname(nr), ':p') - if bufloaded(nr) && !getbufvar(nr,'&modified') && (name ==# one || name ==# two || name ==# three) - execute nr.'bdelete' - endif - endfor - - unlet! restorewinnr - let zero = s:repo().translate(':0:'.path) - for tab in range(1,tabpagenr('$')) - for winnr in range(1,tabpagewinnr(tab,'$')) - let bufnr = tabpagebuflist(tab)[winnr-1] - let bufname = fnamemodify(bufname(bufnr), ':p') - if bufname ==# zero && bufnr != mybufnr - execute 'tabnext '.tab - if winnr != winnr() - execute winnr.'wincmd w' - let restorewinnr = 1 - endif - try - let lnum = line('.') - let last = line('$') - silent execute '$read '.s:fnameescape(file) - silent execute '1,'.last.'delete_' - silent execute lnum - set nomodified - diffupdate - finally - if exists('restorewinnr') - wincmd p - endif - execute 'tabnext '.mytab - endtry - break - endif - endfor - endfor - call fugitive#reload_status() - return 'checktime' -endfunction - -function! s:Wq(force,...) abort - let bang = a:force ? '!' : '' - if exists('b:fugitive_commit_arguments') - return 'wq'.bang - endif - let result = call(s:function('s:Write'),[a:force]+a:000) - if result =~# '^\%(write\|wq\|echoerr\)' - return s:sub(result,'^write','wq') - else - return result.'|quit'.bang - endif -endfunction - -" }}}1 -" Gdiff {{{1 - -call s:command("-bang -bar -nargs=* -complete=customlist,s:EditComplete Gdiff :execute s:Diff(0,)") -call s:command("-bar -nargs=* -complete=customlist,s:EditComplete Gvdiff :execute s:Diff(0,)") -call s:command("-bar -nargs=* -complete=customlist,s:EditComplete Gsdiff :execute s:Diff(1,)") - -augroup fugitive_diff - autocmd! - autocmd BufWinLeave * if s:diff_window_count() == 2 && &diff && getbufvar(+expand(''), 'git_dir') !=# '' | call s:diffoff_all(getbufvar(+expand(''), 'git_dir')) | endif - autocmd BufWinEnter * if s:diff_window_count() == 1 && &diff && getbufvar(+expand(''), 'git_dir') !=# '' | call s:diffoff() | endif -augroup END - -function! s:diff_window_count() - let c = 0 - for nr in range(1,winnr('$')) - let c += getwinvar(nr,'&diff') - endfor - return c -endfunction - -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 - if has('cursorbind') - let restore .= (&l:cursorbind ? ' ' : ' no') . 'cursorbind' - endif - return restore -endfunction - -function! s:diffthis() - if !&diff - let w:fugitive_diff_restore = s:diff_restore() - diffthis - endif -endfunction - -function! s:diffoff() - if exists('w:fugitive_diff_restore') - execute w:fugitive_diff_restore - unlet w:fugitive_diff_restore - else - diffoff - endif -endfunction - -function! s:diffoff_all(dir) - for nr in range(1,winnr('$')) - if getwinvar(nr,'&diff') - if nr != winnr() - execute nr.'wincmd w' - let restorewinnr = 1 - endif - if exists('b:git_dir') && b:git_dir ==# a:dir - call s:diffoff() - endif - endif - endfor -endfunction - -function! s:buffer_compare_age(commit) dict abort - let scores = {':0': 1, ':1': 2, ':2': 3, ':': 4, ':3': 5} - let my_score = get(scores,':'.self.commit(),0) - let their_score = get(scores,':'.a:commit,0) - if my_score || their_score - return my_score < their_score ? -1 : my_score != their_score - elseif self.commit() ==# a:commit - return 0 - endif - let base = self.repo().git_chomp('merge-base',self.commit(),a:commit) - if base ==# self.commit() - return -1 - elseif base ==# a:commit - return 1 - endif - let my_time = +self.repo().git_chomp('log','--max-count=1','--pretty=format:%at',self.commit()) - let their_time = +self.repo().git_chomp('log','--max-count=1','--pretty=format:%at',a:commit) - return my_time < their_time ? -1 : my_time != their_time -endfunction - -call s:add_methods('buffer',['compare_age']) - -function! s:Diff(bang,...) - let vert = a:bang ? '' : 'vertical ' - if exists(':DiffGitCached') - return 'DiffGitCached' - elseif (!a:0 || a:1 == ':') && s:buffer().commit() =~# '^[0-1]\=$' && s:repo().git_chomp_in_tree('ls-files', '--unmerged', '--', s:buffer().path()) !=# '' - let nr = bufnr('') - execute 'leftabove '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':2''))`' - execute 'nnoremap dp :diffput '.nr.'diffupdate' - call s:diffthis() - wincmd p - execute 'rightbelow '.vert.'split `=fugitive#buffer().repo().translate(s:buffer().expand('':3''))`' - execute 'nnoremap dp :diffput '.nr.'diffupdate' - call s:diffthis() - wincmd p - call s:diffthis() - return '' - elseif a:0 - let arg = join(a:000, ' ') - if arg ==# '' - return '' - elseif arg ==# '/' - let file = s:buffer().path('/') - elseif arg ==# ':' - let file = s:buffer().path(':0:') - elseif arg =~# '^:/.' - try - let file = s:repo().rev_parse(arg).s:buffer().path(':') - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry - else - let file = s:buffer().expand(arg) - endif - if file !~# ':' && file !~# '^/' && s:repo().git_chomp('cat-file','-t',file) =~# '^\%(tag\|commit\)$' - let file = file.s:buffer().path(':') - endif - else - let file = s:buffer().path(s:buffer().commit() == '' ? ':0:' : '/') - endif - 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.'diffsplit '.s:fnameescape(spec) - else - execute 'leftabove '.vert.'diffsplit '.s:fnameescape(spec) - endif - let w:fugitive_diff_restore = restore - return '' - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -" }}}1 -" Gmove, Gremove {{{1 - -function! s:Move(force,destination) - if a:destination =~# '^/' - let destination = a:destination[1:-1] - else - let destination = s:shellslash(fnamemodify(s:sub(a:destination,'[%#]%(:\w)*','\=expand(submatch(0))'),':p')) - if destination[0:strlen(s:repo().tree())] ==# s:repo().tree('') - let destination = destination[strlen(s:repo().tree('')):-1] - endif - endif - if isdirectory(s:buffer().spec()) - " Work around Vim parser idiosyncrasy - let discarded = s:buffer().setvar('&swapfile',0) - endif - let message = call(s:repo().git_chomp_in_tree,['mv']+(a:force ? ['-f'] : [])+['--', s:buffer().path(), destination], s:repo()) - if v:shell_error - let v:errmsg = 'fugitive: '.message - return 'echoerr v:errmsg' - endif - let destination = s:repo().tree(destination) - if isdirectory(destination) - let destination = fnamemodify(s:sub(destination,'/$','').'/'.expand('%:t'),':.') - endif - call fugitive#reload_status() - if s:buffer().commit() == '' - if isdirectory(destination) - return 'keepalt edit '.s:fnameescape(destination) - else - return 'keepalt saveas! '.s:fnameescape(destination) - endif - else - return 'file '.s:fnameescape(s:repo().translate(':0:'.destination)) - endif -endfunction - -function! s:MoveComplete(A,L,P) - if a:A =~ '^/' - return s:repo().superglob(a:A) - else - let matches = split(glob(a:A.'*'),"\n") - call map(matches,'v:val !~ "/$" && isdirectory(v:val) ? v:val."/" : v:val') - return matches - endif -endfunction - -function! s:Remove(force) - if s:buffer().commit() ==# '' - let cmd = ['rm'] - elseif s:buffer().commit() ==# '0' - let cmd = ['rm','--cached'] - else - let v:errmsg = 'fugitive: rm not supported here' - return 'echoerr v:errmsg' - endif - if a:force - let cmd += ['--force'] - endif - let message = call(s:repo().git_chomp_in_tree,cmd+['--',s:buffer().path()],s:repo()) - if v:shell_error - let v:errmsg = 'fugitive: '.s:sub(message,'error:.*\zs\n\(.*-f.*',' (add ! to force)') - return 'echoerr '.string(v:errmsg) - else - call fugitive#reload_status() - return 'bdelete'.(a:force ? '!' : '') - endif -endfunction - -augroup fugitive_remove - autocmd! - autocmd User Fugitive if s:buffer().commit() =~# '^0\=$' | - \ exe "command! -buffer -bar -bang -nargs=1 -complete=customlist,s:MoveComplete Gmove :execute s:Move(0,)" | - \ exe "command! -buffer -bar -bang Gremove :execute s:Remove(0)" | - \ endif -augroup END - -" }}}1 -" Gblame {{{1 - -augroup fugitive_blame - autocmd! - autocmd BufReadPost *.fugitiveblame setfiletype fugitiveblame - autocmd FileType fugitiveblame setlocal nomodeline | if exists('b:git_dir') | let &l:keywordprg = s:repo().keywordprg() | endif - autocmd Syntax fugitiveblame call s:BlameSyntax() - autocmd User Fugitive if s:buffer().type('file', 'blob') | exe "command! -buffer -bar -bang -range=0 -nargs=* Gblame :execute s:Blame(0,,,,[])" | endif -augroup END - -function! s:linechars(pattern) - let chars = strlen(s:gsub(matchstr(getline('.'), a:pattern), '.', '.')) - if exists('*synconcealed') && &conceallevel > 1 - for col in range(1, chars) - let chars -= synconcealed(line('.'), col)[0] - endfor - endif - return chars -endfunction - -function! s:Blame(bang,line1,line2,count,args) abort - try - if s:buffer().path() == '' - call s:throw('file or blob required') - endif - if filter(copy(a:args),'v:val !~# "^\\%(--root\|--show-name\\|-\\=\\%([ltfnsew]\\|[MC]\\d*\\)\\+\\)$"') != [] - call s:throw('unsupported option') - endif - call map(a:args,'s:sub(v:val,"^\\ze[^-]","-")') - let cmd = ['--no-pager', 'blame', '--show-number'] + a:args - if s:buffer().commit() =~# '\D\|..' - let cmd += [s:buffer().commit()] - else - let cmd += ['--contents', '-'] - endif - let basecmd = escape(call(s:repo().git_command,cmd+['--',s:buffer().path()],s:repo()),'!') - try - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - if !s:repo().bare() - let dir = getcwd() - execute cd.'`=s:repo().tree()`' - endif - if a:count - execute 'write !'.substitute(basecmd,' blame ',' blame -L '.a:line1.','.a:line2.' ','g') - else - let error = resolve(tempname()) - let temp = error.'.fugitiveblame' - if &shell =~# 'csh' - silent! execute '%write !('.basecmd.' > '.temp.') >& '.error - else - silent! execute '%write !'.basecmd.' > '.temp.' 2> '.error - endif - if exists('l:dir') - execute cd.'`=dir`' - unlet dir - endif - if v:shell_error - call s:throw(join(readfile(error),"\n")) - endif - for winnr in range(winnr('$'),1,-1) - call setwinvar(winnr, '&scrollbind', 0) - if getbufvar(winbufnr(winnr), 'fugitive_blamed_bufnr') - execute winbufnr(winnr).'bdelete' - endif - endfor - let bufnr = bufnr('') - let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)' - if &l:wrap - let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&wrap",1)' - endif - if &l:foldenable - let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)' - endif - setlocal scrollbind nowrap nofoldenable - let top = line('w0') + &scrolloff - let current = line('.') - let s:temp_files[temp] = s:repo().dir() - exe 'keepalt leftabove vsplit '.temp - let b:fugitive_blamed_bufnr = bufnr - let w:fugitive_leave = restore - let b:fugitive_blame_arguments = join(a:args,' ') - execute top - normal! zt - execute current - setlocal nomodified nomodifiable nonumber scrollbind nowrap foldcolumn=0 nofoldenable filetype=fugitiveblame - if exists('+concealcursor') - setlocal concealcursor=nc conceallevel=2 - endif - if exists('+relativenumber') - setlocal norelativenumber - endif - execute "vertical resize ".(s:linechars('.\{-\}\ze\s\+\d\+)')+1) - nnoremap q :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w'.bufnr('').'bdelete','^-1','','') - nnoremap gq :exe substitute(bufwinnr(b:fugitive_blamed_bufnr).' wincmd w'.bufnr('').'bdeleteif expand("%:p") =~# "^fugitive:[\\/][\\/]"Geditendif','^-1','','') - nnoremap :exe BlameCommit("exe 'norm q'edit") - nnoremap - :exe BlameJump('') - nnoremap P :exe BlameJump('^'.v:count1) - nnoremap ~ :exe BlameJump('~'.v:count1) - nnoremap i :exe BlameCommit("exe 'norm q'edit") - nnoremap o :exe BlameCommit((&splitbelow ? "botright" : "topleft")." split") - nnoremap O :exe BlameCommit("tabedit") - nnoremap A :exe "vertical resize ".(linechars('.\{-\}\ze [0-9:/+-][0-9:/+ -]* \d\+)')+1+v:count) - nnoremap C :exe "vertical resize ".(linechars('^\S\+')+1+v:count) - nnoremap D :exe "vertical resize ".(linechars('.\{-\}\ze\d\ze\s\+\d\+)')+1-v:count) - redraw - syncbind - endif - finally - if exists('l:dir') - execute cd.'`=dir`' - endif - endtry - return '' - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -function! s:BlameCommit(cmd) abort - let cmd = s:Edit(a:cmd, 0, matchstr(getline('.'),'\x\+')) - if cmd =~# '^echoerr' - return cmd - endif - let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]') - let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ') - if path ==# '' - let path = s:buffer(b:fugitive_blamed_bufnr).path() - endif - execute cmd - if search('^diff .* b/\M'.escape(path,'\').'$','W') - call search('^+++') - let head = line('.') - while search('^@@ \|^diff ') && getline('.') =~# '^@@ ' - let top = +matchstr(getline('.'),' +\zs\d\+') - let len = +matchstr(getline('.'),' +\d\+,\zs\d\+') - if lnum >= top && lnum <= top + len - let offset = lnum - top - if &scrolloff - + - normal! zt - else - normal! zt - + - endif - while offset > 0 && line('.') < line('$') - + - if getline('.') =~# '^[ +]' - let offset -= 1 - endif - endwhile - return 'if foldlevel(".")|foldopen!|endif' - endif - endwhile - execute head - normal! zt - endif - return '' -endfunction - -function! s:BlameJump(suffix) abort - let commit = matchstr(getline('.'),'^\^\=\zs\x\+') - if commit =~# '^0\+$' - let commit = ':0' - endif - let lnum = matchstr(getline('.'),' \zs\d\+\ze\s\+[([:digit:]]') - let path = matchstr(getline('.'),'^\^\=\x\+\s\+\zs.\{-\}\ze\s*\d\+ ') - if path ==# '' - let path = s:buffer(b:fugitive_blamed_bufnr).path() - endif - let args = b:fugitive_blame_arguments - let offset = line('.') - line('w0') - let bufnr = bufnr('%') - let winnr = bufwinnr(b:fugitive_blamed_bufnr) - if winnr > 0 - exe winnr.'wincmd w' - endif - execute s:Edit('edit', 0, commit.a:suffix.':'.path) - execute lnum - if winnr > 0 - exe bufnr.'bdelete' - endif - execute 'Gblame '.args - execute lnum - let delta = line('.') - line('w0') - offset - if delta > 0 - execute 'normal! '.delta."\" - elseif delta < 0 - execute 'normal! '.(-delta)."\" - endif - syncbind - return '' -endfunction - -function! s:BlameSyntax() abort - let b:current_syntax = 'fugitiveblame' - let conceal = has('conceal') ? ' conceal' : '' - let arg = exists('b:fugitive_blame_arguments') ? b:fugitive_blame_arguments : '' - syn match FugitiveblameBoundary "^\^" - syn match FugitiveblameBlank "^\s\+\s\@=" nextgroup=FugitiveblameAnnotation,fugitiveblameOriginalFile,FugitiveblameOriginalLineNumber skipwhite - syn match FugitiveblameHash "\%(^\^\=\)\@<=\x\{7,40\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite - syn match FugitiveblameUncommitted "\%(^\^\=\)\@<=0\{7,40\}\>" nextgroup=FugitiveblameAnnotation,FugitiveblameOriginalLineNumber,fugitiveblameOriginalFile skipwhite - syn region FugitiveblameAnnotation matchgroup=FugitiveblameDelimiter start="(" end="\%( \d\+\)\@<=)" contained keepend oneline - syn match FugitiveblameTime "[0-9:/+-][0-9:/+ -]*[0-9:/+-]\%( \+\d\+)\)\@=" contained containedin=FugitiveblameAnnotation - exec 'syn match FugitiveblameLineNumber " *\d\+)\@=" contained containedin=FugitiveblameAnnotation'.conceal - exec 'syn match FugitiveblameOriginalFile " \%(\f\+\D\@<=\|\D\@=\f\+\)\%(\%(\s\+\d\+\)\=\s\%((\|\s*\d\+)\)\)\@=" contained nextgroup=FugitiveblameOriginalLineNumber,FugitiveblameAnnotation skipwhite'.(arg =~# 'f' ? '' : conceal) - exec 'syn match FugitiveblameOriginalLineNumber " *\d\+\%(\s(\)\@=" contained nextgroup=FugitiveblameAnnotation skipwhite'.(arg =~# 'n' ? '' : conceal) - exec 'syn match FugitiveblameOriginalLineNumber " *\d\+\%(\s\+\d\+)\)\@=" contained nextgroup=FugitiveblameShort skipwhite'.(arg =~# 'n' ? '' : conceal) - syn match FugitiveblameShort " \d\+)" contained contains=FugitiveblameLineNumber - syn match FugitiveblameNotCommittedYet "(\@<=Not Committed Yet\>" contained containedin=FugitiveblameAnnotation - hi def link FugitiveblameBoundary Keyword - hi def link FugitiveblameHash Identifier - hi def link FugitiveblameUncommitted Function - hi def link FugitiveblameTime PreProc - hi def link FugitiveblameLineNumber Number - hi def link FugitiveblameOriginalFile String - hi def link FugitiveblameOriginalLineNumber Float - hi def link FugitiveblameShort FugitiveblameDelimiter - hi def link FugitiveblameDelimiter Delimiter - hi def link FugitiveblameNotCommittedYet Comment -endfunction - -" }}}1 -" Gbrowse {{{1 - -call s:command("-bar -bang -range -nargs=* -complete=customlist,s:EditComplete Gbrowse :execute s:Browse(0,,,)") - -function! s:Browse(bang,line1,count,...) abort - try - let rev = a:0 ? substitute(join(a:000, ' '),'@[[:alnum:]_-]*\%(://.\{-\}\)\=$','','') : '' - if rev ==# '' - let expanded = s:buffer().rev() - elseif rev ==# ':' - let expanded = s:buffer().path('/') - else - let expanded = s:buffer().expand(rev) - endif - let full = s:repo().translate(expanded) - let commit = '' - if full =~# '^fugitive://' - let commit = matchstr(full,'://.*//\zs\w\+') - let path = matchstr(full,'://.*//\w\+\zs/.*') - if commit =~ '..' - let type = s:repo().git_chomp('cat-file','-t',commit.s:sub(path,'^/',':')) - else - let type = 'blob' - endif - let path = path[1:-1] - elseif s:repo().bare() - let path = '.git/' . full[strlen(s:repo().dir())+1:-1] - let type = '' - else - let path = full[strlen(s:repo().tree())+1:-1] - if path =~# '^\.git/' - let type = '' - elseif isdirectory(full) - let type = 'tree' - else - let type = 'blob' - endif - endif - if path =~# '^\.git/.*HEAD' && filereadable(s:repo().dir(path[5:-1])) - let body = readfile(s:repo().dir(path[5:-1]))[0] - if body =~# '^\x\{40\}$' - let commit = body - let type = 'commit' - let path = '' - elseif body =~# '^ref: refs/' - let path = '.git/' . matchstr(body,'ref: \zs.*') - endif - endif - - if a:0 && join(a:000, ' ') =~# '@[[:alnum:]_-]*\%(://.\{-\}\)\=$' - let remote = matchstr(join(a:000, ' '),'@\zs[[:alnum:]_-]\+\%(://.\{-\}\)\=$') - elseif path =~# '^\.git/refs/remotes/.' - let remote = matchstr(path,'^\.git/refs/remotes/\zs[^/]\+') - else - let remote = 'origin' - let branch = matchstr(rev,'^[[:alnum:]/._-]\+\ze[:^~@]') - if branch ==# '' && path =~# '^\.git/refs/\w\+/' - let branch = s:sub(path,'^\.git/refs/\w+/','') - endif - if filereadable(s:repo().dir('refs/remotes/'.branch)) - let remote = matchstr(branch,'[^/]\+') - let rev = rev[strlen(remote)+1:-1] - else - if branch ==# '' - let branch = matchstr(s:repo().head_ref(),'\ 0 ? a:line1 : 0) - endif - - if url == '' - call s:throw("Instaweb failed to start and '".remote."' is not a GitHub remote") - endif - - if a:bang - let @* = url - return 'echomsg '.string(url) - else - return 'echomsg '.string(url).'|call fugitive#buffer().repo().git_chomp("web--browse",'.string(url).')' - endif - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -function! s:github_url(repo,url,rev,commit,path,type,line1,line2) abort - let path = a:path - let domain_pattern = 'github\.com' - let domains = exists('g:fugitive_github_domains') ? g:fugitive_github_domains : [] - for domain in domains - let domain_pattern .= '\|' . escape(split(domain, '://')[-1], '.') - endfor - let repo = matchstr(a:url,'^\%(https\=://\|git://\|git@\)\zs\('.domain_pattern.'\)[/:].\{-\}\ze\%(\.git\)\=$') - if repo ==# '' - return '' - endif - if index(domains, 'http://' . matchstr(repo, '^[^:/]*')) >= 0 - let root = 'http://' . s:sub(repo,':','/') - else - let root = 'https://' . s:sub(repo,':','/') - endif - if path =~# '^\.git/refs/heads/' - let branch = a:repo.git_chomp('config','branch.'.path[16:-1].'.merge')[11:-1] - if branch ==# '' - return root . '/commits/' . path[16:-1] - else - return root . '/commits/' . branch - endif - elseif path =~# '^\.git/refs/.' - return root . '/commits/' . matchstr(path,'[^/]\+$') - elseif path =~# '.git/\%(config$\|hooks\>\)' - return root . '/admin' - elseif path =~# '^\.git\>' - return root - endif - if a:rev =~# '^[[:alnum:]._-]\+:' - let commit = matchstr(a:rev,'^[^:]*') - elseif a:commit =~# '^\d\=$' - let local = matchstr(a:repo.head_ref(),'\ 0 && a:line1 == a:line2 - let url .= '#L' . a:line1 - elseif a:line2 > 0 - let url .= '#L' . a:line1 . '-' . a:line2 - endif - elseif a:type == 'tag' - let commit = matchstr(getline(3),'^tag \zs.*') - let url = root . '/tree/' . commit - else - let url = root . '/commit/' . commit - endif - return url -endfunction - -function! s:instaweb_url(repo,rev,commit,path,type,...) abort - let output = a:repo.git_chomp('instaweb','-b','unknown') - if output =~# 'http://' - let root = matchstr(output,'http://.*').'/?p='.fnamemodify(a:repo.dir(),':t') - else - return '' - endif - if a:path =~# '^\.git/refs/.' - return root . ';a=shortlog;h=' . matchstr(a:path,'^\.git/\zs.*') - elseif a:path =~# '^\.git\>' - return root - endif - let url = root - if a:commit =~# '^\x\{40\}$' - if a:type ==# 'commit' - let url .= ';a=commit' - endif - let url .= ';h=' . a:repo.rev_parse(a:commit . (a:path == '' ? '' : ':' . a:path)) - else - if a:type ==# 'blob' - let tmp = tempname() - silent execute 'write !'.a:repo.git_command('hash-object','-w','--stdin').' > '.tmp - let url .= ';h=' . readfile(tmp)[0] - else - try - let url .= ';h=' . a:repo.rev_parse((a:commit == '' ? 'HEAD' : ':' . a:commit) . ':' . a:path) - catch /^fugitive:/ - call s:throw('fugitive: cannot browse uncommitted file') - endtry - endif - let root .= ';hb=' . matchstr(a:repo.head_ref(),'[^ ]\+$') - endif - if a:path !=# '' - let url .= ';f=' . a:path - endif - if a:0 && a:1 - let url .= '#l' . a:1 - endif - return url -endfunction - -" }}}1 -" File access {{{1 - -function! s:ReplaceCmd(cmd,...) abort - let fn = expand('%:p') - let tmp = tempname() - let prefix = '' - try - if a:0 && a:1 != '' - if &shell =~# 'cmd' - let old_index = $GIT_INDEX_FILE - let $GIT_INDEX_FILE = a:1 - else - let prefix = 'env GIT_INDEX_FILE='.s:shellesc(a:1).' ' - endif - endif - if &shell =~# 'cmd' - let cmd_escape_char = &shellxquote == '(' ? '^' : '^^^' - call system('cmd /c "'.prefix.s:gsub(a:cmd,'[<>]', cmd_escape_char.'&').' > '.tmp.'"') - else - call system(' ('.prefix.a:cmd.' > '.tmp.') ') - endif - finally - if exists('old_index') - let $GIT_INDEX_FILE = old_index - endif - endtry - silent exe 'keepalt file '.tmp - try - silent edit! - finally - silent exe 'keepalt file '.s:fnameescape(fn) - call delete(tmp) - if fnamemodify(bufname('$'), ':p') ==# tmp - silent execute 'bwipeout '.bufnr('$') - endif - silent exe 'doau BufReadPost '.s:fnameescape(fn) - endtry -endfunction - -function! s:BufReadIndex() - if !exists('b:fugitive_display_format') - let b:fugitive_display_format = filereadable(expand('%').'.lock') - endif - let b:fugitive_display_format = b:fugitive_display_format % 2 - let b:fugitive_type = 'index' - try - let b:git_dir = s:repo().dir() - setlocal noro ma nomodeline - if fnamemodify($GIT_INDEX_FILE !=# '' ? $GIT_INDEX_FILE : b:git_dir . '/index', ':p') ==# expand('%:p') - let index = '' - else - let index = expand('%:p') - endif - if b:fugitive_display_format - call s:ReplaceCmd(s:repo().git_command('ls-files','--stage'),index) - set ft=git nospell - else - let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' - let dir = getcwd() - if fugitive#git_version() =~# '^0\|1\.[1-7]\.' - let cmd = s:repo().git_command('status') - else - let cmd = s:repo().git_command( - \ '-c', 'status.displayCommentPrefix=true', - \ '-c', 'color.status=false', - \ 'status') - endif - try - execute cd.'`=s:repo().tree()`' - call s:ReplaceCmd(cmd, index) - finally - execute cd.'`=dir`' - endtry - set ft=gitcommit - set foldtext=fugitive#foldtext() - endif - setlocal ro noma nomod noswapfile - if &bufhidden ==# '' - setlocal bufhidden=delete - endif - call s:JumpInit() - nunmap P - nunmap ~ - nnoremap :execute StageNext(v:count1) - nnoremap :execute StagePrevious(v:count1) - nnoremap - :silent execute StageToggle(line('.'),line('.')+v:count1-1) - xnoremap - :silent execute StageToggle(line("'<"),line("'>")) - nnoremap a :let b:fugitive_display_format += 1exe BufReadIndex() - nnoremap i :let b:fugitive_display_format -= 1exe BufReadIndex() - nnoremap C :Gcommit - nnoremap cA :Gcommit --amend --reuse-message=HEAD - nnoremap ca :Gcommit --amend - nnoremap cc :Gcommit - nnoremap cva :Gcommit --amend --verbose - nnoremap cvc :Gcommit --verbose - nnoremap D :execute StageDiff('Gvdiff') - nnoremap dd :execute StageDiff('Gvdiff') - nnoremap dh :execute StageDiff('Gsdiff') - nnoremap ds :execute StageDiff('Gsdiff') - nnoremap dp :execute StageDiffEdit() - nnoremap dv :execute StageDiff('Gvdiff') - nnoremap p :execute StagePatch(line('.'),line('.')+v:count1-1) - xnoremap p :execute StagePatch(line("'<"),line("'>")) - nnoremap q :if bufnr('$') == 1quitelsebdeleteendif - nnoremap R :edit - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -function! s:FileRead() - try - let repo = s:repo(fugitive#extract_git_dir(expand(''))) - let path = s:sub(s:sub(matchstr(expand(''),'fugitive://.\{-\}//\zs.*'),'/',':'),'^\d:',':&') - let hash = repo.rev_parse(path) - if path =~ '^:' - let type = 'blob' - else - let type = repo.git_chomp('cat-file','-t',hash) - endif - " TODO: use count, if possible - return "read !".escape(repo.git_command('cat-file',type,hash),'%#\') - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -function! s:BufReadIndexFile() - try - let b:fugitive_type = 'blob' - let b:git_dir = s:repo().dir() - try - call s:ReplaceCmd(s:repo().git_command('cat-file','blob',s:buffer().sha1())) - finally - if &bufhidden ==# '' - setlocal bufhidden=delete - endif - endtry - return '' - catch /^fugitive: rev-parse/ - silent exe 'doau BufNewFile '.s:fnameescape(expand('%:p')) - return '' - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -function! s:BufWriteIndexFile() - let tmp = tempname() - try - let path = matchstr(expand(''),'//\d/\zs.*') - let stage = matchstr(expand(''),'//\zs\d') - silent execute 'write !'.s:repo().git_command('hash-object','-w','--stdin').' > '.tmp - let sha1 = readfile(tmp)[0] - let old_mode = matchstr(s:repo().git_chomp('ls-files','--stage',path),'^\d\+') - if old_mode == '' - let old_mode = executable(s:repo().tree(path)) ? '100755' : '100644' - endif - let info = old_mode.' '.sha1.' '.stage."\t".path - call writefile([info],tmp) - if &shell =~# 'cmd' - let error = system('type '.s:gsub(tmp,'/','\\').'|'.s:repo().git_command('update-index','--index-info')) - else - let error = system(s:repo().git_command('update-index','--index-info').' < '.tmp) - endif - if v:shell_error == 0 - setlocal nomodified - silent execute 'doautocmd BufWritePost '.s:fnameescape(expand('%:p')) - call fugitive#reload_status() - return '' - else - return 'echoerr '.string('fugitive: '.error) - endif - finally - call delete(tmp) - endtry -endfunction - -function! s:BufReadObject() - try - setlocal noro ma - let b:git_dir = s:repo().dir() - let hash = s:buffer().sha1() - if !exists("b:fugitive_type") - let b:fugitive_type = s:repo().git_chomp('cat-file','-t',hash) - endif - if b:fugitive_type !~# '^\%(tag\|commit\|tree\|blob\)$' - return "echoerr 'fugitive: unrecognized git type'" - endif - let firstline = getline('.') - if !exists('b:fugitive_display_format') && b:fugitive_type != 'blob' - let b:fugitive_display_format = +getbufvar('#','fugitive_display_format') - endif - - if b:fugitive_type !=# 'blob' - setlocal nomodeline - endif - - let pos = getpos('.') - silent %delete - setlocal endofline - - try - if b:fugitive_type ==# 'tree' - let b:fugitive_display_format = b:fugitive_display_format % 2 - if b:fugitive_display_format - call s:ReplaceCmd(s:repo().git_command('ls-tree',hash)) - else - call s:ReplaceCmd(s:repo().git_command('show','--no-color',hash)) - endif - elseif b:fugitive_type ==# 'tag' - let b:fugitive_display_format = b:fugitive_display_format % 2 - if b:fugitive_display_format - call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash)) - else - call s:ReplaceCmd(s:repo().git_command('cat-file','-p',hash)) - endif - elseif b:fugitive_type ==# 'commit' - let b:fugitive_display_format = b:fugitive_display_format % 2 - if b:fugitive_display_format - call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash)) - else - call s:ReplaceCmd(s:repo().git_command('show','--no-color','--pretty=format:tree %T%nparent %P%nauthor %an <%ae> %ad%ncommitter %cn <%ce> %cd%nencoding %e%n%n%s%n%n%b',hash)) - call search('^parent ') - if getline('.') ==# 'parent ' - silent delete_ - else - silent s/\%(^parent\)\@\)\=$','W',line('.')+3) - silent delete_ - end - 1 - endif - elseif b:fugitive_type ==# 'blob' - call s:ReplaceCmd(s:repo().git_command('cat-file',b:fugitive_type,hash)) - endif - finally - call setpos('.',pos) - setlocal ro noma nomod - if &bufhidden ==# '' - setlocal bufhidden=delete - endif - if b:fugitive_type !=# 'blob' - set filetype=git - nnoremap a :let b:fugitive_display_format += v:count1exe BufReadObject() - nnoremap i :let b:fugitive_display_format -= v:count1exe BufReadObject() - else - call s:JumpInit() - endif - endtry - - return '' - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -augroup fugitive_files - autocmd! - autocmd BufReadCmd index{,.lock} - \ if fugitive#is_git_dir(expand(':p:h')) | - \ exe s:BufReadIndex() | - \ elseif filereadable(expand('')) | - \ read | - \ 1delete | - \ endif - autocmd FileReadCmd fugitive://**//[0-3]/** exe s:FileRead() - autocmd BufReadCmd fugitive://**//[0-3]/** exe s:BufReadIndexFile() - autocmd BufWriteCmd fugitive://**//[0-3]/** exe s:BufWriteIndexFile() - autocmd BufReadCmd fugitive://**//[0-9a-f][0-9a-f]* exe s:BufReadObject() - autocmd FileReadCmd fugitive://**//[0-9a-f][0-9a-f]* exe s:FileRead() - autocmd FileType git - \ if exists('b:git_dir') | - \ call s:JumpInit() | - \ endif -augroup END - -" }}}1 -" Temp files {{{1 - -if !exists('s:temp_files') - let s:temp_files = {} -endif - -augroup fugitive_temp - autocmd! - autocmd BufNewFile,BufReadPost * - \ if has_key(s:temp_files,expand(':p')) | - \ let b:git_dir = s:temp_files[expand(':p')] | - \ let b:git_type = 'temp' | - \ call fugitive#detect(expand(':p')) | - \ setlocal bufhidden=delete | - \ nnoremap q :bdelete| - \ endif -augroup END - -" }}}1 -" Go to file {{{1 - -function! s:JumpInit() abort - nnoremap :exe GF("edit") - if !&modifiable - if exists(':CtrlP') - nnoremap :exe 'CtrlP '.fnameescape(repo().tree()) - endif - nnoremap o :exe GF("split") - nnoremap S :exe GF("vsplit") - nnoremap O :exe GF("tabedit") - nnoremap - :exe Edit('edit',0,buffer().up(v:count1)) if fugitive#buffer().type('tree')call search('^'.escape(expand('#:t'),'.*[]~\').'/\=$','wc')endif - nnoremap P :exe Edit('edit',0,buffer().commit().'^'.v:count1.buffer().path(':')) - nnoremap ~ :exe Edit('edit',0,buffer().commit().'~'.v:count1.buffer().path(':')) - nnoremap C :exe Edit('edit',0,buffer().containing_commit()) - nnoremap cc :exe Edit('edit',0,buffer().containing_commit()) - nnoremap co :exe Edit('split',0,buffer().containing_commit()) - nnoremap cS :exe Edit('vsplit',0,buffer().containing_commit()) - nnoremap cO :exe Edit('tabedit',0,buffer().containing_commit()) - nnoremap cP :exe Edit('pedit',0,buffer().containing_commit()) - nnoremap . : =fnameescape(recall()) - endif -endfunction - -function! s:GF(mode) abort - try - let buffer = s:buffer() - let myhash = buffer.sha1() - if myhash ==# '' && getline(1) =~# '^\%(commit\|tag\) \w' - let myhash = matchstr(getline(1),'^\w\+ \zs\S\+') - endif - - if buffer.type('tree') - let showtree = (getline(1) =~# '^tree ' && getline(2) == "") - if showtree && line('.') == 1 - return "" - elseif showtree && line('.') > 2 - return s:Edit(a:mode,0,buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(getline('.'),'/$','')) - elseif getline('.') =~# '^\d\{6\} \l\{3,8\} \x\{40\}\t' - return s:Edit(a:mode,0,buffer.commit().':'.s:buffer().path().(buffer.path() =~# '^$\|/$' ? '' : '/').s:sub(matchstr(getline('.'),'\t\zs.*'),'/$','')) - endif - - elseif buffer.type('blob') - let ref = expand("") - try - let sha1 = buffer.repo().rev_parse(ref) - catch /^fugitive:/ - endtry - if exists('sha1') - return s:Edit(a:mode,0,ref) - endif - - else - - " Index - if getline('.') =~# '^\d\{6\} \x\{40\} \d\t' - let ref = matchstr(getline('.'),'\x\{40\}') - let file = ':'.s:sub(matchstr(getline('.'),'\d\t.*'),'\t',':') - return s:Edit(a:mode,0,file) - - elseif getline('.') =~# '^#\trenamed:.* -> ' - let file = '/'.matchstr(getline('.'),' -> \zs.*') - return s:Edit(a:mode,0,file) - elseif getline('.') =~# '^#\t[[:alpha:] ]\+: *.' - let file = '/'.matchstr(getline('.'),': *\zs.\{-\}\ze\%( ([^()[:digit:]]\+)\)\=$') - return s:Edit(a:mode,0,file) - elseif getline('.') =~# '^#\t.' - let file = '/'.matchstr(getline('.'),'#\t\zs.*') - return s:Edit(a:mode,0,file) - elseif getline('.') =~# ': needs merge$' - let file = '/'.matchstr(getline('.'),'.*\ze: needs merge$') - return s:Edit(a:mode,0,file).'|Gdiff' - - elseif getline('.') ==# '# Not currently on any branch.' - return s:Edit(a:mode,0,'HEAD') - elseif getline('.') =~# '^# On branch ' - let file = 'refs/heads/'.getline('.')[12:] - return s:Edit(a:mode,0,file) - elseif getline('.') =~# "^# Your branch .*'" - let file = matchstr(getline('.'),"'\\zs\\S\\+\\ze'") - return s:Edit(a:mode,0,file) - endif - - let showtree = (getline(1) =~# '^tree ' && getline(2) == "") - - if getline('.') =~# '^ref: ' - let ref = strpart(getline('.'),5) - - elseif getline('.') =~# '^commit \x\{40\}\>' - let ref = matchstr(getline('.'),'\x\{40\}') - return s:Edit(a:mode,0,ref) - - elseif getline('.') =~# '^parent \x\{40\}\>' - let ref = matchstr(getline('.'),'\x\{40\}') - let line = line('.') - let parent = 0 - while getline(line) =~# '^parent ' - let parent += 1 - let line -= 1 - endwhile - return s:Edit(a:mode,0,ref) - - elseif getline('.') =~ '^tree \x\{40\}$' - let ref = matchstr(getline('.'),'\x\{40\}') - if s:repo().rev_parse(myhash.':') == ref - let ref = myhash.':' - endif - return s:Edit(a:mode,0,ref) - - elseif getline('.') =~# '^object \x\{40\}$' && getline(line('.')+1) =~ '^type \%(commit\|tree\|blob\)$' - let ref = matchstr(getline('.'),'\x\{40\}') - let type = matchstr(getline(line('.')+1),'type \zs.*') - - elseif getline('.') =~# '^\l\{3,8\} '.myhash.'$' - return '' - - elseif getline('.') =~# '^\l\{3,8\} \x\{40\}\>' - let ref = matchstr(getline('.'),'\x\{40\}') - echoerr "warning: unknown context ".matchstr(getline('.'),'^\l*') - - elseif getline('.') =~# '^[+-]\{3\} [ab/]' - let ref = getline('.')[4:] - - elseif getline('.') =~# '^[+-]' && search('^@@ -\d\+,\d\+ +\d\+,','bnW') - let type = getline('.')[0] - let lnum = line('.') - 1 - let offset = -1 - while getline(lnum) !~# '^@@ -\d\+,\d\+ +\d\+,' - if getline(lnum) =~# '^[ '.type.']' - let offset += 1 - endif - let lnum -= 1 - endwhile - let offset += matchstr(getline(lnum), type.'\zs\d\+') - let ref = getline(search('^'.type.'\{3\} [ab]/','bnW'))[4:-1] - let dcmd = '+'.offset.'|if foldlevel(".")|foldopen!|endif' - let dref = '' - - elseif getline('.') =~# '^rename from ' - let ref = 'a/'.getline('.')[12:] - elseif getline('.') =~# '^rename to ' - let ref = 'b/'.getline('.')[10:] - - elseif getline('.') =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)' - let dref = matchstr(getline('.'),'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)') - let ref = matchstr(getline('.'),'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)') - let dcmd = 'Gdiff' - - elseif getline('.') =~# '^index ' && getline(line('.')-1) =~# '^diff --git \%(a/.*\|/dev/null\) \%(b/.*\|/dev/null\)' - let line = getline(line('.')-1) - let dref = matchstr(line,'\Cdiff --git \zs\%(a/.*\|/dev/null\)\ze \%(b/.*\|/dev/null\)') - let ref = matchstr(line,'\Cdiff --git \%(a/.*\|/dev/null\) \zs\%(b/.*\|/dev/null\)') - let dcmd = 'Gdiff!' - - elseif line('$') == 1 && getline('.') =~ '^\x\{40\}$' - let ref = getline('.') - else - let ref = '' - endif - - if myhash ==# '' - let ref = s:sub(ref,'^a/','HEAD:') - let ref = s:sub(ref,'^b/',':0:') - if exists('dref') - let dref = s:sub(dref,'^a/','HEAD:') - endif - else - let ref = s:sub(ref,'^a/',myhash.'^:') - let ref = s:sub(ref,'^b/',myhash.':') - if exists('dref') - let dref = s:sub(dref,'^a/',myhash.'^:') - endif - endif - - if ref ==# '/dev/null' - " Empty blob - let ref = 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391' - endif - - if exists('dref') - return s:Edit(a:mode,0,ref) . '|'.dcmd.' '.s:fnameescape(dref) - elseif ref != "" - return s:Edit(a:mode,0,ref) - endif - - endif - return '' - catch /^fugitive:/ - return 'echoerr v:errmsg' - endtry -endfunction - -" }}}1 -" Statusline {{{1 - -function! s:repo_head_ref() dict abort - return readfile(self.dir('HEAD'))[0] -endfunction - -call s:add_methods('repo',['head_ref']) - -function! fugitive#statusline(...) - if !exists('b:git_dir') - return '' - endif - let status = '' - if s:buffer().commit() != '' - let status .= ':' . s:buffer().commit()[0:7] - endif - let status .= '('.fugitive#head(7).')' - if &statusline =~# '%[MRHWY]' && &statusline !~# '%[mrhwy]' - return ',GIT'.status - else - return '[Git'.status.']' - endif -endfunction - -function! fugitive#head(...) - if !exists('b:git_dir') - return '' - endif - - return s:repo().head(a:0 ? a:1 : 0) -endfunction - -" }}}1 -" Folding {{{1 - -function! fugitive#foldtext() abort - if &foldmethod !=# 'syntax' - return foldtext() - elseif getline(v:foldstart) =~# '^diff ' - let [add, remove] = [-1, -1] - let filename = '' - for lnum in range(v:foldstart, v:foldend) - if filename ==# '' && getline(lnum) =~# '^[+-]\{3\} [abciow12]/' - let filename = getline(lnum)[6:-1] - endif - if getline(lnum) =~# '^+' - let add += 1 - elseif getline(lnum) =~# '^-' - let remove += 1 - elseif getline(lnum) =~# '^Binary ' - let binary = 1 - endif - endfor - if filename ==# '' - let filename = matchstr(getline(v:foldstart), '^diff .\{-\} a/\zs.*\ze b/') - endif - if filename ==# '' - let filename = getline(v:foldstart)[5:-1] - endif - if exists('binary') - return 'Binary: '.filename - else - return (add<10&&remove<100?' ':'') . add . '+ ' . (remove<10&&add<100?' ':'') . remove . '- ' . filename - endif - elseif getline(v:foldstart) =~# '^# .*:$' - let lines = getline(v:foldstart, v:foldend) - call filter(lines, 'v:val =~# "^#\t"') - cal map(lines,'s:sub(v:val, "^#\t%(modified: +|renamed: +)=", "")') - cal map(lines,'s:sub(v:val, "^([[:alpha:] ]+): +(.*)", "\\2 (\\1)")') - return getline(v:foldstart).' '.join(lines, ', ') - endif - return foldtext() -endfunction - -augroup fugitive_foldtext - autocmd! - autocmd User Fugitive - \ if &filetype =~# '^git\%(commit\)\=$' && &foldtext ==# 'foldtext()' | - \ set foldtext=fugitive#foldtext() | - \ endif -augroup END - -" }}}1 - -" vim:set et sw=2: diff --git a/vim/bundle/instant-markdown/CHANGELOG.md b/vim/bundle/instant-markdown/CHANGELOG.md deleted file mode 100644 index ff84bb6..0000000 --- a/vim/bundle/instant-markdown/CHANGELOG.md +++ /dev/null @@ -1,36 +0,0 @@ -### 0.0.2 (03-27-2012) -All changes for this release were made in the backend. Do `[sudo] npm -g update instant-markdown-d` to get them. - -- Updated to the latest github styles! -- Performance should be slightly better as CSS is no longer generated at every update. - -### 0.0.3 (04-26-2012) -Some changes for this release were made in the backend. Do `[sudo] npm -g update instant-markdown-d` to get them. - -- Delay starting the `instant-markdown-d` server. This fixed the plugin for a few people who were getting empty browser windows. -- Display a message with configuration instructions when the preview window can't be closed due to Firefox restrictions. - -### 0.0.4 (12-05-2012) -All these changes courtesy of @chreekat, THANKS! - -- Is now an `after/ftplugin` plugin. Markdown filetype detection is left to Vim itself, or other plugins. -- Behavior when multiple markdown files are open has been improved -- No more weird characters taking over the status/command bar while editing -- Internals have been completely rewritten and are much more cleaner and adhere to vim script best practices - -### 0.0.5 (12-05-2012) -These changes are _also_ courtesy of @chreekat! - -- Plugin no longer breaks vim mouse scrolling -- No longer errors upon opening an empty markdown file -- `instant_markdown_slow` option to update preview less frequently - -### 0.0.6 (03-02-2013) -All changes for this release were made in the backend. Do `[sudo] npm -g update instant-markdown-d` to get them. - -- Fix for systems (such as Ubuntu, Debian) which use the `nodejs` executable instead of `node`. - -### 0.0.7 (10-31-2013) -thanks to @terryma! - -- Added option to only start previewing markdown on demand diff --git a/vim/bundle/instant-markdown/README.md b/vim/bundle/instant-markdown/README.md deleted file mode 100644 index f8ef928..0000000 --- a/vim/bundle/instant-markdown/README.md +++ /dev/null @@ -1,75 +0,0 @@ -vim-instant-markdown -==================== -Want to instantly preview finnicky markdown files, but don't want to leave your favorite editor, or have to do it in some crappy browser textarea? **vim-instant-markdown** is your friend! When you open a markdown file in vim, a browser window will open which shows the compiled markdown in real-time, and closes once you close the file in vim. - -As a bonus, [github-flavored-markdown][gfm] is supported, and styles used while previewing are the same as those github uses! - -[![Screenshot][ss]][ssbig] - -Installation ------------- -You first need to have Ruby with RubyGems, and node.js with npm installed. (In the future there might be a version which won't require node.js at all, making installation easier) - -- `[sudo] gem install pygments.rb` -- If you're using Ruby 1.9.2 or later, `[sudo] gem install redcarpet`. Otherwise, `[sudo] gem install redcarpet -v 2.3.0` -- `[sudo] npm -g install instant-markdown-d` -- If you're on Linux, the `xdg-utils` package needs to be installed (is installed by default on Ubuntu). -- Copy the `after/ftplugin/markdown/instant-markdown.vim` file from this repo into your `~/.vim/after/ftplugin/markdown/` (creating directories as necessary), or use pathogen. -- Ensure you have the line `filetype plugin on` in your `.vimrc` -- Open a markdown file in vim and enjoy! - -Configuration -------------- -### g:instant_markdown_slow - -By default, vim-instant-markdown will update the display in realtime. If that taxes your system too much, you can specify - -``` -let g:instant_markdown_slow = 1 -``` - -before loading the plugin (for example place that in your `~/.vimrc`). This will cause vim-instant-markdown to only refresh on the following events: - -- No keys have been pressed for a while -- A while after you leave insert mode -- You save the file being edited - -### g:instant_markdown_autostart -By default, vim-instant-markdown will automatically launch the preview window when you open a markdown file. If you want to manually control this behavior, you can specify - -``` -let g:instant_markdown_autostart = 0 -``` - -in your .vimrc. You can then manually trigger preview via the command ```:InstantMarkdownPreview```. This command is only available inside markdown buffers and when the autostart option is turned off. - -Supported Platforms -------------------- -OSX and Unix/Linuxes*. - -*: One annoyance in Linux is that there's no way to reliably open a browser page in the background, so you'll likely have to manually refocus your vim session everytime you open a Markdown file. If you have ideas on how to address this I'd love to know! - -FAQ ---- -> Why don't my `.md` files trigger this plugin? - -By default, vim (7.3 and above) only recognizes files ending with `.markdown`, `.mdown`, and `README.md` as markdown files. If you want `.md` to be recognized, I recommend installing one of many markdown plugins available, such as [this one][tpope-markdown]. - -> It's not working! - -- Make sure all the dependencies are installed... - - Make sure `instant-markdown-d` was installed as a global module (e.g. using `npm -g install`) - - Make sure the ruby gems were installed under your default Ruby (i.e. if you're using RVM, use `gem install` and NOT `sudo gem install` as that might cause the gems to be installed under a non-RVM Ruby) -- If you're on OSX, and are using zsh and rbenv/rvm... - - Make sure that Vim is using the correct version of ruby. From vim, if ```:!which ruby``` returns an unexpected ruby, then see here for a solution: https://github.com/dotphiles/dotzsh#mac-os-x. - - Another thing to try would be to add `set shell=bash\ -i` in your `.vimrc` to set interactive bash as the default vim shell. (See [this issue](http://github.com/suan/vim-instant-markdown/issues/41)) - -etc. ---- -If you're curious, the code for the mini-server component for this plugin can be found at http://github.com/suan/instant-markdown-d. A plugin can easily be written for any editor to interface with the server to get the same functionality found here. - - -[ss]: http://dl.dropbox.com/u/28956267/instant-markdown-demo_thumb.gif "Click for bigger preview" -[ssbig]: http://dl.dropbox.com/u/28956267/instant-markdown-demo.gif -[gfm]: http://github.github.com/github-flavored-markdown/ -[tpope-markdown]: https://github.com/tpope/vim-markdown diff --git a/vim/bundle/instant-markdown/after/ftplugin/markdown/instant-markdown.vim b/vim/bundle/instant-markdown/after/ftplugin/markdown/instant-markdown.vim deleted file mode 100644 index 1c96cb1..0000000 --- a/vim/bundle/instant-markdown/after/ftplugin/markdown/instant-markdown.vim +++ /dev/null @@ -1,135 +0,0 @@ -" # Configuration -if !exists('g:instant_markdown_slow') - let g:instant_markdown_slow = 0 -endif - -if !exists('g:instant_markdown_autostart') - let g:instant_markdown_autostart = 1 -endif - -" # Utility Functions -" Simple system wrapper that ignores empty second args -function! s:system(cmd, stdin) - if strlen(a:stdin) == 0 - call system(a:cmd) - else - call system(a:cmd, a:stdin) - endif -endfu - -function! s:refreshView() - let bufnr = expand('') - call s:system("curl -X PUT -T - http://localhost:8090/ &>/dev/null &", - \ s:bufGetContents(bufnr)) -endfu - -function! s:startDaemon(initialMD) - call s:system("instant-markdown-d &>/dev/null &", a:initialMD) -endfu - -function! s:initDict() - if !exists('s:buffers') - let s:buffers = {} - endif -endfu - -function! s:pushBuffer(bufnr) - call s:initDict() - let s:buffers[a:bufnr] = 1 -endfu - -function! s:popBuffer(bufnr) - call s:initDict() - call remove(s:buffers, a:bufnr) -endfu - -function! s:killDaemon() - call system("curl -s -X DELETE http://localhost:8090/ &>/dev/null &") -endfu - -function! s:bufGetContents(bufnr) - return join(getbufline(a:bufnr, 1, "$"), "\n") -endfu - -" I really, really hope there's a better way to do this. -fu! s:myBufNr() - return str2nr(expand('')) -endfu - -" # Functions called by autocmds -" -" ## push a new Markdown buffer into the system. -" -" 1. Track it so we know when to garbage collect the daemon -" 2. Start daemon if we're on the first MD buffer. -" 3. Initialize changedtickLast, possibly needlessly(?) -fu! s:pushMarkdown() - let bufnr = s:myBufNr() - call s:initDict() - if len(s:buffers) == 0 - call s:startDaemon(s:bufGetContents(bufnr)) - endif - call s:pushBuffer(bufnr) - let b:changedtickLast = b:changedtick -endfu - -" ## pop a Markdown buffer -" -" 1. Pop the buffer reference -" 2. Garbage collection -" * daemon -" * autocmds -fu! s:popMarkdown() - let bufnr = s:myBufNr() - silent au! instant-markdown * - call s:popBuffer(bufnr) - if len(s:buffers) == 0 - call s:killDaemon() - endif -endfu - -" ## Refresh if there's something new worth showing -" -" 'All things in moderation' -fu! s:temperedRefresh() - if !exists('b:changedtickLast') - let b:changedtickLast = b:changedtick - elseif b:changedtickLast != b:changedtick - let b:changedtickLast = b:changedtick - call s:refreshView() - endif -endfu - -fu! s:previewMarkdown() - call s:startDaemon(join(getline(1, '$'), "\n")) - aug instant-markdown - if g:instant_markdown_slow - au CursorHold,BufWrite,InsertLeave call s:temperedRefresh() - else - au CursorHold,CursorHoldI,CursorMoved,CursorMovedI call s:temperedRefresh() - endif - au BufWinLeave call s:cleanUp() - aug END -endfu - -fu! s:cleanUp() - call s:killDaemon() - au! instant-markdown * -endfu - -if g:instant_markdown_autostart - " # Define the autocmds " - aug instant-markdown - au! * - au BufEnter call s:refreshView() - if g:instant_markdown_slow - au CursorHold,BufWrite,InsertLeave call s:temperedRefresh() - else - au CursorHold,CursorHoldI,CursorMoved,CursorMovedI call s:temperedRefresh() - endif - au BufWinLeave call s:popMarkdown() - au BufwinEnter call s:pushMarkdown() - aug END -else - command! -buffer InstantMarkdownPreview call s:previewMarkdown() -endif diff --git a/vim/bundle/jade/README.markdown b/vim/bundle/jade/README.markdown deleted file mode 100644 index 2c2222e..0000000 --- a/vim/bundle/jade/README.markdown +++ /dev/null @@ -1,19 +0,0 @@ -# vim-jade # - -Vim syntax highlighting for Jade templates. - -Installation ------------- - -I prefer to install plugins using Tim Pope's -[pathogen.vim](https://github.com/tpope/vim-pathogen). Installation using -pathogen is quite simple. - - cd ~/.vim/bundle - git clone git://github.com/digitaltoad/vim-jade.git - -If you do not want to use pathogen. You can always install vim-jade in the -normal manner by copying each directory to your ~/.vim directory. Make sure -not to overwrite any existing directory of the same name and instead copy only -the contents of the source directory to the directory of the same name in your -~/.vim directory. diff --git a/vim/bundle/jade/ftdetect/jade.vim b/vim/bundle/jade/ftdetect/jade.vim deleted file mode 100644 index c21dcff..0000000 --- a/vim/bundle/jade/ftdetect/jade.vim +++ /dev/null @@ -1,2 +0,0 @@ -" Jade -autocmd BufNewFile,BufReadPost *.jade set filetype=jade diff --git a/vim/bundle/jade/ftplugin/jade.vim b/vim/bundle/jade/ftplugin/jade.vim deleted file mode 100644 index 235770d..0000000 --- a/vim/bundle/jade/ftplugin/jade.vim +++ /dev/null @@ -1,55 +0,0 @@ -" Vim filetype plugin -" Language: Jade -" Maintainer: Joshua Borton -" Credits: Tim Pope - -" Only do this when not done yet for this buffer -if exists("b:did_ftplugin") - finish -endif - -let s:save_cpo = &cpo -set cpo-=C - -" Define some defaults in case the included ftplugins don't set them. -let s:undo_ftplugin = "" -let s:browsefilter = "All Files (*.*)\t*.*\n" -let s:match_words = "" - -runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim -unlet! b:did_ftplugin - -" Override our defaults if these were set by an included ftplugin. -if exists("b:undo_ftplugin") - let s:undo_ftplugin = b:undo_ftplugin - unlet b:undo_ftplugin -endif -if exists("b:browsefilter") - let s:browsefilter = b:browsefilter - unlet b:browsefilter -endif -if exists("b:match_words") - let s:match_words = b:match_words - unlet b:match_words -endif - -" Change the browse dialog on Win32 to show mainly Haml-related files -if has("gui_win32") - let b:browsefilter="Jade Files (*.jade)\t*.jade\n" . s:browsefilter -endif - -" Load the combined list of match_words for matchit.vim -if exists("loaded_matchit") - let b:match_words = s:match_words -endif - -setlocal comments=://-,:// commentstring=//\ %s - -setlocal suffixesadd+=.jade - -let b:undo_ftplugin = "setl cms< com< " - \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin - -let &cpo = s:save_cpo - -" vim:set sw=2: diff --git a/vim/bundle/jade/indent/jade.vim b/vim/bundle/jade/indent/jade.vim deleted file mode 100644 index 12b9e2e..0000000 --- a/vim/bundle/jade/indent/jade.vim +++ /dev/null @@ -1,70 +0,0 @@ -" Vim indent file -" Language: Jade -" Maintainer: Joshua Borton -" Credits: Tim Pope (vim-jade) -" Last Change: 2010 Sep 22 - -if exists("b:did_indent") - finish -endif - -unlet! b:did_indent -let b:did_indent = 1 - -setlocal autoindent -setlocal indentexpr=GetJadeIndent() -setlocal indentkeys=o,O,*,},],0),!^F - -" Only define the function once. -if exists("*GetJadeIndent") - finish -endif - -let s:attributes = '\%((.\{-\})\)' -let s:tag = '\([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*' - -if !exists('g:jade_self_closing_tags') - let g:jade_self_closing_tags = 'meta|link|img|hr|br|input' -endif - -setlocal formatoptions+=r -setlocal comments+=n:\| - -function! GetJadeIndent() - let lnum = prevnonblank(v:lnum-1) - if lnum == 0 - return 0 - endif - let line = substitute(getline(lnum),'\s\+$','','') - let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') - let lastcol = strlen(line) - let line = substitute(line,'^\s\+','','') - let indent = indent(lnum) - let cindent = indent(v:lnum) - let increase = indent + &sw - if indent == indent(lnum) - let indent = cindent <= indent ? -1 : increase - endif - - let group = synIDattr(synID(lnum,lastcol,1),'name') - - if line =~ '^!!!' - return indent - elseif line =~ '^/\%(\[[^]]*\]\)\=$' - return increase - elseif line =~ '^\%(if\|else\|unless\|for\|each\|block\|mixin\|append\|case\|when\)' - return increase - elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$' - return increase - elseif line == '-#' - return increase - elseif line =~? '^\v%('.g:jade_self_closing_tags.')>' - return indent - elseif group =~? '\v^%(jadeAttributesDelimiter|jadeClass|jadeId|htmlTagName|htmlSpecialTagName|jadeFilter)$' - return increase - else - return indent - endif -endfunction - -" vim:set sw=2: diff --git a/vim/bundle/jade/syntax/jade.vim b/vim/bundle/jade/syntax/jade.vim deleted file mode 100644 index d61e4f0..0000000 --- a/vim/bundle/jade/syntax/jade.vim +++ /dev/null @@ -1,89 +0,0 @@ -" Vim syntax file -" Language: Jade -" Maintainer: Joshua Borton -" Credits: Tim Pope -" Filenames: *.jade - -if exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'jade' -endif - -runtime! syntax/html.vim -runtime! syntax/html/html5.vim -silent! syntax include @htmlCoffeescript syntax/coffee.vim -unlet! b:current_syntax -silent! syntax include @htmlStylus syntax/stylus.vim -unlet! b:current_syntax -silent! syntax include @htmlMarkdown syntax/markdown.vim -unlet! b:current_syntax - -syn case match - -syn region javascriptParenthesisBlock start="(" end=")" contains=@htmlJavascript contained keepend -syn cluster htmlJavascript add=javascriptParenthesisBlock - -syn region jadeJavascript matchgroup=jadeJavascriptOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend -syn region jadeJavascript matchgroup=jadeJavascriptChar start="-" skip=",\s*$" end="$" contained contains=@htmlJavascript keepend -syn cluster jadeTop contains=jadeBegin,jadeComment,jadeHtmlComment,jadeJavascript -syn match jadeBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=jadeTag,jadeClassChar,jadeIdChar,jadePlainChar,jadeJavascript,jadeScriptConditional,jadeScriptStatement -syn match jadeTag "+\?\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@jadeComponent -syn cluster jadeComponent contains=jadeAttributes,jadeIdChar,jadeBlockExpansionChar,jadeClassChar,jadePlainChar,jadeJavascript -syn match jadeComment '\s*\/\/.*$' -syn region jadeHtmlComment start="^\z(\s*\)/" end="^\%(\z1\s\|\s*$\)\@!" -syn region jadeAttributes matchgroup=jadeAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,jadeHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@jadeComponent -syn match jadeClassChar "\." contained nextgroup=jadeClass -syn match jadeBlockExpansionChar ":\s" contained nextgroup=jadeTag -syn match jadeIdChar "#{\@!" contained nextgroup=jadeId -syn match jadeClass "\%(\w\|-\)\+" contained nextgroup=@jadeComponent -syn match jadeId "\%(\w\|-\)\+" contained nextgroup=@jadeComponent -syn region jadeDocType start="^\s*\(!!!\|doctype\)" end="$" -" Unless I'm mistaken, syntax/html.vim requires -" that the = sign be present for these matches. -" This adds the matches back for jade. -syn keyword jadeHtmlArg contained href title - -syn match jadePlainChar "\\" contained -syn region jadeInterpolation matchgroup=jadeInterpolationDelimiter start="#{" end="}" contains=@htmlJavascript -syn match jadeInterpolationEscape "\\\@[?!]\@!" -syn match jadeScriptStatement "\<\%(each\|block\|prepend\|append\|mixin\|extends\|include\)\>[?!]\@!" - -syn region jadeJavascript start="^\z(\s*\)script\%(:\w\+\)\=" end="^\%(\z1\s\|\s*$\)\@!" contains=@htmlJavascript,jadeJavascriptTag keepend -syn region jadeJavascriptTag contained start="^\z(\s*\)script\%(:\w\+\)\=" end="$" contains=jadeBegin,jadeTag -syn region jadeCssBlock start="^\z(\s*\)style" nextgroup=@jadeComponent,jadeError end="^\%(\z1\s\|\s*$\)\@!" contains=@jadeTop,@htmlCss keepend - -syn match jadeError "\$" contained - -hi def link jadePlainChar Special -hi def link jadeScriptConditional PreProc -hi def link jadeScriptStatement PreProc -hi def link jadeHtmlArg htmlArg -hi def link jadeAttributeString String -hi def link jadeAttributesDelimiter Identifier -hi def link jadeIdChar Special -hi def link jadeClassChar Special -hi def link jadeBlockExpansionChar Special -hi def link jadeId Identifier -hi def link jadeClass Type -hi def link jadeInterpolationDelimiter Delimiter -hi def link jadeFilter PreProc -hi def link jadeDocType PreProc -hi def link jadeComment Comment -hi def link jadeHtmlComment jadeComment - -let b:current_syntax = "jade" - -if main_syntax == "jade" - unlet main_syntax -endif diff --git a/vim/bundle/jinja2/README.md b/vim/bundle/jinja2/README.md deleted file mode 100644 index 43415de..0000000 --- a/vim/bundle/jinja2/README.md +++ /dev/null @@ -1,12 +0,0 @@ -This is the latest version of the Jinja2 syntax file for vim with the ability to detect either HTML or Jinja. - -There are two reasons I made this repository: - -* The version of this vim addon is out-of-date on vimscripts. - -* I wanted to manage this syntax file with vim-addons-manager or whatever other vim plugins managers there are. - -The current version is the [2013-04-23 version](https://github.com/mitsuhiko/jinja2/commit/6b7c0c232ff8f9ee373e69c0e1ec0e345ea75816) from the official jinja repository. -If you notice there is a newer version available please message me. - -**If you have bugs or pull requests, please submit them straight to the [source](https://github.com/mitsuhiko/jinja2).** If the plugin is overzealous in detecting the Jinja syntax, send me the template it shouldn't have matched. diff --git a/vim/bundle/jinja2/ftdetect/jinja.vim b/vim/bundle/jinja2/ftdetect/jinja.vim deleted file mode 100644 index 9acf5f1..0000000 --- a/vim/bundle/jinja2/ftdetect/jinja.vim +++ /dev/null @@ -1,13 +0,0 @@ -" Figure out which type of hilighting to use for html. -fun! s:SelectHTML() -let n = 1 -while n < 50 && n <= line("$") - " check for jinja - if getline(n) =~ '{{.*}}\|{%-\?\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\>' - set ft=jinja - return - endif - let n = n + 1 - endwhile -endfun -autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja,*.html,*.htm,*.nunjucks,*.nunjs call s:SelectHTML() diff --git a/vim/bundle/jinja2/indent/jinja.vim b/vim/bundle/jinja2/indent/jinja.vim deleted file mode 100644 index 71a00a8..0000000 --- a/vim/bundle/jinja2/indent/jinja.vim +++ /dev/null @@ -1,12 +0,0 @@ -" Vim indent file -" Language: Jinja HTML template -" Maintainer: Evan Hammer -" Last Change: 2013 Jan 26 - -" Only load this indent file when no other was loaded. -if exists("b:did_indent") - finish -endif - -" Use HTML formatting rules. -runtime! indent/html.vim diff --git a/vim/bundle/jinja2/syntax/jinja.vim b/vim/bundle/jinja2/syntax/jinja.vim deleted file mode 100644 index 503aec6..0000000 --- a/vim/bundle/jinja2/syntax/jinja.vim +++ /dev/null @@ -1,135 +0,0 @@ -" Vim syntax file -" Language: Jinja template -" Maintainer: Armin Ronacher -" Last Change: 2008 May 9 -" Version: 1.1 -" -" Known Bugs: -" because of odd limitations dicts and the modulo operator -" appear wrong in the template. -" -" Changes: -" -" 2008 May 9: Added support for Jinja2 changes (new keyword rules) - -" .vimrc variable to disable html highlighting -if !exists('g:jinja_syntax_html') - let g:jinja_syntax_html=1 -endif - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif - let main_syntax = 'jinja' -endif - -" Pull in the HTML syntax. -if g:jinja_syntax_html - if version < 600 - so :p:h/html.vim - else - runtime! syntax/html.vim - unlet b:current_syntax - endif -endif - -syntax case match - -" Jinja template built-in tags and parameters (without filter, macro, is and raw, they -" have special threatment) -syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import - -syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter -syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction -syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName - -" Variable Names -syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/ -syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs - -" Filters -syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter -syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/ -syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/ -syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/ - -" Jinja template constants -syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\\"/ end=/"/ -syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\\'/ end=/'/ -syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/ - -" Operators -syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/ -syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/ -syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute -syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/ - -" Jinja template tag and variable blocks -syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained -syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained -syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained -syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment - -syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment - -" Jinja template 'raw' tag -syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment - -" Jinja comments -syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString - -" Block start keywords. A bit tricker. We only highlight at the start of a -" tag block and only if the name is not followed by a comma or equals sign -" which usually means that we have to deal with an assignment. -syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/ - -" and context modifiers -syn match jinjaStatement containedin=jinjaTagBlock contained /\/ - - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_jinja_syn_inits") - if version < 508 - let did_jinja_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink jinjaPunctuation jinjaOperator - HiLink jinjaAttribute jinjaVariable - HiLink jinjaFunction jinjaFilter - - HiLink jinjaTagDelim jinjaTagBlock - HiLink jinjaVarDelim jinjaVarBlock - HiLink jinjaCommentDelim jinjaComment - HiLink jinjaRawDelim jinja - - HiLink jinjaSpecial Special - HiLink jinjaOperator Normal - HiLink jinjaRaw Normal - HiLink jinjaTagBlock PreProc - HiLink jinjaVarBlock PreProc - HiLink jinjaStatement Statement - HiLink jinjaFilter Function - HiLink jinjaBlockName Function - HiLink jinjaVariable Identifier - HiLink jinjaString Constant - HiLink jinjaNumber Constant - HiLink jinjaComment Comment - - delcommand HiLink -endif - -let b:current_syntax = "jinja" - -if main_syntax == 'jinja' - unlet main_syntax -endif diff --git a/vim/bundle/json/README.md b/vim/bundle/json/README.md deleted file mode 100644 index de7b231..0000000 --- a/vim/bundle/json/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# vim-json - -This is a simple wrapper around the JSON syntax hightlighting file by -Jeroen Ruigrok van der Werven to make it easier to bundle with -[Vundle](https://github.com/gmarik/vundle) - -The original syntax file can be found at -http://www.vim.org/scripts/script.php?script_id=1945 \ No newline at end of file diff --git a/vim/bundle/json/ftdetect/json.vim b/vim/bundle/json/ftdetect/json.vim deleted file mode 100644 index 21d2d56..0000000 --- a/vim/bundle/json/ftdetect/json.vim +++ /dev/null @@ -1 +0,0 @@ -au BufRead,BufNewFile *.json set filetype=json diff --git a/vim/bundle/json/syntax/json.vim b/vim/bundle/json/syntax/json.vim deleted file mode 100644 index f3e27ba..0000000 --- a/vim/bundle/json/syntax/json.vim +++ /dev/null @@ -1,77 +0,0 @@ -" Vim syntax file -" Language: JSON -" Maintainer: Jeroen Ruigrok van der Werven -" Last Change: 2009-06-16 -" Version: 0.4 -" {{{1 - -" Syntax setup {{{2 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded - -if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish - endif - let main_syntax = 'json' -endif - -" Syntax: Strings {{{2 -syn region jsonString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=jsonEscape -" Syntax: JSON does not allow strings with single quotes, unlike JavaScript. -syn region jsonStringSQ start=+'+ skip=+\\\\\|\\"+ end=+'+ - -" Syntax: Escape sequences {{{3 -syn match jsonEscape "\\["\\/bfnrt]" contained -syn match jsonEscape "\\u\x\{4}" contained - -" Syntax: Strings should always be enclosed with quotes. -syn match jsonNoQuotes "\<\a\+\>" - -" Syntax: Numbers {{{2 -syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>" - -" Syntax: An integer part of 0 followed by other digits is not allowed. -syn match jsonNumError "-\=\<0\d\.\d*\>" - -" Syntax: Boolean {{{2 -syn keyword jsonBoolean true false - -" Syntax: Null {{{2 -syn keyword jsonNull null - -" Syntax: Braces {{{2 -syn match jsonBraces "[{}\[\]]" - -" Define the default highlighting. {{{1 -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_json_syn_inits") - if version < 508 - let did_json_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink jsonString String - HiLink jsonEscape Special - HiLink jsonNumber Number - HiLink jsonBraces Operator - HiLink jsonNull Function - HiLink jsonBoolean Boolean - - HiLink jsonNumError Error - HiLink jsonStringSQ Error - HiLink jsonNoQuotes Error - delcommand HiLink -endif - -let b:current_syntax = "json" -if main_syntax == 'json' - unlet main_syntax -endif - -" Vim settings {{{2 -" vim: ts=8 fdm=marker diff --git a/vim/bundle/less/.gitignore b/vim/bundle/less/.gitignore deleted file mode 100644 index 1377554..0000000 --- a/vim/bundle/less/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.swp diff --git a/vim/bundle/less/README.md b/vim/bundle/less/README.md deleted file mode 100644 index e9d9b5f..0000000 --- a/vim/bundle/less/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# VIM-LESS - -This vim bundle adds syntax highlighting, indenting and autocompletion for the dynamic stylesheet language [LESS](http://lesscss.org). - -This bundle is compatible with [vim-css-color](https://github.com/skammer/vim-css-color), -[vim-css3-syntax](https://github.com/hail2u/vim-css3-syntax) and possibly other plugins that place code -in `after/syntax/css.vim` or `after/syntax/css/*.vim`. - -![vim-less with vim-css-color and vim-css3-syntax (colorscheme solarized)](https://github.com/lenniboy/vim-less/raw/master/screenshot.png) - - -## Installing and Using - -- Install [pathogen](http://www.vim.org/scripts/script.php?script_id=2332) into `~/.vim/autoload/` and add the - following line to your `~/.vimrc`: - - call pathogen#infect() - -- Make a clone of the `vim-less` repository: - - $ mkdir -p ~/.vim/bundle - $ cd ~/.vim/bundle - $ git clone https://github.com/groenewege/vim-less - -- OR use [vundle](https://github.com/gmarik/vundle), adding this line to your `~/.vimrc`: - - Bundle 'groenewege/vim-less' - -- OR use git submodules: - - $ git submodule add https://github.com/groenewege/vim-less.git bundle/vim-less - $ git submodule init - - -### Map -.less to .css , lessc is required. - - nnoremap m :w !lessc % > %:t:r.css - - -## Credits - -Inspiration from [vim-haml](https://github.com/tpope/vim-haml), -[scss-syntax.vim](https://github.com/cakebaker/scss-syntax.vim) and -[vim-less](https://github.com/lunaru/vim-less) - -## License ## - -MIT : [groenewege.mit-license.org](http://groenewege.mit-license.org/) diff --git a/vim/bundle/less/ftdetect/less.vim b/vim/bundle/less/ftdetect/less.vim deleted file mode 100644 index f1cb1d7..0000000 --- a/vim/bundle/less/ftdetect/less.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd BufNewFile,BufRead *.less setf less diff --git a/vim/bundle/less/ftplugin/less.vim b/vim/bundle/less/ftplugin/less.vim deleted file mode 100644 index b6eaf6a..0000000 --- a/vim/bundle/less/ftplugin/less.vim +++ /dev/null @@ -1,25 +0,0 @@ -" Vim filetype plugin -" Language: LessCSS -" Author: Tim Pope -" Maintainer: Leonard Ehrenfried -" Last Change: 2011 Sep 30 - -" Only do this when not done yet for this buffer -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" - -setlocal iskeyword+=- -setlocal commentstring=//\ %s -setlocal define=^\\s*\\%(@mixin\\\|=\\) -setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') -setlocal omnifunc=csscomplete#CompleteCSS -setlocal suffixesadd=.less -setlocal comments=s1:/*,mb:*,ex:*/ - -let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' - -" vim:set sw=2: diff --git a/vim/bundle/less/indent/less.vim b/vim/bundle/less/indent/less.vim deleted file mode 100644 index 556c2d0..0000000 --- a/vim/bundle/less/indent/less.vim +++ /dev/null @@ -1,10 +0,0 @@ -" Vim indent file -" Language: LessCSS -" Maintainer: Leonard Ehrenfried -" Last Change: 2011 Sep 26 - -if exists("b:did_indent") - finish -endif - -runtime! indent/css.vim \ No newline at end of file diff --git a/vim/bundle/less/screenshot.png b/vim/bundle/less/screenshot.png deleted file mode 100644 index ce25624..0000000 Binary files a/vim/bundle/less/screenshot.png and /dev/null differ diff --git a/vim/bundle/less/syntax/less.vim b/vim/bundle/less/syntax/less.vim deleted file mode 100644 index 44bf470..0000000 --- a/vim/bundle/less/syntax/less.vim +++ /dev/null @@ -1,64 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -runtime! syntax/css.vim -runtime! after/syntax/css.vim -" load files from vim-css3-syntax plugin (https://github.com/hail2u/vim-css3-syntax) -runtime! after/syntax/css/*.vim - -syn case ignore - -syn region lessDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssTagName,cssPseudoClass,cssUrl,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors fold - -syn match lessVariable "@[[:alnum:]_-]\+" contained -syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessVariableAssignment skipwhite -syn match lessVariableAssignment ":" contained nextgroup=lessVariableValue skipwhite -syn match lessVariableValue ".*;"me=e-1 contained contains=lessVariable,lessOperator,lessDefault,cssValue.*,@cssColors "me=e-1 means that the last char of the pattern is not highlighted - -syn match lessOperator "+" contained -syn match lessOperator "-" contained -syn match lessOperator "/" contained -syn match lessOperator "*" contained - -syn match lessNestedSelector "[^/]* {"me=e-1 contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty -syn match lessNestedProperty "[[:alnum:]]\+:"me=e-1 contained - -syn match lessDefault "!default" contained - -syn match lessMixinChar "\.[[:alnum:]_-]\@=" contained nextgroup=lessClass -syn match lessAmpersandChar "&" contained nextgroup=lessClass,cssPseudoClass -syn match lessClass "[[:alnum:]_-]\+" contained - -" functions {{{ - -" string functions -syn keyword lessFunction escape e % containedin=cssDefinition contained -" misc functions -syn keyword lessFunction unit containedin=cssDefinition contained -" math functions -syn keyword lessFunction ceil floor percentage round containedin=cssDefinition contained -" color definition -syn keyword lessFunction rgb rgba argb hsl hsla hsv hsva containedin=cssDefinition contained -" color channel information -syn keyword lessFunction hue saturation lightness red green blue alpha luma containedin=cssDefinition contained -" color operations -syn keyword lessFunction saturate desaturate lighten darken fadein fadeout fade spin mix greyscale contrast containedin=cssDefinition contained -" color blending -syn keyword lessFunction multiply screen overlay softlight hardlight difference exclusion average negation containedin=cssDefinition contained - -" }}} - -syn match lessComment "//.*$" contains=@Spell - -hi def link lessVariable Special -hi def link lessVariableValue Constant -hi def link lessDefault Special -hi def link lessComment Comment -hi def link lessFunction Function -hi def link lessMixinChar Special -hi def link lessAmpersandChar Special -hi def link lessNestedProperty Type -hi def link lessClass PreProc - -let b:current_syntax = "less" diff --git a/vim/bundle/literate-coffeescript/LICENSE b/vim/bundle/literate-coffeescript/LICENSE deleted file mode 100644 index 9dfbb05..0000000 --- a/vim/bundle/literate-coffeescript/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Michael Smith - -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/vim/bundle/literate-coffeescript/README.md b/vim/bundle/literate-coffeescript/README.md deleted file mode 100644 index 787bb5a..0000000 --- a/vim/bundle/literate-coffeescript/README.md +++ /dev/null @@ -1,56 +0,0 @@ -`vim-literate-coffeescript` adds syntax highlighting and indentation support for -[Literate CoffeeScript](http://coffeescript.org/#literate) to the vim text -editor. - -It looks something like this: - -![Preview](test/test.png) - -# Dependencies - -You must have syntax highlighting installed for both -[Markdown](https://github.com/tpope/vim-markdown) and -[CoffeeScript](https://github.com/kchmck/vim-coffee-script) installed to use -this package. - -# Installation - -## Manually - - 1. Clone this repository. - - git clone https://github.com/mintplant/vim-literate-coffeescript.git - - 2. Copy all the vim-specific files into your ~/.vim folder. - - cp -r vim-literate-coffeescript/ftdetect/ ~/.vim/ - cp -r vim-literate-coffeescript/indent/ ~/.vim/ - cp -r vim-literate-coffeescript/syntax/ ~/.vim/ - -## With Pathogen - -### Setup - - 1. Install [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332) - - 2. Change directory to your bundle folder. - - cd ~/.vim/bundle - - 3. Clone this repository. - - git clone https://github.com/mintplant/vim-literate-coffeescript.git - -### Updating - - 1. Change directory to where the repository was cloned. - - cd ~/.vim/bundle/vim-literate-coffeescript/ - - 2. Pull in the latest changes. - - git pull - -# License - -[MIT](LICENSE) diff --git a/vim/bundle/literate-coffeescript/ftdetect/vim-literate-coffeescript.vim b/vim/bundle/literate-coffeescript/ftdetect/vim-literate-coffeescript.vim deleted file mode 100644 index 7f66624..0000000 --- a/vim/bundle/literate-coffeescript/ftdetect/vim-literate-coffeescript.vim +++ /dev/null @@ -1,8 +0,0 @@ -" Language: Literate CoffeeScript -" Maintainer: Michael Smith -" URL: https://github.com/mintplant/vim-literate-coffeescript -" License: MIT - -autocmd BufNewFile,BufRead *.litcoffee set filetype=litcoffee -autocmd BufNewFile,BufRead *.coffee.md set filetype=litcoffee - diff --git a/vim/bundle/literate-coffeescript/indent/litcoffee.vim b/vim/bundle/literate-coffeescript/indent/litcoffee.vim deleted file mode 100644 index 599cbea..0000000 --- a/vim/bundle/literate-coffeescript/indent/litcoffee.vim +++ /dev/null @@ -1,22 +0,0 @@ -if exists('b:did_indent') - finish -endif - -runtime! indent/coffee.vim - -let b:did_indent = 1 - -setlocal indentexpr=GetLitCoffeeIndent() - -if exists('*GetLitCoffeeIndent') - finish -endif - -function GetLitCoffeeIndent() - if searchpair('^ \|\t', '', '$', 'bWnm') > 0 - return GetCoffeeIndent(v:lnum) - else - return -1 - endif -endfunc - diff --git a/vim/bundle/literate-coffeescript/syntax/litcoffee.vim b/vim/bundle/literate-coffeescript/syntax/litcoffee.vim deleted file mode 100644 index 4028a82..0000000 --- a/vim/bundle/literate-coffeescript/syntax/litcoffee.vim +++ /dev/null @@ -1,20 +0,0 @@ -" Language: Literate CoffeeScript -" Maintainer: Michael Smith -" URL: https://github.com/mintplant/vim-literate-coffeescript -" License: MIT - -if exists('b:current_syntax') && b:current_syntax == 'litcoffee' - finish -endif - -runtime! syntax/markdown.vim -unlet b:current_syntax - -syn clear markdownCode - -syn include @coffee syntax/coffee.vim - -syn region inlineCoffee start='^ \|\t' end='$' contains=@coffee - -let b:current_syntax = "litcoffee" - diff --git a/vim/bundle/literate-coffeescript/test/test.coffee.md b/vim/bundle/literate-coffeescript/test/test.coffee.md deleted file mode 100644 index 62b99b7..0000000 --- a/vim/bundle/literate-coffeescript/test/test.coffee.md +++ /dev/null @@ -1,117 +0,0 @@ -The **Scope** class regulates lexical scoping within CoffeeScript. As you -generate code, you create a tree of scopes in the same shape as the nested -function bodies. Each scope knows about the variables declared within it, -and has a reference to its parent enclosing scope. In this way, we know which -variables are new and need to be declared with `var`, and which are shared -with external scopes. - -Import the helpers we plan to use. - - {extend, last} = require './helpers' - - exports.Scope = class Scope - -The `root` is the top-level **Scope** object for a given file. - - @root: null - -Initialize a scope with its parent, for lookups up the chain, -as well as a reference to the **Block** node it belongs to, which is -where it should declare its variables, and a reference to the function that -it belongs to. - - constructor: (@parent, @expressions, @method) -> - @variables = [{name: 'arguments', type: 'arguments'}] - @positions = {} - Scope.root = this unless @parent - -Adds a new variable or overrides an existing one. - - add: (name, type, immediate) -> - return @parent.add name, type, immediate if @shared and not immediate - if Object::hasOwnProperty.call @positions, name - @variables[@positions[name]].type = type - else - @positions[name] = @variables.push({name, type}) - 1 - -When `super` is called, we need to find the name of the current method we're -in, so that we know how to invoke the same method of the parent class. This -can get complicated if super is being called from an inner function. -`namedMethod` will walk up the scope tree until it either finds the first -function object that has a name filled in, or bottoms out. - - namedMethod: -> - return @method if @method.name or !@parent - @parent.namedMethod() - -Look up a variable name in lexical scope, and declare it if it does not -already exist. - - find: (name) -> - return yes if @check name - @add name, 'var' - no - -Reserve a variable name as originating from a function parameter for this -scope. No `var` required for internal references. - - parameter: (name) -> - return if @shared and @parent.check name, yes - @add name, 'param' - -Just check to see if a variable has already been declared, without reserving, -walks up to the root scope. - - check: (name) -> - !!(@type(name) or @parent?.check(name)) - -Generate a temporary variable name at the given index. - - temporary: (name, index) -> - if name.length > 1 - '_' + name + if index > 1 then index - 1 else '' - else - '_' + (index + parseInt name, 36).toString(36).replace /\d/g, 'a' - -Gets the type of a variable. - - type: (name) -> - return v.type for v in @variables when v.name is name - null - -If we need to store an intermediate result, find an available name for a -compiler-generated variable. `_var`, `_var2`, and so on... - - freeVariable: (name, reserve=true) -> - index = 0 - index++ while @check((temp = @temporary name, index)) - @add temp, 'var', yes if reserve - temp - -Ensure that an assignment is made at the top of this scope -(or at the top-level scope, if requested). - - assign: (name, value) -> - @add name, {value, assigned: yes}, yes - @hasAssignments = yes - -Does this scope have any declared variables? - - hasDeclarations: -> - !!@declaredVariables().length - -Return the list of variables first declared in this scope. - - declaredVariables: -> - realVars = [] - tempVars = [] - for v in @variables when v.type is 'var' - (if v.name.charAt(0) is '_' then tempVars else realVars).push v.name - realVars.sort().concat tempVars.sort() - -Return the list of assignments that are supposed to be made at the top -of this scope. - - assignedVariables: -> - "#{v.name} = #{v.type.value}" for v in @variables when v.type.assigned - diff --git a/vim/bundle/literate-coffeescript/test/test.litcoffee b/vim/bundle/literate-coffeescript/test/test.litcoffee deleted file mode 100644 index 62b99b7..0000000 --- a/vim/bundle/literate-coffeescript/test/test.litcoffee +++ /dev/null @@ -1,117 +0,0 @@ -The **Scope** class regulates lexical scoping within CoffeeScript. As you -generate code, you create a tree of scopes in the same shape as the nested -function bodies. Each scope knows about the variables declared within it, -and has a reference to its parent enclosing scope. In this way, we know which -variables are new and need to be declared with `var`, and which are shared -with external scopes. - -Import the helpers we plan to use. - - {extend, last} = require './helpers' - - exports.Scope = class Scope - -The `root` is the top-level **Scope** object for a given file. - - @root: null - -Initialize a scope with its parent, for lookups up the chain, -as well as a reference to the **Block** node it belongs to, which is -where it should declare its variables, and a reference to the function that -it belongs to. - - constructor: (@parent, @expressions, @method) -> - @variables = [{name: 'arguments', type: 'arguments'}] - @positions = {} - Scope.root = this unless @parent - -Adds a new variable or overrides an existing one. - - add: (name, type, immediate) -> - return @parent.add name, type, immediate if @shared and not immediate - if Object::hasOwnProperty.call @positions, name - @variables[@positions[name]].type = type - else - @positions[name] = @variables.push({name, type}) - 1 - -When `super` is called, we need to find the name of the current method we're -in, so that we know how to invoke the same method of the parent class. This -can get complicated if super is being called from an inner function. -`namedMethod` will walk up the scope tree until it either finds the first -function object that has a name filled in, or bottoms out. - - namedMethod: -> - return @method if @method.name or !@parent - @parent.namedMethod() - -Look up a variable name in lexical scope, and declare it if it does not -already exist. - - find: (name) -> - return yes if @check name - @add name, 'var' - no - -Reserve a variable name as originating from a function parameter for this -scope. No `var` required for internal references. - - parameter: (name) -> - return if @shared and @parent.check name, yes - @add name, 'param' - -Just check to see if a variable has already been declared, without reserving, -walks up to the root scope. - - check: (name) -> - !!(@type(name) or @parent?.check(name)) - -Generate a temporary variable name at the given index. - - temporary: (name, index) -> - if name.length > 1 - '_' + name + if index > 1 then index - 1 else '' - else - '_' + (index + parseInt name, 36).toString(36).replace /\d/g, 'a' - -Gets the type of a variable. - - type: (name) -> - return v.type for v in @variables when v.name is name - null - -If we need to store an intermediate result, find an available name for a -compiler-generated variable. `_var`, `_var2`, and so on... - - freeVariable: (name, reserve=true) -> - index = 0 - index++ while @check((temp = @temporary name, index)) - @add temp, 'var', yes if reserve - temp - -Ensure that an assignment is made at the top of this scope -(or at the top-level scope, if requested). - - assign: (name, value) -> - @add name, {value, assigned: yes}, yes - @hasAssignments = yes - -Does this scope have any declared variables? - - hasDeclarations: -> - !!@declaredVariables().length - -Return the list of variables first declared in this scope. - - declaredVariables: -> - realVars = [] - tempVars = [] - for v in @variables when v.type is 'var' - (if v.name.charAt(0) is '_' then tempVars else realVars).push v.name - realVars.sort().concat tempVars.sort() - -Return the list of assignments that are supposed to be made at the top -of this scope. - - assignedVariables: -> - "#{v.name} = #{v.type.value}" for v in @variables when v.type.assigned - diff --git a/vim/bundle/literate-coffeescript/test/test.png b/vim/bundle/literate-coffeescript/test/test.png deleted file mode 100644 index e3ad619..0000000 Binary files a/vim/bundle/literate-coffeescript/test/test.png and /dev/null differ diff --git a/vim/bundle/mustache/README.md b/vim/bundle/mustache/README.md deleted file mode 100644 index 7835192..0000000 --- a/vim/bundle/mustache/README.md +++ /dev/null @@ -1,96 +0,0 @@ -mustache and handlebars mode for vim -==================================== - -**Note**: This repo is deprecated, active development moved to -[mustache/vim-mode](http://github.com/mustache/vim-mode). - -A vim plugin for working with [mustache][mustache] and -[handlebars][handlebars] templates. It has: - - - syntax highlighting - - matchit support - - mustache abbreviations (optional) - - section movement mappings `[[` and `]]` - - -### Install for pathogen - - cd ~/.vim/ - git submodule add git://github.com/mustache/vim-mode.git bundle/mustache - vim bundle/mustache/example.mustache - -Get [pathogen][pathogen]. - -### Manually Install - - cd ~/.local/src - git clone git://github.com/mustache/vim-mode.git mustache.vim - cp -R mustache.vim/syntax/* ~/.vim/syntax/ - cp -R mustache.vim/ftdetect/* ~/.vim/ftdetect/ - cp -R mustache.vim/ftplugin/* ~/.vim/ftplugin/ - vim mustache.vim/example.mustache - -### Mustache Abbreviations - -You can activate mustache abbreviations by putting this line in your `.vimrc`: -`let g:mustache_abbreviations = 1` - -Now you get a set of convenient abbreviations. Underscore `_` indicates where -your cursor ends up after typing an abbreviation: - - `{{` => `{{_}}` - - `{{{` => `{{{_}}}` - - `{{!` => `{{!_}}` - - `{{>` => `{{>_}}` - - `{{<` => `{{<_}}` - - `{{#` produces - - ``` - {{# _}} - {{/}} - ``` - - `{{if` produces - - ``` - {{#if _}} - {{/if}} - ``` - - `{{ife` produces - - ``` - {{#if _}} - {{else}} - {{/if}} - ``` - -### Section movement mappings - -Following the vim convention of jumping from section to section, `[[` and `]]` -mappings are implemented for easier movement between mustache tags. - - - `]]` jumps to the first following tag - - `[[` jumps to the first previous tag - -Count with section movements is supported: - - - `2]]` jumps to the second next tag - -## Maintainers - -* [Bruno Michel](http://github.com/nono) -* [Bruno Sutic](http://github.com/bruno-) -* [Juvenn Woo](http://github.com/juvenn) - -This is combined work from -[juvenn/mustache.vim](http://github.com/juvenn/mustache.vim) and -[nono/vim-handlebars](http://github.com/nono/vim-handlebars). - ----- - -Thanks [@5long](http://github.com/5long) for adding matchit support. - -You're encouraged to propose ideas or have discussions via github -issues. - -[mustache]: http://mustache.github.io -[handlebars]: http://handlebarsjs.com -[pathogen]: https://github.com/tpope/vim-pathogen diff --git a/vim/bundle/mustache/example.mustache b/vim/bundle/mustache/example.mustache deleted file mode 100644 index b579adb..0000000 --- a/vim/bundle/mustache/example.mustache +++ /dev/null @@ -1,50 +0,0 @@ - - - - - {{title}} - - {{!}} - - -
-

Mustache Showdown

- - Basic mustache {{hello}} - {{ hello}}, {{hello }} and {{ hello }} are OK - - {{d d d}} - - {{Everything will be hilighted here}} - - Mustaches hilighted in - attribute value - - {{#repo}} - This is an mustache [enumerable] section -
  • {{ name }}
  • - {{/repo}} - - You can {{{yield}}} here - - {{! <> this is a comment TODO:}} - - This is a partial {{> partial1 }} - Yet another partial {{< partial2 }}, for ctemplate - - {{=<% %>=}}Sorry, cusomized delimiter not handled yet<%={{}}=%> - - {{#if some_helper}} - And here is an example of handlebars if... - {{else}} - ... with optional else added. Try matchit `%` command over if/else/if. - {{/if}} - - Thanks goes to {{@defunkt}} - Feedback/blames go to {{@juvenn}} - {{Frustrations}} go to /dev/null -
    - - - - diff --git a/vim/bundle/mustache/ftdetect/mustache.vim b/vim/bundle/mustache/ftdetect/mustache.vim deleted file mode 100644 index e3bb34f..0000000 --- a/vim/bundle/mustache/ftdetect/mustache.vim +++ /dev/null @@ -1,3 +0,0 @@ -if has("autocmd") - au BufNewFile,BufRead *.mustache,*.handlebars,*.hbs,*.hogan,*.hulk,*.hjs set filetype=html syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim -endif diff --git a/vim/bundle/mustache/ftplugin/mustache.vim b/vim/bundle/mustache/ftplugin/mustache.vim deleted file mode 100644 index 7401e8e..0000000 --- a/vim/bundle/mustache/ftplugin/mustache.vim +++ /dev/null @@ -1,63 +0,0 @@ -let s:cpo_save = &cpo -set cpo&vim - -" Matchit support for Mustache & Handlebars -" extending HTML matchit groups -if exists("loaded_matchit") && exists("b:match_words") - let b:match_words = b:match_words - \ . ',{:},[:],(:),' - \ . '\%({{\)\@<=#\s*\%(if\|unless\)\s*.\{-}}}' - \ . ':' - \ . '\%({{\)\@<=\s*else\s*}}' - \ . ':' - \ . '\%({{\)\@<=/\s*\%(if\|unless\)\s*}},' - \ . '\%({{\)\@<=[#^]\s*\([-0-9a-zA-Z_?!/.]\+\).\{-}}}' - \ . ':' - \ . '\%({{\)\@<=/\s*\1\s*}}' -endif - -if exists("g:mustache_abbreviations") - inoremap {{{ {{{}}} - inoremap {{ {{}} - inoremap {{! {{!}} - inoremap {{< {{<}} - inoremap {{> {{>}} - inoremap {{# {{#}}{{/}} - inoremap {{if {{#if }}{{/if}} - inoremap {{ife {{#if }}{{else}}{{/if}} -endif - - -" Section movement -" Adapted from vim-ruby - many thanks to the maintainers of that plugin - -function! s:sectionmovement(pattern,flags,mode,count) - norm! m' - if a:mode ==# 'v' - norm! gv - endif - let i = 0 - while i < a:count - let i = i + 1 - " saving current position - let line = line('.') - let col = col('.') - let pos = search(a:pattern,'W'.a:flags) - " if there's no more matches, return to last position - if pos == 0 - call cursor(line,col) - return - endif - endwhile -endfunction - -nnoremap [[ :call sectionmovement('{{','b','n',v:count1) -nnoremap ]] :call sectionmovement('{{','' ,'n',v:count1) -xnoremap [[ :call sectionmovement('{{','b','v',v:count1) -xnoremap ]] :call sectionmovement('{{','' ,'v',v:count1) - - -let &cpo = s:cpo_save -unlet s:cpo_save - -" vim: nofoldenable diff --git a/vim/bundle/mustache/syntax/mustache.vim b/vim/bundle/mustache/syntax/mustache.vim deleted file mode 100644 index ef4fb79..0000000 --- a/vim/bundle/mustache/syntax/mustache.vim +++ /dev/null @@ -1,75 +0,0 @@ -" Mustache & Handlebars syntax -" Language: Mustache, Handlebars -" Maintainer: Juvenn Woo -" Screenshot: http://imgur.com/6F408 -" Version: 2 -" Last Change: Mar 24th 2013 -" Remark: -" It lexically hilights embedded mustaches (exclusively) in html file. -" While it was written for Ruby-based Mustache template system, it should -" work for Google's C-based *ctemplate* as well as Erlang-based *et*. All -" of them are, AFAIK, based on the idea of ctemplate. -" References: -" [Mustache](http://github.com/defunkt/mustache) -" [Handlebars](https://github.com/wycats/handlebars.js) -" [ctemplate](http://code.google.com/p/google-ctemplate/) -" [ctemplate doc](http://google-ctemplate.googlecode.com/svn/trunk/doc/howto.html) -" [et](http://www.ivan.fomichev.name/2008/05/erlang-template-engine-prototype.html) -" TODO: Feedback is welcomed. - - -" Read the HTML syntax to start with -if version < 600 - so :p:h/html.vim -else - runtime! syntax/html.vim - unlet b:current_syntax -endif - -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" Standard HiLink will not work with included syntax files -if version < 508 - command! -nargs=+ HtmlHiLink hi link -else - command! -nargs=+ HtmlHiLink hi def link -endif - -syntax match mustacheError '}}}\?' -syntax match mustacheInsideError '{{[{#<>=!\/]\?' containedin=@mustacheInside -syntax region mustacheVariable matchgroup=mustacheMarker start=/{{/ end=/}}/ containedin=@htmlMustacheContainer -syntax region mustacheVariableUnescape matchgroup=mustacheMarker start=/{{{/ end=/}}}/ containedin=@htmlMustacheContainer -syntax region mustacheSection matchgroup=mustacheMarker start='{{[#/]' end=/}}/ containedin=@htmlMustacheContainer -syntax region mustachePartial matchgroup=mustacheMarker start=/{{[<>]/ end=/}}/ -syntax region mustacheMarkerSet matchgroup=mustacheMarker start=/{{=/ end=/=}}/ -syntax region mustacheComment start=/{{!/ end=/}}/ contains=Todo containedin=htmlHead - - -" Clustering -syntax cluster mustacheInside add=mustacheVariable,mustacheVariableUnescape,mustacheSection,mustachePartial,mustacheMarkerSet -syntax cluster htmlMustacheContainer add=htmlHead,htmlTitle,htmlString,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlLink,htmlBold,htmlUnderline,htmlItalic - -" Hilighting -" mustacheInside hilighted as Number, which is rarely used in html -" you might like change it to Function or Identifier -HtmlHiLink mustacheVariable Number -HtmlHiLink mustacheVariableUnescape Number -HtmlHiLink mustachePartial Number -HtmlHiLink mustacheSection Number -HtmlHiLink mustacheMarkerSet Number - -HtmlHiLink mustacheComment Comment -HtmlHiLink mustacheMarker Special -HtmlHiLink mustacheError Error -HtmlHiLink mustacheInsideError Error - -syn region mustacheScriptTemplate start=++me=s-1 keepend -\ contains=mustacheError,mustacheInsideError,mustacheVariable,mustacheVariableUnescape,mustacheSection,mustachePartial,mustacheMarkerSet,mustacheComment,htmlHead,htmlTitle,htmlString,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlTag,htmlEndTag,htmlTagName,htmlSpecialChar,htmlLink,htmlBold,htmlUnderline,htmlItalic - -let b:current_syntax = "mustache" -delcommand HtmlHiLink diff --git a/vim/bundle/nginx/README.md b/vim/bundle/nginx/README.md deleted file mode 100644 index 2893faf..0000000 --- a/vim/bundle/nginx/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# nginx syntax files for Vim. - -*NOTE*: As of Dec. 2013, these scripts are maintained in the "contrib" directory of the Nginx source: - -* http://hg.nginx.org/nginx/rev/f38043bd15f5 - -You can see the original vim.org version here: - -* http://www.vim.org/scripts/script.php?script_id=1886 - diff --git a/vim/bundle/nginx/ftdetect/nginx.vim b/vim/bundle/nginx/ftdetect/nginx.vim deleted file mode 100644 index 3ae470d..0000000 --- a/vim/bundle/nginx/ftdetect/nginx.vim +++ /dev/null @@ -1,4 +0,0 @@ -au BufRead,BufNewFile *.nginx set ft=nginx -au BufRead,BufNewFile */etc/nginx/* set ft=nginx -au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx -au BufRead,BufNewFile nginx.conf set ft=nginx diff --git a/vim/bundle/nginx/indent/nginx.vim b/vim/bundle/nginx/indent/nginx.vim deleted file mode 100644 index 8601366..0000000 --- a/vim/bundle/nginx/indent/nginx.vim +++ /dev/null @@ -1,11 +0,0 @@ -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal indentexpr= - -" cindent actually works for nginx' simple file structure -setlocal cindent -" Just make sure that the comments are not reset as defs would be. -setlocal cinkeys-=0# diff --git a/vim/bundle/nginx/syntax/nginx.vim b/vim/bundle/nginx/syntax/nginx.vim deleted file mode 100644 index 50d809b..0000000 --- a/vim/bundle/nginx/syntax/nginx.vim +++ /dev/null @@ -1,703 +0,0 @@ -" Vim syntax file -" Language: nginx.conf - -if exists("b:current_syntax") - finish -end - -setlocal iskeyword+=. -setlocal iskeyword+=/ -setlocal iskeyword+=: - -syn match ngxVariable '\$\(\w\+\|{\w\+}\)' -syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained -syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained -syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline -syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString -syn match ngxComment ' *#.*$' - -syn keyword ngxBoolean on -syn keyword ngxBoolean off - -syn keyword ngxDirectiveBlock http contained -syn keyword ngxDirectiveBlock mail contained -syn keyword ngxDirectiveBlock events contained -syn keyword ngxDirectiveBlock server contained -syn keyword ngxDirectiveBlock types contained -syn keyword ngxDirectiveBlock location contained -syn keyword ngxDirectiveBlock upstream contained -syn keyword ngxDirectiveBlock charset_map contained -syn keyword ngxDirectiveBlock limit_except contained -syn keyword ngxDirectiveBlock if contained -syn keyword ngxDirectiveBlock geo contained -syn keyword ngxDirectiveBlock map contained - -syn keyword ngxDirectiveImportant include -syn keyword ngxDirectiveImportant root -syn keyword ngxDirectiveImportant server -syn keyword ngxDirectiveImportant server_name -syn keyword ngxDirectiveImportant listen -syn keyword ngxDirectiveImportant internal -syn keyword ngxDirectiveImportant proxy_pass -syn keyword ngxDirectiveImportant memcached_pass -syn keyword ngxDirectiveImportant fastcgi_pass -syn keyword ngxDirectiveImportant try_files - -syn keyword ngxDirectiveControl break -syn keyword ngxDirectiveControl return -syn keyword ngxDirectiveControl rewrite -syn keyword ngxDirectiveControl set - -syn keyword ngxDirectiveError error_page -syn keyword ngxDirectiveError post_action - -syn keyword ngxDirectiveDeprecated connections -syn keyword ngxDirectiveDeprecated imap -syn keyword ngxDirectiveDeprecated open_file_cache_retest -syn keyword ngxDirectiveDeprecated optimize_server_names -syn keyword ngxDirectiveDeprecated satisfy_any - -syn keyword ngxDirective accept_mutex -syn keyword ngxDirective accept_mutex_delay -syn keyword ngxDirective access_log -syn keyword ngxDirective add_after_body -syn keyword ngxDirective add_before_body -syn keyword ngxDirective add_header -syn keyword ngxDirective addition_types -syn keyword ngxDirective aio -syn keyword ngxDirective alias -syn keyword ngxDirective allow -syn keyword ngxDirective ancient_browser -syn keyword ngxDirective ancient_browser_value -syn keyword ngxDirective auth_basic -syn keyword ngxDirective auth_basic_user_file -syn keyword ngxDirective auth_http -syn keyword ngxDirective auth_http_header -syn keyword ngxDirective auth_http_timeout -syn keyword ngxDirective autoindex -syn keyword ngxDirective autoindex_exact_size -syn keyword ngxDirective autoindex_localtime -syn keyword ngxDirective charset -syn keyword ngxDirective charset_types -syn keyword ngxDirective client_body_buffer_size -syn keyword ngxDirective client_body_in_file_only -syn keyword ngxDirective client_body_in_single_buffer -syn keyword ngxDirective client_body_temp_path -syn keyword ngxDirective client_body_timeout -syn keyword ngxDirective client_header_buffer_size -syn keyword ngxDirective client_header_timeout -syn keyword ngxDirective client_max_body_size -syn keyword ngxDirective connection_pool_size -syn keyword ngxDirective create_full_put_path -syn keyword ngxDirective daemon -syn keyword ngxDirective dav_access -syn keyword ngxDirective dav_methods -syn keyword ngxDirective debug_connection -syn keyword ngxDirective debug_points -syn keyword ngxDirective default_type -syn keyword ngxDirective degradation -syn keyword ngxDirective degrade -syn keyword ngxDirective deny -syn keyword ngxDirective devpoll_changes -syn keyword ngxDirective devpoll_events -syn keyword ngxDirective directio -syn keyword ngxDirective directio_alignment -syn keyword ngxDirective empty_gif -syn keyword ngxDirective env -syn keyword ngxDirective epoll_events -syn keyword ngxDirective error_log -syn keyword ngxDirective eventport_events -syn keyword ngxDirective expires -syn keyword ngxDirective fastcgi_bind -syn keyword ngxDirective fastcgi_buffer_size -syn keyword ngxDirective fastcgi_buffers -syn keyword ngxDirective fastcgi_busy_buffers_size -syn keyword ngxDirective fastcgi_cache -syn keyword ngxDirective fastcgi_cache_key -syn keyword ngxDirective fastcgi_cache_methods -syn keyword ngxDirective fastcgi_cache_min_uses -syn keyword ngxDirective fastcgi_cache_path -syn keyword ngxDirective fastcgi_cache_use_stale -syn keyword ngxDirective fastcgi_cache_valid -syn keyword ngxDirective fastcgi_catch_stderr -syn keyword ngxDirective fastcgi_connect_timeout -syn keyword ngxDirective fastcgi_hide_header -syn keyword ngxDirective fastcgi_ignore_client_abort -syn keyword ngxDirective fastcgi_ignore_headers -syn keyword ngxDirective fastcgi_index -syn keyword ngxDirective fastcgi_intercept_errors -syn keyword ngxDirective fastcgi_max_temp_file_size -syn keyword ngxDirective fastcgi_next_upstream -syn keyword ngxDirective fastcgi_param -syn keyword ngxDirective fastcgi_pass_header -syn keyword ngxDirective fastcgi_pass_request_body -syn keyword ngxDirective fastcgi_pass_request_headers -syn keyword ngxDirective fastcgi_read_timeout -syn keyword ngxDirective fastcgi_send_lowat -syn keyword ngxDirective fastcgi_send_timeout -syn keyword ngxDirective fastcgi_split_path_info -syn keyword ngxDirective fastcgi_store -syn keyword ngxDirective fastcgi_store_access -syn keyword ngxDirective fastcgi_temp_file_write_size -syn keyword ngxDirective fastcgi_temp_path -syn keyword ngxDirective fastcgi_upstream_fail_timeout -syn keyword ngxDirective fastcgi_upstream_max_fails -syn keyword ngxDirective flv -syn keyword ngxDirective geoip_city -syn keyword ngxDirective geoip_country -syn keyword ngxDirective google_perftools_profiles -syn keyword ngxDirective gzip -syn keyword ngxDirective gzip_buffers -syn keyword ngxDirective gzip_comp_level -syn keyword ngxDirective gzip_disable -syn keyword ngxDirective gzip_hash -syn keyword ngxDirective gzip_http_version -syn keyword ngxDirective gzip_min_length -syn keyword ngxDirective gzip_no_buffer -syn keyword ngxDirective gzip_proxied -syn keyword ngxDirective gzip_static -syn keyword ngxDirective gzip_types -syn keyword ngxDirective gzip_vary -syn keyword ngxDirective gzip_window -syn keyword ngxDirective if_modified_since -syn keyword ngxDirective ignore_invalid_headers -syn keyword ngxDirective image_filter -syn keyword ngxDirective image_filter_buffer -syn keyword ngxDirective image_filter_jpeg_quality -syn keyword ngxDirective image_filter_transparency -syn keyword ngxDirective imap_auth -syn keyword ngxDirective imap_capabilities -syn keyword ngxDirective imap_client_buffer -syn keyword ngxDirective index -syn keyword ngxDirective ip_hash -syn keyword ngxDirective keepalive_requests -syn keyword ngxDirective keepalive_timeout -syn keyword ngxDirective kqueue_changes -syn keyword ngxDirective kqueue_events -syn keyword ngxDirective large_client_header_buffers -syn keyword ngxDirective limit_conn -syn keyword ngxDirective limit_conn_log_level -syn keyword ngxDirective limit_rate -syn keyword ngxDirective limit_rate_after -syn keyword ngxDirective limit_req -syn keyword ngxDirective limit_req_log_level -syn keyword ngxDirective limit_req_zone -syn keyword ngxDirective limit_zone -syn keyword ngxDirective lingering_time -syn keyword ngxDirective lingering_timeout -syn keyword ngxDirective lock_file -syn keyword ngxDirective log_format -syn keyword ngxDirective log_not_found -syn keyword ngxDirective log_subrequest -syn keyword ngxDirective map_hash_bucket_size -syn keyword ngxDirective map_hash_max_size -syn keyword ngxDirective master_process -syn keyword ngxDirective memcached_bind -syn keyword ngxDirective memcached_buffer_size -syn keyword ngxDirective memcached_connect_timeout -syn keyword ngxDirective memcached_next_upstream -syn keyword ngxDirective memcached_read_timeout -syn keyword ngxDirective memcached_send_timeout -syn keyword ngxDirective memcached_upstream_fail_timeout -syn keyword ngxDirective memcached_upstream_max_fails -syn keyword ngxDirective merge_slashes -syn keyword ngxDirective min_delete_depth -syn keyword ngxDirective modern_browser -syn keyword ngxDirective modern_browser_value -syn keyword ngxDirective msie_padding -syn keyword ngxDirective msie_refresh -syn keyword ngxDirective multi_accept -syn keyword ngxDirective open_file_cache -syn keyword ngxDirective open_file_cache_errors -syn keyword ngxDirective open_file_cache_events -syn keyword ngxDirective open_file_cache_min_uses -syn keyword ngxDirective open_file_cache_valid -syn keyword ngxDirective open_log_file_cache -syn keyword ngxDirective output_buffers -syn keyword ngxDirective override_charset -syn keyword ngxDirective perl -syn keyword ngxDirective perl_modules -syn keyword ngxDirective perl_require -syn keyword ngxDirective perl_set -syn keyword ngxDirective pid -syn keyword ngxDirective pop3_auth -syn keyword ngxDirective pop3_capabilities -syn keyword ngxDirective port_in_redirect -syn keyword ngxDirective postpone_gzipping -syn keyword ngxDirective postpone_output -syn keyword ngxDirective protocol -syn keyword ngxDirective proxy -syn keyword ngxDirective proxy_bind -syn keyword ngxDirective proxy_buffer -syn keyword ngxDirective proxy_buffer_size -syn keyword ngxDirective proxy_buffering -syn keyword ngxDirective proxy_buffers -syn keyword ngxDirective proxy_busy_buffers_size -syn keyword ngxDirective proxy_cache -syn keyword ngxDirective proxy_cache_key -syn keyword ngxDirective proxy_cache_methods -syn keyword ngxDirective proxy_cache_min_uses -syn keyword ngxDirective proxy_cache_path -syn keyword ngxDirective proxy_cache_use_stale -syn keyword ngxDirective proxy_cache_valid -syn keyword ngxDirective proxy_connect_timeout -syn keyword ngxDirective proxy_headers_hash_bucket_size -syn keyword ngxDirective proxy_headers_hash_max_size -syn keyword ngxDirective proxy_hide_header -syn keyword ngxDirective proxy_ignore_client_abort -syn keyword ngxDirective proxy_ignore_headers -syn keyword ngxDirective proxy_intercept_errors -syn keyword ngxDirective proxy_max_temp_file_size -syn keyword ngxDirective proxy_method -syn keyword ngxDirective proxy_next_upstream -syn keyword ngxDirective proxy_pass_error_message -syn keyword ngxDirective proxy_pass_header -syn keyword ngxDirective proxy_pass_request_body -syn keyword ngxDirective proxy_pass_request_headers -syn keyword ngxDirective proxy_read_timeout -syn keyword ngxDirective proxy_redirect -syn keyword ngxDirective proxy_send_lowat -syn keyword ngxDirective proxy_send_timeout -syn keyword ngxDirective proxy_set_body -syn keyword ngxDirective proxy_set_header -syn keyword ngxDirective proxy_ssl_session_reuse -syn keyword ngxDirective proxy_store -syn keyword ngxDirective proxy_store_access -syn keyword ngxDirective proxy_temp_file_write_size -syn keyword ngxDirective proxy_temp_path -syn keyword ngxDirective proxy_timeout -syn keyword ngxDirective proxy_upstream_fail_timeout -syn keyword ngxDirective proxy_upstream_max_fails -syn keyword ngxDirective random_index -syn keyword ngxDirective read_ahead -syn keyword ngxDirective real_ip_header -syn keyword ngxDirective recursive_error_pages -syn keyword ngxDirective request_pool_size -syn keyword ngxDirective reset_timedout_connection -syn keyword ngxDirective resolver -syn keyword ngxDirective resolver_timeout -syn keyword ngxDirective rewrite_log -syn keyword ngxDirective rtsig_overflow_events -syn keyword ngxDirective rtsig_overflow_test -syn keyword ngxDirective rtsig_overflow_threshold -syn keyword ngxDirective rtsig_signo -syn keyword ngxDirective satisfy -syn keyword ngxDirective secure_link_secret -syn keyword ngxDirective send_lowat -syn keyword ngxDirective send_timeout -syn keyword ngxDirective sendfile -syn keyword ngxDirective sendfile_max_chunk -syn keyword ngxDirective server_name_in_redirect -syn keyword ngxDirective server_names_hash_bucket_size -syn keyword ngxDirective server_names_hash_max_size -syn keyword ngxDirective server_tokens -syn keyword ngxDirective set_real_ip_from -syn keyword ngxDirective smtp_auth -syn keyword ngxDirective smtp_capabilities -syn keyword ngxDirective smtp_client_buffer -syn keyword ngxDirective smtp_greeting_delay -syn keyword ngxDirective so_keepalive -syn keyword ngxDirective source_charset -syn keyword ngxDirective ssi -syn keyword ngxDirective ssi_ignore_recycled_buffers -syn keyword ngxDirective ssi_min_file_chunk -syn keyword ngxDirective ssi_silent_errors -syn keyword ngxDirective ssi_types -syn keyword ngxDirective ssi_value_length -syn keyword ngxDirective ssl -syn keyword ngxDirective ssl_certificate -syn keyword ngxDirective ssl_certificate_key -syn keyword ngxDirective ssl_ciphers -syn keyword ngxDirective ssl_client_certificate -syn keyword ngxDirective ssl_crl -syn keyword ngxDirective ssl_dhparam -syn keyword ngxDirective ssl_engine -syn keyword ngxDirective ssl_prefer_server_ciphers -syn keyword ngxDirective ssl_protocols -syn keyword ngxDirective ssl_session_cache -syn keyword ngxDirective ssl_session_timeout -syn keyword ngxDirective ssl_verify_client -syn keyword ngxDirective ssl_verify_depth -syn keyword ngxDirective starttls -syn keyword ngxDirective stub_status -syn keyword ngxDirective sub_filter -syn keyword ngxDirective sub_filter_once -syn keyword ngxDirective sub_filter_types -syn keyword ngxDirective tcp_nodelay -syn keyword ngxDirective tcp_nopush -syn keyword ngxDirective thread_stack_size -syn keyword ngxDirective timeout -syn keyword ngxDirective timer_resolution -syn keyword ngxDirective types_hash_bucket_size -syn keyword ngxDirective types_hash_max_size -syn keyword ngxDirective underscores_in_headers -syn keyword ngxDirective uninitialized_variable_warn -syn keyword ngxDirective use -syn keyword ngxDirective user -syn keyword ngxDirective userid -syn keyword ngxDirective userid_domain -syn keyword ngxDirective userid_expires -syn keyword ngxDirective userid_mark -syn keyword ngxDirective userid_name -syn keyword ngxDirective userid_p3p -syn keyword ngxDirective userid_path -syn keyword ngxDirective userid_service -syn keyword ngxDirective valid_referers -syn keyword ngxDirective variables_hash_bucket_size -syn keyword ngxDirective variables_hash_max_size -syn keyword ngxDirective worker_connections -syn keyword ngxDirective worker_cpu_affinity -syn keyword ngxDirective worker_priority -syn keyword ngxDirective worker_processes -syn keyword ngxDirective worker_rlimit_core -syn keyword ngxDirective worker_rlimit_nofile -syn keyword ngxDirective worker_rlimit_sigpending -syn keyword ngxDirective worker_threads -syn keyword ngxDirective working_directory -syn keyword ngxDirective xclient -syn keyword ngxDirective xml_entities -syn keyword ngxDirective xslt_stylesheet -syn keyword ngxDirective xslt_types - -" 3rd party module list: -" http://wiki.nginx.org/Nginx3rdPartyModules - -" Accept Language Module -" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales. -syn keyword ngxDirectiveThirdParty set_from_accept_language - -" Access Key Module -" Denies access unless the request URL contains an access key. -syn keyword ngxDirectiveThirdParty accesskey -syn keyword ngxDirectiveThirdParty accesskey_arg -syn keyword ngxDirectiveThirdParty accesskey_hashmethod -syn keyword ngxDirectiveThirdParty accesskey_signature - -" Auth PAM Module -" HTTP Basic Authentication using PAM. -syn keyword ngxDirectiveThirdParty auth_pam -syn keyword ngxDirectiveThirdParty auth_pam_service_name - -" Cache Purge Module -" Module adding ability to purge content from FastCGI and proxy caches. -syn keyword ngxDirectiveThirdParty fastcgi_cache_purge -syn keyword ngxDirectiveThirdParty proxy_cache_purge - -" Chunkin Module -" HTTP 1.1 chunked-encoding request body support for Nginx. -syn keyword ngxDirectiveThirdParty chunkin -syn keyword ngxDirectiveThirdParty chunkin_keepalive -syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf -syn keyword ngxDirectiveThirdParty chunkin_resume - -" Circle GIF Module -" Generates simple circle images with the colors and size specified in the URL. -syn keyword ngxDirectiveThirdParty circle_gif -syn keyword ngxDirectiveThirdParty circle_gif_max_radius -syn keyword ngxDirectiveThirdParty circle_gif_min_radius -syn keyword ngxDirectiveThirdParty circle_gif_step_radius - -" Drizzle Module -" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle. -syn keyword ngxDirectiveThirdParty drizzle_connect_timeout -syn keyword ngxDirectiveThirdParty drizzle_dbname -syn keyword ngxDirectiveThirdParty drizzle_keepalive -syn keyword ngxDirectiveThirdParty drizzle_module_header -syn keyword ngxDirectiveThirdParty drizzle_pass -syn keyword ngxDirectiveThirdParty drizzle_query -syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout -syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout -syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout -syn keyword ngxDirectiveThirdParty drizzle_server - -" Echo Module -" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file. -syn keyword ngxDirectiveThirdParty echo -syn keyword ngxDirectiveThirdParty echo_after_body -syn keyword ngxDirectiveThirdParty echo_before_body -syn keyword ngxDirectiveThirdParty echo_blocking_sleep -syn keyword ngxDirectiveThirdParty echo_duplicate -syn keyword ngxDirectiveThirdParty echo_end -syn keyword ngxDirectiveThirdParty echo_exec -syn keyword ngxDirectiveThirdParty echo_flush -syn keyword ngxDirectiveThirdParty echo_foreach_split -syn keyword ngxDirectiveThirdParty echo_location -syn keyword ngxDirectiveThirdParty echo_location_async -syn keyword ngxDirectiveThirdParty echo_read_request_body -syn keyword ngxDirectiveThirdParty echo_request_body -syn keyword ngxDirectiveThirdParty echo_reset_timer -syn keyword ngxDirectiveThirdParty echo_sleep -syn keyword ngxDirectiveThirdParty echo_subrequest -syn keyword ngxDirectiveThirdParty echo_subrequest_async - -" Events Module -" Privides options for start/stop events. -syn keyword ngxDirectiveThirdParty on_start -syn keyword ngxDirectiveThirdParty on_stop - -" EY Balancer Module -" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream. -syn keyword ngxDirectiveThirdParty max_connections -syn keyword ngxDirectiveThirdParty max_connections_max_queue_length -syn keyword ngxDirectiveThirdParty max_connections_queue_timeout - -" Fancy Indexes Module -" Like the built-in autoindex module, but fancier. -syn keyword ngxDirectiveThirdParty fancyindex -syn keyword ngxDirectiveThirdParty fancyindex_exact_size -syn keyword ngxDirectiveThirdParty fancyindex_footer -syn keyword ngxDirectiveThirdParty fancyindex_header -syn keyword ngxDirectiveThirdParty fancyindex_localtime -syn keyword ngxDirectiveThirdParty fancyindex_readme -syn keyword ngxDirectiveThirdParty fancyindex_readme_mode - -" GeoIP Module (DEPRECATED) -" Country code lookups via the MaxMind GeoIP API. -syn keyword ngxDirectiveThirdParty geoip_country_file - -" Headers More Module -" Set and clear input and output headers...more than "add"! -syn keyword ngxDirectiveThirdParty more_clear_headers -syn keyword ngxDirectiveThirdParty more_clear_input_headers -syn keyword ngxDirectiveThirdParty more_set_headers -syn keyword ngxDirectiveThirdParty more_set_input_headers - -" HTTP Push Module -" Turn Nginx into an adept long-polling HTTP Push (Comet) server. -syn keyword ngxDirectiveThirdParty push_buffer_size -syn keyword ngxDirectiveThirdParty push_listener -syn keyword ngxDirectiveThirdParty push_message_timeout -syn keyword ngxDirectiveThirdParty push_queue_messages -syn keyword ngxDirectiveThirdParty push_sender - -" HTTP Redis Module > -" Redis support.> -syn keyword ngxDirectiveThirdParty redis_bind -syn keyword ngxDirectiveThirdParty redis_buffer_size -syn keyword ngxDirectiveThirdParty redis_connect_timeout -syn keyword ngxDirectiveThirdParty redis_next_upstream -syn keyword ngxDirectiveThirdParty redis_pass -syn keyword ngxDirectiveThirdParty redis_read_timeout -syn keyword ngxDirectiveThirdParty redis_send_timeout - -" HTTP JavaScript Module -" Embedding SpiderMonkey. Nearly full port on Perl module. -syn keyword ngxDirectiveThirdParty js -syn keyword ngxDirectiveThirdParty js_filter -syn keyword ngxDirectiveThirdParty js_filter_types -syn keyword ngxDirectiveThirdParty js_load -syn keyword ngxDirectiveThirdParty js_maxmem -syn keyword ngxDirectiveThirdParty js_require -syn keyword ngxDirectiveThirdParty js_set -syn keyword ngxDirectiveThirdParty js_utf8 - -" Log Request Speed -" Log the time it took to process each request. -syn keyword ngxDirectiveThirdParty log_request_speed_filter -syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout - -" Memc Module -" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands. -syn keyword ngxDirectiveThirdParty memc_buffer_size -syn keyword ngxDirectiveThirdParty memc_cmds_allowed -syn keyword ngxDirectiveThirdParty memc_connect_timeout -syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified -syn keyword ngxDirectiveThirdParty memc_next_upstream -syn keyword ngxDirectiveThirdParty memc_pass -syn keyword ngxDirectiveThirdParty memc_read_timeout -syn keyword ngxDirectiveThirdParty memc_send_timeout -syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout -syn keyword ngxDirectiveThirdParty memc_upstream_max_fails - -" Mogilefs Module -" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS. -syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout -syn keyword ngxDirectiveThirdParty mogilefs_domain -syn keyword ngxDirectiveThirdParty mogilefs_methods -syn keyword ngxDirectiveThirdParty mogilefs_noverify -syn keyword ngxDirectiveThirdParty mogilefs_pass -syn keyword ngxDirectiveThirdParty mogilefs_read_timeout -syn keyword ngxDirectiveThirdParty mogilefs_send_timeout -syn keyword ngxDirectiveThirdParty mogilefs_tracker - -" MP4 Streaming Lite Module -" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL. -syn keyword ngxDirectiveThirdParty mp4 - -" Nginx Notice Module -" Serve static file to POST requests. -syn keyword ngxDirectiveThirdParty notice -syn keyword ngxDirectiveThirdParty notice_type - -" Phusion Passenger -" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers. -syn keyword ngxDirectiveThirdParty passenger_base_uri -syn keyword ngxDirectiveThirdParty passenger_default_user -syn keyword ngxDirectiveThirdParty passenger_enabled -syn keyword ngxDirectiveThirdParty passenger_log_level -syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app -syn keyword ngxDirectiveThirdParty passenger_max_pool_size -syn keyword ngxDirectiveThirdParty passenger_pool_idle_time -syn keyword ngxDirectiveThirdParty passenger_root -syn keyword ngxDirectiveThirdParty passenger_ruby -syn keyword ngxDirectiveThirdParty passenger_use_global_queue -syn keyword ngxDirectiveThirdParty passenger_user_switching -syn keyword ngxDirectiveThirdParty rack_env -syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time -syn keyword ngxDirectiveThirdParty rails_env -syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time -syn keyword ngxDirectiveThirdParty rails_spawn_method - -" RDS JSON Module -" Help ngx_drizzle and other DBD modules emit JSON data. -syn keyword ngxDirectiveThirdParty rds_json -syn keyword ngxDirectiveThirdParty rds_json_content_type -syn keyword ngxDirectiveThirdParty rds_json_format -syn keyword ngxDirectiveThirdParty rds_json_ret - -" RRD Graph Module -" This module provides an HTTP interface to RRDtool's graphing facilities. -syn keyword ngxDirectiveThirdParty rrd_graph -syn keyword ngxDirectiveThirdParty rrd_graph_root - -" Secure Download -" Create expiring links. -syn keyword ngxDirectiveThirdParty secure_download -syn keyword ngxDirectiveThirdParty secure_download_fail_location -syn keyword ngxDirectiveThirdParty secure_download_path_mode -syn keyword ngxDirectiveThirdParty secure_download_secret - -" SlowFS Cache Module -" Module adding ability to cache static files. -syn keyword ngxDirectiveThirdParty slowfs_big_file_size -syn keyword ngxDirectiveThirdParty slowfs_cache -syn keyword ngxDirectiveThirdParty slowfs_cache_key -syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses -syn keyword ngxDirectiveThirdParty slowfs_cache_path -syn keyword ngxDirectiveThirdParty slowfs_cache_purge -syn keyword ngxDirectiveThirdParty slowfs_cache_valid -syn keyword ngxDirectiveThirdParty slowfs_temp_path - -" Strip Module -" Whitespace remover. -syn keyword ngxDirectiveThirdParty strip - -" Substitutions Module -" A filter module which can do both regular expression and fixed string substitutions on response bodies. -syn keyword ngxDirectiveThirdParty subs_filter -syn keyword ngxDirectiveThirdParty subs_filter_types - -" Supervisord Module -" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand. -syn keyword ngxDirectiveThirdParty supervisord -syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status -syn keyword ngxDirectiveThirdParty supervisord_name -syn keyword ngxDirectiveThirdParty supervisord_start -syn keyword ngxDirectiveThirdParty supervisord_stop - -" Upload Module -" Parses multipart/form-data allowing arbitrary handling of uploaded files. -syn keyword ngxDirectiveThirdParty upload_aggregate_form_field -syn keyword ngxDirectiveThirdParty upload_buffer_size -syn keyword ngxDirectiveThirdParty upload_cleanup -syn keyword ngxDirectiveThirdParty upload_limit_rate -syn keyword ngxDirectiveThirdParty upload_max_file_size -syn keyword ngxDirectiveThirdParty upload_max_output_body_len -syn keyword ngxDirectiveThirdParty upload_max_part_header_len -syn keyword ngxDirectiveThirdParty upload_pass -syn keyword ngxDirectiveThirdParty upload_pass_args -syn keyword ngxDirectiveThirdParty upload_pass_form_field -syn keyword ngxDirectiveThirdParty upload_set_form_field -syn keyword ngxDirectiveThirdParty upload_store -syn keyword ngxDirectiveThirdParty upload_store_access - -" Upload Progress Module -" Tracks and reports upload progress. -syn keyword ngxDirectiveThirdParty report_uploads -syn keyword ngxDirectiveThirdParty track_uploads -syn keyword ngxDirectiveThirdParty upload_progress -syn keyword ngxDirectiveThirdParty upload_progress_content_type -syn keyword ngxDirectiveThirdParty upload_progress_header -syn keyword ngxDirectiveThirdParty upload_progress_json_output -syn keyword ngxDirectiveThirdParty upload_progress_template - -" Upstream Fair Balancer -" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin. -syn keyword ngxDirectiveThirdParty fair -syn keyword ngxDirectiveThirdParty upstream_fair_shm_size - -" Upstream Consistent Hash -" Select backend based on Consistent hash ring. -syn keyword ngxDirectiveThirdParty consistent_hash - -" Upstream Hash Module -" Provides simple upstream load distribution by hashing a configurable variable. -syn keyword ngxDirectiveThirdParty hash -syn keyword ngxDirectiveThirdParty hash_again - -" XSS Module -" Native support for cross-site scripting (XSS) in an nginx. -syn keyword ngxDirectiveThirdParty xss_callback_arg -syn keyword ngxDirectiveThirdParty xss_get -syn keyword ngxDirectiveThirdParty xss_input_types -syn keyword ngxDirectiveThirdParty xss_output_type - -" uWSGI Module -" Allows Nginx to interact with uWSGI processes and control what parameters are passed to the process. -syn keyword ngxDirectiveThirdParty uwsgi_bind -syn keyword ngxDirectiveThirdParty uwsgi_buffer_size -syn keyword ngxDirectiveThirdParty uwsgi_buffering -syn keyword ngxDirectiveThirdParty uwsgi_buffers -syn keyword ngxDirectiveThirdParty uwsgi_busy_buffers_size -syn keyword ngxDirectiveThirdParty uwsgi_cache -syn keyword ngxDirectiveThirdParty uwsgi_cache_bypass -syn keyword ngxDirectiveThirdParty uwsgi_cache_key -syn keyword ngxDirectiveThirdParty uwsgi_cache_lock -syn keyword ngxDirectiveThirdParty uwsgi_cache_lock_timeout -syn keyword ngxDirectiveThirdParty uwsgi_cache_methods -syn keyword ngxDirectiveThirdParty uwsgi_cache_min_uses -syn keyword ngxDirectiveThirdParty uwsgi_cache_path -syn keyword ngxDirectiveThirdParty uwsgi_cache_use_stale -syn keyword ngxDirectiveThirdParty uwsgi_cache_valid -syn keyword ngxDirectiveThirdParty uwsgi_connect_timeout -syn keyword ngxDirectiveThirdParty uwsgi_hide_header -syn keyword ngxDirectiveThirdParty uwsgi_ignore_client_abort -syn keyword ngxDirectiveThirdParty uwsgi_ignore_headers -syn keyword ngxDirectiveThirdParty uwsgi_intercept_errors -syn keyword ngxDirectiveThirdParty uwsgi_max_temp_file_size -syn keyword ngxDirectiveThirdParty uwsgi_modifier1 -syn keyword ngxDirectiveThirdParty uwsgi_modifier2 -syn keyword ngxDirectiveThirdParty uwsgi_next_upstream -syn keyword ngxDirectiveThirdParty uwsgi_no_cache -syn keyword ngxDirectiveThirdParty uwsgi_param -syn keyword ngxDirectiveThirdParty uwsgi_pass -syn keyword ngxDirectiveThirdParty uwsgi_pass_header -syn keyword ngxDirectiveThirdParty uwsgi_pass_request_body -syn keyword ngxDirectiveThirdParty uwsgi_pass_request_headers -syn keyword ngxDirectiveThirdParty uwsgi_read_timeout -syn keyword ngxDirectiveThirdParty uwsgi_send_timeout -syn keyword ngxDirectiveThirdParty uwsgi_store -syn keyword ngxDirectiveThirdParty uwsgi_store_access -syn keyword ngxDirectiveThirdParty uwsgi_string -syn keyword ngxDirectiveThirdParty uwsgi_temp_file_write_size -syn keyword ngxDirectiveThirdParty uwsgi_temp_path - -" highlight - -hi link ngxComment Comment -hi link ngxVariable Identifier -hi link ngxVariableBlock Identifier -hi link ngxVariableString PreProc -hi link ngxBlock Normal -hi link ngxString String - -hi link ngxBoolean Boolean -hi link ngxDirectiveBlock Statement -hi link ngxDirectiveImportant Type -hi link ngxDirectiveControl Keyword -hi link ngxDirectiveError Constant -hi link ngxDirectiveDeprecated Error -hi link ngxDirective Identifier -hi link ngxDirectiveThirdParty Special - -let b:current_syntax = "nginx" diff --git a/vim/bundle/puppet/README.md b/vim/bundle/puppet/README.md deleted file mode 100644 index bec8ffc..0000000 --- a/vim/bundle/puppet/README.md +++ /dev/null @@ -1,38 +0,0 @@ -vim-puppet -========== - -Make vim more Puppet friendly! - -Provides --------- - - * Formatting based on the latest Puppetlabs Style Guide - * Syntax highlighting - * Automatic => alignment (when the [tabular](https://github.com/godlygeek/tabular) plugin is also installed) - * If you don't like that, add `let g:puppet_align_hashes = 0` to your vimrc. - * Doesn't require a bloated JRE - * Doesn't take minutes to open - -Additional useful plugins -------------------------- - - * [syntastic](https://github.com/scrooloose/syntastic) plugin for automatic - syntax checking while in vim. - * [vim-snippets](https://github.com/honza/vim-snippets) is a library of - snippets for multiple languages, including Puppet. Works with both - [snipmate](https://github.com/garbas/vim-snipmate) and - [ultisnips](https://github.com/SirVer/ultisnips). - -Installation ------------- - -If you're using [pathogen](https://github.com/tpope/vim-pathogen) to manage your vim modules (and if you're not, why -aren't you), you can simply add this as a submodule in your `~/.vim/bundle/` -directory. - -My entire home directory is a git repository, so for me it's simply a case of - - $ git submodule add -f git://github.com/rodjek/vim-puppet.git .vim/bundle/puppet - -If you're not using pathogen, you can just manually place the files in the -appropriate places under `~/.vim/` diff --git a/vim/bundle/puppet/after/ftplugin/puppet.vim b/vim/bundle/puppet/after/ftplugin/puppet.vim deleted file mode 100644 index f976a45..0000000 --- a/vim/bundle/puppet/after/ftplugin/puppet.vim +++ /dev/null @@ -1,16 +0,0 @@ -if !exists('g:puppet_align_hashes') - let g:puppet_align_hashes = 1 -endif - -if g:puppet_align_hashes && exists(':Tabularize') - inoremap > >:call puppetalign()a - function! s:puppetalign() - let p = '^\s*\w+\s*[=+]>.*$' - let column = strlen(substitute(getline('.')[0:col('.')],'\([^=]\|=[^>]\)','','g')) - let position = strlen(matchstr(getline('.')[0:col('.')],'.*=>\s*\zs.*')) - Tabularize /=>/l1 - normal! 0 - echo repeat('\([^=]\|=[^>]\)*=>',column).'\s\{-\}'.repeat('.',position) - call search(repeat('\([^=]\|=[^>]\)*=>',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) - endfunction -endif diff --git a/vim/bundle/puppet/ftdetect/puppet.vim b/vim/bundle/puppet/ftdetect/puppet.vim deleted file mode 100644 index dc87505..0000000 --- a/vim/bundle/puppet/ftdetect/puppet.vim +++ /dev/null @@ -1,2 +0,0 @@ -au! BufRead,BufNewFile *.pp setfiletype puppet -au! BufRead,BufNewFile Puppetfile setfiletype ruby diff --git a/vim/bundle/puppet/ftplugin/puppet.vim b/vim/bundle/puppet/ftplugin/puppet.vim deleted file mode 100644 index 175ac12..0000000 --- a/vim/bundle/puppet/ftplugin/puppet.vim +++ /dev/null @@ -1,6 +0,0 @@ -setl ts=2 -setl sts=2 -setl sw=2 -setl et -setl keywordprg=puppet\ describe\ --providers -setl iskeyword=-,:,@,48-57,_,192-255 diff --git a/vim/bundle/puppet/indent/puppet.vim b/vim/bundle/puppet/indent/puppet.vim deleted file mode 100644 index cf49de8..0000000 --- a/vim/bundle/puppet/indent/puppet.vim +++ /dev/null @@ -1,94 +0,0 @@ -" Vim indent file -" Language: Puppet -" Maintainer: Todd Zullinger -" Last Change: 2009 Aug 19 -" vim: set sw=4 sts=4: - -if exists("b:did_indent") - finish -endif -let b:did_indent = 1 - -setlocal autoindent smartindent -setlocal indentexpr=GetPuppetIndent() -setlocal indentkeys+=0],0) - -if exists("*GetPuppetIndent") - finish -endif - -" Check if a line is part of an include 'block', e.g.: -" include foo, -" bar, -" baz -function! s:PartOfInclude(lnum) - let lnum = a:lnum - while lnum - let lnum = lnum - 1 - let line = getline(lnum) - if line !~ ',$' - break - endif - if line =~ '^\s*include\s\+[^,]\+,$' - return 1 - endif - endwhile - return 0 -endfunction - -function! s:OpenBrace(lnum) - call cursor(a:lnum, 1) - return searchpair('{\|\[\|(', '', '}\|\]\|)', 'nbW') -endfunction - -function! GetPuppetIndent() - let pnum = prevnonblank(v:lnum - 1) - if pnum == 0 - return 0 - endif - - let line = getline(v:lnum) - let pline = getline(pnum) - let ind = indent(pnum) - - if pline =~ '^\s*#' - return ind - endif - - if pline =~ '\({\|\[\|(\|:\)$' - let ind += &sw - elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*' - let ind -= &sw - elseif pline =~ '^\s*include\s\+.*,$' - let ind += &sw - endif - - if pline !~ ',$' && s:PartOfInclude(pnum) - let ind -= &sw - endif - - " Match } }, }; ] ]: ], ]; ) - if line =~ '^\s*\(}\(,\|;\)\?$\|]:\|],\|}]\|];\?$\|)\)' - let ind = indent(s:OpenBrace(v:lnum)) - endif - - " Don't actually shift over for } else { - if line =~ '^\s*}\s*els\(e\|if\).*{\s*$' - let ind -= &sw - endif - - " Don't indent resources that are one after another with a ->(ordering arrow) - " file {'somefile': - " ... - " } -> - " - " package { 'mycoolpackage': - " ... - " } - if line =~ '->$' - let ind -= &sw - endif - - - return ind -endfunction diff --git a/vim/bundle/puppet/syntax/puppet.vim b/vim/bundle/puppet/syntax/puppet.vim deleted file mode 100644 index a979aca..0000000 --- a/vim/bundle/puppet/syntax/puppet.vim +++ /dev/null @@ -1,166 +0,0 @@ -" puppet syntax file -" Filename: puppet.vim -" Language: puppet configuration file -" Maintainer: Luke Kanies -" URL: -" Last Change: -" Version: -" - -" Copied from the cfengine, ruby, and perl syntax files -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -" match class/definition/node declarations -syn region puppetDefine start="^\s*\(class\|define\|node\)\s" end="{" contains=puppetDefType,puppetDefName,puppetDefArguments,puppetNodeRe,@NoSpell -syn keyword puppetDefType class define node inherits contained -syn region puppetDefArguments start="(" end=")" contained contains=puppetArgument,puppetString,puppetComment,puppetMultilineComment -syn match puppetArgument "\w\+" contained -syn match puppetArgument "\$\w\+" contained -syn match puppetArgument "'[^']+'" contained -syn match puppetArgument '"[^"]+"' contained -syn match puppetDefName "\w\+" contained -syn match puppetNodeRe "/.*/" contained - -" match 'foo' in 'class foo { ...' -" match 'foo::bar' in 'class foo::bar { ...' -" match 'Foo::Bar' in 'Foo::Bar["..."] -"FIXME: "Foo-bar" doesn't get highlighted as expected, although "foo-bar" does. -syn match puppetInstance "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)*\s*{" contains=puppetTypeName,puppetTypeDefault,@NoSpell -syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*[[{]" contains=puppetTypeName,puppetTypeDefault,@NoSpell -syn match puppetInstance "[A-Z][a-z_-]\+\(::[A-Z][a-z_-]\+\)*\s*<\?<|" contains=puppetTypeName,puppetTypeDefault,@NoSpell -syn match puppetTypeName "[a-z]\w*" contained -syn match puppetTypeDefault "[A-Z]\w*" contained - -syn match puppetParam "\w\+\s*\(=\|+\)>" contains=puppetTypeRArrow,puppetParamName -syn match puppetParamRArrow "\(=\|+\)>" contained -syn match puppetParamName "\w\+" contained contains=@NoSpell -syn match puppetVariable "$\(\(\(::\)\?\w\+\)\+\|{\(\(::\)\?\w\+\)\+}\)" -syn match puppetParen "(" -syn match puppetParen ")" -syn match puppetBrace "{" -syn match puppetBrace "}" -syn match puppetBrack "\[" -syn match puppetBrack "\]" -syn match puppetBrack "<|" -syn match puppetBrack "|>" - -" match 'present' in 'ensure => present' -" match '2755' in 'mode => 2755' -" don't match 'bar' in 'foo => bar' -syn match puppetParam "\w\+\s*[=+]>\s*[a-z0-9]\+" contains=puppetParamString,puppetParamName -syn match puppetParamString "[=+]>\s*\w\+" contains=puppetParamKeyword,puppetParamSpecial,puppetParamDigits contained -syn keyword puppetParamKeyword present absent purged latest installed running stopped mounted unmounted role configured file directory link contained -syn keyword puppetParamSpecial true false undef contained -syn match puppetParamDigits "[0-9]\+" - -" match 'template' in 'content => template("...")' -syn match puppetParam "\w\+\s*[=+]>\s*\w\+\s*(" contains=puppetFunction,puppetParamName -" statements -syn region puppetFunction start="^\s*\(alert\|crit\|debug\|emerg\|err\|fail\|include\|info\|notice\|realize\|require\|search\|tag\|warning\)\s*(" end=")" contained contains=puppetString -" rvalues -syn region puppetFunction start="^\s*\(defined\|file\|fqdn_rand\|generate\|inline_template\|regsubst\|sha1\|shellquote\|split\|sprintf\|tagged\|template\|versioncmp\)\s*(" end=")" contained contains=puppetString - -syn match puppetVariable "$[a-zA-Z0-9_:]\+" contains=@NoSpell -syn match puppetVariable "${[a-zA-Z0-9_:]\+}" contains=@NoSpell - -" match anything between simple/double quotes. -" don't match variables if preceded by a backslash. -syn region puppetString start=+'+ skip=+\\\\\|\\'+ end=+'+ -syn region puppetString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=puppetVariable,puppetNotVariable -syn match puppetNotVariable "\\$\w\+" contained -syn match puppetNotVariable "\\${\w\+}" contained - -syn keyword puppetKeyword import inherits include require contains -syn keyword puppetControl case default if else elsif -syn keyword puppetSpecial true false undef - -syn match puppetClass "[A-Za-z0-9_-]\+\(::[A-Za-z0-9_-]\+\)\+" contains=@NoSpell - -" Match the Regular Expression type -" XXX: Puppet does not currently support a few features available in the -" full Ruby Regexp class, namely, interpolation, lookbehind and named -" sub-expressions. Matches for these features are included in the -" commented-out versions of puppetRegexParen and puppetRegexSubName, -" plus the supporting groups puppetRegexAngBrack and puppetRegexTick. -syn region puppetRegex start="/" skip="\\/" end="/" contains=puppetRegexParen,puppetRegexBrace,puppetRegexOrpuppetRegexBrack,puppetRegexComment -syn match puppetRegexParen "(\(?\([imx]\{0,4}:\|[=!]\)\)\?" contains=puppetRegexSpecChar,puppetRegexSubName contained -"syn match puppetRegexParen "(\(?\([imxo]\{0,4}:\|['<][[:alnum:]]\+[>']\|" contained -"syn match puppetRegexTick +'+ contained -syn match puppetRegexOr "|" contained -"syn match puppetRegexSubName "['<][[:alnum:]]\+[>']" contains=puppetRegexAngBrack,puppetRegexTick contained -syn match puppetRegexSpecialChar "[?:imx]\|\(= 508 || !exists("did_puppet_syn_inits") - if version < 508 - let did_puppet_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink puppetVariable Identifier - HiLink puppetType Identifier - HiLink puppetKeyword Keyword - HiLink puppetComment Comment - HiLink puppetMultilineComment Comment - HiLink puppetString String - HiLink puppetRegex Constant - HiLink puppetRegexParen Delimiter - HiLink puppetRegexBrace Delimiter - HiLink puppetRegexBrack Delimiter - HiLink puppetRegexAngBrack Delimiter - HiLink puppetRegexTick Delimiter - HiLink puppetRegexOr Delimiter - HiLink puppetRegexSubName Identifier - HiLink puppetRegexSpecChar SpecialChar - HiLink puppetRegexComment Comment - HiLink puppetParamKeyword Keyword - HiLink puppetParamDigits String - HiLink puppetNotVariable String - HiLink puppetParamSpecial Boolean - HiLink puppetSpecial Special - HiLink puppetTodo Todo - HiLink puppetBrack Delimiter - HiLink puppetTypeBrack Delimiter - HiLink puppetBrace Delimiter - HiLink puppetTypeBrace Delimiter - HiLink puppetParen Delimiter - HiLink puppetDelimiter Delimiter - HiLink puppetControl Statement - HiLink puppetDefType Define - HiLink puppetDefName Type - HiLink puppetNodeRe Type - HiLink puppetTypeName Statement - HiLink puppetTypeDefault Type - HiLink puppetParamName Identifier - HiLink puppetArgument Identifier - HiLink puppetFunction Function - HiLink puppetClass Include - - delcommand HiLink -endif - -let b:current_syntax = "puppet" diff --git a/vim/bundle/scss-syntax/Readme.md b/vim/bundle/scss-syntax/Readme.md deleted file mode 100644 index 5f811e6..0000000 --- a/vim/bundle/scss-syntax/Readme.md +++ /dev/null @@ -1,20 +0,0 @@ -# Vim Syntax File for SCSS (Sassy CSS) - -## Installation - -I recommend to use a plugin manager like [Vundle](https://github.com/gmarik/vundle) for the installation. - -### Vundle - -Open your `~/.vimrc` file and add the following line: - -``` -Bundle 'cakebaker/scss-syntax.vim' -``` - -Afterwards, run `:BundleInstall` in Vim. - -### Manual - -* [Download](https://github.com/cakebaker/scss-syntax.vim/archive/master.zip) the files -* Copy the content of the folders to the respective folders in `~/.vim/` diff --git a/vim/bundle/scss-syntax/autoload/scss_indent.vim b/vim/bundle/scss-syntax/autoload/scss_indent.vim deleted file mode 100644 index 2e57ab2..0000000 --- a/vim/bundle/scss-syntax/autoload/scss_indent.vim +++ /dev/null @@ -1,37 +0,0 @@ -" usage: -" set indentexpr=scss_indent#GetIndent(v:lnum) -fun! scss_indent#GetIndent(lnum) - " { -> increase indent - " } -> decrease indent - if a:lnum == 1 - " start at 0 indentation - return 0 - endif - - " try to find last line ending with { or } - " ignoring // comments - let regex = '\([{}]\)\%(\/\/.*\)\?$' - let nr = search(regex, 'bnW') - if nr > 0 - let last = indent(nr) - let m = matchlist(getline(nr), regex) - let m_curr = matchlist(getline(a:lnum), regex) - echoe string(m).string(m_curr) - if !empty(m_curr) && m_curr[1] == '}' && m[1] == '{' - " last was open, current is close, use same indent - return last - elseif !empty(m_curr) && m_curr[1] == '}' && m[1] == '}' - " } line and last line was }: decrease - return last - &sw - endif - if m[1] == '{' - " line after {: increase indent - return last + &sw - else - " line after } or { - same indent - return last - endif - else - return 0 - endif -endfun diff --git a/vim/bundle/scss-syntax/example.scss b/vim/bundle/scss-syntax/example.scss deleted file mode 100644 index 5b08ded..0000000 --- a/vim/bundle/scss-syntax/example.scss +++ /dev/null @@ -1,720 +0,0 @@ -// Nested Rules - -#main p { - color: #00ff00; - width: 97%; - - #hello { - background-color: blue; - } - - .redbox { - background-color: #ff0000; - color: #000000; - } -} - -#main { - width: 97%; - - p, div { - font-size: 2em; - a { font-weight: bold; } - } - - pre { font-size: 3em; } -} - -// Referencing Parent Selectors: & - -a { - font-weight: bold; - text-decoration: none; - &:hover { text-decoration: underline; } - body.firefox & { font-weight: normal; } -} - -#main { - color: black; - a { - font-weight: bold; - &:hover { color: red; } - } -} - -// Nested Properties - -.funky { - font: { - family: fantasy; - size: 30em; - weight: bold; - } -} - -.funky { - font: 2px/3px { - family: fantasy; - size: 30em; - weight: bold; - } -} - -// Comments: /* */ and // - -/* This comment is - * several lines long. - * since it uses the CSS comment syntax, - * it will appear in the CSS output */ -body { color: black; } - -// These comments are only one line long each. -// They won't appear in the CSS output, -// since they use the single-line comment syntax. -a { color: green; } - -a { - color: green; // a comment after an assignment -} - -.foo { - color: green; // issue #3: a comment ending with {} -} - -// Variables: $ - -$width: 5em; // another comment - -#main { - width: $width; -} - -// Data Types: Strings - -@mixin firefox-message($selector) { - body.firefox #{$selector}:before { - content: "Hi, Firefox users!"; - } -} - -@include firefox-message(".header"); - -// Number Operations - -p { - width: 1in + 8pt; -} - -p { - font: 10px/8px; - $width: 1000px; - width: $width/2; - height: (500px/2); - margin-left: 5px + 8px/2px; -} - -p { - $font-size: 12px; - $line-height: 30px; - font: #{$font-size}/#{$line-height}; -} - -// Color Operations - -p { - color: #010203 + #040506; -} - -p { - color: #010203 * 2; -} - -p { - color: rgba(255, 0, 0, 0.75) + rgba(0, 255, 0, 0.75); -} - -$translucent-red: rgba(255, 0, 0, 0.5); -p { - color: opacify($translucent-red, 0.3); - background-color: transparentize($translucent-red, 0.25); -} - -// String Operations - -p { - cursor: e + -resize; -} - -p:before { - content: "Foo " + Bar; - font-family: sans- + "serif"; -} - -p { - margin: 3px + 4px auto; -} - -p:before { - content: "I ate #{5 + 10} pies!"; -} - -$value: null; -p:before { - content: "I ate #{$value} pies!"; -} - -// Parentheses - -p { - width: 1em + (2em * 3); -} - -// Functions - -p { - color: hsl(0, 100%, 50%); -} - -// Keyword Arguments - -p { - color: hsl($hue: 0, $saturation: 100%, $lightness: 50%); -} - -// Interpolation: #{} - -$name: foo; -$attr: border; -p.#{$name} { - #{$attr}-color: blue; -} - -p { - $font-size: 12px; - $line-height: 30px; - font: #{$font-size}/#{$line-height}; -} - -// Variable Defaults: !default - -$content: "First content"; -$content: "Second content?" !default; -$new_content: "First time reference" !default; - -#main { - content: $content; - new-content: $new_content; -} - -$content: null; -$content: "Non-null content" !default; - -#main { - content: $content; -} - -// @import - -@import "foo.scss"; -@import "foo"; - -@import "foo.css"; -@import "foo" screen; -@import "http://foo.com/bar"; -@import url(foo); - -@import "rounded-corners", "text-shadow"; - -$family: unquote("Droid+Sans"); -@import url("http://fonts.googleapis.com/css?family=#{$family}"); - -// Partials - -@import "colors"; - -// Nested @import - -.example { - color: red; -} - -#main { - @import "example"; -} - -// @media - -.sidebar { - width: 300px; - @media screen and (orientation: landscape) { - width: 500px; - } -} - -@media screen { - .sidebar { - @media (orientation: landscape) { - width: 500px; - } - } -} - -$media: screen; -$feature: -webkit-min-device-pixel-ratio; -$value: 1.5; - -@media #{$media} and ($feature: $value) { - .sidebar { - width: 500px; - } -} - -// @extend - -.error { - border: 1px #f00; - background-color: #fdd; -} -.seriousError { - @extend .error; - border-width: 3px; -} - -.error { - border: 1px #f00; - background-color: #fdd; -} -.error.intrusion { - background-image: url("/image/hacked.png"); -} -.seriousError { - @extend .error; - border-width: 3px; -} - -// Extending Complex Selectors - -.hoverlink { - @extend a:hover; -} -a:hover { - text-decoration: underline; -} - -.hoverlink { - @extend a:hover; -} -.comment a.user:hover { - font-weight: bold; -} - -// Multiple Extends - -.error { - border: 1px #f00; - background-color: #fdd; -} -.attention { - font-size: 3em; - background-color: #ff0; -} -.seriousError { - @extend .error; - @extend .attention; - border-width: 3px; -} - -// Chaining Extends - -.error { - border: 1px #f00; - background-color: #fdd; -} -.seriousError { - @extend .error; - border-width: 3px; -} -.criticalError { - @extend .seriousError; - position: fixed; - top: 10%; - bottom: 10%; - left: 10%; - right: 10%; -} - -// Selector Sequences - -#fake-links .link { - @extend a; -} - -a { - color: blue; - &:hover { - text-decoration: underline; - } -} - -// Merging Selector Sequences - -#admin .tabbar a { - font-weight: bold; -} -#demo .overview .fakelink { - @extend a; -} - -#admin .tabbar a { - font-weight: bold; -} -#admin .overview .fakelink { - @extend a; -} - -// @extend-Only Selectors - -#context a%extreme { - color: blue; - font-weight: bold; - font-size: 2em; -} - -.notice { - @extend %extreme; -} - -// The !optional Flag - -a.important { - @extend .notice !optional; -} - -// @extend in Directives - -@media print { - .error { - border: 1px #f00; - background-color: #fdd; - } - .seriousError { - @extend .error; - border-width: 3px; - } -} - -// @debug - -@debug 10em + 12em; - -// @warn - -@mixin adjust-location($x, $y) { - @if unitless($x) { - @warn "Assuming #{$x} to be in pixels"; - $x: 1px * $x; - } - @if unitless($y) { - @warn "Assuming #{$y} to be in pixels"; - $y: 1px * $y; - } - position: relative; left: $x; top: $y; -} - -// @if - -p { - @if 1 + 1 == 2 { border: 1px solid; } - @if 5 < 3 { border: 2px dotted; } - @if null { border: 3px double; } -} - -$type: monster; -p { - @if $type == ocean { - color: blue; - } @else if $type == matador { - color: red; - } @else if $type == monster { - color: green; - } @else { - color: black; - } -} - -// @for - -@for $i from 1 through 3 { - .item-#{$1} { width: 2em * $i; } -} - -@for $i from 1 to 3 { - .item-#{$1} { width: 2em * $i; } -} - -// @each - -@each $animal in puma, sea-slug, egret, salamander { - .#{$animal}-icon { - background-image: url('/images/#{$animal}.png'); - } -} - -// @while - -$i: 6; -@while $1 > 0 { - .item-#{$i} { width: 2em * $i; } - $i: $1 - 2; -} - -// Defining a Mixin: @mixin - -@mixin large-text { - font: { - family: Arial; - size: 20px; - weight: bold; - } - color: #ff0000; -} - -@mixin clearfix { - display: inline-block; - &:after { - content: "."; - display: block; - height: 0; - clear: both; - visibility: hidden; - } - * html & { height: 1px } -} - -// Including a Mixin: @include - -.page-title { - @include large-text; - padding: 4px; - margin-top: 10px; -} - -@mixin silly-links { - a { - color: blue; - background-color: red; - } -} - -@include silly-links; - -@mixin compound { - @include highlighted-background; - @include header-text; -} - -@mixin highlighted-background { background-color: #fc0; } -@mixin header-text { font-size: 20px; } - -// Arguments - -@mixin sexy-border($color, $width) { - border: { - color: $color; - width: $width; - style: dashed; - } -} - -p { @include sexy-border(blue, 1in); } - -@mixin sexy-border($color, $width: 1in) { - border: { - color: $color; - width: $width; - style: dashed; - } -} -p { @include sexy-border(blue); } -h1 { @include sexy-border(blue, 2in); } - -// Keyword Arguments - -p { @include sexy-border($color: blue); } -h1 { @include sexy-border($color: blue, $width: 2in); } - -// Variable Arguments - -@mixin box-shadows($shadows...) { - -moz-box-shadow: $shadows; - -webkit-box-shadow: $shadows; - box-shadow: $shadows; -} - -.shadows { - @include box-shadow(0px 4px 5px #666, 2px 6px 10px #999); -} - -@mixin colors($text, $background, $border) { - color: $text; - background-color: $background; - border-color: $border; -} - -$values: #ff0000, #00ff00, #0000ff; -.primary { - @include colors($values...); -} - -@mixin wrapped-stylish-mixin($args...) { - font-weight: bold; - @include stylish-mixin($args...); -} - -.stylish { - // The $width argument will get passed on to "stylish-mixin" as a keyword - @include wrapped-stylish-mixin(#00ff00, $width: 100px); -} - -// Passing Content Blocks to a Mixin - -@mixin apply-to-ie6-only { - * html { - @content; - } -} -@include apply-to-ie6-only { - #logo { - background-image: url(/logo.gif); - } -} - -// Variable Scope and Content Blocks - -$color: white; -@mixin colors($color: blue) { - background-color: $color; - @content; - border-color: $color; -} -.colors { - @include colors { color: $color; } -} - -#sidebar { - $sidebar-width: 300px; - width: $sidebar-width; - @include smartphone { - width: $sidebar-width / 3; - } -} - -// Function Directives - -$grid-width: 40px; -$gutter-width: 10px; - -@function grid-width($n) { - @return $n * $grid-width + ($n - 1) * $gutter-width; -} - -#sidebar { width: grid-width(5); } -#sidebar { width: grid-width($n: 5); } - -// TODO: todo should be highlighted, ticket #21 -/* TODO: same here */ - -@import url(http://fonts.googleapis.com/css?family=Vollkorn); // the // in the url shouldn't be highlighted as comment, ticket #24 - -// Styles which were not highlighted correctly in the past - -// Attribute selectors should get highlighted for parent references. -input { - &[type="text"] { } // <-- This should look the same as... -} -input[type="text"] { } // <-- this. - -$a: $b + $c; // issue #4: variables should be displayed with the same color - -@include text-shadow; // issue #23, @include content block - -@include breakpoint( $bp-default ) { - display: inline-block; -} - -.app-header { // issue #31, functions with hyphens not properly highlighted - @include linear-gradient(gray-with-lightness(0.94), #FFF 90%); - border-bottom: 1px solid gray-with-lightness(0.95); -} - -.breadcrumb:before { // issue #20, string escaping rendering incorrectly for "\\" - content: "\\"; -} - -@import "icons/*.png"; // issue #14, don't treat "/*" as the start of a comment - -.foo { // issue #5, lines without {} colored incorrectly - label.due input[type=text] - { - padding-right: 25px; - } -} - -.funky { // comments after nested properties should be recognized - font: { - family: fantasy; // a comment - size: 30em; /* another comment */ - weight: bold; - } -} - -.container { // issue #33, multiline comments are not recognized as comments - /*height: auto !important; - min-height: 100%;*/ - background: #fff; -} - -.button { // issue #34, functions as params should be recognized as functions - background-image: -webkit-linear-gradient(top, bottom, from(#933), to(#944)); -} - -.class { // issue #35 a) media block is not recognized - @media screen and (min-width: em(480)) { - a { - @extend .clearfix; - } - } -} - -.class { - div { - a { - @extend .clearfix; - } - } -} - -@media screen and (min-width: em(480)) { - a { - @extend .clearfix; - } -} - -.class { // issue #35 b) @extend & @include are not recognized inside media block - @media screen and (min-width: em(480)) { - @extend .clearfix; - @include header-text; - } -} - -div { - height: 10px; -} - -div { - a: 10px; -} - -div { - foo: 10px; -} diff --git a/vim/bundle/scss-syntax/ftdetect/scss.vim b/vim/bundle/scss-syntax/ftdetect/scss.vim deleted file mode 100644 index 67afaaa..0000000 --- a/vim/bundle/scss-syntax/ftdetect/scss.vim +++ /dev/null @@ -1,2 +0,0 @@ -au BufRead,BufNewFile *.scss set filetype=scss.css -au BufEnter *.scss :syntax sync fromstart diff --git a/vim/bundle/scss-syntax/ftplugin/scss.vim b/vim/bundle/scss-syntax/ftplugin/scss.vim deleted file mode 100644 index 8e72e90..0000000 --- a/vim/bundle/scss-syntax/ftplugin/scss.vim +++ /dev/null @@ -1,10 +0,0 @@ -if exists('b:did_indent') && b:did_indent - " be kind. allow users to override this. Does it work? - finish -endif - -setlocal indentexpr=scss_indent#GetIndent(v:lnum) - -" Automatically insert the current comment leader after hitting -" in Insert mode respectively after hitting 'o' or 'O' in Normal mode -setlocal formatoptions+=ro diff --git a/vim/bundle/scss-syntax/plugin-info.txt b/vim/bundle/scss-syntax/plugin-info.txt deleted file mode 100644 index 4162181..0000000 --- a/vim/bundle/scss-syntax/plugin-info.txt +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name" : "scss-syntax.vim", - "version" : "dev", - "author" : "Daniel Hofstetter ", - "repository" : {"type": "git", "url": "git://github.com/cakebaker/scss-syntax.vim.git"}, - "dependencies" : {}, - "description" : "Vim syntax file for scss (Sassy CSS)" -} diff --git a/vim/bundle/scss-syntax/syntax/scss.vim b/vim/bundle/scss-syntax/syntax/scss.vim deleted file mode 100644 index 48f91bb..0000000 --- a/vim/bundle/scss-syntax/syntax/scss.vim +++ /dev/null @@ -1,182 +0,0 @@ -" Vim syntax file -" Language: SCSS (Sassy CSS) -" Author: Daniel Hofstetter (daniel.hofstetter@42dh.com) -" URL: https://github.com/cakebaker/scss-syntax.vim -" Last Change: 2013-12-26 -" Inspired by the syntax files for sass and css. Thanks to the authors of -" those files! - -if !exists("main_syntax") - if exists("b:current_syntax") - finish - endif - let main_syntax = 'scss' -endif - -runtime! syntax/css.vim -runtime! syntax/css/*.vim - -syn case ignore - -" XXX fix for #20, can be removed once the patch is in vim's css.vim -syn match cssSpecialCharQQ +\\\\\|\\"+ contained -syn match cssSpecialCharQ +\\\\\|\\'+ contained - -syn region scssDefinition matchgroup=cssBraces start='{' end='}' contains=cssComment,cssInclude,scssComment,scssDefinition,scssProperty,scssSelector,scssVariable,scssImport,scssExtend,scssInclude,@scssControl,scssWarn containedin=cssMediaBlock - -syn match scssSelector "^\s*\zs\([^:@]\|:[^ ]\)\+{\@=" contained contains=@scssSelectors -syn match scssSelector "^\s*\zs\([^:@{]\|:[^ ]\)\+\_$" contained contains=@scssSelectors -syn cluster scssSelectors contains=cssTagName,cssPseudoClass,cssAttributeSelector,scssSelectorChar,scssAmpersand,scssInterpolation - -syn match scssProperty "\([[:alnum:]-]\)\+\s*\(: \)\@=" contained contains=css.*Prop,cssVendor containedin=cssMediaBlock nextgroup=scssAttribute,scssAttributeWithNestedDefinition -syn match scssAttribute ":[^;]*;" contained contains=css.*Attr,cssValue.*,cssColor,cssFunction,cssString.*,cssURL,scssFunction,scssInterpolation,scssVariable - -syn match scssAttributeWithNestedDefinition ": [^#]*{\@=" nextgroup=scssNestedDefinition contained contains=cssValue.*,scssVariable -syn region scssNestedDefinition matchgroup=cssBraces start="{" end="}" contained contains=cssComment,scssComment,scssProperty,scssNestedProperty - -" CSS properties from https://developer.mozilla.org/en-US/docs/Web/CSS/Reference -" align -syn keyword scssNestedProperty contained content items self nextgroup=scssAttribute -" animation -syn keyword scssNestedProperty contained delay direction duration fill-mode iteration-count name play-state timing-function nextgroup=scssAttribute -" background -syn keyword scssNestedProperty contained attachment clip color image origin position repeat size nextgroup=scssAttribute -" border -syn keyword scssNestedProperty contained bottom bottom-color bottom-left-radius bottom-right-radius bottom-style bottom-width nextgroup=scssAttribute -syn keyword scssNestedProperty contained collapse color nextgroup=scssAttribute -syn keyword scssNestedProperty contained image image-outset image-repeat image-slice image-source image-width nextgroup=scssAttribute -syn keyword scssNestedProperty contained left left-color left-style left-width nextgroup=scssAttribute -syn keyword scssNestedProperty contained radius nextgroup=scssAttribute -syn keyword scssNestedProperty contained right right-color right-style right-width nextgroup=scssAttribute -syn keyword scssNestedProperty contained spacing style nextgroup=scssAttribute -syn keyword scssNestedProperty contained top top-color top-left-radius top-right-radius top-style top-width nextgroup=scssAttribute -syn keyword scssNestedProperty contained width nextgroup=scssAttribute -" box -syn keyword scssNestedProperty contained decoration-break shadow sizing nextgroup=scssAttribute -" break -syn keyword scssNestedProperty contained after before inside nextgroup=scssAttribute -" column -syn keyword scssNestedProperty contained count fill gap rule rule-color rule-style rule-width span width nextgroup=scssAttribute -" counter -syn keyword scssNestedProperty contained increment reset nextgroup=scssAttribute -" flex -syn keyword scssNestedProperty contained basis direction flow grow shrink wrap nextgroup=scssAttribute -" font -syn keyword scssNestedProperty contained family feature-settings kerning language-override size size-adjust stretch style synthesis nextgroup=scssAttribute -syn keyword scssNestedProperty contained variant variant-alternates variant-caps variant-east-asian variant-ligatures variant-numeric variant-position nextgroup=scssAttribute -syn keyword scssNestedProperty contained weight nextgroup=scssAttribute -" image -syn keyword scssNestedProperty contained rendering resolution orientation nextgroup=scssAttribute -" list -syn keyword scssNestedProperty contained style style-image style-position style-type nextgroup=scssAttribute -" margin/padding -syn keyword scssNestedProperty contained bottom left right top nextgroup=scssAttribute -" max/min -syn keyword scssNestedProperty contained height width nextgroup=scssAttribute -" nav -syn keyword scssNestedProperty contained down index left right up nextgroup=scssAttribute -" object -syn keyword scssNestedProperty contained fit position nextgroup=scssAttribute -" outline -syn keyword scssNestedProperty contained color offset style width nextgroup=scssAttribute -" overflow -syn keyword scssNestedProperty contained wrap x y nextgroup=scssAttribute -" page -syn keyword scssNestedProperty contained break-after break-before break-inside nextgroup=scssAttribute -" text -syn keyword scssNestedProperty contained align align-last combine-horizontal nextgroup=scssAttribute -syn keyword scssNestedProperty contained decoration decoration-color decoration-line decoration-style nextgroup=scssAttribute -syn keyword scssNestedProperty contained indent orientation overflow rendering shadow transform underline-position nextgroup=scssAttribute -" transform -syn keyword scssNestedProperty contained origin style nextgroup=scssAttribute -" transition -syn keyword scssNestedProperty contained delay duration property timing-function nextgroup=scssAttribute -" unicode -syn keyword scssNestedProperty contained bidi range nextgroup=scssAttribute -" word -syn keyword scssNestedProperty contained break spacing wrap nextgroup=scssAttribute - -syn region scssInterpolation matchgroup=scssInterpolationDelimiter start="#{" end="}" contains=cssValue.*,cssColor,cssString.*,scssFunction,scssVariable containedin=cssString.*,cssURL,scssFunction - -" ignores the url() function so it can be handled by css.vim -syn region scssFunction contained matchgroup=scssFunctionName start="\<\(url(\)\@!\([[:alnum:]-]\)\+\s*(" end=")" oneline keepend extend containedin=cssMediaType -syn match scssParameterList ".*" contained containedin=cssFunction,scssFunction contains=css.*Attr,cssColor,cssString.*,cssValue.*,scssFunction,scssVariable - -syn match scssVariable "$[[:alnum:]_-]\+" containedin=cssFunction,scssFunction,cssMediaType nextgroup=scssVariableAssignment skipwhite -syn match scssVariableAssignment ":" contained nextgroup=scssVariableValue skipwhite -syn match scssVariableValue "[^;)]\+[;)]\@=" contained contains=css.*Attr,cssValue.*,cssColor,cssFunction,cssString.*,cssURL,scssDefault,scssFunction,scssInterpolation,scssNull,scssVariable -syn keyword scssNull null contained; - -syn match scssMixin "^@mixin" nextgroup=scssMixinName skipwhite -syn match scssMixinName "[[:alnum:]_-]\+" contained nextgroup=scssDefinition,scssMixinParams -syn region scssMixinParams contained contains=cssColor,cssValue.*,cssString.*,scssVariable,scssFunction start="(" end=")" oneline extend -syn match scssInclude "@include" nextgroup=scssMixinName skipwhite containedin=cssMediaBlock -syn match scssContent "@content" contained containedin=scssDefinition - -syn match scssFunctionDefinition "^@function" nextgroup=scssFunctionName skipwhite -syn match scssFunctionName "[[:alnum:]_-]\+" contained nextgroup=scssFunctionParams -syn region scssFunctionParams contained start="(" end=")" nextgroup=scssFunctionBody contains=scssVariable skipwhite -syn region scssFunctionBody contained matchgroup=cssBraces start="{" end="}" contains=cssString.*,cssValue.*,scssVariable,scssReturn,scssFunction -syn match scssReturn "@return" contained -syn match scssExtend "@extend" nextgroup=scssExtendedSelector skipwhite containedin=cssMediaBlock -syn match scssExtendedSelector "[^ ;]\+" contained contains=cssTagName,cssPseudoClass,scssSelectorChar nextgroup=scssOptional skipwhite -syn match scssOptional "!optional" contained -syn match scssImport "@import" nextgroup=scssImportList -syn match scssImportList "[^;]\+" contained contains=cssString.*,cssMediaType,cssURL - -syn match scssSelectorChar "\(#\|\.\|%\)\([[:alnum:]_-]\|#{.*}\)\@=" nextgroup=scssSelectorName containedin=cssMediaBlock -syn match scssSelectorName "\([[:alnum:]_-]\|#{[^}]*}\)\+" contained contains=scssInterpolation - -syn match scssAmpersand "&" nextgroup=cssPseudoClass - -syn match scssDebug "@debug" nextgroup=scssOutput -syn match scssWarn "@warn" nextgroup=scssOutput -syn match scssOutput "[^;]\+" contained contains=cssValue.*,cssString.*,scssFunction,scssVariable -syn match scssDefault "!default" contained - -syn match scssIf "@\=if" nextgroup=scssCondition -syn match scssCondition "[^{]\+" contained contains=cssValue.*,cssString.*,scssFunction,scssNull,scssVariable -syn match scssElse "@else" nextgroup=scssIf -syn match scssElse "@else\(\s*\({\|$\)\)\@=" -syn match scssWhile "@while" nextgroup=scssCondition -syn match scssFor "@for\s\+.*from\s\+.*\(to\|through\)\s\+[^{ ]\+" contains=cssValueNumber,scssFunction,scssVariable,scssForKeyword -syn match scssForKeyword "@for\|from\|to\|through" contained -syn region scssEach matchgroup=scssEachKeyword start="@each" end="in" contains=scssVariable nextgroup=scssList -syn match scssList "[^{]\+" contained contains=scssFunction,scssVariable -syn cluster scssControl contains=scssIf,scssElse,scssWhile,scssFor,scssEach - -syn match scssComment "//.*$" contains=@Spell -syn keyword scssTodo TODO FIXME NOTE OPTIMIZE XXX contained containedin=cssComment,scssComment - -hi def link scssNestedProperty cssProp -hi def link scssVariable Identifier -hi def link scssNull Constant -hi def link scssMixin PreProc -hi def link scssMixinName Function -hi def link scssContent PreProc -hi def link scssFunctionDefinition PreProc -hi def link scssFunctionName Function -hi def link scssReturn Statement -hi def link scssInclude PreProc -hi def link scssExtend PreProc -hi def link scssOptional Special -hi def link scssComment Comment -hi def link scssSelectorChar Special -hi def link scssSelectorName Identifier -hi def link scssAmpersand Character -hi def link scssDebug Debug -hi def link scssWarn Debug -hi def link scssDefault Special -hi def link scssIf Conditional -hi def link scssElse Conditional -hi def link scssWhile Repeat -hi def link scssForKeyword Repeat -hi def link scssEachKeyword Repeat -hi def link scssInterpolationDelimiter Delimiter -hi def link scssImport Include -hi def link scssTodo Todo - -let b:current_syntax = "scss" -if main_syntax == 'scss' - unlet main_syntax -endif diff --git a/vim/bundle/solarized/README.mkd b/vim/bundle/solarized/README.mkd deleted file mode 100644 index a163b02..0000000 --- a/vim/bundle/solarized/README.mkd +++ /dev/null @@ -1,267 +0,0 @@ ---- -Title: Solarized Colorscheme for Vim -Description: Precision colors for machines and people -Author: Ethan Schoonover -Colors: light yellow -Created: 2011 Mar 15 -Modified: 2011 Apr 16 - ---- - -Solarized Colorscheme for Vim -============================= - -Developed by Ethan Schoonover - -Visit the [Solarized homepage] ------------------------------- - -See the [Solarized homepage] for screenshots, -details and colorscheme versions for Vim, Mutt, popular terminal emulators and -other applications. - -Screenshots ------------ - -![solarized dark](https://github.com/altercation/solarized/raw/master/img/solarized-vim.png) - -Downloads ---------- - -If you have come across this colorscheme via the [Vim-only repository] on -github, or the [vim.org script] page see the link above to the Solarized -homepage or visit the main [Solarized repository]. - -The [Vim-only repository] is kept in sync with the main [Solarized repository] -and is for installation convenience only (with [Pathogen] or [Vundle], for -instance). Issues, bug reports, changelogs are centralized at the main -[Solarized repository]. - -[Solarized homepage]: http://ethanschoonover.com/solarized -[Solarized repository]: https://github.com/altercation/solarized -[Vim-only repository]: https://github.com/altercation/vim-colors-solarized -[vimorg-script]: http://vim.org/script -[Pathogen]: https://github.com/tpope/vim-pathogen -[Vundle]: https://github.com/gmarik/vundle - -Installation ------------- - -### Option 1: Manual installation - -1. Move `solarized.vim` to your `.vim/colors` directory. After downloading the - vim script or package: - - $ cd vim-colors-solarized/colors - $ mv solarized.vim ~/.vim/colors/ - -### Option 2: Pathogen installation ***(recommended)*** - -1. Download and install Tim Pope's [Pathogen]. - -2. Next, move or clone the `vim-colors-solarized` directory so that it is - a subdirectory of the `.vim/bundle` directory. - - a. **Clone:** - - $ cd ~/.vim/bundle - $ git clone git://github.com/altercation/vim-colors-solarized.git - - b. **Move:** - - In the parent directory of vim-colors-solarized: - - $ mv vim-colors-solarized ~/.vim/bundle/ - -### Modify .vimrc - -After either Option 1 or Option 2 above, put the following two lines in your -.vimrc: - - syntax enable - set background=dark - colorscheme solarized - -or, for the light background mode of Solarized: - - syntax enable - set background=light - colorscheme solarized - -I like to have a different background in GUI and terminal modes, so I can use -the following if-then. However, I find vim's background autodetection to be -pretty good and, at least with MacVim, I can leave this background value -assignment out entirely and get the same results. - - if has('gui_running') - set background=light - else - set background=dark - endif - -See the [Solarized homepage] for screenshots which will help you -select either the light or dark background. - -### IMPORTANT NOTE FOR TERMINAL USERS: - -If you are going to use Solarized in Terminal mode (i.e. not in a GUI version -like gvim or macvim), **please please please** consider setting your terminal -emulator's colorscheme to used the Solarized palette. I've included palettes -for some popular terminal emulator as well as Xdefaults in the official -Solarized download available from [Solarized homepage]. If you use -Solarized *without* these colors, Solarized will need to be told to degrade its -colorscheme to a set compatible with the limited 256 terminal palette (whereas -by using the terminal's 16 ansi color values, you can set the correct, specific -values for the Solarized palette). - -If you do use the custom terminal colors, solarized.vim should work out of the -box for you. If you are using a terminal emulator that supports 256 colors and -don't want to use the custom Solarized terminal colors, you will need to use -the degraded 256 colorscheme. To do so, simply add the following line *before* -the `colorschem solarized` line: - - let g:solarized_termcolors=256 - -Again, I recommend just changing your terminal colors to Solarized values -either manually or via one of the many terminal schemes available for import. - -Advanced Configuration ----------------------- - -Solarized will work out of the box with just the two lines specified above but -does include several other options that can be set in your .vimrc file. - -Set these in your vimrc file prior to calling the colorscheme. -" - option name default optional - ------------------------------------------------ - g:solarized_termcolors= 16 | 256 - g:solarized_termtrans = 0 | 1 - g:solarized_degrade = 0 | 1 - g:solarized_bold = 1 | 0 - g:solarized_underline = 1 | 0 - g:solarized_italic = 1 | 0 - g:solarized_contrast = "normal"| "high" or "low" - g:solarized_visibility= "normal"| "high" or "low" - ------------------------------------------------ - -### Option Details - -* g:solarized_termcolors - - This is set to *16* by default, meaning that Solarized will attempt to use - the standard 16 colors of your terminal emulator. You will need to set - those colors to the correct Solarized values either manually or by - importing one of the many colorscheme available for popular terminal - emulators and Xdefaults. - -* g:solarized_termtrans - - If you use a terminal emulator with a transparent background and Solarized - isn't displaying the background color transparently, set this to 1 and - Solarized will use the default (transparent) background of the terminal - emulator. *urxvt* required this in my testing; iTerm2 did not. - - Note that on Mac OS X Terminal.app, solarized_termtrans is set to 1 by - default as this is almost always the best option. The only exception to - this is if the working terminfo file supports 256 colors (xterm-256color). - -* g:solarized_degrade - - For test purposes only; forces Solarized to use the 256 degraded color mode - to test the approximate color values for accuracy. - -* g:solarized_bold | g:solarized_underline | g:solarized_italic - - If you wish to stop Solarized from displaying bold, underlined or - italicized typefaces, simply assign a zero value to the appropriate - variable, for example: `let g:solarized_italic=0` - -* g:solarized_contrast - - Stick with normal! It's been carefully tested. Setting this option to high - or low does use the same Solarized palette but simply shifts some values up - or down in order to expand or compress the tonal range displayed. - -* g:solarized_visibility - - Special characters such as trailing whitespace, tabs, newlines, when - displayed using `:set list` can be set to one of three levels depending on - your needs. Default value is `normal` with `high` and `low` options. - -Toggle Background Function --------------------------- - -Solarized comes with a Toggle Background plugin that by default will map to - if that mapping is available. If it is not available you will need to -either map the function manually or change your current mapping to -something else. - -To set your own mapping in your .vimrc file, simply add the following line to -support normal, insert and visual mode usage, changing the "" value to the -key or key combination you wish to use: - - call togglebg#map("") - -Note that you'll want to use a single function key or equivalent if you want -the plugin to work in all modes (normal, insert, visual). - -Code Notes ----------- - -Use folding to view the `solarized.vim` script with `foldmethod=marker` turned -on. - -I have attempted to modularize the creation of Vim colorschemes in this script -and, while it could be refactored further, it should be a good foundation for -the creation of any color scheme. By simply changing the sixteen values in the -GUI section and testing in gvim (or mvim) you can rapidly prototype new -colorschemes without diving into the weeds of line-item editing each syntax -highlight declaration. - -The Values ----------- - -L\*a\*b values are canonical (White D65, Reference D50), other values are -matched in sRGB space. - - SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B sRGB HSB - --------- ------- ---- ------- ----------- ---------- ----------- ----------- - base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 - base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 - base01 #586e75 10/7 brgreen 240 #4e4e4e 45 -07 -07 88 110 117 194 25 46 - base00 #657b83 11/7 bryellow 241 #585858 50 -07 -07 101 123 131 195 23 51 - base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 - base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 - base2 #eee8d5 7/7 white 254 #d7d7af 92 -00 10 238 232 213 44 11 93 - base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 - yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 - orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 - red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 - magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 - violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 - blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 - cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 - green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 - -License -------- -Copyright (c) 2011 Ethan Schoonover - -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/vim/bundle/solarized/autoload/togglebg.vim b/vim/bundle/solarized/autoload/togglebg.vim deleted file mode 100644 index 108511f..0000000 --- a/vim/bundle/solarized/autoload/togglebg.vim +++ /dev/null @@ -1,55 +0,0 @@ -" Toggle Background -" Modified: 2011 Apr 29 -" Maintainer: Ethan Schoonover -" License: OSI approved MIT license - -if exists("g:loaded_togglebg") - finish -endif -let g:loaded_togglebg = 1 - -" noremap is a bit misleading here if you are unused to vim mapping. -" in fact, there is remapping, but only of script locally defined remaps, in -" this case TogBG. The