Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Single server config, zsh, my dotfiles installed

pulls down my oh-my-zsh and dotfiles and installs them
  • Loading branch information...
commit 478055f5867c8ab1d638a4da370825623e15e30a 1 parent b321d38
@pferdefleisch authored
Showing with 10 additions and 32,652 deletions.
  1. +1 −0  .gitignore
  2. +6 −0 .gitmodules
  3. +3 −0  Vagrantfile
  4. +0 −1  cookbooks/pferdefleisch/files/default/vim/.VimballRecord
  5. +0 −10 cookbooks/pferdefleisch/files/default/vim/.netrwhist
  6. +0 −5 cookbooks/pferdefleisch/files/default/vim/README.markdown
  7. +0 −40 cookbooks/pferdefleisch/files/default/vim/after/plugin/snipMate.vim
  8. +0 −1,060 cookbooks/pferdefleisch/files/default/vim/autoload/manpageview.vim
  9. +0 −132 cookbooks/pferdefleisch/files/default/vim/autoload/pathogen.vim
  10. +0 −801 cookbooks/pferdefleisch/files/default/vim/autoload/rubycomplete.vim
  11. +0 −435 cookbooks/pferdefleisch/files/default/vim/autoload/snipMate.vim
  12. +0 −788 cookbooks/pferdefleisch/files/default/vim/autoload/vimclojure.vim
  13. +0 −78 cookbooks/pferdefleisch/files/default/vim/bin/clj
  14. +0 −21 cookbooks/pferdefleisch/files/default/vim/bin/gen-completions.clj
  15. +0 −77 cookbooks/pferdefleisch/files/default/vim/bin/ng-server
  16. +0 −513 cookbooks/pferdefleisch/files/default/vim/bundle/bufexplorer/doc/bufexplorer.txt
  17. +0 −1,162 cookbooks/pferdefleisch/files/default/vim/bundle/bufexplorer/plugin/bufexplorer.vim
  18. +0 −33 cookbooks/pferdefleisch/files/default/vim/bundle/vim-peepopen/README.md
  19. +0 −44 cookbooks/pferdefleisch/files/default/vim/bundle/vim-peepopen/plugin/peepopen.vim
  20. +0 −28 cookbooks/pferdefleisch/files/default/vim/bundle/vim-scala/README
  21. +0 −2  cookbooks/pferdefleisch/files/default/vim/bundle/vim-scala/ftdetect/scala.vim
  22. +0 −83 cookbooks/pferdefleisch/files/default/vim/bundle/vim-scala/indent/scala.vim
  23. +0 −55 cookbooks/pferdefleisch/files/default/vim/bundle/vim-scala/plugin/31-create-scala.vim
  24. +0 −151 cookbooks/pferdefleisch/files/default/vim/bundle/vim-scala/syntax/scala.vim
  25. +0 −105 cookbooks/pferdefleisch/files/default/vim/colors/asmdev.vim
  26. +0 −99 cookbooks/pferdefleisch/files/default/vim/colors/blackboard.vim
  27. +0 −202 cookbooks/pferdefleisch/files/default/vim/colors/inkpot.vim
  28. +0 −212 cookbooks/pferdefleisch/files/default/vim/colors/ir_black.vim
  29. +0 −211 cookbooks/pferdefleisch/files/default/vim/colors/molokai.vim
  30. +0 −969 cookbooks/pferdefleisch/files/default/vim/colors/solarized.vim
  31. +0 −68 cookbooks/pferdefleisch/files/default/vim/colors/vibrantink.vim
  32. +0 −172 cookbooks/pferdefleisch/files/default/vim/colors/vividchalk.vim
  33. +0 −94 cookbooks/pferdefleisch/files/default/vim/colors/xoria256.vim
  34. +0 −245 cookbooks/pferdefleisch/files/default/vim/colors/zenburn.vim
  35. +0 −40 cookbooks/pferdefleisch/files/default/vim/compiler/eruby.vim
  36. +0 −40 cookbooks/pferdefleisch/files/default/vim/compiler/rspec.vim
  37. +0 −67 cookbooks/pferdefleisch/files/default/vim/compiler/ruby.vim
  38. +0 −34 cookbooks/pferdefleisch/files/default/vim/compiler/rubyunit.vim
  39. +0 −1,222 cookbooks/pferdefleisch/files/default/vim/doc/NERD_tree.txt
  40. +0 −311 cookbooks/pferdefleisch/files/default/vim/doc/clojure.txt
  41. +0 −736 cookbooks/pferdefleisch/files/default/vim/doc/command-t.txt
  42. +0 −437 cookbooks/pferdefleisch/files/default/vim/doc/manpageview.txt
  43. +0 −710 cookbooks/pferdefleisch/files/default/vim/doc/project.txt
  44. +0 −1,192 cookbooks/pferdefleisch/files/default/vim/doc/rails.txt
  45. +0 −322 cookbooks/pferdefleisch/files/default/vim/doc/snipMate.txt
  46. +0 −496 cookbooks/pferdefleisch/files/default/vim/doc/tags
  47. +0 −126 cookbooks/pferdefleisch/files/default/vim/doc/tags-ja
  48. +0 −52 cookbooks/pferdefleisch/files/default/vim/doc/textile.txt
  49. +0 −796 cookbooks/pferdefleisch/files/default/vim/doc/vcscommand.txt
  50. +0 −5 cookbooks/pferdefleisch/files/default/vim/filetype.vim
  51. +0 −1  cookbooks/pferdefleisch/files/default/vim/ftdetect/clojure.vim
  52. +0 −18 cookbooks/pferdefleisch/files/default/vim/ftdetect/ruby-sinatra.vim
  53. +0 −17 cookbooks/pferdefleisch/files/default/vim/ftdetect/ruby.vim
  54. +0 −2  cookbooks/pferdefleisch/files/default/vim/ftdetect/treetop.vim
  55. +0 −173 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure.vim
  56. +0 −361 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions
  57. +0 −457 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.core.txt
  58. +0 −13 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.inspector.txt
  59. +0 −10 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.set.txt
  60. +0 −5 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.stacktrace.txt
  61. +0 −2  cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.template.txt
  62. +0 −6 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.test.tap.txt
  63. +0 −33 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.test.txt
  64. +0 −10 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.walk.txt
  65. +0 −13 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.xml.txt
  66. +0 −27 cookbooks/pferdefleisch/files/default/vim/ftplugin/clojure/completions-clojure.zip.txt
  67. +0 −100 cookbooks/pferdefleisch/files/default/vim/ftplugin/eruby.vim
  68. +0 −68 cookbooks/pferdefleisch/files/default/vim/ftplugin/eruby/eruby.ftdetect.vim
  69. +0 −60 cookbooks/pferdefleisch/files/default/vim/ftplugin/html/html.ftdetect.vim
  70. +0 −10 cookbooks/pferdefleisch/files/default/vim/ftplugin/html_snip_helper.vim
  71. +0 −72 cookbooks/pferdefleisch/files/default/vim/ftplugin/php/php.ftdetect.vim
  72. +0 −260 cookbooks/pferdefleisch/files/default/vim/ftplugin/ruby.vim
  73. +0 −51 cookbooks/pferdefleisch/files/default/vim/ftplugin/textile.vim
  74. +0 −206 cookbooks/pferdefleisch/files/default/vim/indent/clojure.vim
  75. +0 −77 cookbooks/pferdefleisch/files/default/vim/indent/eruby.vim
  76. +0 −377 cookbooks/pferdefleisch/files/default/vim/indent/ruby.vim
  77. +0 −1  cookbooks/pferdefleisch/files/default/vim/indent/treetop.vim
  78. +0 −41 cookbooks/pferdefleisch/files/default/vim/nerdtree_plugin/exec_menuitem.vim
  79. +0 −194 cookbooks/pferdefleisch/files/default/vim/nerdtree_plugin/fs_menu.vim
  80. +0 −8 cookbooks/pferdefleisch/files/default/vim/plugin-info.txt
  81. +0 −4,059 cookbooks/pferdefleisch/files/default/vim/plugin/NERD_tree.vim
  82. +0 −12 cookbooks/pferdefleisch/files/default/vim/plugin/ack.vim
  83. +0 −151 cookbooks/pferdefleisch/files/default/vim/plugin/command-t.vim
  84. +0 −113 cookbooks/pferdefleisch/files/default/vim/plugin/editexisting.vim
  85. +0 −31 cookbooks/pferdefleisch/files/default/vim/plugin/manpageviewPlugin.vim
  86. +0 −44 cookbooks/pferdefleisch/files/default/vim/plugin/peepopen.vim
  87. +0 −1,293 cookbooks/pferdefleisch/files/default/vim/plugin/project.vim
  88. +0 −110 cookbooks/pferdefleisch/files/default/vim/plugin/scratch.vim
  89. +0 −32 cookbooks/pferdefleisch/files/default/vim/plugin/slime.vim
  90. +0 −271 cookbooks/pferdefleisch/files/default/vim/plugin/snipMate.vim
  91. +0 −5 cookbooks/pferdefleisch/files/default/vim/plugin/textile.vim
  92. +0 −1,261 cookbooks/pferdefleisch/files/default/vim/plugin/vcscommand.vim
  93. +0 −437 cookbooks/pferdefleisch/files/default/vim/plugin/vcscvs.vim
  94. +0 −254 cookbooks/pferdefleisch/files/default/vim/plugin/vcsgit.vim
  95. +0 −258 cookbooks/pferdefleisch/files/default/vim/plugin/vcssvk.vim
  96. +0 −284 cookbooks/pferdefleisch/files/default/vim/plugin/vcssvn.vim
  97. +0 −181 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/Makefile
  98. +0 −307 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/controller.rb
  99. +0 −24 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/depend
  100. BIN  cookbooks/pferdefleisch/files/default/vim/ruby/command-t/ext.bundle
  101. +0 −65 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/ext.c
  102. +0 −36 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/ext.h
  103. BIN  cookbooks/pferdefleisch/files/default/vim/ruby/command-t/ext.o
  104. +0 −32 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/extconf.rb
  105. +0 −51 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/finder.rb
  106. +0 −189 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/match.c
  107. +0 −29 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/match.h
  108. BIN  cookbooks/pferdefleisch/files/default/vim/ruby/command-t/match.o
  109. +0 −375 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/match_window.rb
  110. +0 −164 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/matcher.c
  111. +0 −30 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/matcher.h
  112. BIN  cookbooks/pferdefleisch/files/default/vim/ruby/command-t/matcher.o
  113. +0 −10 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/mkmf.log
  114. +0 −165 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/prompt.rb
  115. +0 −49 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/ruby_compat.h
  116. +0 −93 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/scanner.rb
  117. +0 −77 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/settings.rb
  118. +0 −46 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/stub.rb
  119. +0 −43 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/vim.rb
  120. +0 −32 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/vim/screen.rb
  121. +0 −38 cookbooks/pferdefleisch/files/default/vim/ruby/command-t/vim/window.rb
  122. +0 −41 cookbooks/pferdefleisch/files/default/vim/ruby/vim.rb
  123. +0 −34 cookbooks/pferdefleisch/files/default/vim/ruby/vim/screen.rb
  124. +0 −40 cookbooks/pferdefleisch/files/default/vim/ruby/vim/window.rb
  125. +0 −9 cookbooks/pferdefleisch/files/default/vim/snippets/_.snippets
  126. +0 −66 cookbooks/pferdefleisch/files/default/vim/snippets/autoit.snippets
  127. +0 −113 cookbooks/pferdefleisch/files/default/vim/snippets/c.snippets
  128. +0 −34 cookbooks/pferdefleisch/files/default/vim/snippets/cpp.snippets
  129. +0 −39 cookbooks/pferdefleisch/files/default/vim/snippets/erlang.snippets
  130. +0 −190 cookbooks/pferdefleisch/files/default/vim/snippets/html.snippets
  131. +0 −95 cookbooks/pferdefleisch/files/default/vim/snippets/java.snippets
  132. +0 −74 cookbooks/pferdefleisch/files/default/vim/snippets/javascript.snippets
  133. +0 −54 cookbooks/pferdefleisch/files/default/vim/snippets/mako.snippets
  134. +0 −247 cookbooks/pferdefleisch/files/default/vim/snippets/objc.snippets
  135. +0 −97 cookbooks/pferdefleisch/files/default/vim/snippets/perl.snippets
  136. +0 −216 cookbooks/pferdefleisch/files/default/vim/snippets/php.snippets
  137. +0 −86 cookbooks/pferdefleisch/files/default/vim/snippets/python.snippets
  138. +0 −33 cookbooks/pferdefleisch/files/default/vim/snippets/ruby-sinatra.snippets
  139. +0 −504 cookbooks/pferdefleisch/files/default/vim/snippets/ruby.snippets
  140. +0 −28 cookbooks/pferdefleisch/files/default/vim/snippets/sh.snippets
  141. +0 −7 cookbooks/pferdefleisch/files/default/vim/snippets/snippet.snippets
  142. +0 −92 cookbooks/pferdefleisch/files/default/vim/snippets/tcl.snippets
  143. +0 −115 cookbooks/pferdefleisch/files/default/vim/snippets/tex.snippets
  144. +0 −32 cookbooks/pferdefleisch/files/default/vim/snippets/vim.snippets
  145. +0 −58 cookbooks/pferdefleisch/files/default/vim/snippets/zsh.snippets
  146. +0 −45 cookbooks/pferdefleisch/files/default/vim/syntax/CVSAnnotate.vim
  147. +0 −42 cookbooks/pferdefleisch/files/default/vim/syntax/SVKAnnotate.vim
  148. +0 −40 cookbooks/pferdefleisch/files/default/vim/syntax/SVNAnnotate.vim
  149. +0 −285 cookbooks/pferdefleisch/files/default/vim/syntax/clojure.vim
  150. +0 −73 cookbooks/pferdefleisch/files/default/vim/syntax/eruby.vim
  151. +0 −190 cookbooks/pferdefleisch/files/default/vim/syntax/go.vim
  152. +0 −32 cookbooks/pferdefleisch/files/default/vim/syntax/info.vim
  153. +0 −107 cookbooks/pferdefleisch/files/default/vim/syntax/llvm.vim
  154. +0 −106 cookbooks/pferdefleisch/files/default/vim/syntax/man.vim
  155. +0 −39 cookbooks/pferdefleisch/files/default/vim/syntax/mankey.vim
  156. +0 −75 cookbooks/pferdefleisch/files/default/vim/syntax/manphp.vim
  157. +0 −104 cookbooks/pferdefleisch/files/default/vim/syntax/mkd.vim
  158. +0 −69 cookbooks/pferdefleisch/files/default/vim/syntax/mustache.vim
  159. +0 −109 cookbooks/pferdefleisch/files/default/vim/syntax/netrw.vim
  160. +0 −664 cookbooks/pferdefleisch/files/default/vim/syntax/nginx.vim
  161. +0 −149 cookbooks/pferdefleisch/files/default/vim/syntax/ragel.vim
  162. +0 −45 cookbooks/pferdefleisch/files/default/vim/syntax/ruby-sinatra.vim
  163. +0 −368 cookbooks/pferdefleisch/files/default/vim/syntax/ruby.vim
Sorry, we could not display the entire diff because it was too big.
View
1  .gitignore
@@ -0,0 +1 @@
+.vagrant
View
6 .gitmodules
@@ -0,0 +1,6 @@
+[submodule "cookbooks/pferdefleisch/files/default/oh-my-zsh"]
+ path = cookbooks/pferdefleisch/files/default/oh-my-zsh
+ url = git://github.com/pferdefleisch/oh-my-zsh
+[submodule "cookbooks/pferdefleisch/files/default/dotfiles"]
+ path = cookbooks/pferdefleisch/files/default/dotfiles
+ url = git://github.com/pferdefleisch/dotfiles
View
3  Vagrantfile
@@ -34,6 +34,9 @@ Vagrant::Config.run do |config|
#db_config.vm.network :hostonly, "22.22.22.23"
#end
+ config.vm.forward_port(80, 8080)
+ config.vm.network :hostonly, "22.22.22.22"
+
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "pferdefleisch"
View
1  cookbooks/pferdefleisch/files/default/vim/.VimballRecord
@@ -1 +0,0 @@
-command-t-1.0.1.vba: call delete('/Users/aaron/.vim/ruby/command-t/controller.rb')|call delete('/Users/aaron/.vim/ruby/command-t/extconf.rb')|call delete('/Users/aaron/.vim/ruby/command-t/finder.rb')|call delete('/Users/aaron/.vim/ruby/command-t/match_window.rb')|call delete('/Users/aaron/.vim/ruby/command-t/prompt.rb')|call delete('/Users/aaron/.vim/ruby/command-t/scanner.rb')|call delete('/Users/aaron/.vim/ruby/command-t/settings.rb')|call delete('/Users/aaron/.vim/ruby/command-t/stub.rb')|call delete('/Users/aaron/.vim/ruby/command-t/vim/screen.rb')|call delete('/Users/aaron/.vim/ruby/command-t/vim/window.rb')|call delete('/Users/aaron/.vim/ruby/command-t/vim.rb')|call delete('/Users/aaron/.vim/ruby/command-t/ext.c')|call delete('/Users/aaron/.vim/ruby/command-t/match.c')|call delete('/Users/aaron/.vim/ruby/command-t/matcher.c')|call delete('/Users/aaron/.vim/ruby/command-t/ext.h')|call delete('/Users/aaron/.vim/ruby/command-t/match.h')|call delete('/Users/aaron/.vim/ruby/command-t/matcher.h')|call delete('/Users/aaron/.vim/ruby/command-t/ruby_compat.h')|call delete('/Users/aaron/.vim/ruby/command-t/depend')|call delete('/Users/aaron/.vim/doc/command-t.txt')|call delete('/Users/aaron/.vim/plugin/command-t.vim')
View
10 cookbooks/pferdefleisch/files/default/vim/.netrwhist
@@ -1,10 +0,0 @@
-let g:netrw_dirhistmax =10
-let g:netrw_dirhist_cnt =8
-let g:netrw_dirhist_1='/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7'
-let g:netrw_dirhist_2='/Users/aaron/Sites/veganismismurder'
-let g:netrw_dirhist_3='/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7'
-let g:netrw_dirhist_4='/usr/local/lib/ruby/gems/1.9.1/gems/guard-sprockets-0.1.3'
-let g:netrw_dirhist_5='/usr/local/lib/ruby/gems/1.9.1/gems/faker-0.9.5/lib'
-let g:netrw_dirhist_6='/usr/local/lib/ruby/1.9.1/date'
-let g:netrw_dirhist_7='/users/aaron/.rvm/gems/ruby-1.9.2-head@veganismismurder_padrino/gems/guard-sprockets-0.1.4'
-let g:netrw_dirhist_8='/usr/local/etc/nginx/sites-available'
View
5 cookbooks/pferdefleisch/files/default/vim/README.markdown
@@ -1,5 +0,0 @@
-Quickly install with:
-
- git clone git://github.com/msanders/snipmate.vim.git
- cd snipmate.vim
- cp -R * ~/.vim
View
40 cookbooks/pferdefleisch/files/default/vim/after/plugin/snipMate.vim
@@ -1,40 +0,0 @@
-" These are the mappings for snipMate.vim. Putting it here ensures that it
-" will be mapped after other plugins such as supertab.vim.
-if !exists('loaded_snips') || exists('s:did_snips_mappings')
- finish
-endif
-let s:did_snips_mappings = 1
-
-" This is put here in the 'after' directory in order for snipMate to override
-" other plugin mappings (e.g., supertab).
-"
-" You can safely adjust these mappings to your preferences (as explained in
-" :help snipMate-remap).
-ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
-snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
-ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
-snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
-ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
-
-" The default mappings for these are annoying & sometimes break snipMate.
-" You can change them back if you want, I've put them here for convenience.
-snor <bs> b<bs>
-snor <right> <esc>a
-snor <left> <esc>bi
-snor ' b<bs>'
-snor ` b<bs>`
-snor % b<bs>%
-snor U b<bs>U
-snor ^ b<bs>^
-snor \ b<bs>\
-snor <c-x> b<bs><c-x>
-
-" By default load snippets in snippets_dir
-if empty(snippets_dir)
- finish
-endif
-
-call GetSnippets(snippets_dir, '_') " Get global snippets
-
-au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
-" vim:noet:sw=4:ts=4:ft=vim
View
1,060 cookbooks/pferdefleisch/files/default/vim/autoload/manpageview.vim
@@ -1,1060 +0,0 @@
-" manpageview.vim : extra commands for manual-handling
-" Author: Charles E. Campbell, Jr.
-" Date: Nov 26, 2008
-" Version: 22
-"
-" Please read :help manpageview for usage, options, etc
-"
-" GetLatestVimScripts: 489 1 :AutoInstall: manpageview.vim
-
-" ---------------------------------------------------------------------
-" Load Once: {{{1
-if &cp || exists("g:loaded_manpageview")
- finish
-endif
-let g:loaded_manpageview = "v22"
-if v:version < 702
- echohl WarningMsg
- echo "***warning*** this version of manpageview needs vim 7.2"
- echohl Normal
- finish
-endif
-let s:keepcpo= &cpo
-set cpo&vim
-"DechoTabOn
-
-" ---------------------------------------------------------------------
-" Set up default manual-window opening option: {{{1
-if !exists("g:manpageview_winopen")
- let g:manpageview_winopen= "hsplit"
-elseif g:manpageview_winopen == "only" && !has("mksession")
- echomsg "***g:manpageview_winopen<".g:manpageview_winopen."> not supported w/o +mksession"
- let g:manpageview_winopen= "hsplit"
-endif
-
-" ---------------------------------------------------------------------
-" Sanity Check: {{{1
-if !exists("*shellescape")
- fun! manpageview#ManPageView(viamap,bknum,...) range
- echohl ERROR
- echo "You need to upgrade your vim to v7.1 or later (manpageview uses the shellescape() function)"
- endfun
- finish
-endif
-
-" ---------------------------------------------------------------------
-" Default Variable Values: {{{1
-if !exists("g:manpageview_iconv")
- if executable("iconv")
- let s:iconv= "iconv -c"
- else
- let s:iconv= ""
- endif
-else
- let s:iconv= g:manpageview_iconv
-endif
-if s:iconv != ""
- let s:iconv= "| ".s:iconv
-endif
-if !exists("g:manpageview_pgm")
- let g:manpageview_pgm= "man"
-endif
-if !exists("g:manpageview_multimanpage")
- let g:manpageview_multimanpage= 1
-endif
-if !exists("g:manpageview_options")
- let g:manpageview_options= ""
-endif
-if !exists("g:manpageview_pgm_i")
- let g:manpageview_pgm_i = "info"
- let g:manpageview_options_i = "--output=-"
- let g:manpageview_syntax_i = "info"
- let g:manpageview_K_i = "<sid>ManPageInfo(0)"
- let g:manpageview_init_i = "call ManPageInfoInit()"
-
- let s:linkpat1 = '\*[Nn]ote \([^():]*\)\(::\|$\)' " note
- let s:linkpat2 = '^\* [^:]*: \(([^)]*)\)' " filename
- let s:linkpat3 = '^\* \([^:]*\)::' " menu
- let s:linkpat4 = '^\* [^:]*:\s*\([^.]*\)\.$' " index
-endif
-if !exists("g:manpageview_pgm_pl")
- let g:manpageview_pgm_pl = "perldoc"
- let g:manpageview_options_pl = ";-f;-q"
-endif
-if !exists("g:manpageview_pgm_php") && executable("links")
- let g:manpageview_pgm_php = "links -dump http://www.php.net/"
- let g:manpageview_syntax_php = "manphp"
- let g:manpageview_nospace_php = 1
- let g:manpageview_K_php = "<sid>ManPagePhp()"
-endif
-if exists("g:manpageview_hypertext_tex") && executable("links") && !exists("g:manpageview_pgm_tex")
- let g:manpageview_pgm_tex = "links ".g:manpageview_hypertext_tex
- let g:manpageview_lookup_tex = "<sid>ManPageTexLookup"
- let g:manpageview_K_tex = "<sid>ManPageTex()"
-endif
-if has("win32") && !exists("g:manpageview_rsh")
- let g:manpageview_rsh= "rsh"
-endif
-
-" =====================================================================
-" Functions: {{{1
-
-" ---------------------------------------------------------------------
-" manpageview#ManPageView: view a manual-page, accepts three formats: {{{2
-" :call manpageview#ManPageView(viamap,"topic")
-" :call manpageview#ManPageView(viamap,booknumber,"topic")
-" :call manpageview#ManPageView(viamap,"topic(booknumber)")
-"
-" viamap=0: called via a command
-" viamap=1: called via a map
-" bknum : if non-zero, then its the book number of the manpage (default=1)
-" if zero, but viamap==1, then use lastline-firstline+1
-fun! manpageview#ManPageView(viamap,bknum,...) range
-" call Dfunc("manpageview#ManPageView(viamap=".a:viamap." bknum=".a:bknum.") a:0=".a:0)
- set lz
- let manpageview_fname = expand("%")
- let bknum = a:bknum
- call s:MPVSaveSettings()
-
- " fix topic {{{3
- if a:0 > 0
-" call Decho("(fix topic) case a:0 > 0: (a:1<".a:1.">)")
- if &ft != "info"
- if a:0 == 2 && bknum > 0
- let bknum = bknum.a:1
- let topic = a:2
- else
- let topic= substitute(a:1,'[^-a-zA-Z.0-9_:].*$','','')
-" call Decho("a:1<".a:1."> topic<".topic."> (after fix)")
- endif
- else
- let topic= a:1
- endif
- if topic =~ '($'
- let topic= substitute(topic,'($','','')
- endif
-" call Decho("topic<".topic."> bknum=".bknum." (after fix topic)")
- endif
-
- if !exists("topic") || topic == ""
- echohl WarningMsg
- echo "***warning*** missing topic"
- echohl None
- sleep 2
-" call Dret("manpageview#ManPageView : missing topic")
- return
- endif
-
- " interpret the input arguments - set up manpagetopic and manpagebook {{{3
- if a:0 > 0 && strpart(topic,0,1) == '"'
-" call Decho("(interpret input arguments) topic<".topic.">")
- " merge quoted arguments: Man "some topic here"
-" call Decho('(merge quoted args) case a:0='.a:0." strpart(".topic.",0,1)<".strpart(topic,0,1))
- let manpagetopic = strpart(topic,1)
- if manpagetopic =~ '($'
- let manpagetopic= substitute(manpagetopic,'($','','')
- endif
-" call Decho("manpagetopic<".manpagetopic.">")
- if bknum != ""
- let manpagebook= string(bknum)
- else
- let manpagebook= ""
- endif
-" call Decho("manpagebook<".manpagebook.">")
- let i= 2
- while i <= a:0
- let manpagetopic= manpagetopic.' '.a:{i}
- if a:{i} =~ '"$'
- break
- endif
- let i= i + 1
- endwhile
- let manpagetopic= strpart(manpagetopic,0,strlen(manpagetopic)-1)
-" call Decho("merged quoted arguments<".manpagetopic.">")
-
- elseif a:0 == 0
-" call Decho('case a:0==0')
- if exists("g:ManCurPosn") && has("mksession")
-" call Decho("(ManPageView) a:0=".a:0." g:ManCurPosn exists")
- call s:ManRestorePosn()
- else
- echomsg "***usage*** :Man topic -or- :Man topic nmbr"
-" call Decho("(ManPageView) a:0=".a:0." g:ManCurPosn doesn't exist")
- endif
- call s:MPVRestoreSettings()
-" call Dret("manpageview#ManPageView")
- return
-
- elseif a:0 == 1
- " ManPageView("topic") -or- ManPageView("topic(booknumber)")
-" call Decho("case a:0==1 (topic -or- topic(booknumber))")
-" call Decho("(ManPageView) a:0=".a:0." topic<".topic.">")
- if a:1 =~ "("
- " abc(3)
-" call Decho("has parenthesis: a:1<".a:1."> ft<".&ft.">")
- let a1 = substitute(a:1,'[-+*/;,.:]\+$','','e')
-" call Decho("has parenthesis: a:1<".a:1."> a1<".a1.">")
- if &ft == 'sh'
-" call Decho('has parenthesis: but ft<'.&ft."> isn't <man>")
- let manpagetopic = substitute(a:1,'(.*$','','')
- let manpagebook = ""
- elseif &ft != 'man'
-" call Decho('has parenthesis: but ft<'.&ft."> isn't <man>")
- let manpagetopic = substitute(a:1,'(.*$','','')
- if a:viamap == 0
- let manpagebook = substitute(a1,'^.*(\([^)]\+\))\=.*$','\1','e')
- else
- let manpagebook = "3"
- endif
- elseif a1 =~ '[,"]'
-" call Decho('has parenthesis: a:1 matches [,"]')
- let manpagetopic= substitute(a1,'[(,"].*$','','e')
- else
-" call Decho('has parenthesis: a:1 does not match [,"]')
- let manpagetopic= substitute(a1,'^\(.*\)(\d\w*),\=.*$','\1','e')
- let manpagebook = substitute(a1,'^.*(\(\d\w*\)),\=.*$','\1','e')
- endif
- if manpagetopic =~ '($'
-" call Decho('has parenthesis: manpagetopic<'.a:1.'> matches "($"')
- let manpagetopic= substitute(manpagetopic,'($','','')
- endif
- if manpagebook =~ '($'
-" call Decho('has parenthesis: manpagebook<'.manpagebook.'> matches "($"')
- let manpagebook= ""
- endif
-
- else
- " ManPageView(booknumber,"topic")
-" call Decho('(ManPageView(booknumber,"topic")) case a:0='.a:0)
- let manpagetopic= topic
- if a:viamap == 1 && a:lastline > a:firstline
- let manpagebook= string(a:lastline - a:firstline + 1)
- elseif a:bknum > 0
- let manpagebook= string(a:bknum)
- else
- let manpagebook= ""
- endif
- endif
-
- else
- " 3 abc -or- abc 3
-" call Decho("(3 abc -or- abc 3) case a:0=".a:0)
- if topic =~ '^\d\+'
-" call Decho("case topic =~ ^\d\+")
- let manpagebook = topic
- let manpagetopic= a:2
- elseif a:2 =~ '^\d\+$'
-" call Decho("case topic =~ \d\+$")
- let manpagebook = a:2
- let manpagetopic= topic
- elseif topic == "-k"
-" call Decho("case topic == -k")
-" call Decho("user requested man -k")
- let manpagetopic = a:2
- let manpagebook = "-k"
- elseif bknum != ""
-" call Decho('case bknum != ""')
- let manpagetopic = topic
- let manpagebook = bknum
- else
- " default: topic book
-" call Decho("default case: topic book")
- let manpagebook = a:2
- let manpagetopic= topic
- endif
- endif
-" call Decho("manpagetopic<".manpagetopic.">")
-" call Decho("manpagebook <".manpagebook.">")
-
- " for the benefit of associated routines (such as InfoIndexLink()) {{{3
- let s:manpagetopic = manpagetopic
- let s:manpagebook = manpagebook
-
- " default program g:manpageview_pgm=="man" may be overridden {{{3
- " if an extension is matched
- if exists("g:manpageview_pgm")
- let pgm = g:manpageview_pgm
- else
- let pgm = ""
- endif
- let ext = ""
- if manpagetopic =~ '\.'
- let ext = substitute(manpagetopic,'^.*\.','','e')
- endif
-
- " infer the appropriate extension based on the filetype {{{3
- if ext == ""
-" call Decho("attempt to infer on filetype<".&ft.">")
-
- " filetype: vim
- if &ft == "vim"
- if g:manpageview_winopen == "only"
- exe "help ".fnameescape(manpagetopic)
- only
- elseif g:manpageview_winopen == "vsplit"
- exe "vert help ".fnameescape(manpagetopic)
- elseif g:manpageview_winopen == "vsplit="
- exe "vert help ".fnameescape(manpagetopic)
- wincmd =
- elseif g:manpageview_winopen == "hsplit="
- exe "help ".fnameescape(manpagetopic)
- wincmd =
- else
- exe "help ".fnameescape(manpagetopic)
- endif
-" call Dret("manpageview#ManPageView")
- return
-
- " filetype: perl
- elseif &ft == "perl"
- let ext = "pl"
-
- " filetype: php
- elseif &ft == "php"
- let ext = "php"
-
- " filetype: tex
- elseif &ft == "tex"
- let ext= "tex"
- endif
- endif
-" call Decho("ext<".ext.">")
-
- " elide extension from manpagetopic {{{3
- if exists("g:manpageview_pgm_{ext}")
- let pgm = g:manpageview_pgm_{ext}
- let manpagetopic = substitute(manpagetopic,'.'.ext.'$','','')
- endif
- let nospace= exists("g:manpageview_nospace_{ext}")? g:manpageview_nospace_{ext} : 0
-" call Decho("pgm<".pgm."> manpagetopic<".manpagetopic.">")
-
- " special exception for info {{{3
- if a:viamap == 0 && ext == "i"
- let s:manpageview_pfx_i = "(".manpagetopic.")"
- let manpagetopic = "Top"
-" call Decho("top-level info: manpagetopic<".manpagetopic.">")
- endif
- if exists("s:manpageview_pfx_{ext}") && s:manpageview_pfx_{ext} != ""
- let manpagetopic= s:manpageview_pfx_{ext}.manpagetopic
- elseif exists("g:manpageview_pfx_{ext}") && g:manpageview_pfx_{ext} != ""
- " prepend any extension-specified prefix to manpagetopic
- let manpagetopic= g:manpageview_pfx_{ext}.manpagetopic
- endif
- if exists("g:manpageview_sfx_{ext}") && g:manpageview_sfx_{ext} != ""
- " append any extension-specified suffix to manpagetopic
- let manpagetopic= manpagetopic.g:manpageview_sfx_{ext}
- endif
- if exists("g:manpageview_K_{ext}") && g:manpageview_K_{ext} != ""
- " override usual K map
-" call Decho("override K map to call ".g:manpageview_K_{ext})
- exe "nmap <silent> K :call ".fnameescape(g:manpageview_K_{ext})."\<cr>"
- endif
- if exists("g:manpageview_syntax_{ext}") && g:manpageview_syntax_{ext} != ""
- " allow special-suffix extensions to optionally control syntax highlighting
- let manpageview_syntax= g:manpageview_syntax_{ext}
- else
- let manpageview_syntax= "man"
- endif
-
- " support for searching for options from conf pages {{{3
- if manpagebook == "" && manpageview_fname =~ '\.conf$'
- let manpagesrch = '^\s\+'.manpagetopic
- let manpagetopic= manpageview_fname
- endif
-" call Decho("manpagebook<".manpagebook."> manpagetopic<".manpagetopic.">")
-
- " it was reported to me that some systems change display sizes when a {{{3
- " filtering command is used such as :r! . I record the height&width
- " here and restore it afterwards. To make use of it, put
- " let g:manpageview_dispresize= 1
- " into your <.vimrc>
- let dwidth = &cwh
- let dheight = &co
-" call Decho("dwidth=".dwidth." dheight=".dheight)
-
- " Set up the window for the manpage display (only hsplit split etc) {{{3
-" call Decho("set up window for manpage display (g:manpageview_winopen<".g:manpageview_winopen."> ft<".&ft."> manpageview_syntax<".manpageview_syntax.">)")
- if g:manpageview_winopen == "only"
-" call Decho("only mode")
- silent! windo w
- if !exists("g:ManCurPosn") && has("mksession")
- call s:ManSavePosn()
- endif
- " Record current file/position/screen-position
- if &ft != manpageview_syntax
- silent! only!
- endif
- enew!
- elseif g:manpageview_winopen == "hsplit"
-" call Decho("hsplit mode")
- if &ft != manpageview_syntax
- wincmd s
- enew!
- wincmd _
- 3wincmd -
- else
- enew!
- endif
- elseif g:manpageview_winopen == "hsplit="
-" call Decho("hsplit= mode")
- if &ft != manpageview_syntax
- wincmd s
- endif
- enew!
- elseif g:manpageview_winopen == "vsplit"
-" call Decho("vsplit mode")
- if &ft != manpageview_syntax
- wincmd v
- enew!
- wincmd |
- 20wincmd <
- else
- enew!
- endif
- elseif g:manpageview_winopen == "vsplit="
-" call Decho("vsplit= mode")
- if &ft != "man"
- wincmd v
- endif
- enew!
- elseif g:manpageview_winopen == "reuse"
-" call Decho("reuse mode")
- " determine if a Manpageview window already exists
- let g:manpageview_manwin= -1
- exe "windo if &ft == '".fnameescape(manpageview_syntax)."'|let g:manpageview_manwin= winnr()|endif"
- if g:manpageview_manwin != -1
- " found a pre-existing Manpageview window, re-using it
- exe fnameescape(g:manpageview_manwin)."wincmd w"
- enew!
- elseif &l:mod == 1
- " file has been modified, would be lost if we re-used window. Use hsplit instead.
- wincmd s
- enew!
- wincmd _
- 3wincmd -
- elseif &ft != manpageview_syntax
- " re-using current window (but hiding it first)
- setlocal bh=hide
- enew!
- else
- enew!
- endif
- else
- echohl ErrorMsg
- echo "***sorry*** g:manpageview_winopen<".g:manpageview_winopen."> not supported"
- echohl None
- sleep 2
- call s:MPVRestoreSettings()
-" call Dret("manpageview#ManPageView : manpageview_winopen<".g:manpageview_winopen."> not supported")
- return
- endif
-
- " add some maps for multiple manpage handling {{{3
- if g:manpageview_multimanpage
- nmap <silent> <script> <buffer> <PageUp> :call search("^NAME$",'bW')<cr>z<cr>5<c-y>
- nmap <silent> <script> <buffer> <PageDown> :call search("^NAME$",'W')<cr>z<cr>5<c-y>
- endif
-
- " allow K to use <cWORD> when in man pages
- if manpageview_syntax == "man"
- nmap <silent> <script> <buffer> K :<c-u>call manpageview#ManPageView(1,v:count,expand("<cWORD>"))<CR>
- endif
-
- " allow user to specify file encoding {{{3
- if exists("g:manpageview_fenc")
- exe "setlocal fenc=".fnameescape(g:manpageview_fenc)
- endif
-
- " when this buffer is exited it will be wiped out {{{3
- if v:version >= 602
- setlocal bh=wipe
- endif
- let b:did_ftplugin= 2
- let $COLUMNS=winwidth(0)
-
- " special manpageview buffer maps {{{3
- nnoremap <buffer> <space> <c-f>
- nnoremap <buffer> <c-]> :call manpageview#ManPageView(1,expand("<cWORD>"))<cr>
-
- " -----------------------------------------
- " Invoke the man command to get the manpage {{{3
- " -----------------------------------------
-
- " the buffer must be modifiable for the manpage to be loaded via :r! {{{4
- setlocal ma
-
- let cmdmod= ""
- if v:version >= 603
- let cmdmod= "silent keepjumps "
- endif
-
- " extension-based initialization (expected: buffer-specific maps) {{{4
- if exists("g:manpageview_init_{ext}")
- if !exists("b:manpageview_init_{ext}")
-" call Decho("exe manpageview_init_".ext."<".g:manpageview_init_{ext}.">")
- exe fnameescape(g:manpageview_init_{ext})
- let b:manpageview_init_{ext}= 1
- endif
- elseif ext == ""
- silent! unmap K
- nmap <unique> K <Plug>ManPageView
- endif
-
- " default program g:manpageview_options (empty string) may be overridden {{{4
- " if an extension is matched
- let opt= g:manpageview_options
- if exists("g:manpageview_options_{ext}")
- let opt= g:manpageview_options_{ext}
- endif
-" call Decho("opt<".opt.">")
-
- let cnt= 0
- while cnt < 3 && (strlen(opt) > 0 || cnt == 0)
- let cnt = cnt + 1
- let iopt = substitute(opt,';.*$','','e')
- let opt = substitute(opt,'^.\{-};\(.*\)$','\1','e')
-" call Decho("iopt<".iopt."> opt<".opt.">")
-
- " use pgm to read/find/etc the manpage (but only if pgm is not the empty string)
- " by default, pgm is "man"
- if pgm != ""
-
- " ---------------------------
- " use manpage_lookup function {{{4
- " ---------------------------
- if exists("g:manpageview_lookup_{ext}")
-" call Decho("lookup: exe call ".g:manpageview_lookup_{ext}."(".manpagebook.",".manpagetopic.")")
- exe "call ".fnameescape(g:manpageview_lookup_{ext}."(".manpagebook.",".manpagetopic.")")
-
- elseif has("win32") && exists("g:manpageview_server") && exists("g:manpageview_user")
-" call Decho("win32: manpagebook<".manpagebook."> topic<".manpagetopic.">")
- exe cmdmod."r!".g:manpageview_rsh." ".g:manpageview_server." -l ".g:manpageview_user." ".pgm." ".iopt." ".shellescape(manpagebook,1)." ".shellescape(manpagetopic,1)
- exe cmdmod.'silent! %s/.\b//ge'
-
-" elseif has("conceal")
-" exe cmdmod."r!".pgm." ".iopt." ".shellescape(manpagebook,1)." ".shellescape(manpagetopic,1)
-
- "--------------------------
- " use pgm to obtain manpage {{{4
- "--------------------------
- else
- if manpagebook != ""
- let mpb= shellescape(manpagebook,1)
- else
- let mpb= ""
- endif
- if nospace
-" call Decho("(nospace) exe silent! ".cmdmod."r!".pgm.iopt.mpb.manpagetopic)
- exe cmdmod."r!".pgm.iopt.mpb.shellescape(manpagetopic,1).s:iconv
- elseif has("win32")
-" call Decho("(win32) exe ".cmdmod."r!".pgm." ".iopt." ".mpb." \"".manpagetopic."\"")
- exe cmdmod."r!".pgm." ".iopt." ".mpb." ".shellescape(manpagetopic,1)." ".s:iconv
- else
-" call Decho("(nrml) exe ".cmdmod."r!".pgm." ".iopt." ".mpb." '".manpagetopic."'")
- exe cmdmod."r!".pgm." ".iopt." ".mpb." ".shellescape(manpagetopic,1)." ".s:iconv
- endif
- exe cmdmod.'silent! %s/.\b//ge'
- endif
- setlocal ro nomod noswf
- endif
-
- " check if manpage actually found {{{3
- if line("$") != 1 || col("$") != 1
-" call Decho("manpage found")
- break
- endif
-" call Decho("manpage not found")
- endwhile
-
- " here comes the vim display size restoration {{{3
- if exists("g:manpageview_dispresize")
- if g:manpageview_dispresize == 1
-" call Decho("restore display size to ".dheight."x".dwidth)
- exe "let &co=".dwidth
- exe "let &cwh=".dheight
- endif
- endif
-
- " clean up (ie. remove) any ansi escape sequences {{{3
- silent! %s/\e\[[0-9;]\{-}m//ge
- silent! %s/\%xe2\%x80\%x90/-/ge
- silent! %s/\%xe2\%x88\%x92/-/ge
- silent! %s/\%xe2\%x80\%x99/'/ge
- silent! %s/\%xe2\%x94\%x82/ /ge
-
- " set up options and put cursor at top-left of manpage {{{3
- if manpagebook == "-k"
- setlocal ft=mankey
- else
- exe cmdmod."setlocal ft=".fnameescape(manpageview_syntax)
- endif
- exe cmdmod."setlocal ro"
- exe cmdmod."setlocal noma"
- exe cmdmod."setlocal nomod"
- exe cmdmod."setlocal nolist"
- exe cmdmod."setlocal nonu"
- exe cmdmod."setlocal fdc=0"
-" exe cmdmod."setlocal isk+=-,.,(,)"
- exe cmdmod."setlocal nowrap"
- set nolz
- exe cmdmod."1"
- exe cmdmod."norm! 0"
-
- if line("$") == 1 && col("$") == 1
- " looks like there's no help for this topic
- if &ft == manpageview_syntax
- if exists("s:manpageview_curtopic")
- call manpageview#ManPageView(0,0,s:manpageview_curtopic)
- else
- q
- endif
- endif
-" call Decho("***warning*** no manpage exists for <".manpagetopic."> book=".manpagebook)
- echohl ErrorMsg
- echo "***warning*** sorry, no manpage exists for <".manpagetopic.">"
- echohl None
- sleep 2
- elseif manpagebook == ""
-" call Decho('exe file '.fnameescape('Manpageview['.manpagetopic.']'))
- exe 'file '.fnameescape('Manpageview['.manpagetopic.']')
- let s:manpageview_curtopic= manpagetopic
- else
-" call Decho('exe file '.fnameescape('Manpageview['.manpagetopic.'('.fnameescape(manpagebook).')]'))
- exe 'file '.fnameescape('Manpageview['.manpagetopic.'('.fnameescape(manpagebook).')]')
- let s:manpageview_curtopic= manpagetopic."(".manpagebook.")"
- endif
-
- " if there's a search pattern, use it {{{3
- if exists("manpagesrch")
- if search(manpagesrch,'w') != 0
- exe "norm! z\<cr>"
- endif
- endif
-
- " restore settings {{{3
- call s:MPVRestoreSettings()
-" call Dret("manpageview#ManPageView")
-endfun
-
-" ---------------------------------------------------------------------
-" s:MPVSaveSettings: save and standardize certain user settings {{{2
-fun! s:MPVSaveSettings()
-
- if !exists("s:sxqkeep")
-" call Dfunc("s:MPVSaveSettings()")
- let s:sxqkeep = &sxq
- let s:srrkeep = &srr
- let s:repkeep = &report
- let s:gdkeep = &gd
- let s:cwhkeep = &cwh
- let s:magickeep = &magic
- setlocal srr=> report=10000 nogd magic
- if &cwh < 2
- " avoid hit-enter prompts
- setlocal cwh=2
- endif
- if has("win32") || has("win95") || has("win64") || has("win16")
- let &sxq= '"'
- else
- let &sxq= ""
- endif
-" call Dret("s:MPVSaveSettings")
- endif
-
-endfun
-
-" ---------------------------------------------------------------------
-" s:MPV_RestoreSettings: {{{2
-fun! s:MPVRestoreSettings()
- if exists("s:sxqkeep")
-" call Dfunc("s:MPV_RestoreSettings()")
- let &sxq = s:sxqkeep | unlet s:sxqkeep
- let &srr = s:srrkeep | unlet s:srrkeep
- let &report = s:repkeep | unlet s:repkeep
- let &gd = s:gdkeep | unlet s:gdkeep
- let &cwh = s:cwhkeep | unlet s:cwhkeep
- let &magic = s:magickeep | unlet s:magickeep
-" call Dret("s:MPV_RestoreSettings")
- endif
-endfun
-
-" ---------------------------------------------------------------------
-" s:ManRestorePosn: restores file/position/screen-position {{{2
-" (uses g:ManCurPosn)
-fun! s:ManRestorePosn()
-" call Dfunc("s:ManRestorePosn()")
-
- if exists("g:ManCurPosn")
-" call Decho("g:ManCurPosn<".g:ManCurPosn.">")
- if v:version >= 603
- exe 'keepjumps silent! source '.fnameescape(g:ManCurPosn)
- else
- exe 'silent! source '.fnameescape(g:ManCurPosn)
- endif
- unlet g:ManCurPosn
- silent! cunmap q
- endif
-
-" call Dret("s:ManRestorePosn")
-endfun
-
-" ---------------------------------------------------------------------
-" s:ManSavePosn: saves current file, line, column, and screen position {{{2
-fun! s:ManSavePosn()
-" call Dfunc("s:ManSavePosn()")
-
- let g:ManCurPosn= tempname()
- let keep_ssop = &ssop
- let &ssop = 'winpos,buffers,slash,globals,resize,blank,folds,help,options,winsize'
- if v:version >= 603
- exe 'keepjumps silent! mksession! '.fnameescape(g:ManCurPosn)
- else
- exe 'silent! mksession! '.fnameescape(g:ManCurPosn)
- endif
- let &ssop = keep_ssop
- cnoremap <silent> q call <SID>ManRestorePosn()<CR>
-
-" call Dret("s:ManSavePosn")
-endfun
-
-let &cpo= s:keepcpo
-unlet s:keepcpo
-
-" ---------------------------------------------------------------------
-" s:ManPageInfo: {{{2
-fun! s:ManPageInfo(type)
-" call Dfunc("s:ManPageInfo(type=".a:type.")")
-
- if &ft != "info"
- " restore K and do a manpage lookup for word under cursor
-" call Decho("ft!=info: restore K and do a manpage lookup of word under cursor")
- setlocal kp=manpageview#ManPageView
- if exists("s:manpageview_pfx_i")
- unlet s:manpageview_pfx_i
- endif
- call manpageview#ManPageView(1,0,expand("<cWORD>"))
-" call Dret("s:ManPageInfo : restored K")
- return
- endif
-
- if !exists("s:manpageview_pfx_i")
- let s:manpageview_pfx_i= g:manpageview_pfx_i
- endif
-
- " -----------
- " Follow Link
- " -----------
- if a:type == 0
- " extract link
- let curline = getline(".")
-" call Decho("type==0: curline<".curline.">")
- let ipat = 1
- while ipat <= 4
- let link= matchstr(curline,s:linkpat{ipat})
-" call Decho("..attempting s:linkpat".ipat.":<".s:linkpat{ipat}.">")
- if link != ""
- if ipat == 2
- let s:manpageview_pfx_i = substitute(link,s:linkpat{ipat},'\1','')
- let node = "Top"
- else
- let node = substitute(link,s:linkpat{ipat},'\1','')
- endif
-" call Decho("ipat=".ipat."link<".link."> node<".node."> pfx<".s:manpageview_pfx_i.">")
- break
- endif
- let ipat= ipat + 1
- endwhile
-
- " ---------------
- " Go to next node
- " ---------------
- elseif a:type == 1
-" call Decho("type==1: goto next node")
- let node= matchstr(getline(2),'Next: \zs[^,]\+\ze,')
- let fail= "no next node"
-
- " -------------------
- " Go to previous node
- " -------------------
- elseif a:type == 2
-" call Decho("type==2: goto previous node")
- let node= matchstr(getline(2),'Prev: \zs[^,]\+\ze,')
- let fail= "no previous node"
-
- " ----------
- " Go up node
- " ----------
- elseif a:type == 3
-" call Decho("type==3: go up one node")
- let node= matchstr(getline(2),'Up: \zs.\+$')
- let fail= "no up node"
- if node == "(dir)"
- echo "***sorry*** can't go up from this node"
-" call Dret("ManPageInfo : can't go up a node")
- return
- endif
-
- " --------------
- " Go to top node
- " --------------
- elseif a:type == 4
-" call Decho("type==4: go to top node")
- let node= "Top"
- endif
-" call Decho("node<".(exists("node")? node : '--n/a--').">")
-
- " use ManPageView() to view selected node
- if !exists("node")
- echohl ErrorMsg
- echo "***sorry*** unable to view selection"
- echohl None
- sleep 2
- elseif node == ""
- echohl ErrorMsg
- echo "***sorry*** ".fail
- echohl None
- sleep 2
- else
- call manpageview#ManPageView(1,0,node.".i")
- endif
-
-" call Dret("ManPageInfo")
-endfun
-
-" ---------------------------------------------------------------------
-" s:ManPageInfoInit: {{{2
-fun! ManPageInfoInit()
-" call Dfunc("ManPageInfoInit()")
-
- " some mappings to imitate the default info reader
- nmap <buffer> <cr> K
- noremap <buffer> <silent> > :call <SID>ManPageInfo(1)<cr>
- noremap <buffer> <silent> n :call <SID>ManPageInfo(1)<cr>
- noremap <buffer> <silent> < :call <SID>ManPageInfo(2)<cr>
- noremap <buffer> <silent> p :call <SID>ManPageInfo(2)<cr>
- noremap <buffer> <silent> u :call <SID>ManPageInfo(3)<cr>
- noremap <buffer> <silent> t :call <SID>ManPageInfo(4)<cr>
- noremap <buffer> <silent> ? :he manpageview-info<cr>
- noremap <buffer> <silent> d :call manpageview#ManPageView(0,0,"dir.i")<cr>
- noremap <buffer> <silent> <BS> <C-B>
- noremap <buffer> <silent> <Del> <C-B>
- noremap <buffer> <silent> <Tab> :call <SID>NextInfoLink()<CR>
- noremap <buffer> <silent> i :call <SID>InfoIndexLink('i')<CR>
- noremap <buffer> <silent> , :call <SID>InfoIndexLink(',')<CR>
- noremap <buffer> <silent> ; :call <SID>InfoIndexLink(';')<CR>
-
-" call Dret("ManPageInfoInit")
-endfun
-
-" ---------------------------------------------------------------------
-" s:NextInfoLink: {{{2
-fun! s:NextInfoLink()
- let ln = search('\('.s:linkpat1.'\|'.s:linkpat2.'\|'.s:linkpat3.'\|'.s:linkpat4.'\)', 'w')
- if ln == 0
- echohl ErrorMsg
- echo '***sorry*** no links found'
- echohl None
- sleep 2
- endif
-endfun
-
-" ---------------------------------------------------------------------
-" s:InfoIndexLink: supports info's "i" for index-search-for-topic {{{2
-fun! s:InfoIndexLink(cmd)
-" call Dfunc("s:InfoIndexLink(cmd<".a:cmd.">)")
-" call Decho("indx vars: line #".(exists("s:indxline")? s:indxline : '---'))
-" call Decho("indx vars: cnt =".(exists("s:indxcnt")? s:indxcnt : '---'))
-" call Decho("indx vars: find =".(exists("s:indxfind")? s:indxfind : '---'))
-" call Decho("indx vars: link <".(exists("s:indxlink")? s:indxlink : '---').">")
-" call Decho("indx vars: where<".(exists("s:wheretopic")? s:wheretopic : '---').">")
-" call Decho("indx vars: srch <".(exists("s:indxsrchdir")? s:indxsrchdir : '---').">")
-
- " sanity checks
- if !exists("s:manpagetopic")
- echohl Error
- echo "(InfoIndexLink) no manpage topic available!"
- echohl NONE
-" call Dret("s:InfoIndexLink : no manpagetopic")
- return
-
- elseif !executable("info")
- echohl Error
- echo '(InfoIndexLink) the info command is not executable!'
- echohl NONE
-" call Dret("s:InfoIndexLink : info not exe")
- return
- endif
-
- if a:cmd == 'i'
- call inputsave()
- let s:infolink= input("Index entry: ","","shellcmd")
- call inputrestore()
- let s:indxfind= -1
- endif
-" call Decho("infolink<".s:infolink.">")
-
- if s:infolink != ""
-
- if a:cmd == 'i'
- let mpt= substitute(s:manpagetopic,'\.i','','')
-" call Decho('system("info '.mpt.' --where")')
- let s:wheretopic = substitute(system("info ".shellescape(mpt)." --where"),'\n','','g')
- let s:indxline = 1
- let s:indxcnt = 0
- let s:indxsrchdir = 'cW'
-" call Decho("new indx vars: cmd<i> where<".s:wheretopic.">")
-" call Decho("new indx vars: cmd<i> line#".s:indxline)
-" call Decho("new indx vars: cmd<i> cnt =".s:indxcnt)
-" call Decho("new indx vars: cmd<i> srch<".s:indxsrchdir.">")
- elseif a:cmd == ','
- let s:indxsrchdir= 'W'
-" call Decho("new indx vars: cmd<,> srch<".s:indxsrchdir.">")
- elseif a:cmd == ';'
- let s:indxsrchdir= 'bW'
-" call Decho("new indx vars: cmd<;> srch<".s:indxsrchdir.">")
- endif
-
- let cmdmod= ""
- if v:version >= 603
- let cmdmod= "silent keepjumps "
- endif
-
- let wheretopic= s:wheretopic
- if s:indxcnt != 0
- let wheretopic= substitute(wheretopic,'\.info\%(-\d\+\)\=\.','.info-'.s:indxcnt.".",'')
- else
- let wheretopic= substitute(wheretopic,'\.info\%(-\d\+\)\=\.','.info.','')
- endif
-" call Decho("initial wheretopic<".wheretopic."> indxcnt=".s:indxcnt)
-
- " search for topic in various files loop
- while filereadable(wheretopic)
-" call Decho("--- while loop: where<".wheretopic."> indxcnt=".s:indxcnt." indxline#".s:indxline)
-
- " read file <topic.info-#.gz>
- setlocal ma
- silent! %d
- if s:indxcnt != 0
- let wheretopic= substitute(wheretopic,'\.info\%(-\d\+\)\=\.','.info-'.s:indxcnt.".",'')
- else
- let wheretopic= substitute(wheretopic,'\.info\%(-\d\+\)\=\.','.info.','')
- endif
-" call Decho(" exe ".cmdmod."r ".fnameescape(wheretopic))
- try
- exe cmdmod."r ".fnameescape(wheretopic)
- catch /^Vim\%((\a\+)\)\=:E484/
- break
- finally
- if search('^File:','W') != 0
- silent 1,/^File:/-1d
- 1put! =''
- else
- 1d
- endif
- endtry
- setlocal noma nomod
-
- if s:indxline < 0
- if a:cmd == ','
- " searching forwards
- let s:indxline= 1
-" call Decho(" searching forwards from indxline#".s:indxline)
- elseif a:cmd == ';'
- " searching backwards
- let s:indxline= line("$")
-" call Decho(" searching backwards from indxline#".s:indxline)
- endif
- endif
-
- if s:indxline != 0
-" call Decho(" indxline=".s:indxline." infolink<".s:infolink."> srchflags<".s:indxsrchdir.">")
- exe fnameescape(s:indxline)
- let s:indxline= search('^\n\zs'.s:infolink.'\>\|^[0-9.]\+.*\zs\<'.s:infolink.'\>',s:indxsrchdir)
-" call Decho(" search(".s:infolink.",".s:indxsrchdir.") yields: s:indxline#".s:indxline)
- if s:indxline != 0
- let s:indxfind= s:indxcnt
- echo ",=Next Match ;=Previous Match"
-" call Dret("s:InfoIndexLink : success! (indxfind=".s:indxfind.")")
- return
- endif
- endif
-
- if a:cmd == 'i' || a:cmd == ','
- let s:indxcnt = s:indxcnt + 1
- let s:indxline = 1
- elseif a:cmd == ';'
- let s:indxcnt = s:indxcnt - 1
- if s:indxcnt < 0
- let s:indxcnt= 0
-" call Decho(" new indx vars: cmd<".a:cmd."> indxcnt=".s:indxcnt)
- break
- endif
- let s:indxline = -1
- endif
-" call Decho(" new indx vars: cmd<".a:cmd."> indxcnt =".s:indxcnt)
-" call Decho(" new indx vars: cmd<".a:cmd."> indxline#".s:indxline)
- endwhile
- endif
-" call Decho("end-while indx vars: find=".s:indxfind." cnt=".s:indxcnt)
-
- " clear screen
- setlocal ma
- silent! %d
- setlocal noma nomod
-
- if s:indxfind < 0
- " unsuccessful :(
- echohl WarningMsg
- echo "(InfoIndexLink) unable to find info for topic<".s:manpagetopic."> indx<".s:infolink.">"
- echohl NONE
-" call Dret("s:InfoIndexLink : unable to find info for ".s:manpagetopic.":".s:infolink)
- return
- elseif a:cmd == ','
- " no more matches
- let s:indxcnt = s:indxcnt - 1
- let s:indxline= 1
- echohl WarningMsg
- echo "(InfoIndexLink) no more matches"
- echohl NONE
-" call Dret("s:InfoIndexLink : no more matches")
- return
- elseif a:cmd == ';'
- " no more matches
- let s:indxcnt = s:indxfind
- let s:indxline= -1
- echohl WarningMsg
- echo "(InfoIndexLink) no previous matches"
- echohl NONE
-" call Dret("s:InfoIndexLink : no previous matches")
- return
- endif
-endfun
-
-" ---------------------------------------------------------------------
-" s:ManPageTex: {{{2
-fun! s:ManPageTex()
- let topic= '\'.expand("<cWORD>")
-" call Dfunc("s:ManPageTex() topic<".topic.">")
- call manpageview#ManPageView(1,0,topic)
-" call Dret("s:ManPageTex")
-endfun
-
-" ---------------------------------------------------------------------
-" s:ManPageTexLookup: {{{2
-fun! s:ManPageTexLookup(book,topic)
-" call Dfunc("s:ManPageTexLookup(book<".a:book."> topic<".a:topic.">)")
-" call Dret("s:ManPageTexLookup ".lookup)
-endfun
-
-" ---------------------------------------------------------------------
-" s:ManPagePhp: {{{2
-fun! s:ManPagePhp()
- let topic=substitute(expand("<cWORD>"),'()\=','.php','')
-" call Dfunc("s:ManPagePhp() topic<".topic.">")
- call manpageview#ManPageView(1,0,topic)
-" call Dret("s:ManPagePhp")
-endfun
-
-" ---------------------------------------------------------------------
-" Modeline: {{{1
-" vim: ts=4 fdm=marker
View
132 cookbooks/pferdefleisch/files/default/vim/autoload/pathogen.vim
@@ -1,132 +0,0 @@
-" 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:
View
801 cookbooks/pferdefleisch/files/default/vim/autoload/rubycomplete.vim
@@ -1,801 +0,0 @@
-" Vim completion script
-" Language: Ruby
-" Maintainer: Mark Guzman <segfault@hasno.info>
-" URL: http://vim-ruby.rubyforge.org
-" Anon CVS: See above site
-" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
-" Maintainer Version: 0.8.1
-" ----------------------------------------------------------------------------
-"
-" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
-" ----------------------------------------------------------------------------
-
-" {{{ requirement checks
-if !has('ruby')
- s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" )
- s:ErrMsg( "Error: falling back to syntax completion" )
- " lets fall back to syntax completion
- setlocal omnifunc=syntaxcomplete#Complete
- finish
-endif
-
-if version < 700
- s:ErrMsg( "Error: Required vim >= 7.0" )
- finish
-endif
-" }}} requirement checks
-
-" {{{ configuration failsafe initialization
-if !exists("g:rubycomplete_rails")
- let g:rubycomplete_rails = 0
-endif
-
-if !exists("g:rubycomplete_classes_in_global")
- let g:rubycomplete_classes_in_global = 0
-endif
-
-if !exists("g:rubycomplete_buffer_loading")
- let g:rubycomplete_buffer_loading = 0
-endif
-
-if !exists("g:rubycomplete_include_object")
- let g:rubycomplete_include_object = 0
-endif
-
-if !exists("g:rubycomplete_include_objectspace")
- let g:rubycomplete_include_objectspace = 0
-endif
-" }}} configuration failsafe initialization
-
-" {{{ vim-side support functions
-let s:rubycomplete_debug = 0
-
-function! s:ErrMsg(msg)
- echohl ErrorMsg
- echo a:msg
- echohl None
-endfunction
-
-function! s:dprint(msg)
- if s:rubycomplete_debug == 1
- echom a:msg
- endif
-endfunction
-
-function! s:GetBufferRubyModule(name, ...)
- if a:0 == 1
- let [snum,enum] = s:GetBufferRubyEntity(a:name, "module", a:1)
- else
- let [snum,enum] = s:GetBufferRubyEntity(a:name, "module")
- endif
- return snum . '..' . enum
-endfunction
-
-function! s:GetBufferRubyClass(name, ...)
- if a:0 >= 1
- let [snum,enum] = s:GetBufferRubyEntity(a:name, "class", a:1)
- else
- let [snum,enum] = s:GetBufferRubyEntity(a:name, "class")
- endif
- return snum . '..' . enum
-endfunction
-
-function! s:GetBufferRubySingletonMethods(name)
-endfunction
-
-function! s:GetBufferRubyEntity( name, type, ... )
- let lastpos = getpos(".")
- let lastline = lastpos
- if (a:0 >= 1)
- let lastline = [ 0, a:1, 0, 0 ]
- call cursor( a:1, 0 )
- endif
-
- let stopline = 1
-
- let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?'
- let [lnum,lcol] = searchpos( crex, 'w' )
- "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
-
- if lnum == 0 && lcol == 0
- call cursor(lastpos[1], lastpos[2])
- return [0,0]
- endif
-
- let curpos = getpos(".")
- let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' )
- call cursor(lastpos[1], lastpos[2])
-
- if lnum > enum
- return [0,0]
- endif
- " we found a the class def
- return [lnum,enum]
-endfunction
-
-function! s:IsInClassDef()
- return s:IsPosInClassDef( line('.') )
-endfunction
-
-function! s:IsPosInClassDef(pos)
- let [snum,enum] = s:GetBufferRubyEntity( '.*', "class" )
- let ret = 'nil'
-
- if snum < a:pos && a:pos < enum
- let ret = snum . '..' . enum
- endif
-
- return ret
-endfunction
-
-function! s:GetRubyVarType(v)
- let stopline = 1
- let vtp = ''
- let pos = getpos('.')
- let sstr = '^\s*#\s*@var\s*'.a:v.'\>\s\+[^ \t]\+\s*$'
- let [lnum,lcol] = searchpos(sstr,'nb',stopline)
- if lnum != 0 && lcol != 0
- call setpos('.',pos)
- let str = getline(lnum)
- let vtp = substitute(str,sstr,'\1','')
- return vtp
- endif
- call setpos('.',pos)
- let ctors = '\(now\|new\|open\|get_instance'
- if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
- let ctors = ctors.'\|find\|create'
- else
- endif
- let ctors = ctors.'\)'
-
- let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
- let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr
- let [lnum,lcol] = searchpos(sstr,'nb',stopline)
- if lnum != 0 && lcol != 0
- let str = matchstr(getline(lnum),fstr,lcol)
- let str = substitute(str,'^=\s*','','')
-
- call setpos('.',pos)
- if str == '"' || str == '''' || stridx(tolower(str), '%q[') != -1
- return 'String'
- elseif str == '[' || stridx(str, '%w[') != -1
- return 'Array'
- elseif str == '{'
- return 'Hash'
- elseif str == '/' || str == '%r{'
- return 'Regexp'
- elseif strlen(str) >= 4 && stridx(str,'..') != -1
- return 'Range'
- elseif stridx(str, 'lambda') != -1 || str == '&'
- return 'Proc'
- elseif strlen(str) > 4
- let l = stridx(str,'.')
- return str[0:l-1]
- end
- return ''
- endif
- call setpos('.',pos)
- return ''
-endfunction
-
-"}}} vim-side support functions
-
-"{{{ vim-side completion function
-function! rubycomplete#Init()
- execute "ruby VimRubyCompletion.preload_rails"
-endfunction
-
-function! rubycomplete#Complete(findstart, base)
- "findstart = 1 when we need to get the text length
- if a:findstart
- let line = getline('.')
- let idx = col('.')
- while idx > 0
- let idx -= 1
- let c = line[idx-1]
- if c =~ '\w'
- continue
- elseif ! c =~ '\.'
- idx = -1
- break
- else
- break
- endif
- endwhile
-
- return idx
- "findstart = 0 when we need to return the list of completions
- else
- let g:rubycomplete_completions = []
- execute "ruby VimRubyCompletion.get_completions('" . a:base . "')"
- return g:rubycomplete_completions
- endif
-endfunction
-"}}} vim-side completion function
-
-"{{{ ruby-side code
-function! s:DefRuby()
-ruby << RUBYEOF
-# {{{ ruby completion
-
-begin
- require 'rubygems' # let's assume this is safe...?
-rescue Exception
- #ignore?
-end
-class VimRubyCompletion
-# {{{ constants
- @@debug = false
- @@ReservedWords = [
- "BEGIN", "END",
- "alias", "and",
- "begin", "break",
- "case", "class",
- "def", "defined", "do",
- "else", "elsif", "end", "ensure",
- "false", "for",
- "if", "in",
- "module",
- "next", "nil", "not",
- "or",
- "redo", "rescue", "retry", "return",
- "self", "super",
- "then", "true",
- "undef", "unless", "until",
- "when", "while",
- "yield",
- ]
-
- @@Operators = [ "%", "&", "*", "**", "+", "-", "/",
- "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>",
- "[]", "[]=", "^", ]
-# }}} constants
-
-# {{{ buffer analysis magic
- def load_requires
- buf = VIM::Buffer.current
- enum = buf.line_number
- nums = Range.new( 1, enum )
- nums.each do |x|
- ln = buf[x]
- begin
- eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln )
- rescue Exception
- #ignore?
- end
- end
- end
-
- def load_buffer_class(name)
- dprint "load_buffer_class(%s) START" % name
- classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
- return if classdef == nil
-
- pare = /^\s*class\s*(.*)\s*<\s*(.*)\s*\n/.match( classdef )
- load_buffer_class( $2 ) if pare != nil && $2 != name # load parent class if needed
-
- mixre = /.*\n\s*include\s*(.*)\s*\n/.match( classdef )
- load_buffer_module( $2 ) if mixre != nil && $2 != name # load mixins if needed
-
- begin
- eval classdef
- rescue Exception
- VIM::evaluate( "s:ErrMsg( 'Problem loading class \"%s\", was it already completed?' )" % name )
- end
- dprint "load_buffer_class(%s) END" % name
- end
-
- def load_buffer_module(name)
- dprint "load_buffer_module(%s) START" % name
- classdef = get_buffer_entity(name, 's:GetBufferRubyModule("%s")')
- return if classdef == nil
-
- begin
- eval classdef
- rescue Exception
- VIM::evaluate( "s:ErrMsg( 'Problem loading module \"%s\", was it already completed?' )" % name )
- end
- dprint "load_buffer_module(%s) END" % name
- end
-
- def get_buffer_entity(name, vimfun)
- loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
- return nil if loading_allowed.to_i.zero?
- return nil if /(\"|\')+/.match( name )
- buf = VIM::Buffer.current
- nums = eval( VIM::evaluate( vimfun % name ) )
- return nil if nums == nil
- return nil if nums.min == nums.max && nums.min == 0
-
- dprint "get_buffer_entity START"
- visited = []
- clscnt = 0
- bufname = VIM::Buffer.current.name
- classdef = ""
- cur_line = VIM::Buffer.current.line_number
- while (nums != nil && !(nums.min == 0 && nums.max == 0) )
- dprint "visited: %s" % visited.to_s
- break if visited.index( nums )
- visited << nums
-
- nums.each do |x|
- if x != cur_line
- next if x == 0
- ln = buf[x]
- if /^\s*(module|class|def|include)\s+/.match(ln)
- clscnt += 1 if $1 == "class"
- #dprint "\$1$1
- classdef += "%s\n" % ln
- classdef += "end\n" if /def\s+/.match(ln)
- dprint ln
- end
- end
- end
-
- nm = "%s(::.*)*\", %s, \"" % [ name, nums.last ]
- nums = eval( VIM::evaluate( vimfun % nm ) )
- dprint "nm: \"%s\"" % nm
- dprint "vimfun: %s" % (vimfun % nm)
- dprint "got nums: %s" % nums.to_s
- end
- if classdef.length > 1
- classdef += "end\n"*clscnt
- # classdef = "class %s\n%s\nend\n" % [ bufname.gsub( /\/|\\/, "_" ), classdef ]
- end
-
- dprint "get_buffer_entity END"
- dprint "classdef====start"
- lns = classdef.split( "\n" )
- lns.each { |x| dprint x }
- dprint "classdef====end"
- return classdef
- end
-
- def get_var_type( receiver )
- if /(\"|\')+/.match( receiver )
- "String"
- else
- VIM::evaluate("s:GetRubyVarType('%s')" % receiver)
- end
- end
-
- def dprint( txt )
- print txt if @@debug
- end
-
- def get_buffer_entity_list( type )
- # this will be a little expensive.
- loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
- allow_aggressive_load = VIM::evaluate("exists('g:rubycomplete_classes_in_global') && g:rubycomplete_classes_in_global")
- return [] if allow_aggressive_load.to_i.zero? || loading_allowed.to_i.zero?
-
- buf = VIM::Buffer.current
- eob = buf.length
- ret = []
- rg = 1..eob
- re = eval( "/^\s*%s\s*([A-Za-z0-9_:-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/" % type )
-
- rg.each do |x|
- if re.match( buf[x] )
- next if type == "def" && eval( VIM::evaluate("s:IsPosInClassDef(%s)" % x) ) != nil
- ret.push $1
- end
- end
-
- return ret
- end
-
- def get_buffer_modules
- return get_buffer_entity_list( "modules" )
- end
-
- def get_buffer_methods
- return get_buffer_entity_list( "def" )
- end
-
- def get_buffer_classes
- return get_buffer_entity_list( "class" )
- end
-
-
- def load_rails
- allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
- return if allow_rails.to_i.zero?
-
- buf_path = VIM::evaluate('expand("%:p")')
- file_name = VIM::evaluate('expand("%:t")')
- vim_dir = VIM::evaluate('getcwd()')
- file_dir = buf_path.gsub( file_name, '' )
- file_dir.gsub!( /\\/, "/" )
- vim_dir.gsub!( /\\/, "/" )
- vim_dir << "/"
- dirs = [ vim_dir, file_dir ]
- sdirs = [ "", "./", "../", "../../", "../../../", "../../../../" ]
- rails_base = nil
-
- dirs.each do |dir|
- sdirs.each do |sub|
- trail = "%s%s" % [ dir, sub ]
- tcfg = "%sconfig" % trail
-
- if File.exists?( tcfg )
- rails_base = trail
- break
- end
- end
- break if rails_base
- end
-
- return if rails_base == nil
- $:.push rails_base unless $:.index( rails_base )
-
- rails_config = rails_base + "config/"
- rails_lib = rails_base + "lib/"
- $:.push rails_config unless $:.index( rails_config )
- $:.push rails_lib unless $:.index( rails_lib )
-
- bootfile = rails_config + "boot.rb"
- envfile = rails_config + "environment.rb"
- if File.exists?( bootfile ) && File.exists?( envfile )
- begin
- require bootfile
- require envfile
- begin
- require 'console_app'
- require 'console_with_helpers'
- rescue Exception
- dprint "Rails 1.1+ Error %s" % $!
- # assume 1.0
- end
- #eval( "Rails::Initializer.run" ) #not necessary?
- VIM::command('let s:rubycomplete_rails_loaded = 1')
- dprint "rails loaded"
- rescue Exception
- dprint "Rails Error %s" % $!
- VIM::evaluate( "s:ErrMsg('Error loading rails environment')" )
- end
- end
- end
-
- def get_rails_helpers
- allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
- rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
- return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero?
-
- buf_path = VIM::evaluate('expand("%:p")')
- buf_path.gsub!( /\\/, "/" )
- path_elm = buf_path.split( "/" )
- dprint "buf_path: %s" % buf_path
- types = [ "app", "db", "lib", "test", "components", "script" ]
-
- i = nil
- ret = []
- type = nil
- types.each do |t|
- i = path_elm.index( t )
- break if i
- end
- type = path_elm[i]
- type.downcase!
-
- dprint "type: %s" % type
- case type
- when "app"
- i += 1
- subtype = path_elm[i]
- subtype.downcase!
-
- dprint "subtype: %s" % subtype
- case subtype
- when "views"
- ret += ActionView::Base.instance_methods
- ret += ActionView::Base.methods
- when "controllers"
- ret += ActionController::Base.instance_methods
- ret += ActionController::Base.methods
- when "models"
- ret += ActiveRecord::Base.instance_methods
- ret += ActiveRecord::Base.methods
- end
-
- when "db"
- ret += ActiveRecord::ConnectionAdapters::SchemaStatements.instance_methods
- ret += ActiveRecord::ConnectionAdapters::SchemaStatements.methods
- end
-
-
- return ret
- end
-
- def add_rails_columns( cls )
- allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
- rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
- return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero?
-
- begin
- eval( "#{cls}.establish_connection" )
- return [] unless eval( "#{cls}.ancestors.include?(ActiveRecord::Base).to_s" )
- col = eval( "#{cls}.column_names" )
- return col if col
- rescue
- dprint "add_rails_columns err: (cls: %s) %s" % [ cls, $! ]
- return []
- end
- return []
- end
-
- def clean_sel(sel, msg)
- sel.delete_if { |x| x == nil }
- sel.uniq!
- sel.grep(/^#{Regexp.quote(msg)}/) if msg != nil
- end
-
- def get_rails_view_methods
- allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
- rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
- return [] if allow_rails.to_i.zero? || rails_loaded.to_i.zero?
-
- buf_path = VIM::evaluate('expand("%:p")')
- buf_path.gsub!( /\\/, "/" )
- pelm = buf_path.split( "/" )
- idx = pelm.index( "views" )
-
- return [] unless idx
- idx += 1
-
- clspl = pelm[idx].camelize.pluralize
- cls = clspl.singularize
-
- ret = []
- begin
- ret += eval( "#{cls}.instance_methods" )
- ret += eval( "#{clspl}Helper.instance_methods" )
- rescue Exception
- dprint "Error: Unable to load rails view helpers for %s: %s" % [ cls, $! ]
- end
-
- return ret
- end
-# }}} buffer analysis magic
-
-# {{{ main completion code
- def self.preload_rails
- a = VimRubyCompletion.new
- require 'Thread'
- Thread.new(a) do |b|
- begin
- b.load_rails
- rescue
- end
- end
- a.load_rails
- rescue
- end
-
- def self.get_completions(base)
- b = VimRubyCompletion.new
- b.get_completions base
- end
-
- def get_completions(base)
- loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
- if loading_allowed.to_i == 1
- load_requires
- load_rails
- end
-
- input = VIM::Buffer.current.line
- cpos = VIM::Window.current.cursor[1] - 1
- input = input[0..cpos]
- input += base
- input.sub!(/.*[ \t\n\"\\'`><=;|&{(]/, '') # Readline.basic_word_break_characters
- input.sub!(/self\./, '')
- input.sub!(/.*((\.\.[\[(]?)|([\[(]))/, '')
-
- dprint 'input %s' % input
- message = nil
- receiver = nil
- methods = []
- variables = []
- classes = []
- constants = []
-
- case input
- when /^(\/[^\/]*\/)\.([^.]*)$/ # Regexp
- receiver = $1
- message = Regexp.quote($2)
- methods = Regexp.instance_methods(true)
-
- when /^([^\]]*\])\.([^.]*)$/ # Array
- receiver = $1
- message = Regexp.quote($2)
- methods = Array.instance_methods(true)
-
- when /^([^\}]*\})\.([^.]*)$/ # Proc or Hash
- receiver = $1
- message = Regexp.quote($2)
- methods = Proc.instance_methods(true) | Hash.instance_methods(true)
-
- when /^(:[^:.]*)$/ # Symbol
- dprint "symbol"
- if Symbol.respond_to?(:all_symbols)
- receiver = $1
- message = $1.sub( /:/, '' )
- methods = Symbol.all_symbols.collect{|s| s.id2name}
- methods.delete_if { |c| c.match( /'/ ) }
- end
-
- when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods
- dprint "const or cls"
- receiver = $1
- methods = Object.constants
- methods.grep(/^#{receiver}/).collect{|e| "::" + e}
-
- when /^(((::)?[A-Z][^:.\(]*)+?)::?([^:.]*)$/ # Constant or class methods
- receiver = $1
- message = Regexp.quote($4)
- dprint "const or cls 2 [recv: \'%s\', msg: \'%s\']" % [ receiver, message ]
- load_buffer_class( receiver )
- begin
- classes = eval("#{receiver}.constants")
- #methods = eval("#{receiver}.methods")
- rescue Exception
- dprint "exception: %s" % $!
- methods = []
- end
- methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
-
- when /^(:[^:.]+)\.([^.]*)$/ # Symbol
- dprint "symbol"
- receiver = $1
- message = Regexp.quote($2)
- methods = Symbol.instance_methods(true)
-
- when /^([0-9_]+(\.[0-9_]+)?(e[0-9]+)?)\.([^.]*)$/ # Numeric
- dprint "numeric"
- receiver = $1
- message = Regexp.quote($4)
- begin
- methods = eval(receiver).methods
- rescue Exception
- methods = []
- end
-
- when /^(\$[^.]*)$/ #global
- dprint "global"
- methods = global_variables.grep(Regexp.new(Regexp.quote($1)))
-
- when /^((\.?[^.]+)+?)\.([^.]*)$/ # variable
- dprint "variable"
- receiver = $1
- message = Regexp.quote($3)
- load_buffer_class( receiver )
-
- cv = eval("self.class.constants")
- vartype = get_var_type( receiver )
- dprint "vartype: %s" % vartype
- if vartype != ''
- load_buffer_class( vartype )
-
- begin
- methods = eval("#{vartype}.instance_methods")
- variables = eval("#{vartype}.instance_variables")
- rescue Exception
- dprint "load_buffer_class err: %s" % $!
- end
- elsif (cv).include?(receiver)
- # foo.func and foo is local var.
- methods = eval("#{receiver}.methods")
- vartype = receiver
- elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver
- vartype = receiver
- # Foo::Bar.func
- begin
- methods = eval("#{receiver}.methods")
- rescue Exception
- end
- else
- # func1.func2
- ObjectSpace.each_object(Module){|m|
- next if m.name != "IRB::Context" and
- /^(IRB|SLex|RubyLex|RubyToken)/ =~ m.name
- methods.concat m.instance_methods(false)
- }
- end
- variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
-
- when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
- message = $1
- methods = Range.instance_methods(true)
-
- when /^\.([^.]*)$/ # unknown(maybe String)
- message = Regexp.quote($1)
- methods = String.instance_methods(true)
-
- else
- dprint "default/other"
- inclass = eval( VIM::evaluate("s:IsInClassDef()") )
-
- if inclass != nil
- dprint "inclass"
- classdef = "%s\n" % VIM::Buffer.current[ inclass.min ]
- found = /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*\n$/.match( classdef )
-
- if found != nil
- receiver = $1
- message = input
- load_buffer_class( receiver )
- begin
- methods = eval( "#{receiver}.instance_methods" )
- variables += add_rails_columns( "#{receiver}" )
- rescue Exception
- found = nil
- end
- end
- end
-
- if inclass == nil || found == nil
- dprint "inclass == nil"
- methods = get_buffer_methods
- methods += get_rails_view_methods
-
- cls_const = Class.constants
- constants = cls_const.select { |c| /^[A-Z_-]+$/.match( c ) }
- classes = eval("self.class.constants") - constants
- classes += get_buffer_classes
- classes += get_buffer_modules
-
- include_objectspace = VIM::evaluate("exists('g:rubycomplete_include_objectspace') && g:rubycomplete_include_objectspace")
- ObjectSpace.each_object(Class) { |cls| classes << cls.to_s } if include_objectspace == "1"
- message = receiver = input
- end
-
- methods += get_rails_helpers
- methods += Kernel.public_methods
- end
-
-
- include_object = VIM::evaluate("exists('g:rubycomplete_include_object') && g:rubycomplete_include_object")
- methods = clean_sel( methods, message )
- methods = (methods-Object.instance_methods) if include_object == "0"
- rbcmeth = (VimRubyCompletion.instance_methods-Object.instance_methods) # lets remove those rubycomplete methods
- methods = (methods-rbcmeth)
-
- variables = clean_sel( variables, message )
- classes = clean_sel( classes, message ) - ["VimRubyCompletion"]
- constants = clean_sel( constants, message )
-
- valid = []
- valid += methods.collect { |m| { :name => m, :type => 'm' } }
- valid += variables.collect { |v| { :name => v, :type => 'v' } }
- valid += classes.collect { |c| { :name => c, :type => 't' } }
- valid += constants.collect { |d| { :name => d, :type => 'd' } }
- valid.sort! { |x,y| x[:name] <=> y[:name] }
-
- outp = ""
-
- rg = 0..valid.length
- rg.step(150) do |x|
- stpos = 0+x
- enpos = 150+x
- valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ] }
- outp.sub!(/,$/, '')
-
- VIM::command("call extend(g:rubycomplete_completions, [%s])" % outp)
- outp = ""
- end
- end
-# }}} main completion code
-
-end # VimRubyCompletion
-# }}} ruby completion
-RUBYEOF
-endfunction
-
-let s:rubycomplete_rails_loaded = 0
-
-call s:DefRuby()
-"}}} ruby-side code
-
-
-" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:
View
435 cookbooks/pferdefleisch/files/default/vim/autoload/snipMate.vim
@@ -1,435 +0,0 @@
-fun! Filename(...)
- let filename = expand('%:t:r')
- if filename == '' | return a:0 == 2 ? a:2 : '' | endif
- return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
-endf
-
-fun s:RemoveSnippet()
- unl! g:snipPos s:curPos s:snipLen s:endCol s:endLine s:prevLen