Permalink
Browse files

Initial commit, including older stuff.

  • Loading branch information...
0 parents commit 559e11b2d4e429b513d0150b0c2ffcdc96ecb4d4 @roidrage committed May 24, 2010
Showing with 57,855 additions and 0 deletions.
  1. +132 −0 autoload/pathogen.vim
  2. +42 −0 bundle/ack/doc/ack.txt
  3. +8 −0 bundle/ack/doc/tags
  4. +42 −0 bundle/ack/plugin/ack.vim
  5. +132 −0 bundle/endwise/plugin/endwise.vim
  6. +5 −0 bundle/msanders-snipmate.vim/README.markdown
  7. +40 −0 bundle/msanders-snipmate.vim/after/plugin/snipMate.vim
  8. +435 −0 bundle/msanders-snipmate.vim/autoload/snipMate.vim
  9. +322 −0 bundle/msanders-snipmate.vim/doc/snipMate.txt
  10. +10 −0 bundle/msanders-snipmate.vim/ftplugin/html_snip_helper.vim
  11. +8 −0 bundle/msanders-snipmate.vim/plugin-info.txt
  12. +271 −0 bundle/msanders-snipmate.vim/plugin/snipMate.vim
  13. +9 −0 bundle/msanders-snipmate.vim/snippets/_.snippets
  14. +66 −0 bundle/msanders-snipmate.vim/snippets/autoit.snippets
  15. +113 −0 bundle/msanders-snipmate.vim/snippets/c.snippets
  16. +34 −0 bundle/msanders-snipmate.vim/snippets/cpp.snippets
  17. +39 −0 bundle/msanders-snipmate.vim/snippets/erlang.snippets
  18. +190 −0 bundle/msanders-snipmate.vim/snippets/html.snippets
  19. +95 −0 bundle/msanders-snipmate.vim/snippets/java.snippets
  20. +74 −0 bundle/msanders-snipmate.vim/snippets/javascript.snippets
  21. +54 −0 bundle/msanders-snipmate.vim/snippets/mako.snippets
  22. +247 −0 bundle/msanders-snipmate.vim/snippets/objc.snippets
  23. +97 −0 bundle/msanders-snipmate.vim/snippets/perl.snippets
  24. +216 −0 bundle/msanders-snipmate.vim/snippets/php.snippets
  25. +86 −0 bundle/msanders-snipmate.vim/snippets/python.snippets
  26. +504 −0 bundle/msanders-snipmate.vim/snippets/ruby.snippets
  27. +28 −0 bundle/msanders-snipmate.vim/snippets/sh.snippets
  28. +7 −0 bundle/msanders-snipmate.vim/snippets/snippet.snippets
  29. +92 −0 bundle/msanders-snipmate.vim/snippets/tcl.snippets
  30. +115 −0 bundle/msanders-snipmate.vim/snippets/tex.snippets
  31. +32 −0 bundle/msanders-snipmate.vim/snippets/vim.snippets
  32. +58 −0 bundle/msanders-snipmate.vim/snippets/zsh.snippets
  33. +19 −0 bundle/msanders-snipmate.vim/syntax/snippet.vim
  34. +3 −0 bundle/scrooloose-nerdtree/.gitignore
  35. +75 −0 bundle/scrooloose-nerdtree/Rakefile
  36. +1,222 −0 bundle/scrooloose-nerdtree/doc/NERD_tree.txt
  37. +41 −0 bundle/scrooloose-nerdtree/nerdtree_plugin/exec_menuitem.vim
  38. +194 −0 bundle/scrooloose-nerdtree/nerdtree_plugin/fs_menu.vim
  39. +4,059 −0 bundle/scrooloose-nerdtree/plugin/NERD_tree.vim
  40. +2 −0 bundle/tpope-vim-cucumber/ftdetect/cucumber.vim
  41. +131 −0 bundle/tpope-vim-cucumber/ftplugin/cucumber.vim
  42. +59 −0 bundle/tpope-vim-cucumber/indent/cucumber.vim
  43. +125 −0 bundle/tpope-vim-cucumber/syntax/cucumber.vim
  44. +4 −0 bundle/tpope-vim-liquid/ftdetect/liquid.vim
  45. +60 −0 bundle/tpope-vim-liquid/ftplugin/liquid.vim
  46. +62 −0 bundle/tpope-vim-liquid/indent/liquid.vim
  47. +136 −0 bundle/tpope-vim-liquid/syntax/liquid.vim
  48. +82 −0 bundle/tpope-vim-ragtag/doc/ragtag.txt
  49. +492 −0 bundle/tpope-vim-ragtag/plugin/ragtag.vim
  50. +10 −0 bundle/tpope-vim-rails/README
  51. +56 −0 bundle/tpope-vim-rails/Rakefile
  52. +4,699 −0 bundle/tpope-vim-rails/autoload/rails.vim
  53. +1,134 −0 bundle/tpope-vim-rails/doc/rails.txt
  54. +340 −0 bundle/tpope-vim-rails/plugin/rails.vim
  55. +222 −0 bundle/tpope-vim-surround/doc/surround.txt
  56. +625 −0 bundle/tpope-vim-surround/plugin/surround.vim
  57. +576 −0 bundle/tsaleh-vim-tcomment/autoload/tcomment.vim
  58. +208 −0 bundle/tsaleh-vim-tcomment/doc/tComment.txt
  59. +16 −0 bundle/tsaleh-vim-tcomment/doc/tags
  60. +385 −0 bundle/tsaleh-vim-tcomment/plugin/tComment.vim
  61. +45 −0 bundle/vim-fugitive/README.markdown
  62. +220 −0 bundle/vim-fugitive/doc/fugitive.txt
  63. +36 −0 bundle/vim-fugitive/doc/tags
  64. +1,703 −0 bundle/vim-fugitive/plugin/fugitive.vim
  65. +5 −0 bundle/vim-git/doc/ft-gitcommit-plugin.txt
  66. +1 −0 bundle/vim-git/doc/tags
  67. +18 −0 bundle/vim-git/ftdetect/git.vim
  68. +36 −0 bundle/vim-git/ftplugin/git.vim
  69. +67 −0 bundle/vim-git/ftplugin/gitcommit.vim
  70. +14 −0 bundle/vim-git/ftplugin/gitconfig.vim
  71. +42 −0 bundle/vim-git/ftplugin/gitrebase.vim
  72. +5 −0 bundle/vim-git/ftplugin/gitsendemail.vim
  73. +34 −0 bundle/vim-git/indent/gitconfig.vim
  74. +77 −0 bundle/vim-git/syntax/git.vim
  75. +82 −0 bundle/vim-git/syntax/gitcommit.vim
  76. +37 −0 bundle/vim-git/syntax/gitconfig.vim
  77. +34 −0 bundle/vim-git/syntax/gitrebase.vim
  78. +18 −0 bundle/vim-git/syntax/gitsendemail.vim
  79. +72 −0 bundle/vim-makegreen/README.md
  80. +80 −0 bundle/vim-makegreen/plugin/makegreen.vim
  81. +6 −0 bundle/vim-markdown/ftdetect/markdown.vim
  82. +18 −0 bundle/vim-markdown/ftplugin/markdown.vim
  83. +101 −0 bundle/vim-markdown/syntax/markdown.vim
  84. +35 −0 bundle/vim-peepopen/README.md
  85. +37 −0 bundle/vim-peepopen/plugin/peepopen.vim
  86. +79 −0 bundle/vim-rooter/plugin/rooter.vim
  87. +1,501 −0 bundle/vim-taglist/doc/taglist.txt
  88. +62 −0 bundle/vim-taglist/doc/tags
  89. +4,546 −0 bundle/vim-taglist/plugin/taglist.vim
  90. +49 −0 bundle/vim-unimpaired/doc/tags
  91. +101 −0 bundle/vim-unimpaired/doc/unimpaired.txt
  92. +260 −0 bundle/vim-unimpaired/plugin/unimpaired.vim
  93. +23 −0 colors/default.vim
  94. +63 −0 colors/emacs.vim
  95. +168 −0 colors/pink.vim
  96. +63 −0 colors/topfunky-light.vim
  97. +191 −0 colors/vividchalk.vim
  98. +8 −0 doc/tags
  99. +1 −0 dotvim_before/.VimballRecord
  100. BIN dotvim_before/NERD_commenter.zip
  101. BIN dotvim_before/NERD_tree.zip
  102. +160 −0 dotvim_before/after/ftplugin/html_snippets.vim
  103. +56 −0 dotvim_before/after/ftplugin/rails_snippets.vim
  104. +32 −0 dotvim_before/after/ftplugin/ruby_snippets.vim
  105. +112 −0 dotvim_before/autoload/erlangcomplete.vim
  106. +4,409 −0 dotvim_before/autoload/rails.vim
  107. BIN dotvim_before/bufexplorer.zip
  108. +48 −0 dotvim_before/compiler/erlang.vim
  109. +212 −0 dotvim_before/compiler/ir_black.vim
  110. +438 −0 dotvim_before/doc/bufexplorer.txt
  111. +541 −0 dotvim_before/doc/command-t.txt
  112. +1,140 −0 dotvim_before/doc/rails.txt
  113. +1,501 −0 dotvim_before/doc/taglist.txt
  114. +352 −0 dotvim_before/doc/tags
  115. +804 −0 dotvim_before/doc/vcscommand.txt
  116. +12 −0 dotvim_before/filetype
  117. +201 −0 dotvim_before/ftplugin/erlang.vim
  118. +101 −0 dotvim_before/ftplugin/eruby.vim
  119. +34 −0 dotvim_before/ftplugin/git.vim
  120. +68 −0 dotvim_before/ftplugin/gitcommit.vim
  121. +15 −0 dotvim_before/ftplugin/gitconfig.vim
  122. +41 −0 dotvim_before/ftplugin/gitrebase.vim
  123. +70 −0 dotvim_before/ftplugin/ned_konz_ruby.vim
  124. +206 −0 dotvim_before/indent/erlang.vim
  125. +328 −0 dotvim_before/indent/ruby.vim
  126. +3,317 −0 dotvim_before/plugin/NERD_commenter.vim
  127. +866 −0 dotvim_before/plugin/bufexplorer.vim
  128. +327 −0 dotvim_before/plugin/closetag.vim
  129. +148 −0 dotvim_before/plugin/command-t.vim
  130. +1,676 −0 dotvim_before/plugin/fuzzyfinder.vim
  131. +335 −0 dotvim_before/plugin/rails.vim
  132. +974 −0 dotvim_before/plugin/snippetsEmu.vim
  133. +463 −0 dotvim_before/plugin/supertab.vim
  134. +4,546 −0 dotvim_before/plugin/taglist.vim
  135. +1,275 −0 dotvim_before/plugin/vcscommand.vim
  136. +441 −0 dotvim_before/plugin/vcscvs.vim
  137. +258 −0 dotvim_before/plugin/vcsgit.vim
  138. +262 −0 dotvim_before/plugin/vcssvk.vim
  139. +288 −0 dotvim_before/plugin/vcssvn.vim
  140. +181 −0 dotvim_before/ruby/command-t/Makefile
  141. +249 −0 dotvim_before/ruby/command-t/controller.rb
  142. +24 −0 dotvim_before/ruby/command-t/depend
  143. BIN dotvim_before/ruby/command-t/ext.bundle
  144. +66 −0 dotvim_before/ruby/command-t/ext.c
  145. +33 −0 dotvim_before/ruby/command-t/ext.h
  146. BIN dotvim_before/ruby/command-t/ext.o
  147. +32 −0 dotvim_before/ruby/command-t/extconf.rb
  148. +51 −0 dotvim_before/ruby/command-t/finder.rb
  149. +229 −0 dotvim_before/ruby/command-t/match.c
  150. +29 −0 dotvim_before/ruby/command-t/match.h
  151. BIN dotvim_before/ruby/command-t/match.o
  152. +323 −0 dotvim_before/ruby/command-t/match_window.rb
  153. +155 −0 dotvim_before/ruby/command-t/matcher.c
  154. +30 −0 dotvim_before/ruby/command-t/matcher.h
  155. BIN dotvim_before/ruby/command-t/matcher.o
  156. +10 −0 dotvim_before/ruby/command-t/mkmf.log
  157. +165 −0 dotvim_before/ruby/command-t/prompt.rb
  158. +49 −0 dotvim_before/ruby/command-t/ruby_compat.h
  159. +91 −0 dotvim_before/ruby/command-t/scanner.rb
  160. +75 −0 dotvim_before/ruby/command-t/settings.rb
  161. +46 −0 dotvim_before/ruby/command-t/stub.rb
  162. +41 −0 dotvim_before/ruby/vim.rb
  163. +34 −0 dotvim_before/ruby/vim/screen.rb
  164. +40 −0 dotvim_before/ruby/vim/window.rb
  165. +45 −0 dotvim_before/syntax/CVSAnnotate.vim
  166. +42 −0 dotvim_before/syntax/SVKAnnotate.vim
  167. +40 −0 dotvim_before/syntax/SVNAnnotate.vim
  168. +134 −0 dotvim_before/syntax/erlang.vim
  169. +450 −0 dotvim_before/syntax/groovy.vim
  170. +264 −0 dotvim_before/syntax/ruby.vim
  171. +31 −0 dotvim_before/syntax/vcscommit.vim
  172. BIN dotvim_before/taglist_45.zip
  173. BIN dotvim_before/vcscommand.zip
  174. BIN dotvim_before/vim_erlang-0.2.tar.bz2
  175. +13 −0 gvimrc
  176. +2 −0 gvimrc_before
  177. +83 −0 vimrc
  178. +163 −0 vimrc_before
@@ -0,0 +1,132 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Version: 1.2
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" API is documented below.
+
+if exists("g:loaded_pathogen") || &cp
+ finish
+endif
+let g:loaded_pathogen = 1
+
+" Split a path into a list.
+function! pathogen#split(path) abort " {{{1
+ if type(a:path) == type([]) | return a:path | endif
+ let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction " }}}1
+
+" Convert a list to a path.
+function! pathogen#join(...) abort " {{{1
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction " }}}1
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort " {{{1
+ return call('pathogen#join',[1] + a:000)
+endfunction " }}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort " {{{1
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if has_key(seen,a:list[i])
+ call remove(a:list,i)
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction " }}}1
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#separator() abort " {{{1
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction " }}}1
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort " {{{1
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort " {{{1
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Prepend all subdirectories of path to the rtp, and append all after
+" directories in those subdirectories.
+function! pathogen#runtime_prepend_subdirectories(path) " {{{1
+ let sep = pathogen#separator()
+ let before = pathogen#glob_directories(a:path.sep."*[^~]")
+ let after = pathogen#glob_directories(a:path.sep."*[^~]".sep."after")
+ let rtp = pathogen#split(&rtp)
+ let path = expand(a:path)
+ call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
+ let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
+ return &rtp
+endfunction " }}}1
+
+" For each directory in rtp, check for a subdirectory named dir. If it
+" exists, add all subdirectories of that subdirectory to the rtp, immediately
+" after the original directory. If no argument is given, 'bundle' is used.
+" Repeated calls with the same arguments are ignored.
+function! pathogen#runtime_append_all_bundles(...) " {{{1
+ let sep = pathogen#separator()
+ let name = a:0 ? a:1 : 'bundle'
+ if "\n".s:done_bundles =~# "\\M\n".name."\n"
+ return ""
+ endif
+ let s:done_bundles .= name . "\n"
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += pathogen#glob_directories(substitute(dir,'after$',name.sep.'*[^~]'.sep.'after','')) + [dir]
+ else
+ let list += [dir] + pathogen#glob_directories(dir.sep.name.sep.'*[^~]')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = ''
+" }}}1
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() " {{{1
+ for dir in pathogen#split(&rtp)
+ if dir[0 : strlen($VIM)-1] !=# $VIM && isdirectory(dir.'/doc') && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))
+ helptags `=dir.'/doc'`
+ endif
+ endfor
+endfunction " }}}1
+
+" vim:set ft=vim ts=8 sw=2 sts=2:
@@ -0,0 +1,42 @@
+*ack.txt* Plugin that integrates ack with Vim
+
+==============================================================================
+Author: Antoine Imbert <antoine.imbert+ackvim@gmail.com> *ack-author*
+License: Same terms as Vim itself (see |license|)
+
+==============================================================================
+INTRODUCTION *ack*
+
+This plugin is a front for the Perl module App::Ack. Ack can be used as a
+replacement for grep. This plugin will allow you to run ack from vim, and
+shows the results in a split window.
+
+:Ack [options] {pattern} [{directory}] *:Ack*
+
+ Search recursively in {directory} (which defaults to the current
+ directory) for the {pattern}. Behaves just like the |:grep| command, but
+ will open the |Quickfix| window for you.
+
+:AckAdd [options] {pattern} [{directory}] *:AckAdd*
+
+ Just like |:Ack| + |:grepadd|. Appends the |quickfix| with the results
+
+:AckFromSearch [{directory}] *:AckFromSearch*
+
+ Just like |:Ack| but the pattern is from previous search.
+
+:LAck [options] {pattern} [{directory}] *:LAck*
+
+ Just like |:Ack| + |:lgrep|. Searches, but opens in |location-list|
+
+:LAckAdd [options] {pattern} [{directory}] *:LAckAdd*
+
+ Just like |:Ack| + |:lgrepadd|. Searches, but appends results to
+ |location-list|
+
+Files containing the search term will be listed in the split window, along
+with the line number of the occurrence, once for each occurrence. <Enter> on
+a line in this window will open the file, and place the cursor on the matching
+line.
+
+See http://search.cpan.org/~petdance/ack/ack for more information.
@@ -0,0 +1,8 @@
+:Ack ack.txt /*:Ack*
+:AckAdd ack.txt /*:AckAdd*
+:AckFromSearch ack.txt /*:AckFromSearch*
+:LAck ack.txt /*:LAck*
+:LAckAdd ack.txt /*:LAckAdd*
+ack ack.txt /*ack*
+ack-author ack.txt /*ack-author*
+ack.txt ack.txt /*ack.txt*
@@ -0,0 +1,42 @@
+" NOTE: You must, of course, install the ack script
+" in your path.
+" On Ubuntu:
+" sudo apt-get install ack-grep
+" ln -s /usr/bin/ack-grep /usr/bin/ack
+" With MacPorts:
+" sudo port install p5-app-ack
+
+let g:ackprg="ack -H --nocolor --nogroup"
+
+function! s:Ack(cmd, args)
+ redraw
+ echo "Searching ..."
+
+ let grepprg_bak=&grepprg
+ try
+ let &grepprg=g:ackprg
+ silent execute a:cmd . " " . a:args
+ finally
+ let &grepprg=grepprg_bak
+ endtry
+
+ if a:cmd =~# '^l'
+ botright lopen
+ else
+ botright copen
+ endif
+ redraw!
+endfunction
+
+function! s:AckFromSearch(cmd, args)
+ let search = getreg('/')
+ " translate vim regular expression to perl regular expression.
+ let search = substitute(search,'\(\\<\|\\>\)','\\b','g')
+ call s:Ack(a:cmd, '"' . search .'" '. a:args)
+endfunction
+
+command! -bang -nargs=* -complete=file Ack call s:Ack('grep<bang>',<q-args>)
+command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd<bang>', <q-args>)
+command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep<bang>', <q-args>)
+command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep<bang>', <q-args>)
+command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd<bang>', <q-args>)
@@ -0,0 +1,132 @@
+" endwise.vim - EndWise
+" Author: Tim Pope <vimNOSPAM@tpope.info>
+" Version: 1.0
+
+" Distributable under the same terms as Vim itself (see :help license)
+
+" Exit quickly when:
+" - this plugin was already loaded (or disabled)
+" - when 'compatible' is set
+if (exists("g:loaded_endwise") && g:loaded_endwise) || &cp
+ finish
+endif
+let g:loaded_endwise = 1
+
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+augroup endwise " {{{1
+ au!
+ autocmd FileType ruby
+ \ let b:endwise_addition = '\=submatch(0)=="{" ? "}" : "end"' |
+ \ let b:endwise_words = 'module,class,def,if,unless,case,while,until,begin,do' |
+ \ let b:endwise_pattern = '^\s*\zs\%(module\|class\|def\|if\|unless\|case\|while\|until\|for\|\|begin\)\>\%(.*[^.:@$]\<end\>\)\@!\|\<do\ze\%(\s*|.*|\)\=\s*$' |
+ \ let b:endwise_syngroups = 'rubyModule,rubyClass,rubyDefine,rubyControl,rubyConditional,rubyRepeat'
+ autocmd FileType vb,vbnet,aspvbs
+ \ let b:endwise_addition = 'End &' |
+ \ let b:endwise_words = 'Function,Sub,Class,Module,Enum,Namespace' |
+ \ let b:endwise_pattern = '\%(\<End\>.*\)\@<!\<&\>' |
+ \ let b:endwise_syngroups = 'vbStatement,vbnetStorage,vbnetProcedure,vbnet.*Words,AspVBSStatement'
+ autocmd FileType vim
+ \ let b:endwise_addition = 'end&' |
+ \ let b:endwise_words = 'fu\%[nction],wh\%[ile],if,for,try' |
+ \ let b:endwise_syngroups = 'vimFuncKey,vimNotFunc,vimCommand'
+augroup END " }}}1
+
+" Maps {{{1
+
+
+if maparg("<Plug>DiscretionaryEnd") == ""
+ inoremap <silent> <SID>DiscretionaryEnd <C-R>=<SID>crend(0)<CR>
+ inoremap <silent> <SID>AlwaysEnd <C-R>=<SID>crend(1)<CR>
+ imap <script> <Plug>DiscretionaryEnd <SID>DiscretionaryEnd
+ imap <script> <Plug>AlwaysEnd <SID>AlwaysEnd
+endif
+if maparg('<CR>','i') =~# '<C-R>=.*crend(.)<CR>\|<\%(Plug\|SID\)>.*End'
+ " Already mapped
+elseif maparg('<CR>','i') =~ '<CR>'
+ exe "imap <script> <C-X><CR> ".maparg('<CR>','i')."<SID>AlwaysEnd"
+ exe "imap <script> <CR> ".maparg('<CR>','i')."<SID>DiscretionaryEnd"
+else
+ imap <C-X><CR> <CR><Plug>AlwaysEnd
+ imap <CR> <CR><Plug>DiscretionaryEnd
+endif
+
+if maparg('<M-o>','i') == ''
+ inoremap <M-o> <C-O>o
+endif
+
+" }}}1
+
+" Code {{{1
+
+function! s:mysearchpair(beginpat,endpat,synpat)
+ let g:endwise_syntaxes = ""
+ let s:lastline = line('.')
+ call s:synname()
+ let line = searchpair(a:beginpat,'',a:endpat,'Wn','<SID>synname() !~# "^'.substitute(a:synpat,'\\','\\\\','g').'$"',line('.')+50)
+ return line
+endfunction
+
+function! s:crend(always)
+ let n = ""
+ if !exists("b:endwise_addition") || !exists("b:endwise_words") || !exists("b:endwise_syngroups")
+ return n
+ end
+ let synpat = '\%('.substitute(b:endwise_syngroups,',','\\|','g').'\)'
+ let wordchoice = '\%('.substitute(b:endwise_words,',','\\|','g').'\)'
+ if exists("b:endwise_pattern")
+ let beginpat = substitute(b:endwise_pattern,'&',substitute(wordchoice,'\\','\\&','g'),'g')
+ else
+ let beginpat = '\<'.wordchoice.'\>'
+ endif
+ let lnum = line('.') - 1
+ let space = matchstr(getline(lnum),'^\s*')
+ let col = match(getline(lnum),beginpat) + 1
+ let word = matchstr(getline(lnum),beginpat)
+ let endpat = substitute(word,'.*',b:endwise_addition,'')
+ let y = n.endpat."\<C-O>O"
+ let endpat = '\<'.substitute(wordchoice,'.*',b:endwise_addition,'').'\>'
+ if a:always
+ return y
+ elseif col <= 0 || synIDattr(synID(lnum,col,1),'name') !~ '^'.synpat.'$'
+ return n
+ elseif getline('.') !~ '^\s*#\=$'
+ return n
+ endif
+ let line = s:mysearchpair(beginpat,endpat,synpat)
+ " even is false if no end was found, or if the end found was less
+ " indented than the current line
+ let even = strlen(matchstr(getline(line),'^\s*')) >= strlen(space)
+ if line == 0
+ let even = 0
+ endif
+ let g:endwise_debug = line . "(" . even . ")"
+ if !even && line == line('.') + 1
+ return y
+ endif
+ if even
+ return n
+ endif
+ return y
+endfunction
+
+function! s:synname()
+ " Checking this helps to force things to stay in sync
+ while s:lastline < line('.')
+ let s = synIDattr(synID(s:lastline,indent(s:lastline)+1,1),'name')
+ let s:lastline = nextnonblank(s:lastline + 1)
+ endwhile
+
+ let s = synIDattr(synID(line('.'),col('.'),1),'name')
+ let g:endwise_syntaxes = g:endwise_syntaxes . line('.').','.col('.')."=".s."\n"
+ let s:lastline = line('.')
+ return s
+endfunction
+
+" }}}1
+
+let &cpo = s:cpo_save
+
+" vim:set ft=vim ff=unix ts=8 sw=4 sts=4:
@@ -0,0 +1,5 @@
+Quickly install with:
+
+ git clone git://github.com/msanders/snipmate.vim.git
+ cd snipmate.vim
+ cp -R * ~/.vim
Oops, something went wrong.

0 comments on commit 559e11b

Please sign in to comment.