Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated vim-ruby

  • Loading branch information...
commit 92e745496a818287847506c84e1ad1dcce8b0cde 1 parent 4ee96fe
@ryankinderman authored
Showing with 309 additions and 235 deletions.
  1. +4 −5 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/CONTRIBUTORS
  2. +4 −4 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/ChangeLog
  3. +7 −10 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/FAQ
  4. +2 −2 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/INSTALL
  5. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/NEWS
  6. +15 −23 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/README
  7. +1 −2  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/Rakefile
  8. +1 −2  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/autoload/rubycomplete.vim
  9. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/bin/vim-ruby-install.rb
  10. +1 −2  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/compiler/eruby.vim
  11. +7 −14 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/compiler/rspec.vim
  12. +2 −24 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/compiler/ruby.vim
  13. +1 −2  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/compiler/rubyunit.vim
  14. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/doc/ft-ruby-omni.txt
  15. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/doc/ft-ruby-syntax.txt
  16. +53 −0 vim/vendor/vim-ruby-7105a/etc/examples/indent/nested_hashes.rb
  17. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/etc/release/README
  18. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/etc/release/cvsrelease
  19. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/etc/release/release.sh
  20. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/etc/website/djk-theme.css
  21. +1 −1  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/etc/website/index.html
  22. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/etc/website/update.sh
  23. 0  vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/ftdetect/ruby.vim
  24. +4 −6 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/ftplugin/eruby.vim
  25. +43 −21 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/ftplugin/ruby.vim
  26. +8 −9 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/indent/eruby.vim
  27. +106 −58 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/indent/ruby.vim
  28. +4 −6 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/syntax/eruby.vim
  29. +45 −44 vim/vendor/{vim-ruby-faef7e → vim-ruby-7105a}/syntax/ruby.vim
View
9 vim/vendor/vim-ruby-faef7e/CONTRIBUTORS → vim/vendor/vim-ruby-7105a/CONTRIBUTORS
@@ -1,19 +1,18 @@
Maintainers:
Mark Guzman <segfault@hasno.info>
- Tim Hammerquist <timh@rubyforge.org>
Doug Kearns <dougkearns@gmail.com>
- Tim Pope <vimNOSPAM@tpope.info>
- Gavin Sinclair <gsinclair@gmail.com>
+ Tim Pope <vim@NOSPAMtpope.org>
+ Andrew Radev <andrey.radev@gmail.com>
Nikolai Weibull <now@bitwi.se>
-Developers:
-
Other contributors:
Michael Brailsford <brailsmt@yahoo.com>
Sean Flanagan <sdflanagan@ozemail.com.au>
+ Tim Hammerquist <timh@rubyforge.org>
Ken Miller <ken.miller@gmail.com>
Hugh Sasse <hgs@dmu.ac.uk>
Tilman Sauerbeck <tilman@code-monkey.de>
Bertram Scharpf <info@bertram-scharpf.de>
+ Gavin Sinclair <gsinclair@gmail.com>
Aaron Son <aaronson@uiuc.edu>
Ned Konz <ned@bike-nomad.com>
View
8 vim/vendor/vim-ruby-faef7e/ChangeLog → vim/vendor/vim-ruby-7105a/ChangeLog
@@ -20,7 +20,7 @@
* autoload/rubycomplete.vim: resolve a typo in the configuration initialization
section
-
+
2008-06-29 Tim Pope <vim@tpope.info>
* syntax/ruby.vim: revert highlighting of - as number
@@ -256,7 +256,7 @@
2007-03-20 Doug Kearns <dougkearns@gmail.com>
* syntax/ruby.vim, syntax/eruby.vim: remove the Vim version 5
- compatibility code
+ compatibility code
2007-03-20 Doug Kearns <dougkearns@gmail.com>
@@ -463,7 +463,7 @@
procs.
2006-12-07 Mark Guzman <segfault@hasno.info>
-
+
* ftplugin/ruby.vim: modified the path detection code use
the built-in interpreter if it's available in all cases.
@@ -512,7 +512,7 @@
2006-10-28 Doug Kearns <djkea2@gus.gscit.monash.edu.au>
* syntax/ruby.vim: remove accidently included nextgroup arg in
- 'heredoc' syntax group definitions
+ 'heredoc' syntax group definitions
2006-10-24 Doug Kearns <djkea2@gus.gscit.monash.edu.au>
View
17 vim/vendor/vim-ruby-faef7e/FAQ → vim/vendor/vim-ruby-7105a/FAQ
@@ -4,7 +4,7 @@
The vim-ruby Project FAQ
- http://vim-ruby.rubyforge.org
+ https://github.com/vim-ruby/vim-ruby
The vim-ruby project maintains Ruby-related configuration files for Vim. This
FAQ contains all you need to know about it.
@@ -43,7 +43,7 @@ The easiest way is to run: >
If you don't have RubyGems, download a tarball from: >
- http://rubyforge.org/projects/vim-ruby/
+ https://github.com/vim-ruby/vim-ruby/downloads
Again, see installation instructions below.
@@ -191,13 +191,13 @@ appropriate. Try creating these lines of code and hitting SHIFT-ENTER:
For other suggestions, search the web or look at: >
- http://www.rubygarden.org/Ruby/page/show/VimRubySupport
+ https://github.com/vim-ruby/vim-ruby/wiki/VimRubySupport
*vim-ruby-faq-X* How can I report a bug? *vim-ruby-bug-reporting*
Bug reports are most welcome. In order of preference:
- - submit a bug at http://rubyforge.org/tracker/?group_id=16
+ - submit a bug at https://github.com/vim-ruby/vim-ruby/issues
- send an email to the mailing list (see below)
- email the maintainer (email address appears in each configuration file)
@@ -232,16 +232,13 @@ asking there.
*vim-ruby-faq-X* Can you repeat all the web pages listed in this FAQ?
Homepage *vim-ruby-homepage* : >
- http://vim-ruby.rubyforge.org
-
-Project page: >
- http://rubyforge.org/projects/vim-ruby/
+ https://github.com/vim-ruby/vim-ruby/
Bug tracker: >
- http://rubyforge.org/tracker/?group_id=16
+ https://github.com/vim-ruby/vim-ruby/issues
Relevant Wiki page: >
- http://rubygarden.org/ruby?VimRubySupport
+ https://github.com/vim-ruby/vim-ruby/wiki
Mailing list archives: >
http://news.gmane.org/gmane.comp.editors.vim.vim%2druby.devel
View
4 vim/vendor/vim-ruby-faef7e/INSTALL → vim/vendor/vim-ruby-7105a/INSTALL
@@ -1,7 +1,7 @@
= Installing vim-ruby
The vim-ruby runtime files may be installed via the vim-ruby gem or by
-downloading an archive file from http://rubyforge.org/frs/?group_id=16
+downloading an archive file from https://github.com/vim-ruby/vim-ruby/downloads
NOTE: the installer vim-ruby-install.rb currently only supports Unix and
Windows systems; other platforms may require a manual install. This installer
@@ -78,4 +78,4 @@ appropriate for your version of Vim.
If you have any problems installing the vim-ruby configuration files please
send a message to the mailing list (http://rubyforge.org/mail/?group_id=16) or
-post an item to the tracker (http://rubyforge.org/tracker/?group_id=16).
+post an item to the tracker (https://github.com/vim-ruby/vim-ruby/issues).
View
0  vim/vendor/vim-ruby-faef7e/NEWS → vim/vendor/vim-ruby-7105a/NEWS
File renamed without changes
View
38 vim/vendor/vim-ruby-faef7e/README → vim/vendor/vim-ruby-7105a/README
@@ -1,14 +1,14 @@
- +-----------------------------------+
- | vim-ruby RubyForge project README |
- +-----------------------------------+
+ +---------------------------------+
+ | vim-ruby github project README |
+ +---------------------------------+
Summary:
This project contains Vim configuration files for editing and compiling Ruby
within Vim. See the project homepage for more details.
Web links:
- Homepage: http://vim-ruby.rubyforge.org
- Project: http://www.rubyforge.org/vim-ruby
+ Homepage: https://github.com/vim-ruby
+ Explanation: https://github.com/vim-ruby/vim-ruby/wiki
For regular users:
- The project page should have two tarballs for download:
@@ -16,10 +16,9 @@ For regular users:
- vim-ruby-devel-YYYY.MM.DD.tar.gz (cutting-edge features we'd like you
to test)
- Please give feedback through the bug tracking and feature request features
- of RubyForge.
- - Feel free to join discussions on the vim-ruby-devel mailing list.
- Instructions on how to join are in the project page somewhere.
- - RubyForge also features forums, but the mailing list is better.
+ of github.
+ - Feel free to join discussions on the vim-ruby-devel mailing list:
+ http://rubyforge.org/mail/?group_id=16
For would-be contributors:
- Please get the latest from Git.
@@ -42,7 +41,7 @@ How you get these files into Vim:
($HOME/vimfiles on Windows) for personal use.
- Remember that when you install Vim in the first place, all of these files
are present. The purpose of downloading and installing them from
- RubyForge is to get the latest version of them.
+ github is to get the latest version of them.
Git topics:
- Project was migrated from CVS in August, 2008.
@@ -62,21 +61,14 @@ Git topics:
Any questions or suggestions?
- If there's something about the project or its concepts that you don't
- understand, send an email to the project maintainer, Gavin Sinclair
- (gsinclair at gmail.com).
- - To ask about the contents of the configuration files, ask on the mailing
- list, as different people maintain the different files. Gavin knows
- nothing about the syntax file, for instance. (Come to think of it, nor does
- Doug - djk)
+ understand, send an email to the project maintainer, Tim Pope
+ (vim at tpope.org).
+ - To ask about the contents of the configuration files, open a GitHub issue
+ or ask on the mailing list, as different people maintain the different
+ files.
Project gossip:
- - Two of the configuration file maintainers, Doug Kearns and Gavin Sinclair,
- live in Australia (Jindabyne and Sydney respectively). Tim Hammerquist,
- the last man standing, has lived in the Reno/Lake Tahoe area of Nevada,
- USA, since the late 1970s and doesn't like to gamble; a waste, really.
- While the individual effort to maintain these files has a long history,
- this actual project began in late July 2003. Therefore, if you're reading
- this soon thereafter and something doesn't make sense, now is the time to
- let us know.
+ this actual project began in late July 2003.
--= End of Document =--
View
3  vim/vendor/vim-ruby-faef7e/Rakefile → vim/vendor/vim-ruby-7105a/Rakefile
@@ -26,8 +26,7 @@ def gemspec
s.executables = ['vim-ruby-install.rb']
s.author = 'Gavin Sinclair et al.'
s.email = 'gsinclair@soyabean.com.au'
- s.homepage = 'http://vim-ruby.rubyforge.org'
- s.rubyforge_project = 'vim-ruby'
+ s.homepage = 'https://github.com/vim-ruby/vim-ruby'
s.has_rdoc = false
end
end
View
3  vim/vendor/vim-ruby-faef7e/autoload/rubycomplete.vim → vim/vendor/vim-ruby-7105a/autoload/rubycomplete.vim
@@ -1,8 +1,7 @@
" Vim completion script
" Language: Ruby
" Maintainer: Mark Guzman <segfault@hasno.info>
-" Last Change: 2009 Sep 28
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" Maintainer Version: 0.8.1
View
0  vim/vendor/vim-ruby-faef7e/bin/vim-ruby-install.rb → vim/vendor/vim-ruby-7105a/bin/vim-ruby-install.rb
File renamed without changes
View
3  vim/vendor/vim-ruby-faef7e/compiler/eruby.vim → vim/vendor/vim-ruby-7105a/compiler/eruby.vim
@@ -1,8 +1,7 @@
" Vim compiler file
" Language: eRuby
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2008 Aug 1
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
View
21 vim/vendor/vim-ruby-faef7e/compiler/rspec.vim → vim/vendor/vim-ruby-7105a/compiler/rspec.vim
@@ -1,8 +1,7 @@
" Vim compiler file
" Language: RSpec
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2009 Dec 22
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
@@ -18,21 +17,15 @@ endif
let s:cpo_save = &cpo
set cpo-=C
-CompilerSet makeprg=spec
+CompilerSet makeprg=rspec
CompilerSet errorformat=
- \%+W'%.%#'\ FAILED,
- \%+I'%.%#'\ FIXED,
- \%-Cexpected:%.%#,
- \%-C\ \ \ \ \ got:%.%#,
+ \%f:%l:\ %tarning:\ %m,
\%E%.%#:in\ `load':\ %f:%l:%m,
- \%C%f:%l:,
- \%W%f:%l:\ warning:\ %m,
- \%E%f:%l:in\ %*[^:]:\ %m,
- \%E%f:%l:\ %m,
- \%-Z%\tfrom\ %f:%l,
- \%-Z%p^%.%#,
- \%-C%.%#,
+ \%E%f:%l:in\ `%*[^']':\ %m,
+ \%-Z\ \ \ \ \ \#\ %f:%l:%.%#,
+ \%E\ \ %\\d%\\+)%.%#,
+ \%C\ \ \ \ \ %m,
\%-G%.%#
let &cpo = s:cpo_save
View
26 vim/vendor/vim-ruby-faef7e/compiler/ruby.vim → vim/vendor/vim-ruby-7105a/compiler/ruby.vim
@@ -1,33 +1,11 @@
" Vim compiler file
" Language: Ruby
" Function: Syntax check and/or error reporting
-" Maintainer: Tim Hammerquist <timh at rubyforge.org>
-" Last Change: 2008 Aug 1
-" URL: http://vim-ruby.rubyforge.org
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" ----------------------------------------------------------------------------
-"
-" Changelog:
-" 0.2: script saves and restores 'cpoptions' value to prevent problems with
-" line continuations
-" 0.1: initial release
-"
-" Contributors:
-" Hugh Sasse <hgs@dmu.ac.uk>
-" Doug Kearns <djkea2@gus.gscit.monash.edu.au>
-"
-" Todo:
-" match error type %m
-"
-" Comments:
-" I know this file isn't perfect. If you have any questions, suggestions,
-" patches, etc., please don't hesitate to let me know.
-"
-" This is my first experience with 'errorformat' and compiler plugins and
-" I welcome any input from more experienced (or clearer-thinking)
-" individuals.
-" ----------------------------------------------------------------------------
if exists("current_compiler")
finish
View
3  vim/vendor/vim-ruby-faef7e/compiler/rubyunit.vim → vim/vendor/vim-ruby-7105a/compiler/rubyunit.vim
@@ -1,8 +1,7 @@
" Vim compiler file
" Language: Test::Unit - Ruby Unit Testing Framework
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2008 Aug 1
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
View
0  vim/vendor/vim-ruby-faef7e/doc/ft-ruby-omni.txt → vim/vendor/vim-ruby-7105a/doc/ft-ruby-omni.txt
File renamed without changes
View
0  vim/vendor/vim-ruby-faef7e/doc/ft-ruby-syntax.txt → vim/vendor/vim-ruby-7105a/doc/ft-ruby-syntax.txt
File renamed without changes
View
53 vim/vendor/vim-ruby-7105a/etc/examples/indent/nested_hashes.rb
@@ -0,0 +1,53 @@
+class Foo
+ # nested do ... end blocks:
+ var.func1(:param => 'value') do
+ var.func2(:param => 'value') do
+ puts "test"
+ end
+ end
+
+ # nested { ... } blocks
+ var.func1(:param => 'value') {
+ var.func2(:param => 'value') {
+ foo({ bar => baz })
+ puts "test one"
+ puts "test two"
+ }
+ }
+
+ # nested hash
+ foo, bar = {
+ :bar => {
+ :one => 'two',
+ :five => 'six'
+ }
+ }
+
+ # nested { ... } blocks with a continued first line
+ var.
+ func1(:param => 'value') {
+ var.func2(:param => 'value') {
+ puts "test"
+ }
+ }
+
+ # nested hashes with a continued first line
+ foo,
+ bar = {
+ :bar => {
+ :foo { 'bar' => 'baz' },
+ :one => 'two',
+ :three => 'four'
+ }
+ }
+
+ # TODO nested { ... } blocks with a continued first line and a function call
+ # inbetween
+ var.
+ func1(:param => 'value') {
+ func1_5(:param => 'value')
+ var.func2(:param => 'value') {
+ puts "test"
+ }
+ }
+end
View
0  vim/vendor/vim-ruby-faef7e/etc/release/README → vim/vendor/vim-ruby-7105a/etc/release/README
File renamed without changes
View
0  vim/vendor/vim-ruby-faef7e/etc/release/cvsrelease → vim/vendor/vim-ruby-7105a/etc/release/cvsrelease
File renamed without changes
View
0  vim/vendor/vim-ruby-faef7e/etc/release/release.sh → vim/vendor/vim-ruby-7105a/etc/release/release.sh
File renamed without changes
View
0  vim/vendor/vim-ruby-faef7e/etc/website/djk-theme.css → vim/vendor/vim-ruby-7105a/etc/website/djk-theme.css
File renamed without changes
View
2  vim/vendor/vim-ruby-faef7e/etc/website/index.html → vim/vendor/vim-ruby-7105a/etc/website/index.html
@@ -19,7 +19,7 @@
If you edit <a href="http://www.ruby-lang.org/">Ruby</a> code in <a href="http://www.vim.org/">Vim</a>, there are some configuration files (distributed with Vim) that aim to make your life easier. These are maintained by three different people, but are grouped together in <a href="http://www.rubyforge.org/projects/vim-ruby">this project</a> so we can keep them all up to date and offer them in a <a href="http://rubyforge.org/project/showfiles.php?group_id=16">convenient download</a>.
</p>
<p>
- Below you will find the README file from the <a href="http://github.com/vim-ruby/vim-ruby">Git repository</a>, which discusses the structure of the project, and how to take advantage of the resources it offers.
+ Below you will find the README file from the <a href="https://github.com/vim-ruby/vim-ruby">Git repository</a>, which discusses the structure of the project, and how to take advantage of the resources it offers.
</p>
<p>
<em>Gavin Sinclair, 2003-07-28</em>
View
0  vim/vendor/vim-ruby-faef7e/etc/website/update.sh → vim/vendor/vim-ruby-7105a/etc/website/update.sh
File renamed without changes
View
0  vim/vendor/vim-ruby-faef7e/ftdetect/ruby.vim → vim/vendor/vim-ruby-7105a/ftdetect/ruby.vim
File renamed without changes
View
10 vim/vendor/vim-ruby-faef7e/ftplugin/eruby.vim → vim/vendor/vim-ruby-7105a/ftplugin/eruby.vim
@@ -1,8 +1,7 @@
" Vim filetype plugin
" Language: eRuby
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 Apr 15
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
@@ -23,13 +22,12 @@ if !exists("g:eruby_default_subtype")
let g:eruby_default_subtype = "html"
endif
-if !exists("b:eruby_subtype")
+if &filetype =~ '^eruby\.'
+ let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
+elseif !exists("b:eruby_subtype")
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
if b:eruby_subtype == ''
- let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
- endif
- if b:eruby_subtype == ''
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
endif
if b:eruby_subtype == 'rhtml'
View
64 vim/vendor/vim-ruby-faef7e/ftplugin/ruby.vim → vim/vendor/vim-ruby-7105a/ftplugin/ruby.vim
@@ -1,17 +1,11 @@
" Vim filetype plugin
" Language: Ruby
-" Maintainer: Gavin Sinclair <gsinclair at gmail.com>
-" Last Change: 2010 Mar 15
-" URL: http://vim-ruby.rubyforge.org
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" ----------------------------------------------------------------------------
-"
-" Original matchit support thanks to Ned Konz. See his ftplugin/ruby.vim at
-" http://bike-nomad.com/vim/ruby.vim.
-" ----------------------------------------------------------------------------
-" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
finish
endif
@@ -72,21 +66,24 @@ setlocal commentstring=#\ %s
if !exists("s:ruby_path")
if exists("g:ruby_path")
let s:ruby_path = g:ruby_path
- elseif has("ruby") && has("win32")
- ruby VIM::command( 'let s:ruby_path = "%s"' % ($: + begin; require %q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,}) )
- let s:ruby_path = '.,' . substitute(s:ruby_path, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
- elseif executable("ruby")
- let s:code = "print ($: + begin; require %q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,})"
- if &shellxquote == "'"
- let s:ruby_path = system('ruby -e "' . s:code . '"')
+ else
+ if has("ruby") && has("win32")
+ ruby VIM::command( 'let s:ruby_path = "%s"' % $:.join(%q{,}) )
+ let s:ruby_path = substitute(s:ruby_path, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
+ elseif executable("ruby")
+ let s:code = "print $:.join(%q{,})"
+ if &shellxquote == "'"
+ let s:ruby_path = system('ruby -e "' . s:code . '"')
+ else
+ let s:ruby_path = system("ruby -e '" . s:code . "'")
+ endif
+ let s:ruby_path = substitute(s:ruby_path, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
else
- let s:ruby_path = system("ruby -e '" . s:code . "'")
+ let s:ruby_path = substitute($RUBYLIB,':',',','g')
+ endif
+ if &g:path !~# '\v^\.%(,/%(usr|emx)/include)=,,$'
+ let s:ruby_path = substitute(&g:path,',,$',',','') . ',' . s:ruby_path
endif
- let s:ruby_path = '.,' . substitute(s:ruby_path, '\%(^\|,\)\.\%(,\|$\)', ',,', '')
- else
- " If we can't call ruby to get its path, just default to using the
- " current directory and the directory of the current file.
- let s:ruby_path = ".,,"
endif
endif
@@ -142,6 +139,17 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
\."| sil! exe 'nunmap <buffer> <C-W>g<C-]>'| sil! exe 'nunmap <buffer> <C-W>g]'"
\."| sil! exe 'nunmap <buffer> <C-W>}'| sil! exe 'nunmap <buffer> <C-W>g}'"
endif
+
+ if maparg("gf",'n') == ''
+ " By using findfile() rather than gf's normal behavior, we prevent
+ " erroneously editing a directory.
+ nnoremap <silent> <buffer> gf :<C-U>exe <SID>gf(v:count1,"gf",'edit')<CR>
+ nnoremap <silent> <buffer> <C-W>f :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>f",'split')<CR>
+ nnoremap <silent> <buffer> <C-W><C-F> :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>\<Lt>C-F>",'split')<CR>
+ nnoremap <silent> <buffer> <C-W>gf :<C-U>exe <SID>gf(v:count1,"\<Lt>C-W>gf",'tabedit')<CR>
+ let b:undo_ftplugin = b:undo_ftplugin
+ \."| sil! exe 'nunmap <buffer> gf' | sil! exe 'nunmap <buffer> <C-W>f' | sil! exe 'nunmap <buffer> <C-W><C-F>' | sil! exe 'nunmap <buffer> <C-W>gf'"
+ endif
endif
let &cpo = s:cpo_save
@@ -241,6 +249,20 @@ function! RubyCursorIdentifier()
return stripped == '' ? expand("<cword>") : stripped
endfunction
+function! s:gf(count,map,edit) abort
+ let target = expand('<cfile>')
+ if target =~# '^\%(require\|load\|autoload\)$' && getline('.') =~# '^\s*\%(require \|load \|autoload :\w\+,\)\s*\(["'']\).*\1'
+ let target = matchstr(getline('.'),'\(["'']\)\zs.\{-\}\ze\1')
+ let g:target = target
+ endif
+ let found = findfile(target, &path, a:count)
+ if found ==# ''
+ return 'norm! '.a:count.a:map
+ else
+ return a:edit.' '.fnameescape(found)
+ endif
+endfunction
+
"
" Instructions for enabling "matchit" support:
"
View
17 vim/vendor/vim-ruby-faef7e/indent/eruby.vim → vim/vendor/vim-ruby-7105a/indent/eruby.vim
@@ -1,8 +1,7 @@
" Vim indent file
" Language: eRuby
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 May 28
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
@@ -50,23 +49,23 @@ function! GetErubyIndent(...)
call cursor(v:lnum,1)
let inruby = searchpair('<%','','%>','W')
call cursor(v:lnum,vcol)
- if inruby && getline(v:lnum) !~ '^<%\|^\s*-\=%>'
- let ind = GetRubyIndent()
+ if inruby && getline(v:lnum) !~ '^<%\|^\s*[-=]\=%>'
+ let ind = GetRubyIndent(v:lnum)
else
exe "let ind = ".b:eruby_subtype_indentexpr
endif
let lnum = prevnonblank(v:lnum-1)
let line = getline(lnum)
let cline = getline(v:lnum)
- if cline =~# '^\s*<%-\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%(-\=%>\|$\)'
+ if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw
endif
- if line =~# '\S\s*<%-\=\s*\%(}\|end\).\{-\}\s*\%(-\=%>\|$\)'
+ if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)'
let ind = ind - &sw
endif
- if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*-\=%>'
+ if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>'
let ind = ind + &sw
- elseif line =~# '<%-\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
+ elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>'
let ind = ind + &sw
endif
if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>'
@@ -75,7 +74,7 @@ function! GetErubyIndent(...)
if line !~# '^\s*<%' && line =~# '%>\s*$'
let ind = ind - &sw
endif
- if cline =~# '^\s*-\=%>\s*$'
+ if cline =~# '^\s*[-=]\=%>\s*$'
let ind = ind - &sw
endif
return ind
View
164 vim/vendor/vim-ruby-faef7e/indent/ruby.vim → vim/vendor/vim-ruby-7105a/indent/ruby.vim
@@ -1,8 +1,7 @@
" Vim indent file
" Language: Ruby
" Maintainer: Nikolai Weibull <now at bitwi.se>
-" Last Change: 2009 Dec 17
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
@@ -18,7 +17,7 @@ let b:did_indent = 1
setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it.
-setlocal indentexpr=GetRubyIndent()
+setlocal indentexpr=GetRubyIndent(v:lnum)
setlocal indentkeys=0{,0},0),0],!^F,o,O,e
setlocal indentkeys+==end,=elsif,=when,=ensure,=rescue,==begin,==end
@@ -27,6 +26,11 @@ if exists("*GetRubyIndent")
finish
endif
+" Set up some defaults.
+if !exists('g:ruby_hanging_indent')
+ let g:ruby_hanging_indent = 1
+endif
+
let s:cpo_save = &cpo
set cpo&vim
@@ -34,7 +38,8 @@ set cpo&vim
" ============
" Regex of syntax group names that are or delimit string or are comments.
-let s:syng_strcom = '\<ruby\%(String\|StringEscape\|ASCIICode' .
+let s:syng_strcom = '\<ruby\%(Regexp\|RegexpDelimiter' .
+ \ '\|String\|StringEscape\|ASCIICode' .
\ '\|Interpolation\|NoInterpolation\|Comment\|Documentation\)\>'
" Regex of syntax group names that are strings.
@@ -52,45 +57,48 @@ let s:skip_expr =
" Regex used for words that, at the start of a line, add a level of indent.
let s:ruby_indent_keywords = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
\ '\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure' .
- \ '\|rescue\)\>' .
- \ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' .
- \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\)\>'
+ \ '\|rescue\):\@!\>' .
+ \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
+ \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>'
" Regex used for words that, at the start of a line, remove a level of indent.
let s:ruby_deindent_keywords =
- \ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\)\>'
+ \ '^\s*\zs\<\%(ensure\|else\|rescue\|elsif\|when\|end\):\@!\>'
" Regex that defines the start-match for the 'end' keyword.
"let s:end_start_regex = '\%(^\|[^.]\)\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\|do\)\>'
" TODO: the do here should be restricted somewhat (only at end of line)?
let s:end_start_regex = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
- \ '\|while\|until\|case\|unless\|begin\)\>' .
- \ '\|\%([*+/,=-]\|<<\|>>\|:\s\)\s*\zs' .
- \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\)\>' .
- \ '\|\<do\>'
+ \ '\|while\|until\|case\|unless\|begin\):\@!\>' .
+ \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
+ \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
+ \ '\|\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword.
-let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue\>\|when\|elsif\)\>'
+let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue:\@!\>\|when\|elsif\):\@!\>'
" Regex that defines the end-match for the 'end' keyword.
-let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end\>'
+let s:end_end_regex = '\%(^\|[^.:@$]\)\@<=\<end:\@!\>'
" Expression used for searchpair() call for finding match for 'end' keyword.
let s:end_skip_expr = s:skip_expr .
\ ' || (expand("<cword>") == "do"' .
- \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\)\\>")'
+ \ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
" Regex that defines continuation lines, not including (, {, or [.
-let s:continuation_regex = '\%([\\*+/.,:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
+let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|and\|or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
" Regex that defines continuation lines.
" TODO: this needs to deal with if ...: and so on
-let s:continuation_regex2 =
- \ '\%([\\*+/.,:({[]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
+let s:continuation_regex =
+ \ '\%([({[\\.,:*/%+]\|and\|or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
+
+" Regex that defines bracket continuations
+let s:bracket_continuation_regex = '\%([({[]\)\s*\%(#.*\)\=$'
" Regex that defines blocks.
let s:block_regex =
- \ '\%(\<do\>\|{\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=\s*\%(#.*\)\=$'
+ \ '\%(\<do:\@!\>\|{\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=\s*\%(#.*\)\=$'
" 2. Auxiliary Functions {{{1
" ======================
@@ -139,42 +147,70 @@ endfunction
function s:GetMSL(lnum)
" Start on the line we're at and use its indent.
let msl = a:lnum
+ let msl_body = getline(msl)
let lnum = s:PrevNonBlankNonString(a:lnum - 1)
while lnum > 0
" If we have a continuation line, or we're in a string, use line as MSL.
" Otherwise, terminate search as we have found our MSL already.
let line = getline(lnum)
- let col = match(line, s:continuation_regex2) + 1
- if (col > 0 && !s:IsInStringOrComment(lnum, col))
- \ || s:IsInString(lnum, strlen(line))
+
+ if line =~ s:non_bracket_continuation_regex && msl_body =~ s:non_bracket_continuation_regex
+ " If the current line is a non-bracket continuation and so is the
+ " previous one, keep its indent and continue looking for an MSL.
let msl = lnum
+ elseif line =~ s:non_bracket_continuation_regex && msl_body =~ s:bracket_continuation_regex
+ " If the current line is a non-bracket continuation, but the previous is
+ " a bracket one, respect the previous' indentation, and stop here.
+ return lnum
+ elseif line =~ s:bracket_continuation_regex && msl_body =~ s:bracket_continuation_regex
+ " If both lines are bracket continuations, use the current one's and
+ " stop here
+ return msl
else
- break
+ let col = match(line, s:continuation_regex) + 1
+ if (col > 0 && !s:IsInStringOrComment(lnum, col))
+ \ || s:IsInString(lnum, strlen(line))
+ let msl = lnum
+ else
+ break
+ endif
endif
+
let lnum = s:PrevNonBlankNonString(lnum - 1)
endwhile
return msl
endfunction
" Check if line 'lnum' has more opening brackets than closing ones.
-function s:LineHasOpeningBrackets(lnum)
- let open_0 = 0
- let open_2 = 0
- let open_4 = 0
+function s:FindRightmostOpenBracket(lnum)
+ let open = {'parentheses': [], 'braces': [], 'brackets': []}
let line = getline(a:lnum)
let pos = match(line, '[][(){}]', 0)
while pos != -1
if !s:IsInStringOrComment(a:lnum, pos + 1)
- let idx = stridx('(){}[]', line[pos])
- if idx % 2 == 0
- let open_{idx} = open_{idx} + 1
- else
- let open_{idx - 1} = open_{idx - 1} - 1
+ if line[pos] == '('
+ call add(open.parentheses, {'type': '(', 'pos': pos})
+ elseif line[pos] == ')'
+ let open.parentheses = open.parentheses[0:-2]
+ elseif line[pos] == '{'
+ call add(open.braces, {'type': '{', 'pos': pos})
+ elseif line[pos] == '}'
+ let open.braces = open.braces[0:-2]
+ elseif line[pos] == '['
+ call add(open.brackets, {'type': '[', 'pos': pos})
+ elseif line[pos] == ']'
+ let open.brackets = open.brackets[0:-2]
endif
endif
let pos = match(line, '[][(){}]', pos + 1)
endwhile
- return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
+ let rightmost = {'type': '(', 'pos': -1}
+ for open in open.parentheses + open.braces + open.brackets
+ if open.pos > rightmost.pos
+ let rightmost = open
+ endif
+ endfor
+ return rightmost
endfunction
function s:Match(lnum, regex)
@@ -195,30 +231,33 @@ endfunction
" 3. GetRubyIndent Function {{{1
" =========================
-function GetRubyIndent()
+function GetRubyIndent(...)
" 3.1. Setup {{{2
" ----------
- " Set up variables for restoring position in file. Could use v:lnum here.
+ " For the current line, use the first argument if given, else v:lnum
+ let clnum = a:0 ? a:1 : v:lnum
+
+ " Set up variables for restoring position in file. Could use clnum here.
let vcol = col('.')
" 3.2. Work on the current line {{{2
" -----------------------------
" Get the current line.
- let line = getline(v:lnum)
+ let line = getline(clnum)
let ind = -1
" If we got a closing bracket on an empty line, find its match and indent
" according to it. For parentheses we indent to its column - 1, for the
" others we indent to the containing line's MSL's level. Return -1 if fail.
let col = matchend(line, '^\s*[]})]')
- if col > 0 && !s:IsInStringOrComment(v:lnum, col)
- call cursor(v:lnum, col)
+ if col > 0 && !s:IsInStringOrComment(clnum, col)
+ call cursor(clnum, col)
let bs = strpart('(){}[]', stridx(')}]', line[col - 1]) * 2, 2)
if searchpair(escape(bs[0], '\['), '', bs[1], 'bW', s:skip_expr) > 0
if line[col-1]==')' && col('.') != col('$') - 1
- let ind = virtcol('.')-1
+ let ind = virtcol('.') - 1
else
let ind = indent(s:GetMSL(line('.')))
endif
@@ -233,13 +272,14 @@ function GetRubyIndent()
" If we have a deindenting keyword, find its match and indent to its level.
" TODO: this is messy
- if s:Match(v:lnum, s:ruby_deindent_keywords)
- call cursor(v:lnum, 1)
+ if s:Match(clnum, s:ruby_deindent_keywords)
+ call cursor(clnum, 1)
if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
\ s:end_skip_expr) > 0
let line = getline('.')
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
- \ strpart(line, col('.') - 1, 2) !~ 'do'
+ \ strpart(line, col('.') - 1, 2) !~ 'do' &&
+ \ g:ruby_hanging_indent
let ind = virtcol('.') - 1
else
let ind = indent('.')
@@ -249,7 +289,7 @@ function GetRubyIndent()
endif
" If we are in a multi-line string or line-comment, don't do anything to it.
- if s:IsInStringOrDocumentation(v:lnum, matchend(line, '^\s*') + 1)
+ if s:IsInStringOrDocumentation(clnum, matchend(line, '^\s*') + 1)
return indent('.')
endif
@@ -257,11 +297,11 @@ function GetRubyIndent()
" -------------------------------
" Find a non-blank, non-multi-line string line above the current line.
- let lnum = s:PrevNonBlankNonString(v:lnum - 1)
+ let lnum = s:PrevNonBlankNonString(clnum - 1)
" If the line is empty and inside a string, use the previous line.
- if line =~ '^\s*$' && lnum != prevnonblank(v:lnum - 1)
- return indent(prevnonblank(v:lnum))
+ if line =~ '^\s*$' && lnum != prevnonblank(clnum - 1)
+ return indent(prevnonblank(clnum))
endif
" At the start of the file use zero indent.
@@ -275,23 +315,26 @@ function GetRubyIndent()
" If the previous line ended with a block opening, add a level of indent.
if s:Match(lnum, s:block_regex)
- return indent(s:GetMSL(lnum)) + &sw
+ return indent(lnum) + &sw
endif
" If the previous line contained an opening bracket, and we are still in it,
" add indent depending on the bracket type.
if line =~ '[[({]'
- let counts = s:LineHasOpeningBrackets(lnum)
- if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
- if col('.') + 1 == col('$')
- return ind + &sw
+ let open = s:FindRightmostOpenBracket(lnum)
+ if open.pos != -1
+ if open.type == '(' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
+ if col('.') + 1 == col('$')
+ return ind + &sw
+ else
+ return virtcol('.')
+ endif
else
- return virtcol('.')
+ let nonspace = matchend(line, '\S', open.pos + 1) - 1
+ return nonspace > 0 ? nonspace : ind + &sw
endif
- elseif counts[1] == '1' || counts[2] == '1'
- return ind + &sw
else
- call cursor(v:lnum, vcol)
+ call cursor(clnum, vcol)
end
endif
@@ -315,7 +358,12 @@ function GetRubyIndent()
let col = s:Match(lnum, s:ruby_indent_keywords)
if col > 0
call cursor(lnum, col)
- let ind = virtcol('.') - 1 + &sw
+
+ if g:ruby_hanging_indent
+ let ind = virtcol('.') - 1 + &sw
+ else
+ let ind = indent('.') + &sw
+ endif
" let ind = indent(lnum) + &sw
" TODO: make this better (we need to count them) (or, if a searchpair
" fails, we know that something is lacking an end and thus we indent a
@@ -336,7 +384,7 @@ function GetRubyIndent()
" If the previous line wasn't a MSL and is continuation return its indent.
" TODO: the || s:IsInString() thing worries me a bit.
if p_lnum != lnum
- if s:Match(p_lnum,s:continuation_regex)||s:IsInString(p_lnum,strlen(line))
+ if s:Match(p_lnum,s:non_bracket_continuation_regex)||s:IsInString(p_lnum,strlen(line))
return ind
endif
endif
@@ -357,7 +405,7 @@ function GetRubyIndent()
endif
" If the previous line ended with [*+/.-=], indent one extra level.
- if s:Match(lnum, s:continuation_regex)
+ if s:Match(lnum, s:non_bracket_continuation_regex)
if lnum == p_lnum
let ind = msl_ind + &sw
else
View
10 vim/vendor/vim-ruby-faef7e/syntax/eruby.vim → vim/vendor/vim-ruby-7105a/syntax/eruby.vim
@@ -1,8 +1,7 @@
" Vim syntax file
" Language: eRuby
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 Apr 15
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
@@ -18,13 +17,12 @@ if !exists("g:eruby_default_subtype")
let g:eruby_default_subtype = "html"
endif
-if !exists("b:eruby_subtype") && main_syntax == 'eruby'
+if &filetype =~ '^eruby\.'
+ let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
+elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
if b:eruby_subtype == ''
- let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
- endif
- if b:eruby_subtype == ''
let b:eruby_subtype = matchstr(substitute(expand("%:t"),'\c\%(\.erb\|\.eruby\|\.erubis\)\+$','',''),'\.\zs\w\+$')
endif
if b:eruby_subtype == 'rhtml'
View
89 vim/vendor/vim-ruby-faef7e/syntax/ruby.vim → vim/vendor/vim-ruby-7105a/syntax/ruby.vim
@@ -1,8 +1,7 @@
" Vim syntax file
" Language: Ruby
" Maintainer: Doug Kearns <dougkearns@gmail.com>
-" Last Change: 2009 Dec 2
-" URL: http://vim-ruby.rubyforge.org
+" URL: https://github.com/vim-ruby/vim-ruby
" Anon CVS: See above site
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
" ----------------------------------------------------------------------------
@@ -32,26 +31,11 @@ endif
" Operators
if exists("ruby_operators")
- syn match rubyOperator "\%([~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::\)"
- syn match rubyPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)"
+ syn match rubyOperator "[~!^&|*/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\*\*\|\.\.\.\|\.\.\|::"
+ syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!="
syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop
endif
-" Special Methods
-if !exists("ruby_no_special_methods")
- syn keyword rubyAccess public protected private module_function
- " attr is a common variable name
- syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!"
- syn keyword rubyAttribute attr_accessor attr_reader attr_writer
- syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)"
- syn keyword rubyEval eval class_eval instance_eval module_eval
- syn keyword rubyException raise fail catch throw
- " false positive with 'include?'
- syn match rubyInclude "\<include\>[?!]\@!"
- syn keyword rubyInclude autoload extend load require
- syn keyword rubyKeyword callcc caller lambda proc
-endif
-
" Expression Substitution and Backslash Notation
syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display
syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display
@@ -119,6 +103,8 @@ syn match rubySymbol "[]})\"':]\@<!:\%(\$\|@@\=\)\=\h\w*"
syn match rubySymbol "[]})\"':]\@<!:\h\w*\%([?!=]>\@!\)\="
syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1
syn match rubySymbol "[]})\"':]\@<!\h\w*[!?]\=:\s\@="he=e-1
+syn match rubySymbol "\%([{(,]\_s*\)\@<=[[:space:],{]\l\w*[!?]\=::\@!"hs=s+1,he=e-1
+syn match rubySymbol "[[:space:],{]\h\w*[!?]\=:\s\@="hs=s+1,he=e-1
syn region rubySymbol start="[]})\"':]\@<!:'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape fold
syn region rubySymbol start="[]})\"':]\@<!:\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
@@ -126,28 +112,27 @@ syn match rubyBlockParameter "\h\w*" contained
syn region rubyBlockParameterList start="\%(\%(\<do\>\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter
syn match rubyInvalidVariable "$[^ A-Za-z_-]"
-syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~1-9]#
+syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]#
+syn match rubyPredefinedVariable "$\d\+" display
syn match rubyPredefinedVariable "$_\>" display
syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display
syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display
syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display
syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>\%(\s*(\)\@!"
-syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>\%(\s*(\)\@!"
-syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
-"Obsolete Global Constants
-"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>"
-"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>"
+syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(DATA\|FALSE\|NIL\)\>\%(\s*(\)\@!"
+syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>\%(\s*(\)\@!"
+syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_\%(VERSION\|RELEASE_DATE\|PLATFORM\|PATCHLEVEL\|REVISION\|DESCRIPTION\|COPYRIGHT\|ENGINE\)\)\>\%(\s*(\)\@!"
" Normal Regular Expression
-syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold
+syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>?:]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
" Generalized Regular Expression
-syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
-syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
-syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
-syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
-syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
+syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold
+syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold
+syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
+syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold
+syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold
" Normal String and Shell Command Output
syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial fold
@@ -160,11 +145,12 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
-syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold
-syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
-syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
-syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
-syn region rubySymbol matchgroup=rubySymbolDelimiter start="%[s](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
+syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold
+syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold
+syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape
+syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape
+syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape
+syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape
" Generalized Double Quoted String and Array of Strings and Shell Command Output
" Note: %= is not matched here as the beginning of a double quoted string
@@ -174,6 +160,7 @@ syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" en
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold
syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold
+syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold
" Here Document
syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@<!<<-\=\zs\%(\h\w*\)+ end=+$+ oneline contains=ALLBUT,@rubyNotTop
@@ -213,7 +200,7 @@ syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue
syn match rubyOperator "\<defined?" display
syn match rubyKeyword "\<\%(super\|yield\)\>[?!]\@!"
syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!"
-syn match rubyPseudoVariable "\<\%(nil\|self\|__FILE__\|__LINE__\)\>[?!]\@!"
+syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise
syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!"
" Expensive Mode - match 'end' with the appropriate opening keyword for syntax
@@ -266,6 +253,21 @@ else
syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!"
endif
+" Special Methods
+if !exists("ruby_no_special_methods")
+ syn keyword rubyAccess public protected private public_class_method private_class_method module_function
+ " attr is a common variable name
+ syn match rubyAttribute "\%(\%(^\|;\)\s*\)\@<=attr\>\(\s*[.=]\)\@!"
+ syn keyword rubyAttribute attr_accessor attr_reader attr_writer
+ syn match rubyControl "\<\%(exit!\|\%(abort\|at_exit\|exit\|fork\|loop\|trap\)\>[?!]\@!\)"
+ syn keyword rubyEval eval class_eval instance_eval module_eval
+ syn keyword rubyException raise fail catch throw
+ " false positive with 'include?'
+ syn match rubyInclude "\<include\>[?!]\@!"
+ syn keyword rubyInclude autoload extend load require require_relative
+ syn keyword rubyKeyword callcc caller lambda proc
+endif
+
" Comments and Documentation
syn match rubySharpBang "\%^#!.*" display
syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE XXX contained
@@ -286,12 +288,12 @@ syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(undef\|unless\|until
syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE
syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE
-syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE
-syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE
-syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE
-syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE
-syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|private\|proc\|protected\)\>" transparent contains=NONE
-syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|raise\|throw\|trap\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(abort\|at_exit\|attr\|attr_accessor\|attr_reader\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(attr_writer\|autoload\|callcc\|catch\|caller\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(eval\|class_eval\|instance_eval\|module_eval\|exit\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(extend\|fail\|fork\|include\|lambda\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(load\|loop\|private\|proc\|protected\)\>" transparent contains=NONE
+syn match rubyKeywordAsMethod "\%(\%(\.\@<!\.\)\|::\)\_s*\%(public\|require\|require_relative\|raise\|throw\|trap\)\>" transparent contains=NONE
" __END__ Directive
syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold
@@ -330,7 +332,6 @@ hi def link rubyPredefinedVariable rubyPredefinedIdentifier
hi def link rubySymbol Constant
hi def link rubyKeyword Keyword
hi def link rubyOperator Operator
-hi def link rubyPseudoOperator rubyOperator
hi def link rubyBeginEnd Statement
hi def link rubyAccess Statement
hi def link rubyAttribute Statement
Please sign in to comment.
Something went wrong with that request. Please try again.