Permalink
Browse files

add new files

  • Loading branch information...
1 parent 4f1d1bd commit 9708b9827031e2319faa57cf806dac491cf41fdf @xwuxin committed Mar 6, 2013
Showing 366 changed files with 42,231 additions and 0 deletions.
Submodule abolish added at 6a633f
Submodule ack.vim added at 989528
@@ -0,0 +1,6 @@
+
+AutoComplPop.vim
+================
+
+这是一份针对 [AutoComplPop.vim](https://bitbucket.org/ns9tks/vim-autocomplpop)
+的文档中文翻译。
Oops, something went wrong.
Oops, something went wrong.
@@ -0,0 +1,45 @@
+:AcpDisable acp.txt /*:AcpDisable*
+:AcpEnable acp.txt /*:AcpEnable*
+:AcpLock acp.txt /*:AcpLock*
+:AcpUnlock acp.txt /*:AcpUnlock*
+acp acp.txt /*acp*
+acp-about acp.txt /*acp-about*
+acp-author acp.txt /*acp-author*
+acp-changelog acp.txt /*acp-changelog*
+acp-commands acp.txt /*acp-commands*
+acp-contact acp.txt /*acp-contact*
+acp-installation acp.txt /*acp-installation*
+acp-introduction acp.txt /*acp-introduction*
+acp-options acp.txt /*acp-options*
+acp-perl-omni acp.txt /*acp-perl-omni*
+acp-snipMate acp.txt /*acp-snipMate*
+acp-thanks acp.txt /*acp-thanks*
+acp-usage acp.txt /*acp-usage*
+acp.txt acp.txt /*acp.txt*
+autocomplpop acp.txt /*autocomplpop*
+g:acp_behavior acp.txt /*g:acp_behavior*
+g:acp_behavior-command acp.txt /*g:acp_behavior-command*
+g:acp_behavior-completefunc acp.txt /*g:acp_behavior-completefunc*
+g:acp_behavior-meets acp.txt /*g:acp_behavior-meets*
+g:acp_behavior-onPopupClose acp.txt /*g:acp_behavior-onPopupClose*
+g:acp_behavior-repeat acp.txt /*g:acp_behavior-repeat*
+g:acp_behaviorCssOmniPropertyLength acp.txt /*g:acp_behaviorCssOmniPropertyLength*
+g:acp_behaviorCssOmniValueLength acp.txt /*g:acp_behaviorCssOmniValueLength*
+g:acp_behaviorFileLength acp.txt /*g:acp_behaviorFileLength*
+g:acp_behaviorHtmlOmniLength acp.txt /*g:acp_behaviorHtmlOmniLength*
+g:acp_behaviorKeywordCommand acp.txt /*g:acp_behaviorKeywordCommand*
+g:acp_behaviorKeywordIgnores acp.txt /*g:acp_behaviorKeywordIgnores*
+g:acp_behaviorKeywordLength acp.txt /*g:acp_behaviorKeywordLength*
+g:acp_behaviorPerlOmniLength acp.txt /*g:acp_behaviorPerlOmniLength*
+g:acp_behaviorPythonOmniLength acp.txt /*g:acp_behaviorPythonOmniLength*
+g:acp_behaviorRubyOmniMethodLength acp.txt /*g:acp_behaviorRubyOmniMethodLength*
+g:acp_behaviorRubyOmniSymbolLength acp.txt /*g:acp_behaviorRubyOmniSymbolLength*
+g:acp_behaviorSnipmateLength acp.txt /*g:acp_behaviorSnipmateLength*
+g:acp_behaviorUserDefinedFunction acp.txt /*g:acp_behaviorUserDefinedFunction*
+g:acp_behaviorUserDefinedMeets acp.txt /*g:acp_behaviorUserDefinedMeets*
+g:acp_behaviorXmlOmniLength acp.txt /*g:acp_behaviorXmlOmniLength*
+g:acp_completeOption acp.txt /*g:acp_completeOption*
+g:acp_completeoptPreview acp.txt /*g:acp_completeoptPreview*
+g:acp_enableAtStartup acp.txt /*g:acp_enableAtStartup*
+g:acp_ignorecaseOption acp.txt /*g:acp_ignorecaseOption*
+g:acp_mappingDriven acp.txt /*g:acp_mappingDriven*
@@ -0,0 +1,47 @@
+!_TAG_FILE_ENCODING utf-8 //
+:AcpDisable acp.cnx /*:AcpDisable*
+:AcpEnable acp.cnx /*:AcpEnable*
+:AcpLock acp.cnx /*:AcpLock*
+:AcpUnlock acp.cnx /*:AcpUnlock*
+acp acp.cnx /*acp*
+acp-about acp.cnx /*acp-about*
+acp-author acp.cnx /*acp-author*
+acp-changelog acp.cnx /*acp-changelog*
+acp-commands acp.cnx /*acp-commands*
+acp-contact acp.cnx /*acp-contact*
+acp-installation acp.cnx /*acp-installation*
+acp-introduction acp.cnx /*acp-introduction*
+acp-options acp.cnx /*acp-options*
+acp-perl-omni acp.cnx /*acp-perl-omni*
+acp-snipMate acp.cnx /*acp-snipMate*
+acp-thanks acp.cnx /*acp-thanks*
+acp-usage acp.cnx /*acp-usage*
+acp.txt acp.cnx /*acp.txt*
+autocomplpop acp.cnx /*autocomplpop*
+g:acp_behavior acp.cnx /*g:acp_behavior*
+g:acp_behavior-command acp.cnx /*g:acp_behavior-command*
+g:acp_behavior-completefunc acp.cnx /*g:acp_behavior-completefunc*
+g:acp_behavior-meets acp.cnx /*g:acp_behavior-meets*
+g:acp_behavior-onPopupClose acp.cnx /*g:acp_behavior-onPopupClose*
+g:acp_behavior-repeat acp.cnx /*g:acp_behavior-repeat*
+g:acp_behaviorCssOmniPropertyLength acp.cnx /*g:acp_behaviorCssOmniPropertyLength*
+g:acp_behaviorCssOmniValueLength acp.cnx /*g:acp_behaviorCssOmniValueLength*
+g:acp_behaviorFileLength acp.cnx /*g:acp_behaviorFileLength*
+g:acp_behaviorHtmlOmniLength acp.cnx /*g:acp_behaviorHtmlOmniLength*
+g:acp_behaviorKeywordCommand acp.cnx /*g:acp_behaviorKeywordCommand*
+g:acp_behaviorKeywordIgnores acp.cnx /*g:acp_behaviorKeywordIgnores*
+g:acp_behaviorKeywordLength acp.cnx /*g:acp_behaviorKeywordLength*
+g:acp_behaviorPerlOmniLength acp.cnx /*g:acp_behaviorPerlOmniLength*
+g:acp_behaviorPythonOmniLength acp.cnx /*g:acp_behaviorPythonOmniLength*
+g:acp_behaviorRubyOmniMethodLength acp.cnx /*g:acp_behaviorRubyOmniMethodLength*
+g:acp_behaviorRubyOmniSymbolLength acp.cnx /*g:acp_behaviorRubyOmniSymbolLength*
+g:acp_behaviorSnipmateLength acp.cnx /*g:acp_behaviorSnipmateLength*
+g:acp_behaviorUserDefinedFunction acp.cnx /*g:acp_behaviorUserDefinedFunction*
+g:acp_behaviorUserDefinedMeets acp.cnx /*g:acp_behaviorUserDefinedMeets*
+g:acp_behaviorXmlOmniLength acp.cnx /*g:acp_behaviorXmlOmniLength*
+g:acp_completeOption acp.cnx /*g:acp_completeOption*
+g:acp_completeoptPreview acp.cnx /*g:acp_completeoptPreview*
+g:acp_enableAtStartup acp.cnx /*g:acp_enableAtStartup*
+g:acp_ignorecaseOption acp.cnx /*g:acp_ignorecaseOption*
+g:acp_mappingDriven acp.cnx /*g:acp_mappingDriven*
+volcanowill[at]gmail.com acp.cnx /*volcanowill[at]gmail.com*
Submodule align added at fa5fde
@@ -0,0 +1,189 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" AutoClose.vim - Automatically close pair of characters: ( with ), [ with ], { with }, etc.
+" Version: 1.1
+" Author: Thiago Alves <thiago.salves@gmail.com>
+" Maintainer: Thiago Alves <thiago.salves@gmail.com>
+" URL: http://thiagoalves.org
+" Licence: This script is released under the Vim License.
+" Last modified: 08/25/2008
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+let s:debug = 1
+
+" check if script is already loaded
+if s:debug == 0 && exists("g:loaded_AutoClose")
+ finish "stop loading the script"
+endif
+let g:loaded_AutoClose = 1
+
+let s:global_cpo = &cpo " store compatible-mode in local variable
+set cpo&vim " go into nocompatible-mode
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Functions
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! s:GetNextChar()
+ if col('$') == col('.')
+ return "\0"
+ endif
+ return strpart(getline('.'), col('.')-1, 1)
+endfunction
+
+function! s:GetPrevChar()
+ if col('.') == 1
+ return "\0"
+ endif
+ return strpart(getline('.'), col('.')-2, 1)
+endfunction
+
+function! s:IsEmptyPair()
+ let l:prev = s:GetPrevChar()
+ let l:next = s:GetNextChar()
+ if l:prev == "\0" || l:next == "\0"
+ return 0
+ endif
+ return get(s:charsToClose, l:prev, "\0") == l:next
+endfunction
+
+function! s:GetCurrentSyntaxRegion()
+ return synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+endfunction
+
+function! s:GetCurrentSyntaxRegionIf(char)
+ let l:origin_line = getline('.')
+ let l:changed_line = strpart(l:origin_line, 0, col('.')-1) . a:char . strpart(l:origin_line, col('.')-1)
+ call setline('.', l:changed_line)
+ let l:region = synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+ call setline('.', l:origin_line)
+ return l:region
+endfunction
+
+function! s:IsForbidden(char)
+ let l:result = index(s:protectedRegions, s:GetCurrentSyntaxRegion()) >= 0
+ if l:result
+ return l:result
+ endif
+ let l:region = s:GetCurrentSyntaxRegionIf(a:char)
+ let l:result = index(s:protectedRegions, l:region) >= 0
+ return l:result && l:region == 'Comment'
+endfunction
+
+function! s:InsertPair(char)
+ let l:next = s:GetNextChar()
+ let l:result = a:char
+ if s:running && !s:IsForbidden(a:char) && (l:next == "\0" || l:next !~ '\w')
+ let l:result .= s:charsToClose[a:char] . "\<Left>"
+ endif
+ return l:result
+endfunction
+
+function! s:ClosePair(char)
+ if s:running && s:GetNextChar() == a:char
+ let l:result = "\<Right>"
+ else
+ let l:result = a:char
+ endif
+ return l:result
+endfunction
+
+function! s:CheckPair(char)
+ let l:lastpos = 0
+ let l:occur = stridx(getline('.'), a:char, l:lastpos) == 0 ? 1 : 0
+
+ while l:lastpos > -1
+ let l:lastpos = stridx(getline('.'), a:char, l:lastpos+1)
+ if l:lastpos > col('.')-2
+ break
+ endif
+ if l:lastpos >= 0
+ let l:occur += 1
+ endif
+ endwhile
+
+ if l:occur == 0 || l:occur%2 == 0
+ " Opening char
+ return s:InsertPair(a:char)
+ else
+ " Closing char
+ return s:ClosePair(a:char)
+ endif
+endfunction
+
+function! s:Backspace()
+ if s:running && s:IsEmptyPair()
+ return "\<BS>\<Del>"
+ endif
+ return "\<BS>"
+endfunction
+
+function! s:ToggleAutoClose()
+ let s:running = !s:running
+ if s:running
+ echo "AutoClose ON"
+ else
+ echo "AutoClose OFF"
+ endif
+endfunction
+
+function! s:SetVEAll()
+ let s:save_ve = &ve
+ set ve=all
+ return ""
+endfunction
+
+function! s:RestoreVE()
+ exec "set ve=" . s:save_ve
+ unlet s:save_ve
+ return ""
+endfunction
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Configuration
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" let user define which character he/she wants to autocomplete
+if exists("g:AutoClosePairs") && type(g:AutoClosePairs) == type({})
+ let s:charsToClose = g:AutoClosePairs
+ unlet g:AutoClosePairs
+else
+ let s:charsToClose = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'"}
+endif
+
+" let user define in which regions the autocomplete feature should not occur
+if exists("g:AutoCloseProtectedRegions") && type(g:AutoCloseProtectedRegions) == type([])
+ let s:protectedRegions = g:AutoCloseProtectedRegions
+ unlet g:AutoCloseProtectedRegions
+else
+ let s:protectedRegions = ["Comment", "String", "Character"]
+endif
+
+" let user define if he/she wants the plugin turned on when vim start. Defaul is YES
+if exists("g:AutoCloseOn") && type(g:AutoCloseOn) == type(0)
+ let s:running = g:AutoCloseOn
+ unlet g:AutoCloseOn
+else
+ let s:running = 1
+endif
+
+" create appropriate maps to defined open/close characters
+for key in keys(s:charsToClose)
+ if key == '"'
+ let open_func_arg = '"\""'
+ let close_func_arg = '"\""'
+ else
+ let open_func_arg = '"' . key . '"'
+ let close_func_arg = '"' . s:charsToClose[key] . '"'
+ endif
+
+ if key == s:charsToClose[key]
+ exec "inoremap <silent> " . key . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>CheckPair(" . open_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ else
+ exec "inoremap <silent> " . s:charsToClose[key] . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>ClosePair(" . close_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ exec "inoremap <silent> " . key . " <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>InsertPair(" . open_func_arg . ")<CR><C-R>=<SID>RestoreVE()<CR>"
+ endif
+endfor
+exec "inoremap <silent> <BS> <C-R>=<SID>SetVEAll()<CR><C-R>=<SID>Backspace()<CR><C-R>=<SID>RestoreVE()<CR>"
+
+" Define convenient commands
+command! AutoCloseOn :let s:running = 1
+command! AutoCloseOff :let s:running = 0
+command! AutoCloseToggle :call s:ToggleAutoClose()
Binary file not shown.
Oops, something went wrong.

0 comments on commit 9708b98

Please sign in to comment.