Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleanup

  • Loading branch information...
commit cfa883d154a13f4c99925462308d6fe958092d6f 1 parent 8921ff3
@spicycode authored
Showing with 354 additions and 38,374 deletions.
  1. +1 −0  .gitignore
  2. +3 −17 auto_commands.vim
  3. +0 −132 autoload/pathogen.vim
  4. +0 −1  bundle/ack-vim/.gitignore
  5. +0 −80 bundle/ack-vim/README.md
  6. +0 −23 bundle/ack-vim/Rakefile
  7. +0 −50 bundle/ack-vim/doc/ack.txt
  8. +0 −61 bundle/ack-vim/plugin/ack.vim
  9. +0 −1,378 bundle/conque_1.0/autoload/conque_term.vim
  10. +0 −156 bundle/conque_1.0/doc/conque_term.txt
  11. +0 −80 bundle/conque_1.0/plugin/conque_term.vim
  12. +0 −77 bundle/conque_1.0/syntax/conque_term.vim
  13. +0 −327 bundle/css_color/after/syntax/css.vim
  14. +0 −111 bundle/gist.vim/README.mkd
  15. +0 −182 bundle/gist.vim/gist.vim.vimup
  16. +0 −715 bundle/gist.vim/plugin/gist.vim
  17. +0 −3  bundle/haml.vim/ftdetect/haml.vim
  18. +0 −67 bundle/haml.vim/ftplugin/haml.vim
  19. +0 −22 bundle/haml.vim/ftplugin/sass.vim
  20. +0 −12 bundle/haml.vim/ftplugin/scss.vim
  21. +0 −73 bundle/haml.vim/indent/haml.vim
  22. +0 −39 bundle/haml.vim/indent/sass.vim
  23. +0 −12 bundle/haml.vim/indent/scss.vim
  24. +0 −109 bundle/haml.vim/syntax/haml.vim
  25. +0 −90 bundle/haml.vim/syntax/sass.vim
  26. +0 −20 bundle/haml.vim/syntax/scss.vim
  27. +0 −2  bundle/jslint.vim/.gitignore
  28. +0 −13 bundle/jslint.vim/CHANGES
  29. +0 −22 bundle/jslint.vim/LICENSE
  30. +0 −147 bundle/jslint.vim/README.markdown
  31. +0 −61 bundle/jslint.vim/Rakefile
  32. +0 −25 bundle/jslint.vim/bin/jslint
  33. +0 −187 bundle/jslint.vim/ftplugin/javascript/jslint.vim
  34. +0 −5,806 bundle/jslint.vim/ftplugin/javascript/jslint/jslint-core.js
  35. +0 −87 bundle/jslint.vim/ftplugin/javascript/jslint/runjslint.js
  36. +0 −39 bundle/jslint.vim/ftplugin/javascript/jslint/runjslint.wsf
  37. +0 −6 bundle/markdown/ftdetect/markdown.vim
  38. +0 −18 bundle/markdown/ftplugin/markdown.vim
  39. +0 −104 bundle/markdown/syntax/markdown.vim
  40. +32 −2 bundle/nerdcommenter/doc/NERD_commenter.txt
  41. +44 −15 bundle/nerdcommenter/plugin/NERD_commenter.vim
  42. +4 −0 bundle/nerdtree/doc/NERD_tree.txt
  43. +2 −2 bundle/nerdtree/nerdtree_plugin/fs_menu.vim
  44. +98 −89 bundle/nerdtree/plugin/NERD_tree.vim
  45. +0 −83 bundle/oop_javascript/indent/javascript.vim
  46. +0 −76 bundle/slimv.vim/README
  47. +0 −1,518 bundle/slimv.vim/doc/slimv.txt
  48. +0 −2  bundle/slimv.vim/ftdetect/clojure.vim
  49. +0 −121 bundle/slimv.vim/ftplugin/clojure/slimv-clojure.vim
  50. +0 −149 bundle/slimv.vim/ftplugin/lisp/slimv-lisp.vim
  51. +0 −1,227 bundle/slimv.vim/ftplugin/metering.lisp
  52. +0 −2,236 bundle/slimv.vim/ftplugin/slimv-clhs.vim
  53. +0 −554 bundle/slimv.vim/ftplugin/slimv-cljapi.vim
  54. +0 −3,820 bundle/slimv.vim/ftplugin/slimv-javadoc.vim
  55. +0 −574 bundle/slimv.vim/ftplugin/slimv.py
  56. +0 −1,669 bundle/slimv.vim/ftplugin/slimv.vim
  57. +0 −20 bundle/slimv.vim/indent/clojure.vim
  58. +0 −1,234 bundle/slimv.vim/plugin/paredit.vim
  59. +0 −34 bundle/slimv.vim/syntax/clojure/slimv-syntax-clojure.vim
  60. +0 −308 bundle/supertab/doc/supertab.txt
  61. +0 −510 bundle/supertab/plugin/supertab.vim
  62. +0 −7 bundle/vim-coffee-script/ftdetect/coffee.vim
  63. +0 −19 bundle/vim-coffee-script/ftplugin/coffee.vim
  64. +0 −205 bundle/vim-coffee-script/indent/coffee.vim
  65. +0 −84 bundle/vim-coffee-script/readme.md
  66. +0 −177 bundle/vim-coffee-script/syntax/coffee.vim
  67. +0 −19 bundle/vim-coffee-script/thanks.md
  68. +0 −32 bundle/vim-coffee-script/todo.md
  69. +0 −29 bundle/vim-cucumber/compiler/cucumber.vim
  70. +0 −2  bundle/vim-cucumber/ftdetect/cucumber.vim
  71. +0 −132 bundle/vim-cucumber/ftplugin/cucumber.vim
  72. +0 −60 bundle/vim-cucumber/indent/cucumber.vim
  73. +0 −126 bundle/vim-cucumber/syntax/cucumber.vim
  74. +3 −1 bundle/vim-fugitive/doc/fugitive.txt
  75. +75 −25 bundle/vim-fugitive/plugin/fugitive.vim
  76. +0 −1,046 bundle/vim-fuzzyfinder/autoload/fuf.vim
  77. +0 −163 bundle/vim-fuzzyfinder/autoload/fuf/bookmarkdir.vim
  78. +0 −199 bundle/vim-fuzzyfinder/autoload/fuf/bookmarkfile.vim
  79. +0 −189 bundle/vim-fuzzyfinder/autoload/fuf/buffer.vim
  80. +0 −300 bundle/vim-fuzzyfinder/autoload/fuf/buffertag.vim
  81. +0 −137 bundle/vim-fuzzyfinder/autoload/fuf/callbackfile.vim
  82. +0 −139 bundle/vim-fuzzyfinder/autoload/fuf/callbackitem.vim
  83. +0 −172 bundle/vim-fuzzyfinder/autoload/fuf/changelist.vim
  84. +0 −199 bundle/vim-fuzzyfinder/autoload/fuf/coveragefile.vim
  85. +0 −132 bundle/vim-fuzzyfinder/autoload/fuf/dir.vim
  86. +0 −139 bundle/vim-fuzzyfinder/autoload/fuf/file.vim
  87. +0 −123 bundle/vim-fuzzyfinder/autoload/fuf/givencmd.vim
  88. +0 −123 bundle/vim-fuzzyfinder/autoload/fuf/givendir.vim
  89. +0 −121 bundle/vim-fuzzyfinder/autoload/fuf/givenfile.vim
  90. +0 −198 bundle/vim-fuzzyfinder/autoload/fuf/help.vim
  91. +0 −182 bundle/vim-fuzzyfinder/autoload/fuf/jumplist.vim
  92. +0 −135 bundle/vim-fuzzyfinder/autoload/fuf/line.vim
  93. +0 −134 bundle/vim-fuzzyfinder/autoload/fuf/mrucmd.vim
  94. +0 −234 bundle/vim-fuzzyfinder/autoload/fuf/mrufile.vim
  95. +0 −154 bundle/vim-fuzzyfinder/autoload/fuf/quickfix.vim
  96. +0 −178 bundle/vim-fuzzyfinder/autoload/fuf/tag.vim
  97. +0 −159 bundle/vim-fuzzyfinder/autoload/fuf/taggedfile.vim
  98. +0 −1,405 bundle/vim-fuzzyfinder/doc/fuf.jax
  99. +0 −1,883 bundle/vim-fuzzyfinder/doc/fuf.txt
  100. +0 −158 bundle/vim-fuzzyfinder/plugin/fuf.vim
  101. +1 −1  bundle/vim-git/ftplugin/gitcommit.vim
  102. +2 −0  bundle/vim-git/indent/gitconfig.vim
  103. +0 −65 bundle/vim-indent-guides/README.markdown
  104. +0 −880 bundle/vim-indent-guides/autoload/color_helper.vim
  105. +0 −240 bundle/vim-indent-guides/autoload/indent_guides.vim
  106. +0 −253 bundle/vim-indent-guides/doc/indent_guides.txt
  107. +0 −63 bundle/vim-indent-guides/plugin/indent_guides.vim
  108. +0 −25 bundle/vim-indent-guides/test-files/test-ts2sw2et.txt
  109. +0 −25 bundle/vim-indent-guides/test-files/test-ts2sw2noet.txt
  110. +0 −25 bundle/vim-indent-guides/test-files/test-ts4sw4et.txt
  111. +0 −25 bundle/vim-indent-guides/test-files/test-ts4sw4noet.txt
  112. +0 −25 bundle/vim-indent-guides/test-files/test-ts8sw8et.txt
  113. +0 −25 bundle/vim-indent-guides/test-files/test-ts8sw8noet.txt
  114. BIN  bundle/vim-l9/.hg/00changelog.i
  115. +0 −1  bundle/vim-l9/.hg/branch
  116. +0 −2  bundle/vim-l9/.hg/branchheads.cache
  117. BIN  bundle/vim-l9/.hg/dirstate
  118. +0 −2  bundle/vim-l9/.hg/hgrc
  119. +0 −3  bundle/vim-l9/.hg/requires
  120. BIN  bundle/vim-l9/.hg/store/00changelog.i
  121. BIN  bundle/vim-l9/.hg/store/00manifest.i
  122. BIN  bundle/vim-l9/.hg/store/data/.hgtags.i
  123. BIN  bundle/vim-l9/.hg/store/data/autoload/l9.vim.i
  124. BIN  bundle/vim-l9/.hg/store/data/autoload/l9/async.py.i
  125. BIN  bundle/vim-l9/.hg/store/data/autoload/l9/async.vim.i
  126. BIN  bundle/vim-l9/.hg/store/data/autoload/l9/quickfix.vim.i
  127. BIN  bundle/vim-l9/.hg/store/data/autoload/l9/tempbuffer.vim.i
  128. BIN  bundle/vim-l9/.hg/store/data/autoload/l9/tempvariables.vim.i
  129. BIN  bundle/vim-l9/.hg/store/data/doc/l9.jax.i
  130. BIN  bundle/vim-l9/.hg/store/data/doc/l9.txt.i
  131. BIN  bundle/vim-l9/.hg/store/data/plugin/l9.vim.i
  132. +0 −10 bundle/vim-l9/.hg/store/fncache
  133. BIN  bundle/vim-l9/.hg/store/undo
  134. +0 −5 bundle/vim-l9/.hg/tags.cache
  135. +0 −1  bundle/vim-l9/.hg/undo.branch
  136. +0 −3  bundle/vim-l9/.hg/undo.desc
  137. 0  bundle/vim-l9/.hg/undo.dirstate
  138. +0 −3  bundle/vim-l9/.hgtags
  139. +0 −570 bundle/vim-l9/autoload/l9.vim
  140. +0 −92 bundle/vim-l9/autoload/l9/async.py
  141. +0 −67 bundle/vim-l9/autoload/l9/async.vim
  142. +0 −107 bundle/vim-l9/autoload/l9/quickfix.vim
  143. +0 −112 bundle/vim-l9/autoload/l9/tempbuffer.vim
  144. +0 −60 bundle/vim-l9/autoload/l9/tempvariables.vim
  145. +0 −55 bundle/vim-l9/doc/l9.jax
  146. +0 −73 bundle/vim-l9/doc/l9.txt
  147. +0 −9 bundle/vim-l9/doc/tags-ja
  148. +0 −108 bundle/vim-l9/plugin/l9.vim
  149. +0 −33 bundle/vim-peepopen/README.md
  150. +0 −44 bundle/vim-peepopen/plugin/peepopen.vim
  151. +32 −120 bundle/vim-rails/autoload/rails.vim
  152. +5 −10 bundle/vim-rails/doc/rails.txt
  153. +3 −4 bundle/vim-ruby/ftplugin/eruby.vim
  154. +38 −23 bundle/vim-ruby/indent/ruby.vim
  155. +3 −4 bundle/vim-ruby/syntax/eruby.vim
  156. +4 −4 bundle/vim-surround/doc/surround.txt
  157. +4 −3 bundle/vim-surround/plugin/surround.vim
  158. +0 −101 bundle/vim-unimpaired/doc/unimpaired.txt
  159. +0 −274 bundle/vim-unimpaired/plugin/unimpaired.vim
  160. +0 −20 bundle/vimclojure/LICENSE.txt
  161. +0 −122 bundle/vimclojure/README.markdown
  162. +0 −139 bundle/vimclojure/build.gradle
  163. +0 −30 bundle/vimclojure/client/Makefile
  164. BIN  bundle/vimclojure/client/ng.exe
  165. +0 −640 bundle/vimclojure/client/ngclient/ng.c
  166. +0 −289 bundle/vimclojure/server/src/main/clojure/vimclojure/backend.clj
  167. +0 −32 bundle/vimclojure/server/src/main/clojure/vimclojure/core.clj
  168. +0 −30 bundle/vimclojure/server/src/main/clojure/vimclojure/gencompletions.clj
Sorry, we could not display the entire diff because it was too big.
View
1  .gitignore
@@ -3,3 +3,4 @@
tags
custom_vimrc
custom_gvimrc
+bundle
View
20 auto_commands.vim
@@ -1,17 +1,3 @@
-function! CustomClojureSettings()
- set filetype=clojure
-endfunction
-
-function! CustomMarkdownSettings()
- set filetype=mkd
-endfunction
-
-function! CustomJsonSettings()
- set filetype=javascript
-endfunction
-
-augroup SpicyAutoCommands
- autocmd BufEnter,BufWritePost *.clj call CustomClojureSettings()
- autocmd BufEnter *.markdown call CustomMarkdownSettings()
- autocmd BufEnter,BufWritePost *.json call CustomJsonSettings()
-augroup END
+autocmd BufRead,BufNewFile {Gemfile,Rakefile,Capfile,*.rake,config.ru} set ft=ruby
+autocmd BufRead,BufNewFile {*.md,*.mkd,*.markdown} set ft=markdown
+autocmd BufRead,BufNewFile {COMMIT_EDITMSG} set ft=gitcommit
View
132 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
1  bundle/ack-vim/.gitignore
@@ -1 +0,0 @@
-tags
View
80 bundle/ack-vim/README.md
@@ -1,80 +0,0 @@
-# ack.vim #
-
-This plugin is a front for the Perl module
-[App::Ack](http://search.cpan.org/~petdance/ack/ack). Ack can be used as a
-replacement for 99% of the uses of _grep_. This plugin will allow you to run
-ack from vim, and shows the results in a split window.
-
-The *Official Version* of this plugin is available at [vim.org](http://www.vim.org/scripts/script.php?script_id=2572).
-
-## Installation ##
-
-
-### Ack
-
-You have to install [ack](http://search.cpan.org/~petdance/ack/ack), of course.
-
-Install on Debian / Ubuntu with:
-
- sudo apt-get install ack-grep
-
-For Debian / Ubuntu you can add this line into your .vimrc:
-
- let g:ackprg="ack-grep -H --nocolor --nogroup --column"
-
-Install on Gentoo with:
-
- sudo emerge ack
-
-Install with MacPorts:
-
- sudo port install p5-app-ack
-
-Install with Gentoo Prefix
-
- emerge ack
-
-Otherwise, you are on your own.
-
-### The Plugin
-
-If you have [Rake](http://rake.rubyforge.org/) installed, you can just run: `rake install`.
-
-Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc. Be sure to run
-
- :helptags ~/.vim/doc
-
-afterwards.
-
-
-## Usage ##
-
- :Ack [options] {pattern} [{directory}]
-
-Search recursively in {directory} (which defaults to the current directory) for the {pattern}.
-
-Files containing the search term will be listed in the split window, along with
-the line number of the occurrence, once for each occurrence. [Enter] on a line
-in this window will open the file, and place the cursor on the matching line.
-
-Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `doc/ack.txt`, or install and `:h Ack` for more information.)
-
-**From the [ack docs](http://search.cpan.org/~petdance/ack/ack)** (my favorite feature):
-
- --type=TYPE, --type=noTYPE
-
- Specify the types of files to include or exclude from a search. TYPE is a filetype, like perl or xml. --type=perl can also be specified as --perl, and --type=noperl can be done as --noperl.
-
- If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion.
-
- Type specifications can be repeated and are ORed together.
-
- See ack --help=types for a list of valid types.
-
-This Vim plugin is derived (and by derived, I mean copied, essentially) from
-Antoine Imbert's blog post [Ack and Vim
-Integration](http://blog.ant0ine.com/2007/03/ack_and_vim_integration.html) (in
-particular, the function at the bottom of the post). I added a help file that
-provides just enough reference to get you going. I also highly recommend you
-check out the docs for the Perl script 'ack', for obvious reasons: [ack -
-grep-like text finder](http://search.cpan.org/~petdance/ack/ack).
View
23 bundle/ack-vim/Rakefile
@@ -1,23 +0,0 @@
-# Added by Josh Nichols, a.k.a. technicalpickles
-require 'rake'
-
-files = ['doc/ack.txt', 'plugin/ack.vim']
-
-desc 'Install plugin and documentation'
-task :install do
- vimfiles = if ENV['VIMFILES']
- ENV['VIMFILES']
- elsif RUBY_PLATFORM =~ /(win|w)32$/
- File.expand_path("~/vimfiles")
- else
- File.expand_path("~/.vim")
- end
- files.each do |file|
- target_file = File.join(vimfiles, file)
- FileUtils.mkdir_p File.dirname(target_file)
- FileUtils.cp file, target_file
-
- puts " Copied #{file} to #{target_file}"
- end
-
-end
View
50 bundle/ack-vim/doc/ack.txt
@@ -1,50 +0,0 @@
-*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|, but instead of making a new list, the matches are
- appended to the current |quickfix| list.
-
-:AckFromSearch [{directory}] *:AckFromSearch*
-
- Just like |:Ack| but the pattern is from previous search.
-
-:LAck [options] {pattern} [{directory}] *:LAck*
-
- Just like |:Ack| but instead of the |quickfix| list, matches are placed in
- the current |location-list|.
-
-:LAckAdd [options] {pattern} [{directory}] *:LAckAdd*
-
- Just like |:AckAdd| but instead of the |quickfix| list, matches are added
- to the current |location-list|
-
-:AckFile [options] {pattern} [{directory}] *:AckFile*
-
- Search recursively in {directory} (which defaults to the current
- directory) for filenames matching the {pattern}. Behaves just like the
- |:grep| command, but will open the |Quickfix| window for you.
-
-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.
View
61 bundle/ack-vim/plugin/ack.vim
@@ -1,61 +0,0 @@
-" NOTE: You must, of course, install the ack script
-" in your path.
-" On Debian / Ubuntu:
-" sudo apt-get install ack-grep
-" On your vimrc:
-" let g:ackprg="ack-grep -H --nocolor --nogroup --column"
-"
-" With MacPorts:
-" sudo port install p5-app-ack
-
-" Location of the ack utility
-if !exists("g:ackprg")
- let g:ackprg="ack -H --nocolor --nogroup --column"
-endif
-
-function! s:Ack(cmd, args)
- redraw
- echo "Searching ..."
-
- " Format, used to manage column jump
- if a:cmd =~# '-g$'
- let g:ackformat="%f"
- else
- let g:ackformat="%f:%l:%c:%m"
- end
-
- let grepprg_bak=&grepprg
- let grepformat_bak=&grepformat
- try
- let &grepprg=g:ackprg
- let &grepformat=g:ackformat
- silent execute a:cmd . " " . a:args
- finally
- let &grepprg=grepprg_bak
- let &grepformat=grepformat_bak
- endtry
-
- if a:cmd =~# '^l'
- botright lopen
- else
- botright copen
- endif
-
- exec "nnoremap <silent> <buffer> q :ccl<CR>"
-
- 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>)
-command! -bang -nargs=* -complete=file AckFile call s:Ack('grep<bang> -g', <q-args>)
View
1,378 bundle/conque_1.0/autoload/conque_term.vim
@@ -1,1378 +0,0 @@
-" FILE: plugin/conque_term.vim {{{
-" AUTHOR: Nico Raffo <nicoraffo@gmail.com>
-" MODIFIED: 2010-02-02
-" VERSION: 1.0, for Vim 7.0
-" LICENSE:
-" Conque - pty interaction in Vim
-" Copyright (C) 2009-2010 Nico Raffo
-"
-" MIT License
-"
-" Permission is hereby granted, free of charge, to any person obtaining a copy
-" of this software and associated documentation files (the "Software"), to deal
-" in the Software without restriction, including without limitation the rights
-" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-" copies of the Software, and to permit persons to whom the Software is
-" furnished to do so, subject to the following conditions:
-"
-" The above copyright notice and this permission notice shall be included in
-" all copies or substantial portions of the Software.
-"
-" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-" THE SOFTWARE.
-" }}}
-
-" **********************************************************************************************************
-" **** VIM FUNCTIONS ***************************************************************************************
-" **********************************************************************************************************
-
-" launch conque
-function! conque_term#open(...) "{{{
- let command = get(a:000, 0, '')
- let hooks = get(a:000, 1, [])
-
- " bare minimum validation
- if empty(command)
- echohl WarningMsg | echomsg "No command found" | echohl None
- return 0
- else
- let l:cargs = split(command, '\s')
- if !executable(l:cargs[0])
- echohl WarningMsg | echomsg "Not an executable" | echohl None
- return 0
- endif
- endif
-
- " set buffer window options
- let g:Conque_BufName = substitute(command, ' ', '\\ ', 'g') . "\\ -\\ " . g:ConqueTerm_Idx
- call conque_term#set_buffer_settings(command, hooks)
- let b:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
- let g:ConqueTerm_Var = 'ConqueTerm_' . g:ConqueTerm_Idx
- let g:ConqueTerm_Idx += 1
-
- " open command
- try
- let l:config = '{"color":' . string(g:ConqueTerm_Color) . ',"TERM":"' . g:ConqueTerm_TERM . '"}'
- execute 'python ' . b:ConqueTerm_Var . ' = Conque()'
- execute "python " . b:ConqueTerm_Var . ".open('" . conque_term#python_escape(command) . "', " . l:config . ")"
- catch
- echohl WarningMsg | echomsg "Unable to open command: " . command | echohl None
- return 0
- endtry
-
- " set buffer mappings and auto commands
- call conque_term#set_mappings()
-
- startinsert!
- return 1
-endfunction "}}}
-
-" set buffer options
-function! conque_term#set_buffer_settings(command, pre_hooks) "{{{
-
- " optional hooks to execute, e.g. 'split'
- for h in a:pre_hooks
- silent execute h
- endfor
- silent execute "edit " . g:Conque_BufName
-
- " buffer settings
- setlocal nocompatible " conque won't work in compatible mode
- setlocal buftype=nofile " this buffer is not a file, you can't save it
- setlocal nonumber " hide line numbers
- setlocal foldcolumn=0 " reasonable left margin
- setlocal nowrap " default to no wrap (esp with MySQL)
- setlocal noswapfile " don't bother creating a .swp file
- setlocal updatetime=50 " trigger cursorhold event after 50ms / XXX - global
- setlocal scrolloff=0 " don't use buffer lines. it makes the 'clear' command not work as expected
- setlocal sidescrolloff=0 " don't use buffer lines. it makes the 'clear' command not work as expected
- setlocal sidescroll=1 " don't use buffer lines. it makes the 'clear' command not work as expected
- setlocal foldmethod=manual " don't fold on {{{}}} and stuff
- setlocal switchbuf=usetab " switch tabs with the <f9> command
- setfiletype conque_term " useful
- silent execute "setlocal syntax=" . g:ConqueTerm_Syntax
-
-endfunction " }}}
-
-" set key mappings and auto commands
-function! conque_term#set_mappings() "{{{
-
- " handle unexpected closing of shell, passes HUP to parent and all child processes
- execute 'autocmd BufUnload <buffer> python ' . b:ConqueTerm_Var . '.proc.signal(1)'
-
- " check for resized/scrolled buffer when entering buffer
- execute 'autocmd BufEnter <buffer> python ' . b:ConqueTerm_Var . '.update_window_size()'
-
- " set/reset updatetime on entering/exiting buffer
- autocmd BufEnter <buffer> set updatetime=50
- autocmd BufLeave <buffer> set updatetime=1000
-
- " check for resized/scrolled buffer when entering insert mode
- " XXX - messed up since we enter insert mode at each updatetime
- "execute 'autocmd InsertEnter <buffer> python ' . b:ConqueTerm_Var . '.screen.align()'
-
- " read more output when this isn't the current buffer
- if g:ConqueTerm_ReadUnfocused == 1
- autocmd CursorHold * call conque_term#read_all()
- endif
-
- " use F22 key to get more input
- inoremap <silent> <buffer> <expr> <F22> "\<left>\<right>"
- inoremap <silent> <buffer> <expr> <F23> "\<right>\<left>"
- silent execute 'autocmd CursorHoldI <buffer> python ' . b:ConqueTerm_Var . '.auto_read()'
-
- " map ASCII 1-31
- for c in range(1, 31)
- " <Esc>
- if c == 27
- continue
- endif
- silent execute 'inoremap <silent> <buffer> <C-' . nr2char(64 + c) . '> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(' . c . '))<CR>'
- endfor
- silent execute 'inoremap <silent> <buffer> <Esc><Esc> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(27))<CR>'
- silent execute 'nnoremap <silent> <buffer> <C-c> <C-o>:python ' . b:ConqueTerm_Var . '.write(chr(3))<CR>'
-
- " map ASCII 33-127
- for i in range(33, 127)
- " <Bar>
- if i == 124
- silent execute "inoremap <silent> <buffer> <Bar> <C-o>:python " . b:ConqueTerm_Var . ".write(chr(124))<CR>"
- continue
- endif
- silent execute "inoremap <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write(chr(" . i . "))<CR>"
- endfor
-
- " map ASCII 128-255
- for i in range(128, 255)
- silent execute "inoremap <silent> <buffer> " . nr2char(i) . " <C-o>:python " . b:ConqueTerm_Var . ".write('" . nr2char(i) . "')<CR>"
- endfor
-
- " Special cases
- silent execute 'inoremap <silent> <buffer> <BS> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u0008")<CR>'
- "silent execute 'inoremap <silent> <buffer> <Tab> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u0009")<CR>'
- silent execute 'inoremap <silent> <buffer> <LF> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u000a")<CR>'
- silent execute 'inoremap <silent> <buffer> <CR> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u000d")<CR>'
- silent execute 'inoremap <silent> <buffer> <Space> <C-o>:python ' . b:ConqueTerm_Var . '.write(" ")<CR>'
- silent execute 'inoremap <silent> <buffer> <Up> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[A")<CR>'
- silent execute 'inoremap <silent> <buffer> <Down> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[B")<CR>'
- silent execute 'inoremap <silent> <buffer> <Right> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[C")<CR>'
- silent execute 'inoremap <silent> <buffer> <Left> <C-o>:python ' . b:ConqueTerm_Var . '.write(u"\u001b[D")<CR>'
-
- " meta characters
- "for c in split(s:chars_meta, '\zs')
- " silent execute 'inoremap <silent> <buffer> <M-' . c . '> <Esc>:call conque_term#press_key("<C-v><Esc>' . c . '")<CR>a'
- "endfor
-
- " send selected text into conque
- vnoremap <silent> <F9> :<C-u>call conque_term#send_selected(visualmode())<CR>
-
- " remap paste keys
- silent execute 'nnoremap <silent> <buffer> p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
- silent execute 'nnoremap <silent> <buffer> P :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
- silent execute 'nnoremap <silent> <buffer> ]p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
- silent execute 'nnoremap <silent> <buffer> [p :python ' . b:ConqueTerm_Var . '.write(vim.eval("@@"))<CR>a'
- if has('gui_running')
- silent execute 'inoremap <buffer> <S-Insert> <Esc>:<C-u>python ' . b:ConqueTerm_Var . ".write(vim.eval('@+'))<CR>a"
- endif
-
- " disable other normal mode keys which insert text
- nnoremap <silent> <buffer> r :echo 'Replace mode disabled in shell.'<CR>
- nnoremap <silent> <buffer> R :echo 'Replace mode disabled in shell.'<CR>
- nnoremap <silent> <buffer> c :echo 'Change mode disabled in shell.'<CR>
- nnoremap <silent> <buffer> C :echo 'Change mode disabled in shell.'<CR>
- nnoremap <silent> <buffer> s :echo 'Change mode disabled in shell.'<CR>
- nnoremap <silent> <buffer> S :echo 'Change mode disabled in shell.'<CR>
-
- " help message about <Esc>
- "nnoremap <silent> <buffer> <Esc> :echo 'To send an <E'.'sc> to the terminal, press <E'.'sc><E'.'sc> quickly in insert mode. Some programs, such as Vim, will also accept <Ctrl-c> as a substitute for <E'.'sc>'<CR><Esc>
-
-endfunction "}}}
-
-" send selected text from another buffer
-function! conque_term#send_selected(type) "{{{
- let reg_save = @@
-
- " yank current selection
- silent execute "normal! `<" . a:type . "`>y"
-
- let @@ = substitute(@@, '^[\r\n]*', '', '')
- let @@ = substitute(@@, '[\r\n]*$', '', '')
-
- silent execute ":sb " . g:Conque_BufName
- silent execute 'python ' . g:ConqueTerm_Var . '.paste_selection()'
-
- let @@ = reg_save
- startinsert!
-endfunction "}}}
-
-" read from all known conque buffers
-function! conque_term#read_all() "{{{
- " don't run this if we're in a conque buffer
- if exists('b:ConqueTerm_Var')
- return
- endif
-
- try
- for i in range(1, g:ConqueTerm_Idx - 1)
- execute 'python ConqueTerm_' . string(i) . '.read(1)'
- endfor
- catch
- " probably a deleted buffer
- endtry
-
- " TODO - doesn't work
- " restart updatetime
- "call feedkeys("\x80\xFD\x35")
-endfunction "}}}
-
-" util function to add enough \s to pass a string to python
-function! conque_term#python_escape(input) "{{{
- let l:cleaned = a:input
- let l:cleaned = substitute(l:cleaned, '\\', '\\\\', 'g')
- let l:cleaned = substitute(l:cleaned, '\n', '\\n', 'g')
- let l:cleaned = substitute(l:cleaned, '\r', '\\r', 'g')
- let l:cleaned = substitute(l:cleaned, "'", "\\\\'", 'g')
- return l:cleaned
-endfunction "}}}
-
-" **********************************************************************************************************
-" **** PYTHON **********************************************************************************************
-" **********************************************************************************************************
-
-python << EOF
-
-import vim, re, time, math
-
-# CONFIG CONSTANTS {{{
-
-CONQUE_CTL = {
- 7:'bel', # bell
- 8:'bs', # backspace
- 9:'tab', # tab
- 10:'nl', # new line
- 13:'cr' # carriage return
-}
-# 11 : 'vt', # vertical tab
-# 12 : 'ff', # form feed
-# 14 : 'so', # shift out
-# 15 : 'si' # shift in
-
-# Escape sequences
-CONQUE_ESCAPE = {
- 'm':'font',
- 'J':'clear_screen',
- 'K':'clear_line',
- '@':'add_spaces',
- 'A':'cursor_up',
- 'B':'cursor_down',
- 'C':'cursor_right',
- 'D':'cursor_left',
- 'G':'cursor_to_column',
- 'H':'cursor',
- 'P':'delete_chars',
- 'f':'cursor',
- 'g':'tab_clear',
- 'r':'set_coords',
- 'h':'set',
- 'l':'reset'
-}
-# 'L':'insert_lines',
-# 'M':'delete_lines',
-# 'd':'cusor_vpos',
-
-# Alternate escape sequences, no [
-CONQUE_ESCAPE_PLAIN = {
- 'D':'scroll_up',
- 'E':'next_line',
- 'H':'set_tab',
- 'M':'scroll_down'
-}
-# 'N':'single_shift_2',
-# 'O':'single_shift_3',
-# '=':'alternate_keypad',
-# '>':'numeric_keypad',
-# '7':'save_cursor',
-# '8':'restore_cursor',
-
-# Uber alternate escape sequences, with # or ?
-CONQUE_ESCAPE_QUESTION = {
- '1h':'new_line_mode',
- '3h':'132_cols',
- '4h':'smooth_scrolling',
- '5h':'reverse_video',
- '6h':'relative_origin',
- '7h':'set_auto_wrap',
- '8h':'set_auto_repeat',
- '9h':'set_interlacing_mode',
- '1l':'set_cursor_key',
- '2l':'set_vt52',
- '3l':'80_cols',
- '4l':'set_jump_scrolling',
- '5l':'normal_video',
- '6l':'absolute_origin',
- '7l':'reset_auto_wrap',
- '8l':'reset_auto_repeat',
- '9l':'reset_interlacing_mode'
-}
-
-CONQUE_ESCAPE_HASH = {
- '8':'screen_alignment_test'
-}
-# '3':'double_height_top',
-# '4':'double_height_bottom',
-# '5':'single_height_single_width',
-# '6':'single_height_double_width',
-
-# Font codes {{{
-CONQUE_FONT = {
- 0: {'description':'Normal (default)', 'attributes': {'cterm':'NONE','ctermfg':'NONE','ctermbg':'NONE','gui':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
- 1: {'description':'Bold', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
- 4: {'description':'Underlined', 'attributes': {'cterm':'UNDERLINE','gui':'UNDERLINE'}, 'normal':False},
- 5: {'description':'Blink (appears as Bold)', 'attributes': {'cterm':'BOLD','gui':'BOLD'}, 'normal':False},
- 7: {'description':'Inverse', 'attributes': {'cterm':'REVERSE','gui':'REVERSE'}, 'normal':False},
- 8: {'description':'Invisible (hidden)', 'attributes': {'ctermfg':'0','ctermbg':'0','guifg':'#000000','guibg':'#000000'}, 'normal':False},
- 22: {'description':'Normal (neither bold nor faint)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
- 24: {'description':'Not underlined', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
- 25: {'description':'Steady (not blinking)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
- 27: {'description':'Positive (not inverse)', 'attributes': {'cterm':'NONE','gui':'NONE'}, 'normal':True},
- 28: {'description':'Visible (not hidden)', 'attributes': {'ctermfg':'NONE','ctermbg':'NONE','guifg':'NONE','guibg':'NONE'}, 'normal':True},
- 30: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'16','guifg':'#000000'}, 'normal':False},
- 31: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'1','guifg':'#ff0000'}, 'normal':False},
- 32: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'2','guifg':'#00ff00'}, 'normal':False},
- 33: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'3','guifg':'#ffff00'}, 'normal':False},
- 34: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'4','guifg':'#0000ff'}, 'normal':False},
- 35: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'5','guifg':'#990099'}, 'normal':False},
- 36: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'6','guifg':'#009999'}, 'normal':False},
- 37: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'7','guifg':'#ffffff'}, 'normal':False},
- 39: {'description':'Set foreground color to default (original)', 'attributes': {'ctermfg':'NONE','guifg':'NONE'}, 'normal':True},
- 40: {'description':'Set background color to Black', 'attributes': {'ctermbg':'16','guibg':'#000000'}, 'normal':False},
- 41: {'description':'Set background color to Red', 'attributes': {'ctermbg':'1','guibg':'#ff0000'}, 'normal':False},
- 42: {'description':'Set background color to Green', 'attributes': {'ctermbg':'2','guibg':'#00ff00'}, 'normal':False},
- 43: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'3','guibg':'#ffff00'}, 'normal':False},
- 44: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'4','guibg':'#0000ff'}, 'normal':False},
- 45: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'5','guibg':'#990099'}, 'normal':False},
- 46: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'6','guibg':'#009999'}, 'normal':False},
- 47: {'description':'Set background color to White', 'attributes': {'ctermbg':'7','guibg':'#ffffff'}, 'normal':False},
- 49: {'description':'Set background color to default (original).', 'attributes': {'ctermbg':'NONE','guibg':'NONE'}, 'normal':True},
- 90: {'description':'Set foreground color to Black', 'attributes': {'ctermfg':'8','guifg':'#000000'}, 'normal':False},
- 91: {'description':'Set foreground color to Red', 'attributes': {'ctermfg':'9','guifg':'#ff0000'}, 'normal':False},
- 92: {'description':'Set foreground color to Green', 'attributes': {'ctermfg':'10','guifg':'#00ff00'}, 'normal':False},
- 93: {'description':'Set foreground color to Yellow', 'attributes': {'ctermfg':'11','guifg':'#ffff00'}, 'normal':False},
- 94: {'description':'Set foreground color to Blue', 'attributes': {'ctermfg':'12','guifg':'#0000ff'}, 'normal':False},
- 95: {'description':'Set foreground color to Magenta', 'attributes': {'ctermfg':'13','guifg':'#990099'}, 'normal':False},
- 96: {'description':'Set foreground color to Cyan', 'attributes': {'ctermfg':'14','guifg':'#009999'}, 'normal':False},
- 97: {'description':'Set foreground color to White', 'attributes': {'ctermfg':'15','guifg':'#ffffff'}, 'normal':False},
- 100: {'description':'Set background color to Black', 'attributes': {'ctermbg':'8','guibg':'#000000'}, 'normal':False},
- 101: {'description':'Set background color to Red', 'attributes': {'ctermbg':'9','guibg':'#ff0000'}, 'normal':False},
- 102: {'description':'Set background color to Green', 'attributes': {'ctermbg':'10','guibg':'#00ff00'}, 'normal':False},
- 103: {'description':'Set background color to Yellow', 'attributes': {'ctermbg':'11','guibg':'#ffff00'}, 'normal':False},
- 104: {'description':'Set background color to Blue', 'attributes': {'ctermbg':'12','guibg':'#0000ff'}, 'normal':False},
- 105: {'description':'Set background color to Magenta', 'attributes': {'ctermbg':'13','guibg':'#990099'}, 'normal':False},
- 106: {'description':'Set background color to Cyan', 'attributes': {'ctermbg':'14','guibg':'#009999'}, 'normal':False},
- 107: {'description':'Set background color to White', 'attributes': {'ctermbg':'15','guibg':'#ffffff'}, 'normal':False}
-}
-# }}}
-
-# regular expression matching (almost) all control sequences
-CONQUE_SEQ_REGEX = re.compile(ur"(\u001b\[?\??#?[0-9;]*[a-zA-Z@]|\u001b\][0-9];.*?\u0007|[\u0007-\u000f])", re.UNICODE)
-CONQUE_SEQ_REGEX_CTL = re.compile(ur"^[\u0007-\u000f]$", re.UNICODE)
-CONQUE_SEQ_REGEX_CSI = re.compile(ur"^\u001b\[", re.UNICODE)
-CONQUE_SEQ_REGEX_TITLE = re.compile(ur"^\u001b\]", re.UNICODE)
-CONQUE_SEQ_REGEX_HASH = re.compile(ur"^\u001b#", re.UNICODE)
-CONQUE_SEQ_REGEX_ESC = re.compile(ur"^\u001b", re.UNICODE)
-
-# match table output
-CONQUE_TABLE_OUTPUT = re.compile("^\s*\|\s.*\s\|\s*$|^\s*\+[=+-]+\+\s*$")
-
-# }}}
-
-###################################################################################################
-class Conque:
-
- # CLASS PROPERTIES {{{
-
- # screen object
- window = None
- screen = None
-
- # subprocess object
- proc = None
-
- # terminal dimensions and scrolling region
- columns = 80 # same as $COLUMNS
- lines = 24 # same as $LINES
- working_columns = 80 # can be changed by CSI ? 3 l/h
- working_lines = 24 # can be changed by CSI r
-
- # top/bottom of the scroll region
- top = 1 # relative to top of screen
- bottom = 24 # relative to top of screen
-
- # cursor position
- l = 1 # current cursor line
- c = 1 # current cursor column
-
- # autowrap mode
- autowrap = True
-
- # absolute coordinate mode
- absolute_coords = True
-
- # tabstop positions
- tabstops = []
-
- # enable colors
- enable_colors = True
-
- # color changes
- color_changes = {}
-
- # color history
- color_history = {}
-
- # don't wrap table output
- unwrap_tables = True
-
- # wrap CUF/CUB around line breaks
- wrap_cursor = False
-
- # }}}
-
- # constructor
- def __init__(self): # {{{
- self.window = vim.current.window
- self.screen = ConqueScreen()
- # }}}
-
- # start program and initialize this instance
- def open(self, command, options): # {{{
-
- # int vars
- self.columns = self.window.width
- self.lines = self.window.height
- self.working_columns = self.window.width
- self.working_lines = self.window.height
- self.bottom = self.window.height
-
- # init color
- self.enable_colors = options['color']
-
- # init tabstops
- self.init_tabstops()
-
- # open command
- self.proc = ConqueSubprocess()
- self.proc.open(command, { 'TERM' : options['TERM'], 'CONQUE' : '1', 'LINES' : str(self.lines), 'COLUMNS' : str(self.columns)})
- # }}}
-
- # write to pty
- def write(self, input): # {{{
-
- # write and read
- self.proc.write(input)
- self.read(1)
- # }}}
-
- # read from pty, and update buffer
- def read(self, timeout = 1): # {{{
- # read from subprocess
- output = self.proc.read(timeout)
- # and strip null chars
- output = output.replace(chr(0), '')
-
- if output == '':
- return
-
- chunks = CONQUE_SEQ_REGEX.split(output)
-
- # don't go through all the csi regex if length is one (no matches)
- if len(chunks) == 1:
-
- self.plain_text(chunks[0])
-
- else:
- for s in chunks:
- if s == '':
- continue
-
- # Check for control character match {{{
- if CONQUE_SEQ_REGEX_CTL.match(s[0]):
-
- nr = ord(s[0])
- if nr in CONQUE_CTL:
- getattr(self, 'ctl_' + CONQUE_CTL[nr])()
- else:
-
- pass
- # }}}
-
- # check for escape sequence match {{{
- elif CONQUE_SEQ_REGEX_CSI.match(s):
-
- if s[-1] in CONQUE_ESCAPE:
- csi = self.parse_csi(s[2:])
-
- getattr(self, 'csi_' + CONQUE_ESCAPE[s[-1]])(csi)
- else:
-
- pass
- # }}}
-
- # check for title match {{{
- elif CONQUE_SEQ_REGEX_TITLE.match(s):
-
- self.change_title(s[2], s[4:-1])
- # }}}
-
- # check for hash match {{{
- elif CONQUE_SEQ_REGEX_HASH.match(s):
-
- if s[-1] in CONQUE_ESCAPE_HASH:
- getattr(self, 'hash_' + CONQUE_ESCAPE_HASH[s[-1]])()
- else:
-
- pass
- # }}}
-
- # check for other escape match {{{
- elif CONQUE_SEQ_REGEX_ESC.match(s):
-
- if s[-1] in CONQUE_ESCAPE_PLAIN:
- getattr(self, 'esc_' + CONQUE_ESCAPE_PLAIN[s[-1]])()
- else:
-
- pass
- # }}}
-
- # else process plain text {{{
- else:
- self.plain_text(s)
- # }}}
-
- # set cursor position
- self.screen.set_cursor(self.l, self.c)
-
- vim.command('redraw')
-
- # }}}
-
- # for polling
- def auto_read(self): # {{{
- self.read(1)
- if self.c == 1:
- vim.command('call feedkeys("\<F23>", "t")')
- else:
- vim.command('call feedkeys("\<F22>", "t")')
- self.screen.set_cursor(self.l, self.c)
- # }}}
-
- ###############################################################################################
- # Plain text # {{{
-
- def plain_text(self, input):
-
- current_line = self.screen[self.l]
-
- if len(current_line) < self.working_columns:
- current_line = current_line + ' ' * (self.c - len(current_line))
-
- # if line is wider than screen
- if self.c + len(input) - 1 > self.working_columns:
- # Table formatting hack
- if self.unwrap_tables and CONQUE_TABLE_OUTPUT.match(input):
- self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
- self.apply_color(self.c, self.c + len(input))
- self.c += len(input)
- return
-
- diff = self.c + len(input) - self.working_columns - 1
- # if autowrap is enabled
- if self.autowrap:
- self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff ]
- self.apply_color(self.c, self.working_columns)
- self.ctl_nl()
- self.ctl_cr()
- remaining = input[ -1 * diff : ]
-
- self.plain_text(remaining)
- else:
- self.screen[self.l] = current_line[ : self.c - 1] + input[ : -1 * diff - 1 ] + input[-1]
- self.apply_color(self.c, self.working_columns)
- self.c = self.working_columns
-
- # no autowrap
- else:
- self.screen[self.l] = current_line[ : self.c - 1] + input + current_line[ self.c + len(input) - 1 : ]
- self.apply_color(self.c, self.c + len(input))
- self.c += len(input)
-
- def apply_color(self, start, end):
-
- # stop here if coloration is disabled
- if not self.enable_colors:
- return
-
- real_line = self.screen.get_real_line(self.l)
-
- # check for previous overlapping coloration
-
- to_del = []
- if self.color_history.has_key(real_line):
- for i in range(len(self.color_history[real_line])):
- syn = self.color_history[real_line][i]
-
- if syn['start'] >= start and syn['start'] < end:
-
- vim.command('syn clear ' + syn['name'])
- to_del.append(i)
- # outside
- if syn['end'] > end:
-
- self.exec_highlight(real_line, end, syn['end'], syn['highlight'])
- elif syn['end'] > start and syn['end'] <= end:
-
- vim.command('syn clear ' + syn['name'])
- to_del.append(i)
- # outside
- if syn['start'] < start:
-
- self.exec_highlight(real_line, syn['start'], start, syn['highlight'])
-
- if len(to_del) > 0:
- to_del.reverse()
- for di in to_del:
- del self.color_history[real_line][di]
-
- # if there are no new colors
- if len(self.color_changes) == 0:
- return
-
- highlight = ''
- for attr in self.color_changes.keys():
- highlight = highlight + ' ' + attr + '=' + self.color_changes[attr]
-
- # execute the highlight
- self.exec_highlight(real_line, start, end, highlight)
-
- def exec_highlight(self, real_line, start, end, highlight):
- unique_key = str(self.proc.pid)
-
- syntax_name = 'EscapeSequenceAt_' + unique_key + '_' + str(self.l) + '_' + str(start) + '_' + str(len(self.color_history) + 1)
- syntax_options = ' contains=ALLBUT,ConqueString,MySQLString,MySQLKeyword oneline'
- syntax_region = 'syntax match ' + syntax_name + ' /\%' + str(real_line) + 'l\%>' + str(start - 1) + 'c.*\%<' + str(end + 1) + 'c/' + syntax_options
- syntax_highlight = 'highlight ' + syntax_name + highlight
-
- vim.command(syntax_region)
- vim.command(syntax_highlight)
-
- # add syntax name to history
- if not self.color_history.has_key(real_line):
- self.color_history[real_line] = []
-
- self.color_history[real_line].append({'name':syntax_name, 'start':start, 'end':end, 'highlight':highlight})
-
- # }}}
-
- ###############################################################################################
- # Control functions {{{
-
- def ctl_nl(self):
- # if we're in a scrolling region, scroll instead of moving cursor down
- if self.lines != self.working_lines and self.l == self.bottom:
- del self.screen[self.top]
- self.screen.insert(self.bottom, '')
- elif self.l == self.bottom:
- self.screen.append('')
- else:
- self.l += 1
-
- self.color_changes = {}
-
- def ctl_cr(self):
- self.c = 1
-
- self.color_changes = {}
-
- def ctl_bs(self):
- if self.c > 1:
- self.c += -1
-
- def ctl_bel(self):
- print 'BELL'
-
- def ctl_tab(self):
- # default tabstop location
- ts = self.working_columns
-
- # check set tabstops
- for i in range(self.c, len(self.tabstops)):
- if self.tabstops[i]:
- ts = i + 1
- break
-
- self.c = ts
-
- # }}}
-
- ###############################################################################################
- # CSI functions {{{
-
- def csi_font(self, csi): # {{{
- if not self.enable_colors:
- return
-
- # defaults to 0
- if len(csi['vals']) == 0:
- csi['vals'] = [0]
-
- for val in csi['vals']:
- if CONQUE_FONT.has_key(val):
-
- # ignore starting normal colors
- if CONQUE_FONT[val]['normal'] and len(self.color_changes) == 0:
-
- continue
- # clear color changes
- elif CONQUE_FONT[val]['normal']:
-
- self.color_changes = {}
- # save these color attributes for next plain_text() call
- else:
-
- for attr in CONQUE_FONT[val]['attributes'].keys():
- if self.color_changes.has_key(attr) and (attr == 'cterm' or attr == 'gui'):
- self.color_changes[attr] += ',' + CONQUE_FONT[val]['attributes'][attr]
- else:
- self.color_changes[attr] = CONQUE_FONT[val]['attributes'][attr]
- # }}}
-
- def csi_clear_line(self, csi): # {{{
-
- # this escape defaults to 0
- if len(csi['vals']) == 0:
- csi['val'] = 0
-
- # 0 means cursor right
- if csi['val'] == 0:
- self.screen[self.l] = self.screen[self.l][0 : self.c - 1]
-
- # 1 means cursor left
- elif csi['val'] == 1:
- self.screen[self.l] = ' ' * (self.c) + self.screen[self.l][self.c : ]
-
- # clear entire line
- elif csi['val'] == 2:
- self.screen[self.l] = ''
-
- # clear colors
- if csi['val'] == 2 or (csi['val'] == 0 and self.c == 1):
- real_line = self.screen.get_real_line(self.l)
- if self.color_history.has_key(real_line):
- for syn in self.color_history[real_line]:
- vim.command('syn clear ' + syn['name'])
-
- # }}}
-
- def csi_cursor_right(self, csi): # {{{
- # we use 1 even if escape explicitly specifies 0
- if csi['val'] == 0:
- csi['val'] = 1
-
- if self.wrap_cursor and self.c + csi['val'] > self.working_columns:
- self.l += int(math.floor( (self.c + csi['val']) / self.working_columns ))
- self.c = (self.c + csi['val']) % self.working_columns
- return
-
- self.c = self.bound(self.c + csi['val'], 1, self.working_columns)
- # }}}
-
- def csi_cursor_left(self, csi): # {{{
- # we use 1 even if escape explicitly specifies 0
- if csi['val'] == 0:
- csi['val'] = 1
-
- if self.wrap_cursor and csi['val'] >= self.c:
- self.l += int(math.floor( (self.c - csi['val']) / self.working_columns ))
- self.c = self.working_columns - (csi['val'] - self.c) % self.working_columns
- return
-
- self.c = self.bound(self.c - csi['val'], 1, self.working_columns)
- # }}}
-
- def csi_cursor_to_column(self, csi): # {{{
- self.c = self.bound(csi['val'], 1, self.working_columns)
- # }}}
-
- def csi_cursor_up(self, csi): # {{{
- self.l = self.bound(self.l - csi['val'], self.top, self.bottom)
-
- self.color_changes = {}
- # }}}
-
- def csi_cursor_down(self, csi): # {{{
- self.l = self.bound(self.l + csi['val'], self.top, self.bottom)
-
- self.color_changes = {}
- # }}}
-
- def csi_clear_screen(self, csi): # {{{
- # default to 0
- if len(csi['vals']) == 0:
- csi['val'] = 0
-
- # 2 == clear entire screen
- if csi['val'] == 2:
- self.l = 1
- self.c = 1
- self.screen.clear()
-
- # 0 == clear down
- elif csi['val'] == 0:
- for l in range(self.bound(self.l + 1, 1, self.lines), self.lines + 1):
- self.screen[l] = ''
-
- # clear end of current line
- self.csi_clear_line(self.parse_csi('K'))
-
- # 1 == clear up
- elif csi['val'] == 1:
- for l in range(1, self.bound(self.l, 1, self.lines + 1)):
- self.screen[l] = ''
-
- # clear beginning of current line
- self.csi_clear_line(self.parse_csi('1K'))
-
- # clear coloration
- if csi['val'] == 2 or csi['val'] == 0:
- real_line = self.screen.get_real_line(self.l)
- for line in self.color_history.keys():
- if line >= real_line:
- for syn in self.color_history[line]:
- vim.command('syn clear ' + syn['name'])
-
- self.color_changes = {}
- # }}}
-
- def csi_delete_chars(self, csi): # {{{
- self.screen[self.l] = self.screen[self.l][ : self.c ] + self.screen[self.l][ self.c + csi['val'] : ]
- # }}}
-
- def csi_add_spaces(self, csi): # {{{
- self.screen[self.l] = self.screen[self.l][ : self.c - 1] + ' ' * csi['val'] + self.screen[self.l][self.c : ]
- # }}}
-
- def csi_cursor(self, csi): # {{{
- if len(csi['vals']) == 2:
- new_line = csi['vals'][0]
- new_col = csi['vals'][1]
- else:
- new_line = 1
- new_col = 1
-
- if self.absolute_coords:
- self.l = self.bound(new_line, 1, self.lines)
- else:
- self.l = self.bound(self.top + new_line - 1, self.top, self.bottom)
-
- self.c = self.bound(new_col, 1, self.working_columns)
- if self.c > len(self.screen[self.l]):
- self.screen[self.l] = self.screen[self.l] + ' ' * (self.c - len(self.screen[self.l]))
-
- # }}}
-
- def csi_set_coords(self, csi): # {{{
- if len(csi['vals']) == 2:
- new_start = csi['vals'][0]
- new_end = csi['vals'][1]
- else:
- new_start = 1
- new_end = self.window.height
-
- self.top = new_start
- self.bottom = new_end
- self.working_lines = new_end - new_start + 1
-
- # if cursor is outside scrolling region, reset it
- if self.l < self.top:
- self.l = self.top
- elif self.l > self.bottom:
- self.l = self.bottom
-
- self.color_changes = {}
- # }}}
-
- def csi_tab_clear(self, csi): # {{{
- # this escape defaults to 0
- if len(csi['vals']) == 0:
- csi['val'] = 0
-
- if csi['val'] == 0:
- self.tabstops[self.c - 1] = False
- elif csi['val'] == 3:
- for i in range(0, self.columns + 1):
- self.tabstops[i] = False
- # }}}
-
- def csi_set(self, csi): # {{{
- # 132 cols
- if csi['val'] == 3:
- self.csi_clear_screen(self.parse_csi('2J'))
- self.working_columns = 132
-
- # relative_origin
- elif csi['val'] == 6:
- self.absolute_coords = False
-
- # set auto wrap
- elif csi['val'] == 7:
- self.autowrap = True
-
- self.color_changes = {}
- # }}}
-
- def csi_reset(self, csi): # {{{
- # 80 cols
- if csi['val'] == 3:
- self.csi_clear_screen(self.parse_csi('2J'))
- self.working_columns = 80
-
- # absolute origin
- elif csi['val'] == 6:
- self.absolute_coords = True
-
- # reset auto wrap
- elif csi['val'] == 7:
- self.autowrap = False
-
- self.color_changes = {}
- # }}}
-
- # }}}
-
- ###############################################################################################
- # ESC functions {{{
-
- def esc_scroll_up(self): # {{{
- self.ctl_nl()
-
- self.color_changes = {}
- # }}}
-
- def esc_next_line(self): # {{{
- self.ctl_nl()
- self.c = 1
- # }}}
-
- def esc_set_tab(self): # {{{
-
- if self.c <= len(self.tabstops):
- self.tabstops[self.c - 1] = True
- # }}}
-
- def esc_scroll_down(self): # {{{
- if self.l == self.top:
- del self.screen[self.bottom]
- self.screen.insert(self.top, '')
- else:
- self.l += -1
-
- self.color_changes = {}
- # }}}
-
- # }}}
-
- ###############################################################################################
- # HASH functions {{{
-
- def hash_screen_alignment_test(self): # {{{
- self.csi_clear_screen(self.parse_csi('2J'))
- self.working_lines = self.lines
- for l in range(1, self.lines + 1):
- self.screen[l] = 'E' * self.working_columns
- # }}}
-
- # }}}
-
- ###############################################################################################
- # Random stuff {{{
-
- def change_title(self, key, val):
-
- if key == '0' or key == '2':
-
- vim.command('setlocal statusline=' + re.escape(val))
-
- def paste(self):
- self.write(vim.eval('@@'))
- self.read(50)
-
- def paste_selection(self):
- self.write(vim.eval('@@'))
-
- def update_window_size(self):
- # resize if needed
- if self.window.width != self.columns or self.window.height != self.lines:
-
- # reset all window size attributes to default
- self.columns = self.window.width
- self.lines = self.window.height
- self.working_columns = self.window.width
- self.working_lines = self.window.height
- self.bottom = self.window.height
-
- # reset screen object attributes
- self.l = self.screen.reset_size(self.l)
-
- # reset tabstops
- self.init_tabstops()
-
- # signal process that screen size has changed
- self.proc.window_resize(self.lines, self.columns)
-
- def init_tabstops(self):
- for i in range(0, self.columns + 1):
- if i % 8 == 0:
- self.tabstops.append(True)
- else:
- self.tabstops.append(False)
-
- # }}}
-
- ###############################################################################################
- # Utility {{{
-
- def parse_csi(self, s): # {{{
- attr = { 'key' : s[-1], 'flag' : '', 'val' : 1, 'vals' : [] }
-
- if len(s) == 1:
- return attr
-
- full = s[0:-1]
-
- if full[0] == '?':
- full = full[1:]
- attr['flag'] = '?'
-
- if full != '':
- vals = full.split(';')
- for val in vals:
-
- val = re.sub("\D", "", val)
-
- if val != '':
- attr['vals'].append(int(val))
-
- if len(attr['vals']) == 1:
- attr['val'] = int(attr['vals'][0])
-
- return attr
- # }}}
-
- def bound(self, val, min, max): # {{{
- if val > max:
- return max
-
- if val < min:
- return min
-
- return val
- # }}}
-
- # }}}
-
-import os, signal, pty, tty, select, fcntl, termios, struct
-
-###################################################################################################
-class ConqueSubprocess:
-
- # process id
- pid = 0
-
- # stdout+stderr file descriptor
- fd = None
-
- # constructor
- def __init__(self): # {{{
- self.pid = 0
- # }}}
-
- # create the pty or whatever (whatever == windows)
- def open(self, command, env = {}): # {{{
- command_arr = command.split()
- executable = command_arr[0]
- args = command_arr
-
- try:
- self.pid, self.fd = pty.fork()
-
- except:
- pass
-
- # child proc, replace with command after altering terminal attributes
- if self.pid == 0:
-
- # set requested environment variables
- for k in env.keys():
- os.environ[k] = env[k]
-
- # set some attributes
- try:
- attrs = tty.tcgetattr(1)
- attrs[0] = attrs[0] ^ tty.IGNBRK
- attrs[0] = attrs[0] | tty.BRKINT | tty.IXANY | tty.IMAXBEL
- attrs[2] = attrs[2] | tty.HUPCL
- attrs[3] = attrs[3] | tty.ICANON | tty.ECHO | tty.ISIG | tty.ECHOKE
- attrs[6][tty.VMIN] = 1
- attrs[6][tty.VTIME] = 0
- tty.tcsetattr(1, tty.TCSANOW, attrs)
- except:
- pass
-
- os.execvp(executable, args)
-
- # else master, do nothing
- else:
- pass
-
- # }}}
-
- # read from pty
- # XXX - select.poll() doesn't work in OS X!!!!!!!
- def read(self, timeout = 1): # {{{
-
- output = ''
- read_timeout = float(timeout) / 1000
-
- try:
- # what, no do/while?
- while 1:
- s_read, s_write, s_error = select.select( [ self.fd ], [], [], read_timeout)
-
- lines = ''
- for s_fd in s_read:
- try:
- lines = os.read( self.fd, 32 )
- except:
- pass
- output = output + lines
-
- if lines == '':
- break
- except:
- pass
-
- return output
- # }}}
-
- # I guess this one's not bad
- def write(self, input): # {{{
- try:
- os.write(self.fd, input)
- except:
- pass
- # }}}
-
- # signal process
- def signal(self, signum): # {{{
- try:
- os.kill(self.pid, signum)
- except:
- pass
- # }}}
-
- # get process status
- def get_status(self): #{{{
-
- p_status = True
-
- try:
- if os.waitpid( self.pid, os.WNOHANG )[0]:
- p_status = False
- except:
- p_status = False
-
- return p_status
-
- # }}}
-
- # update window size in kernel, then send SIGWINCH to fg process
- def window_resize(self, lines, columns): # {{{
- try:
- fcntl.ioctl(self.fd, termios.TIOCSWINSZ, struct.pack("HHHH", lines, columns, 0, 0))
- os.kill(self.pid, signal.SIGWINCH)
- except:
- pass
-
- # }}}
-
-###################################################################################################
-# ConqueScreen is an extention of the vim.current.buffer object
-# It restricts the working indices of the buffer object to the scroll region which pty is expecting
-# It also uses 1-based indexes, to match escape sequence commands
-#
-# E.g.:
-# s = ConqueScreen()
-# ...
-# s[5] = 'Set 5th line in terminal to this line'
-# s.append('Add new line to terminal')
-# s[5] = 'Since previous append() command scrolled the terminal down, this is a different line than first cb[5] call'
-#
-
-import vim
-
-class ConqueScreen(object):
-
- # CLASS PROPERTIES {{{
-
- # the buffer
- buffer = None
- window = None
-
- # screen and scrolling regions
- screen_top = 1
-
- # screen width
- screen_width = 80
- screen_height = 80
-
- # }}}
-
- def __init__(self): # {{{
- self.buffer = vim.current.buffer
- self.window = vim.current.window
-
- self.screen_top = 1
- self.screen_width = self.window.width
- self.screen_height = self.window.height
- # }}}
-
- ###############################################################################################
- # List overload {{{
- def __len__(self): # {{{
- return len(self.buffer)
- # }}}
-
- def __getitem__(self, key): # {{{
- real_line = self.get_real_idx(key)
-
- # if line is past buffer end, add lines to buffer
- if real_line >= len(self.buffer):
- for i in range(len(self.buffer), real_line + 1):
- self.append(' ' * self.screen_width)
-
- return self.buffer[ real_line ]
- # }}}
-
- def __setitem__(self, key, value): # {{{
- real_line = self.get_real_idx(key)
-
- # if line is past end of screen, append
- if real_line == len(self.buffer):
- self.buffer.append(value)
- else:
- self.buffer[ real_line ] = value
- # }}}
-
- def __delitem__(self, key): # {{{
- del self.buffer[ self.screen_top + key - 2 ]
- # }}}
-
- def append(self, value): # {{{
- if len(self.buffer) > self.screen_top + self.screen_height - 1:
- self.buffer[len(self.buffer) - 1] = value
- else:
- self.buffer.append(value)
-
- if len(self.buffer) > self.screen_top + self.screen_height - 1:
- self.screen_top += 1
- if vim.current.buffer.number == self.buffer.number:
- vim.command('normal G')
- # }}}
-
- def insert(self, line, value): # {{{
-
- l = self.screen_top + line - 2
- self.buffer[l:l] = [ value ]
-
- # }}}
- # }}}
-
- ###############################################################################################
- # Util {{{
- def get_top(self): # {{{
- return self.screen_top
- # }}}
-
- def get_real_idx(self, line): # {{{
- return (self.screen_top + line - 2)
- # }}}
-
- def get_real_line(self, line): # {{{
- return (self.screen_top + line - 1)
- # }}}
-
- def set_screen_width(self, width): # {{{
- self.screen_width = width
- # }}}
-
- # }}}
-
- ###############################################################################################
- def clear(self): # {{{
- self.buffer.append(' ')
- vim.command('normal Gzt')
- self.screen_top = len(self.buffer)
- # }}}
-
- def set_cursor(self, line, column): # {{{
- # figure out line
- real_line = self.screen_top + line - 1
- if real_line > len(self.buffer):
- for l in range(len(self.buffer) - 1, real_line):
- self.buffer.append('')
-
- # figure out column
- real_column = column
- if len(self.buffer[real_line - 1]) < real_column:
- self.buffer[real_line - 1] = self.buffer[real_line - 1] + ' ' * (real_column - len(self.buffer[real_line - 1]))
-
- # XXX - Using python's version makes lots of super-fun segfaults
- self.window.cursor = (real_line, real_column - 1)
- #vim.command('call cursor(' + str(real_line) + ', ' + str(real_column) + ')')
- # }}}
-
- def reset_size(self, line): # {{{
-
- # save cursor line number
- real_line = self.screen_top + line
-
- # reset screen size
- self.screen_width = self.window.width
- self.screen_height = self.window.height
- self.screen_top = len(self.buffer) - self.window.height + 1
- if self.screen_top < 1:
- self.screen_top = 1
-
- # align bottom of buffer to bottom of screen
- vim.command('normal ' + str(self.screen_height) + 'kG')
-
- # return new relative line number
- return (real_line - self.screen_top)
- # }}}
-
- def scroll_to_bottom(self): # {{{
- self.window.cursor = (len(self.buffer) - 1, 1)
- # }}}
-
- def align(self): # {{{
- # align bottom of buffer to bottom of screen
- vim.command('normal ' + str(self.screen_height) + 'kG')
- # }}}
-
-EOF
-
View
156 bundle/conque_1.0/doc/conque_term.txt
@@ -1,156 +0,0 @@
-*ConqueTerm* Plugin to run a shell in a buffer
-
-The ConqueTerm plugin will convert a buffer into a terminal emulator, allowing
-you to run a shell or shell application in the buffer.
-
- *conque_term-usage*
-
-Type :ConqueTerm <command> to launch an application in the current buffer. E.g.
-
- :ConqueTerm bash
- :ConqueTerm mysql -h localhost -u joe_lunchbox Menu
- :ConqueTerm man top
-
-Use :ConqueTermSplit or :ConqueTermVSplit to open Conque in a new horizontal
-or vertical buffer.
-
-Keys pressed in insert mode will be sent to the shell, along with output from
-the 'p' command in normal mode.
-
-Press the <Esc> key twice to send a single <Esc> to the shell. Pressing this
-key once will leave insert mode like normal.
-
-Press <F9> in any buffer to send a visual selection to the shell.
-
-
- *conque_term-settings*
-
-Set the following in your .vimrc (default values shown)
-
-" Enable colors. Setting this to 0 will make your terminal faster.
-let g:ConqueTerm_Color = 1
-
-" Set your terminal type. I strong recommend leaving this as vt100,
-" however more features may be enabled with xterm.
-let g:ConqueTerm_TERM = 'vt100'
-
-" Set buffer syntax. Conque has highlighting for MySQL, but not much else.
-let g:ConqueTerm_Syntax = 'conque'
-
-" Continue updating shell when it's not the current, focused buffer
-let g:ConqueTerm_ReadUnfocused = 1
-
-
- *conque_term-requirements*
-
-The following minimum requirements are needed to run Conque. Conque will not
-run on Windows without a Cygwin-like environment.
-
- - Vim 7.1
- - Python 2.3
- - Supported operating systems: *nix, Mac, or Cygwin
-
-Tested on:
- - Vim 7.2 / Python 2.6 / Ubuntu 9.10 (Gnome & GTK)
- - Vim 7.2 / Python 2.6 / FreeBSD 8.0 (GTK)
- - Vim 7.1 / Python 2.6 / FreeBSD 8.0 (GTK)
- x Vim 7.0 / Python 2.6 / FreeBSD 8.0 (GTK)
- * feedkeys() doesn't restart updatetime
- - Vim 7.2 / Python 2.4 / OpenSolaris 2009.06 (Gnome)
- - Vim 7.2 / Python 2.4 / CentOS 5.3 (no GUI)
- - Vim 7.1 / Python 2.3 / RHEL 4 (no GUI)
- - Vim 7.2 / Python 2.5 / Cygwin (Windows Vista 64b)
- - MacVim 7.2 / Python 2.3 / OS X 10.6.2
-
- *conque_term-bugs*
-
-The following are known limitations:
-
- - Font/color highlighting is imperfect and slow. If you don't care about
- color in your shell, set g:ConqueTerm_Color = 0 in your .vimrc
- - Conque only supports the extended ASCII character set for input, not utf-8.
- - VT100 escape sequence support is not complete.
- - Alt/Meta key support in Vim isn't great in general, and conque is no
- exception. Pressing <Esc><Esc>x or <Esc><M-x> instead of <M-x> works in
- most cases.
-
- *conque_term-todo*
-
- - Fix pasting from named registers
- - Polling unfucused conque buffers (Top explodes when window resizes)
- - Enable graphics character set
- - Consider supporting xterm escapes
- - Improve color logic
- - Find a solution to UTF-8 input (See InsertCharPre in Vim todo.txt)
- - Find an alternative to updatetime polling (See Vim todo.txt)
- - Find a graceful solution to Meta key input
- - Windows support
- (See PyConsole http://www.vim.org/scripts/script.php?script_id=1974)
- - Always: look for performance improvements
-
-
- *conque_term-contribute*
-
-The two contributions most in need are improvements to Vim itself. I currently
-use hacks to simulate a key press event and repeating CursorHold event. The
-Vim todo.txt document lists proposed improvements to give users this behavior
-without hacks. Having a key press event should allow Conque to work with multi-
-byte input. If you are a Vim developer, please consider prioritizing these two
-items:
-
- - todo.txt (Autocommands, line ~3137)
- 8 Add an event like CursorHold that is triggered repeatedly, not just
- once after typing something.
-
- - todo.txt (Autocommands, proposed event list, line ~3189)
- InsertCharPre - user typed character Insert mode, before inserting the
- char. Pattern is matched with text before the cursor. Set v:char to the
- character, can be changed. (not triggered when 'paste' is set).
-
-Bugs, suggestions and patches are all welcome.
-
-For more information visit http://conque.googlecode.com
-
-Check out the latest from svn at http://conque.googlecode.com/svn/trunk/
-
- *conque_term-changelog*
-
- - 1.0 / 2010-02-
- * Complete python rewrite
- * Add support for ncurses based applications
- * Add continuous polling, instead of using <Tab>
- * Improve speed
- * Improve syntax highlighting
-
- - 0.6 / 2009-12-18
- * Fix GVim errors with non-english locale
- * No functional changes
-
- - 0.5 / 2009-12-02
- * Various performance enhancements and bugfixes.
- * Rewritten escape sequence processing
-
- - 0.4 / 2009-10-30
- * Improved history and tab completion
- * Fix escape sequence formatting and improve highlighting
- * Send selected text to shell from any buffer
- * Add special handling of "vi" and "man" commands
- * Improve error handling
- * Add key mappings for <C-p> <C-n> <C-l> <C-j>
- * Various bugfixes
-
- - 0.3 / 2009-10-13
- * Apply escape sequence coloring to output, e.g. ls --color
- * Clean up syntax files for portability
- * Fix several Vim 7.1 bugs
- * Bugfixes for multiple shell buffers
- * Add experimental shell folding option
-
- - 0.2 / 2009-10-01
- * Rewritten subprocess management module in python instead of c
- * Added support for OS X, partial support for Windows
- * Improved tab completion
-
- - 0.1 / 2009-09-03
- * Initial release
-
View
80 bundle/conque_1.0/plugin/conque_term.vim
@@ -1,80 +0,0 @@
-" FILE: plugin/conque_term.vim {{{
-" AUTHOR: Nico Raffo <nicoraffo@gmail.com>
-" MODIFIED: 2010-02-02
-" VERSION: 1.0, for Vim 7.0
-" LICENSE:
-" Conque - pty interaction in Vim
-" Copyright (C) 2009-2010 Nico Raffo
-"
-" MIT License
-"
-" Permission is hereby granted, free of charge, to any person obtaining a copy
-" of this software and associated documentation files (the "Software"), to deal
-" in the Software without restriction, including without limitation the rights
-" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-" copies of the Software, and to permit persons to whom the Software is
-" furnished to do so, subject to the following conditions:
-"
-" The above copyright notice and this permission notice shall be included in
-" all copies or substantial portions of the Software.
-"
-" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-" THE SOFTWARE.
-" }}}
-
-" See docs/conque_term.txt for help or type :help conque_term
-
-if exists('g:ConqueTerm_Loaded') || v:version < 700
- finish
-endif
-
-" **********************************************************************************************************
-" **** CONFIG **********************************************************************************************
-" **********************************************************************************************************
-
-" Enable color {{{
-if !exists('g:ConqueTerm_Color')
- let g:ConqueTerm_Color = 1
-endif " }}}
-
-" TERM environment setting {{{
-if !exists('g:ConqueTerm_TERM')
- let g:ConqueTerm_TERM = 'vt100'
-endif " }}}
-
-" Syntax for your buffer {{{
-if !exists('g:ConqueTerm_Syntax')
- let g:ConqueTerm_Syntax = 'conque_term'
-endif " }}}
-
-" Read when unfocused {{{
-if !exists('g:ConqueTerm_ReadUnfocused')
- let g:ConqueTerm_ReadUnfocused = 1
-endif " }}}
-
-" Use this regular expression to highlight prompt {{{
-if !exists('g:ConqueTerm_PromptRegex')
- let g:ConqueTerm_PromptRegex = '^\w\+@[0-9A-Za-z_.-]\+:[0-9A-Za-z_./\~,:-]\+\$'
-endif " }}}
-
-" **********************************************************************************************************
-" **** Startup *********************************************************************************************
-" **********************************************************************************************************
-
-" Startup {{{
-setlocal encoding=utf-8
-
-let g:ConqueTerm_Loaded = 1
-let g:ConqueTerm_Idx = 1
-
-command! -nargs=+ -complete=shellcmd ConqueTerm call conque_term#open(<q-args>)
-command! -nargs=+ -complete=shellcmd ConqueTermSplit call conque_term#open(<q-args>, ['split'])
-command! -nargs=+ -complete=shellcmd ConqueTermVSplit call conque_term#open(<q-args>, ['vsplit'])
-
-" }}}
-
View
77 bundle/conque_1.0/syntax/conque_term.vim
@@ -1,77 +0,0 @@
-
-" *******************************************************************************************************************
-" MySQL *************************************************************************************************************
-" *******************************************************************************************************************
-
-syn match MySQLTableHead "^ *|.*| *$" nextgroup=MySQLTableDivide contains=MySQLTableBar oneline skipwhite skipnl
-syn match MySQLTableBody "^ *|.*| *$" nextgroup=MySQLTableBody,MySQLTableEnd contains=MySQLTableBar,MySQLNull,MySQLBool,MySQLNumber,MySQLStorageClass oneline skipwhite skipnl
-syn match MySQLTableEnd "^ *+[+=-]\++ *$" oneline
-syn match MySQLTableDivide "^ *+[+=-]\++ *$" nextgroup=MySQLTableBody oneline skipwhite skipnl
-syn match MySQLTableStart "^ *+[+=-]\++ *$" nextgroup=MySQLTableHead oneline skipwhite skipnl
-syn match MySQLTableBar "|" contained
-syn match MySQLNull " NULL " contained
-syn match MySQLBool " YES " contained
-syn match MySQLBool " NO " contained
-syn match MySQLStorageClass " PRI " contained
-syn match MySQLStorageClass " MUL " contained
-syn match MySQLStorageClass " UNI " contained
-syn match MySQLStorageClass " CURRENT_TIMESTAMP " contained
-syn match MySQLStorageClass " auto_increment " contained
-syn match MySQLNumber " \d\+ " contained
-syn match MySQLQueryStat "^\d\+ rows\? in set.*" oneline
-syn match MySQLPromptLine "^.\?mysql> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
-syn match MySQLPromptLine "^ -> .*$" contains=MySQLKeyword,MySQLPrompt,MySQLString oneline
-syn match MySQLPrompt "^.\?mysql>" contained oneline
-syn match MySQLPrompt "^ ->" contained oneline
-syn case ignore
-syn keyword MySQLKeyword select count max sum avg date show table tables status like as from left right outer inner join contained
-syn keyword MySQLKeyword where group by having limit offset order desc asc show contained
-syn case match
-syn region MySQLString start=+'+ end=+'+ skip=+\\'+ contained oneline
-syn region MySQLString start=+"+ end=+"+ skip=+\\"+ contained oneline
-syn region MySQLString start=+`+ end=+`+ skip=+\\`+ contained oneline
-
-hi def link MySQLPrompt Identifier
-hi def link MySQLTableHead Title
-hi def link MySQLTableBody Normal
-hi def link MySQLBool Boolean
-hi def link MySQLStorageClass StorageClass
-hi def link MySQLNumber Number
-hi def link MySQLKeyword Keyword
-hi def link MySQLString String
-
-" terms which have no reasonable default highlight group to link to
-hi MySQLTableHead term=bold cterm=bold gui=bold
-if &background == 'dark'
- hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
- hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
- hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
- hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
- hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
- hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=238 guifg=#444444
-elseif &background == 'light'
- hi MySQLTableEnd term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
- hi MySQLTableDivide term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
- hi MySQLTableStart term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
- hi MySQLTableBar term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
- hi MySQLNull term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
- hi MySQLQueryStat term=NONE cterm=NONE gui=NONE ctermfg=247 guifg=#9e9e9e
-endif
-
-
-" *******************************************************************************************************************
-" Bash **************************************************************************************************************
-" *******************************************************************************************************************
-
-" Typical Prompt
-silent execute "syn match ConquePromptLine '" . g:ConqueTerm_PromptRegex . ".*$' contains=ConquePrompt,ConqueString oneline"
-silent execute "syn match ConquePrompt '" . g:ConqueTerm_PromptRegex . "' contained oneline"
-hi def link ConquePrompt Identifier
-
-" Strings
-syn region ConqueString start=+'+ end=+'+ skip=+\\'+ contained oneline
-syn region ConqueString start=+"+ end=+"+ skip=+\\"+ contained oneline
-syn region ConqueString start=+`+ end=+`+ skip=+\\`+ contained oneline
-hi def link ConqueString String
-
-" vim: foldmethod=marker
View
327 bundle/css_color/after/syntax/css.vim
@@ -1,327 +0,0 @@
-" Language: Colored CSS Color Preview
-" Maintainer: Niklas Hofer <niklas+vim@lanpartei.de>
-" URL: svn://lanpartei.de/vimrc/after/syntax/css.vim
-" Last Change: 2008 Feb 12
-" Licence: No Warranties. Do whatever you want with this. But please tell me!
-" Version: 0.6
-
-function! s:FGforBG(bg)
- " takes a 6hex color code and returns a matching color that is visible
- let pure = substitute(a:bg,'^#','','')
- let r = eval('0x'.pure[0].pure[1])
- let g = eval('0x'.pure[2].pure[3])
- let b = eval('0x'.pure[4].pure[5])
- if r*30 + g*59 + b*11 > 12000
- return '#000000'
- else
- return '#ffffff'
- end
-endfunction
-
-function! s:SetMatcher(clr,pat)
- let group = 'cssColor'.substitute(a:clr,'^#','','')
- redir => s:currentmatch
- silent! exe 'syn list '.group
- redir END
- let g:currentmatch = s:currentmatch
- if s:currentmatch !~ a:pat.'\/'
- exe 'syn match '.group.' /'.a:pat.'/ contained'
- exe 'syn cluster cssColors add='.group
- if has('gui_running')
- exe 'hi '.group.' guifg='.s:FGforBG(a:clr)
- exe 'hi '.group.' guibg='.a:clr
- elseif &t_Co == 256
- exe 'hi '.group.' ctermfg='.s:Rgb2xterm(s:FGforBG(a:clr))
- exe 'hi '.group.' ctermbg='.s:Rgb2xterm(a:clr)