From dougkearns at gmail.com Sat Jul 2 10:38:17 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sat Jul 2 10:39:20 2005 Subject: Stable release? In-Reply-To: <20050429124556.GB19087@localhost.localdomain> References: <20050429124556.GB19087@localhost.localdomain> Message-ID: <20050702143817.GB3824@localhost.localdomain> On Fri, Apr 29, 2005 at 10:45:56PM +1000, Doug Kearns wrote: > On Mon, Apr 25, 2005 at 07:28:36PM +0100, Hugh Sasse wrote: > > Is the CVS considered stable now? > > Yes. I think so. Do you not use the latest CVS? > > > I ask because I have just updated > > vim on one machine by some 40 patches, and considering the next step > > notice that > > http://rubyforge.org/frs/?group_id=16 > > displays files some 7 months old (2004-09-20). > > Yes, we really should release more often. Just as long as Gavin is > responsible for organising it. ;-) Sheesh, that was a hint Gavin... ;-) Regards, Doug From dougkearns at gmail.com Mon Jul 4 02:31:55 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Mon Jul 4 02:33:15 2005 Subject: PATCH: installer source directory detection (was Re: The installer again -- further tests.) In-Reply-To: References: <1341958919607.20041218111858@soyabean.com.au> Message-ID: <20050704063155.GA6221@localhost.localdomain> On Tue, Jan 04, 2005 at 11:29:06AM +0000, Hugh Sasse Staff Elec Eng wrote: > > OK, here is the diff with the extra diagnostic print statements > removed. this is against the CVS as grabbed with wget from > http://rubyforge.org/cgi-bin/viewcvs.cgi/vim-ruby/bin/vim-ruby-install.rb?cvsroot=vim-ruby > > today. > > You don't need to worry about the change from env ruby on the first > line of course... OK, I'll stick my nose in where it doesn't belong and commit this. ;-) Thanks Hugh! Is there any reason we're trying the current directory as a possible source directory first. Isn't it always going to be one up from the installation script? Excluding the gems case because I know nothing of RubyGems... Committed as: Index: bin/vim-ruby-install.rb =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/bin/vim-ruby-install.rb,v retrieving revision 1.1 diff -u -r1.1 vim-ruby-install.rb --- bin/vim-ruby-install.rb 19 Sep 2004 15:37:35 -0000 1.1 +++ bin/vim-ruby-install.rb 4 Jul 2005 06:23:44 -0000 @@ -52,8 +52,11 @@ # 1. Try the current directory. if SOURCE_FILES.all? { |path| FileTest.file?(path) } return '.' + # 2. Try the directory above this installation script. + elsif SOURCE_FILES.map { |f| File.join(File.dirname($0), '..', f) }.all? { |path| FileTest.file?(path) } + return File.join(File.dirname($0), '..') end - # 2. Try the gem 'vim-ruby'. + # 3. Try the gem 'vim-ruby'. begin require 'rubygems' raise "Need RubyGems 0.8+" if Gem::RubyGemsPackageVersion < '0.8' @@ -231,6 +234,9 @@ # will be copied. Both are strings. def initialize(source, target) @source_dir = source + unless FileTest.directory?(@source_dir) + raise "Automatically determined source directory ('#{@source_dir}') doesn't exist" + end unless FileTest.directory?(target) raise "Chosen target directory ('#{target}') doesn't exist" end @@ -366,6 +372,7 @@ op.parse!(ARGV) source_dir = Env.determine_source_directory +if source_dir.nil? then raise "Can't find source directory"; end target_dir = $options[:target_dir] || TargetDirectory.finder.find_target_directory VimRubyInstaller.new(source_dir, target_dir).install From hgs at dmu.ac.uk Tue Jul 5 05:24:54 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue Jul 5 05:20:01 2005 Subject: PATCH: installer source directory detection (was Re: The installer again -- further tests.) In-Reply-To: <20050704063155.GA6221@localhost.localdomain> References: <1341958919607.20041218111858@soyabean.com.au> <20050704063155.GA6221@localhost.localdomain> Message-ID: On Mon, 4 Jul 2005, Doug Kearns wrote: > On Tue, Jan 04, 2005 at 11:29:06AM +0000, Hugh Sasse Staff Elec Eng wrote: >> >> OK, here is the diff with the extra diagnostic print statements > > OK, I'll stick my nose in where it doesn't belong and commit this. ;-) > Thanks Hugh! > > Is there any reason we're trying the current directory as a possible > source directory first. Isn't it always going to be one up from the > installation script? Excluding the gems case because I know nothing of > RubyGems... > Given we are in bin I'd tend to agree. It's been a while since writing that but I think I just added to what was there so I didn't break anything. And I did it afterwards for the same reason. Hugh From hgs at dmu.ac.uk Wed Jul 6 11:33:12 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Wed Jul 6 11:30:23 2005 Subject: PATCH: installer source directory detection (was Re: The installer again -- further tests.) In-Reply-To: References: <1341958919607.20041218111858@soyabean.com.au> <20050704063155.GA6221@localhost.localdomain> Message-ID: I've just got the CVS tarball and tried to install it. E:\Downloads\vim-ruby\vim-ruby\bin>vim-ruby-install.rb E:/Downloads/vim-ruby/vim-ruby/bin/vim-ruby-install.rb:375: Can't find source di rectory (RuntimeError) E:\Downloads\vim-ruby\vim-ruby\bin>cd .. E:\Downloads\vim-ruby\vim-ruby>.\bin\vim-ruby-install.rb E:/Downloads/vim-ruby/vim-ruby/bin/vim-ruby-install.rb:375: Can't find source di rectory (RuntimeError) E:\Downloads\vim-ruby\vim-ruby> running rake on the Rakefile didn't create the gem -- it didn't "know" how to make Default. Since it looked like a gemspec file I just executed it instead of passing it to rake, but it produced nothing. thus I can's seem to get a gem out of the CVS tarball to proceed that way either. Hugh From dougkearns at gmail.com Fri Jul 22 08:44:22 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri Jul 22 08:47:02 2005 Subject: Slack syntax file maintainer In-Reply-To: <20050330113115.GR3884@localhost.localdomain> References: <20050330040626.GK3884@localhost.localdomain> <6629831144.20050330174413@soyabean.com.au> <20050330113115.GR3884@localhost.localdomain> Message-ID: <20050722124422.GA16864@localhost.localdomain> On Wed, Mar 30, 2005 at 09:31:15PM +1000, Doug Kearns wrote: > On Wed, Mar 30, 2005 at 05:44:13PM +1000, Gavin Sinclair wrote: > > > > > On the syntax note, should we include the definition for eruby files > > in our package? > > I guess we should if Michael is willing to come on-board or donate it. Did we ever hear back from Michael off-list? Regards, Doug From dougkearns at gmail.com Fri Jul 22 10:34:58 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri Jul 22 10:36:03 2005 Subject: PATCH: allow strings inside interpolation Message-ID: <20050722143457.GB16864@localhost.localdomain> This is the beginning of an update to the interpolation syntax highlighting - allowing strings to appear within these regions. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.45 diff -u -r1.45 ruby.vim --- syntax/ruby.vim 5 Apr 2005 07:21:39 -0000 1.45 +++ syntax/ruby.vim 22 Jul 2005 13:05:37 -0000 @@ -40,7 +40,7 @@ " Expression Substitution and Backslash Notation syn match rubyEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display syn match rubyEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display -syn match rubyInterpolation "#{[^}]*}" contained +syn match rubyInterpolation "#{[^}]*}" contained contains=rubyString syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" contained display syn match rubyNoInterpolation "\\#{[^}]*}" contained syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" contained display From dougkearns at gmail.com Tue Jul 26 06:24:22 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Jul 26 06:26:01 2005 Subject: PATCH: replace leading context offsets with \@<= Message-ID: <20050726102422.GA10073@localhost.localdomain> This replaces the deprecated leading context offsets, used to 'match' the beginning of a normal regular expression, with the \@<= pattern construct. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.37 diff -u -r1.37 ruby.vim --- syntax/ruby.vim 12 May 2004 13:35:07 -0000 1.37 +++ syntax/ruby.vim 26 Jul 2005 10:05:25 -0000 @@ -76,8 +76,8 @@ endif " Normal Regular Expression -syn region rubyString matchgroup=rubyStringDelimiter start="^\s*/" start="\ References: <1341958919607.20041218111858@soyabean.com.au> <20050704063155.GA6221@localhost.localdomain> Message-ID: <20050727095143.GB10073@localhost.localdomain> On Wed, Jul 06, 2005 at 04:33:12PM +0100, Hugh Sasse wrote: > running rake on the Rakefile didn't create the gem -- it didn't > "know" how to make Default. See patch below... > Since it looked like a gemspec file I > just executed it instead of passing it to rake, but it produced > nothing. thus I can's seem to get a gem out of the CVS tarball to > proceed that way either. rake -T will list all the tasks. Regards, Doug Index: Rakefile =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/Rakefile,v retrieving revision 1.2 diff -u -r1.2 Rakefile --- Rakefile 19 Sep 2004 15:36:50 -0000 1.2 +++ Rakefile 27 Jul 2005 09:42:37 -0000 @@ -8,6 +8,10 @@ ] PACKAGE_VERSION = Time.now.strftime('%Y.%m.%d') +desc "Build all the packages" +task :default => :package + + def gemspec Gem::Specification.new do |s| s.name = PACKAGE_NAME From hgs at dmu.ac.uk Wed Jul 27 09:23:05 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Wed Jul 27 09:17:49 2005 Subject: PATCH: default rake target (was Re: PATCH: installer source directory detection) In-Reply-To: <20050727095143.GB10073@localhost.localdomain> References: <1341958919607.20041218111858@soyabean.com.au> <20050704063155.GA6221@localhost.localdomain> <20050727095143.GB10073@localhost.localdomain> Message-ID: On Wed, 27 Jul 2005, Doug Kearns wrote: > On Wed, Jul 06, 2005 at 04:33:12PM +0100, Hugh Sasse wrote: > > > >> running rake on the Rakefile didn't create the gem -- it didn't >> "know" how to make Default. > > See patch below... > I grabbed the CVS which has this patch, I see... [...] > > rake -T will list all the tasks. Thanks. I'm not so fluent in Rake yet... That worked. I successfully ran the installation script too. Thank you. > > Regards, > Doug > Thank you, Hugh From dougkearns at gmail.com Thu Jul 28 02:10:22 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Jul 28 02:11:25 2005 Subject: PATCH: improve highlighting of conditional expressions Message-ID: <20050728061022.GA28748@localhost.localdomain> This improves the matching of conditional expressions. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.47 diff -u -r1.47 ruby.vim --- syntax/ruby.vim 26 Jul 2005 10:48:10 -0000 1.47 +++ syntax/ruby.vim 28 Jul 2005 05:53:26 -0000 @@ -157,7 +157,7 @@ syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold " statements without *do* - syn region rubyNoDoBlock matchgroup=rubyControl start="\<\%(case\|begin\)\>" start="^\s*\%(if\|unless\)\>" start="[;=(]\s*\%(if\|unless\)\>"hs=s+1 end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold + syn region rubyNoDoBlock matchgroup=rubyControl start="\<\%(case\|begin\)\>" start="\%(^\|\.\.\.\=\|[;=([<>~+-\*/]\)\s*\zs\%(if\|unless\)\>" end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold " statement with optional *do* syn region rubyOptDoBlock matchgroup=rubyControl start="\" start="^\s*\%(while\|until\)\>" start=";\s*\%(while\|until\)\>"hs=s+1 end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold From dougkearns at gmail.com Thu Jul 28 09:08:29 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Jul 28 09:09:29 2005 Subject: Installation script's target directory Message-ID: <20050728130829.GB28748@localhost.localdomain> Currently it appears that we're attempting to install the vim-ruby runtime files into $VIMRUNTIME which should really only contained the default distributed files. It would be better to default to, $HOME/.vim (or $HOME/vimfiles for Windows) and $VIM/vimfiles. Any objections? Regards, Doug PS. Is HOME set on Windows in Win2k and later? From hgs at dmu.ac.uk Thu Jul 28 09:36:38 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Thu Jul 28 09:31:12 2005 Subject: Installation script's target directory In-Reply-To: <20050728130829.GB28748@localhost.localdomain> References: <20050728130829.GB28748@localhost.localdomain> Message-ID: On Thu, 28 Jul 2005, Doug Kearns wrote: > Currently it appears that we're attempting to install the vim-ruby > runtime files into $VIMRUNTIME which should really only contained the > default distributed files. Well, it should really only contain the system-wide settings determined by the admin(s) of the machines mounting this stuff.... Normally, vims defaults are the right thing, (though matchit is good to have). > > It would be better to default to, $HOME/.vim (or $HOME/vimfiles for > Windows) and $VIM/vimfiles. I don't know how many other users than me here make use of vim and ruby, but I like being able to give them the benefits of this package, once and for all users. Also, when users ask me for help it is nice to spin up vim and have it work sensibly, even if they prefer to use EMACS normally when I'm not doing stuff for them. Sometimes it is easier to write a ruby program then and there to solve the problem, in which case I want the things I'm used to available. If this is to change, I think we need a way to make it optional, and it would seem strange to me if most users didn't want to utilise this stuff, so I'd have it default to current behaviour. Then there's the case of the admins who've installed Ruby and Vim for some users, and get pestered to update things for them from time to time. Their job should be kept easy, too. > > Any objections? > > Regards, Doug > > PS. Is HOME set on Windows in Win2k and later? IIRC in XP you have to set it, but it's a while since I did. Thank you, Hugh From dougkearns at gmail.com Thu Jul 28 11:02:06 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Jul 28 11:04:04 2005 Subject: Installation script's target directory In-Reply-To: References: <20050728130829.GB28748@localhost.localdomain> Message-ID: <20050728150206.GC28748@localhost.localdomain> On Thu, Jul 28, 2005 at 02:36:38PM +0100, Hugh Sasse wrote: > On Thu, 28 Jul 2005, Doug Kearns wrote: > > >Currently it appears that we're attempting to install the vim-ruby > >runtime files into $VIMRUNTIME which should really only contained the > >default distributed files. > > Well, it should really only contain the system-wide settings > determined by the admin(s) of the machines mounting this stuff.... My understanding is that these should really go in $VIM/vimfiles (eg. /usr/share/vim/vimfiles). $VIM/vimfiles is designed as the system-wide preferences directory. It precedes $VIMRUNTIME in the 'runtimepath', is usable by all Vim installations, and survives upgrades. :help runtimepath My intent would be to offer $VIM/vimfiles and $HOME/.vim as the default installation directories. I guess we'll have to parse "env vim --version" to determine $VIM. What's the best way on Windows? > Also, when users ask me for help it > is nice to spin up vim and have it work sensibly, even if they > prefer to use EMACS normally when I'm not doing stuff for them. I hope you're working your magic on them... > If this is to change, I think we need a way to make it optional, and > it would seem strange to me if most users didn't want to utilise > this stuff, so I'd have it default to current behaviour. Of course, the user will still be able to specify any installation path they wish. > Then there's the case of the admins who've installed Ruby and Vim > for some users, and get pestered to update things for them from time > to time. Their job should be kept easy, too. Yes, this is intended to make it easier. ;-) This only came up because I was considering a release and thought I should check the installation script. I've never used it before and noticed that it offered me /usr/share/vim/vim63 as the default installation path and completely ignored my local installation. I thought I'd uninstalled the system-wide version... Thanks, Doug From dougkearns at gmail.com Sat Jul 30 11:17:21 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sat Jul 30 11:18:26 2005 Subject: PATCH: reorder identifier syntax matching Message-ID: <20050730151721.GA4055@localhost.localdomain> This reorders the identifier matching so that those containing some of the more unusual predefined identifiers, such as $_, will match properly without having to mess around with 'iskeyword'. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.48 diff -u -r1.48 ruby.vim --- syntax/ruby.vim 28 Jul 2005 06:12:33 -0000 1.48 +++ syntax/ruby.vim 30 Jul 2005 14:51:03 -0000 @@ -68,17 +68,6 @@ syn match rubyLocalVariableOrMethod "[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent if !exists("ruby_no_identifiers") - syn match rubyConstant "\%(::\)\=\zs\u\w*" display - syn match rubyClassVariable "@@\h\w*" display - syn match rubyInstanceVariable "@\h\w*" display - syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" - syn match rubySymbol ":\@\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" - syn match rubySymbol ":\@_,;:!?/.'"@$*\&+0]\)" - syn match rubySymbol ":\@?@\_`~1-9]# syn match rubyPredefinedVariable "$-[0FIKadilpvw]" display syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display @@ -89,6 +78,17 @@ "Obsolete Global Constants "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(NotImplementError\)\>" + + syn match rubyConstant "\%(::\)\=\zs\u\w*" display + syn match rubyClassVariable "@@\h\w*" display + syn match rubyInstanceVariable "@\h\w*" display + syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" + syn match rubySymbol ":\@\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" + syn match rubySymbol ":\@_,;:!?/.'"@$*\&+0]\)" + syn match rubySymbol ":\@ This allows the highlighting to differentiate between constants and capitalized class methods invoked using the 'scope operator'. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.50 diff -u -r1.50 ruby.vim --- syntax/ruby.vim 1 Aug 2005 15:27:38 -0000 1.50 +++ syntax/ruby.vim 2 Aug 2005 14:49:09 -0000 @@ -68,7 +68,7 @@ syn match rubyLocalVariableOrMethod "[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent if !exists("ruby_no_identifiers") - syn match rubyConstant "\%(::\)\=\zs\u\w*" display + syn match rubyConstant "\%(\%(\.\@\%(\s*(\)\@!" display syn match rubyClassVariable "@@\h\w*" display syn match rubyInstanceVariable "@\h\w*" display syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" @@ -84,12 +84,12 @@ syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>" display - syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>" display - syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>" display - syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>" display + syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" + syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" + syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" "Obsolete Global Constants - "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" - "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(NotImplementError\)\>" + "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" + "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>" else syn match NONE +$['"]+ endif From dougkearns at gmail.com Tue Aug 2 10:58:04 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Aug 2 10:59:26 2005 Subject: PATCH: reorder identifier syntax matching In-Reply-To: <20050730151721.GA4055@localhost.localdomain> References: <20050730151721.GA4055@localhost.localdomain> Message-ID: <20050802145804.GB4017@localhost.localdomain> On Sun, Jul 31, 2005 at 01:17:21AM +1000, Doug Kearns wrote: > This reorders the identifier matching so that those containing some of > the more unusual predefined identifiers, such as $_, will match properly > without having to mess around with 'iskeyword'. Scrap that... just make it a special case. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.49 diff -u -r1.49 ruby.vim --- syntax/ruby.vim 30 Jul 2005 15:22:23 -0000 1.49 +++ syntax/ruby.vim 1 Aug 2005 15:00:11 -0000 @@ -68,17 +68,6 @@ syn match rubyLocalVariableOrMethod "[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent if !exists("ruby_no_identifiers") - syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\_`~1-9]# - syn match rubyPredefinedVariable "$-[0FIKadilpvw]" display - syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display - syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>" display - syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>" display - syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>" display - syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>" display - "Obsolete Global Constants - "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" - "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(NotImplementError\)\>" - syn match rubyConstant "\%(::\)\=\zs\u\w*" display syn match rubyClassVariable "@@\h\w*" display syn match rubyInstanceVariable "@\h\w*" display @@ -89,6 +78,18 @@ syn region rubySymbol start=":\@?@\`~1-9]# + syn match rubyPredefinedVariable "$_\>" display + syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display + syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display + syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>" display + syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(MatchingData\|ARGF\|ARGV\|ENV\)\>" display + syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(DATA\|FALSE\|NIL\|RUBY_PLATFORM\|RUBY_RELEASE_DATE\)\>" display + syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(RUBY_VERSION\|STDERR\|STDIN\|STDOUT\|TOPLEVEL_BINDING\|TRUE\)\>" display + "Obsolete Global Constants + "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" + "syn match rubyPredefinedConstant "\<\%(::\)\=\zs\%(NotImplementError\)\>" else syn match NONE +$['"]+ endif From dougkearns at gmail.com Wed Aug 3 10:08:36 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Wed Aug 3 10:10:40 2005 Subject: PATCH: contributors file In-Reply-To: <20050802145449.GA4017@localhost.localdomain> References: <20050802145449.GA4017@localhost.localdomain> Message-ID: <20050803140836.GA5169@localhost.localdomain> I've added a new file listing all the contributors to this project. My apologies to anyone I've missed; if you feel that you should be included let me know. Regards, Doug Index: CONTRIBUTORS =================================================================== RCS file: CONTRIBUTORS diff -N CONTRIBUTORS --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ CONTRIBUTORS 3 Aug 2005 13:52:35 -0000 @@ -0,0 +1,15 @@ +Maintainers: + Tim Hammerquist + Doug Kearns + Gavin Sinclair + +Developers: + Nikolai Weibull + +Other contributors: + Ned Konz + Ken Miller + Hugh Sasse + Tilman Sauerbeck + Bertram Scharpf + Aaron Son From dougkearns at gmail.com Tue Aug 9 06:43:08 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Aug 9 07:11:50 2005 Subject: Installation script's target directory In-Reply-To: <20050728150206.GC28748@localhost.localdomain> References: <20050728130829.GB28748@localhost.localdomain> <20050728150206.GC28748@localhost.localdomain> Message-ID: <20050809104308.GA7398@localhost.localdomain> On Fri, Jul 29, 2005 at 01:02:06AM +1000, Doug Kearns wrote: > My intent would be to offer $VIM/vimfiles and $HOME/.vim as the default > installation directories. I guess we'll have to parse "env vim > --version" to determine $VIM. What's the best way on Windows? Because I'm 'flying blind', without access to a Windows box anytime soon, could someone please do me a favour and see if something like this returns $VIM? require 'win32/registry' dirs = [] path = '' Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') do |reg| path = reg['path', Win32::Registry::REG_SZ] end unless path.empty? system_dir = path.sub(/\\vim\d\d\\gvim.exe/, '') dirs << system_dir + '/vimfiles' end Thanks, Doug From hgs at dmu.ac.uk Tue Aug 9 07:34:41 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue Aug 9 07:28:42 2005 Subject: Installation script's target directory In-Reply-To: <20050809104308.GA7398@localhost.localdomain> References: <20050728130829.GB28748@localhost.localdomain> <20050728150206.GC28748@localhost.localdomain> <20050809104308.GA7398@localhost.localdomain> Message-ID: On Tue, 9 Aug 2005, Doug Kearns wrote: > On Fri, Jul 29, 2005 at 01:02:06AM +1000, Doug Kearns wrote: > > > >> My intent would be to offer $VIM/vimfiles and $HOME/.vim as the default >> installation directories. I guess we'll have to parse "env vim >> --version" to determine $VIM. What's the best way on Windows? > > Because I'm 'flying blind', without access to a Windows box anytime > soon, could someone please do me a favour and see if something like this > returns $VIM? > > require 'win32/registry' > dirs = [] > path = '' > Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') do |reg| > path = reg['path', Win32::Registry::REG_SZ] > end > unless path.empty? > system_dir = path.sub(/\\vim\d\d\\gvim.exe/, '') > dirs << system_dir + '/vimfiles' > end > > Windows98 I get rb(main):001:0> require 'win32/registry' => true irb(main):002:0> dirs = [] => [] irb(main):003:0> path = '' => "" irb(main):004:0> Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') d o |reg| irb(main):005:1* path = reg['path', Win32::Registry::REG_SZ] irb(main):006:1> end => "C:\\VIM\\VIM63\\gvim.exe" irb(main):007:0> unless path.empty? irb(main):008:1> system_dir = path.sub(/\\vim\d\d\\gvim.exe/, '') irb(main):009:1> dirs << system_dir + '/vimfiles' irb(main):010:1> end => ["C:\\VIM\\VIM63\\gvim.exe/vimfiles"] irb(main):011:0> dirs => ["C:\\VIM\\VIM63\\gvim.exe/vimfiles"] irb(main):012:0> but in my vim I get C:\vim from echo $VIM And that's with irb(main):012:0> puts RUBY_VERSION 1.8.2 => nil irb(main):013:0> or C:\WINDOWS>ruby --version ruby 1.8.2 (2004-12-25) [i386-mswin32] C:\WINDOWS> > > Thanks, > Doug > HTH Hugh From dougkearns at gmail.com Tue Aug 9 07:51:26 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Aug 9 07:52:23 2005 Subject: Installation script's target directory In-Reply-To: References: <20050728130829.GB28748@localhost.localdomain> <20050728150206.GC28748@localhost.localdomain> <20050809104308.GA7398@localhost.localdomain> Message-ID: <20050809115126.GB7398@localhost.localdomain> Thanks Hugh, On Tue, Aug 09, 2005 at 12:34:41PM +0100, Hugh Sasse wrote: > Windows98 I get > rb(main):001:0> require 'win32/registry' > => true > irb(main):002:0> dirs = [] > => [] > irb(main):003:0> path = '' > => "" > irb(main):004:0> > Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') d > o |reg| > irb(main):005:1* path = reg['path', Win32::Registry::REG_SZ] > irb(main):006:1> end > => "C:\\VIM\\VIM63\\gvim.exe" > irb(main):007:0> unless path.empty? > irb(main):008:1> system_dir = path.sub(/\\vim\d\d\\gvim.exe/, '') irb(main):008:1> system_dir = path.sub(/\\vim\d\d\\gvim.exe/i, '') > irb(main):009:1> dirs << system_dir + '/vimfiles' > irb(main):010:1> end > => ["C:\\VIM\\VIM63\\gvim.exe/vimfiles"] > irb(main):011:0> dirs > => ["C:\\VIM\\VIM63\\gvim.exe/vimfiles"] > irb(main):012:0> I always forget that it's case insensitive... Thanks again, Doug From hgs at dmu.ac.uk Tue Aug 9 08:08:30 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue Aug 9 08:02:31 2005 Subject: Installation script's target directory In-Reply-To: <20050809115126.GB7398@localhost.localdomain> References: <20050728130829.GB28748@localhost.localdomain> <20050728150206.GC28748@localhost.localdomain> <20050809104308.GA7398@localhost.localdomain> <20050809115126.GB7398@localhost.localdomain> Message-ID: On Tue, 9 Aug 2005, Doug Kearns wrote: > Thanks Hugh, > [...] > > irb(main):008:1> system_dir = path.sub(/\\vim\d\d\\gvim.exe/i, '') > [...] irb(main):013:0> dirs = [] => [] irb(main):014:0> path = '' => "" irb(main):015:0> Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') d o |reg| irb(main):016:1* path = reg['path', Win32::Registry::REG_SZ] irb(main):017:1> end => "C:\\VIM\\VIM63\\gvim.exe" irb(main):018:0> unless path.empty? irb(main):019:1> system_dir = path.sub(/\\vim\d\d\\gvim.exe/i, '') irb(main):020:1> dirs << system_dir + '/vimfiles' irb(main):021:1> end => ["C:\\VIM/vimfiles"] irb(main):022:0> > > I always forget that it's case insensitive... Yes, same here.. > > > > Thanks again, > Doug Hugh From dougkearns at gmail.com Thu Aug 11 09:17:15 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Aug 11 09:18:15 2005 Subject: PATCH: link rubyIdentifier to NONE when ruby_no_identifiers is set Message-ID: <20050811131715.GA4252@localhost.localdomain> This links the rubyIdentifier syntax group to NONE when ruby_no_identifiers is set. Too much of the highlighting now relies on the identifier matches to use the current implementation. Nikolai, you're the only one I've come across who actually uses this so let me know if there are any problems. Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.52 retrieving revision 1.53 diff -u -b -r1.52 -r1.53 --- syntax/ruby.vim 6 Aug 2005 08:11:44 -0000 1.52 +++ syntax/ruby.vim 6 Aug 2005 12:55:44 -0000 1.53 @@ -67,32 +67,28 @@ " Identifiers syn match rubyLocalVariableOrMethod "[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent -if !exists("ruby_no_identifiers") - syn match rubyConstant "\%(\%(\.\@\%(\s*(\)\@!" - syn match rubyClassVariable "@@\h\w*" display - syn match rubyInstanceVariable "@\h\w*" display - syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" - syn match rubySymbol ":\@\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" - syn match rubySymbol ":\@_,;:!?/.'"@$*\&+0]\)" - syn match rubySymbol ":\@?@\`~1-9]# - syn match rubyPredefinedVariable "$_\>" display - syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display - syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display - syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>" display - syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" - syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" - syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" - "Obsolete Global Constants - "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" - "syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>" -else - syn match NONE +$['"]+ -endif +syn match rubyConstant "\%(\%(\.\@\%(\s*(\)\@!" +syn match rubyClassVariable "@@\h\w*" display +syn match rubyInstanceVariable "@\h\w*" display +syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" +syn match rubySymbol ":\@\|<=\|<\|===\|==\|=\~\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" +syn match rubySymbol ":\@_,;:!?/.'"@$*\&+0]\)" +syn match rubySymbol ":\@?@\`~1-9]# +syn match rubyPredefinedVariable "$_\>" display +syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display +syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display +syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOAD_PATH\|SAFE\|VERBOSE\)\>" display +syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" +"Obsolete Global Constants +"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(PLATFORM\|RELEASE_DATE\|VERSION\)\>" +"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>" " Normal Regular Expression syn region rubyString matchgroup=rubyStringDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\)\|[\~=!|&(,[]\)\s*\)\@<=/" end="/[iomx]*" skip="\\\\\|\\/" contains=@rubyStringSpecial @@ -244,7 +240,11 @@ HiLink rubyException Exception HiLink rubyClass Type HiLink rubyModule Type + if !exists("ruby_no_identifiers") HiLink rubyIdentifier Identifier + else + HiLink rubyIdentifier NONE + endif HiLink rubyClassVariable rubyIdentifier HiLink rubyConstant rubyIdentifier HiLink rubyGlobalVariable rubyIdentifier From dougkearns at gmail.com Thu Aug 11 09:17:49 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Aug 11 09:18:49 2005 Subject: PATCH: move filetype.vim to ftdetect/ruby.vim Message-ID: <20050811131749.GB4252@localhost.localdomain> I've moved filetype/filetype.vim to ftdetect/ruby.vim and added this to the installer's list of known files. However, this will only work for vim6.3+ so we may have to come up with a solution for earlier versions too. Regards, Doug From dougkearns at gmail.com Thu Aug 11 09:19:04 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Aug 11 09:20:01 2005 Subject: PATCH: new eRuby syntax file In-Reply-To: <20050803140836.GA5169@localhost.localdomain> References: <20050802145449.GA4017@localhost.localdomain> <20050803140836.GA5169@localhost.localdomain> Message-ID: <20050811131904.GC4252@localhost.localdomain> I've added a new eRuby syntax file to the repository - to meet a feature request in the tracker more than anything. I don't actually use eRuby but it appears to be usable; if that's not the case speak up. ;-) Regards, Doug PS. Thanks to Michael Brailsford for writing a version of this which can be found at http://vim.sourceforge.net/scripts/script.php?script_id=403 We haven't been able to contact him so I've written a new version with several improvements...I think. Index: syntax/eruby.vim =================================================================== RCS file: syntax/eruby.vim diff -N syntax/eruby.vim --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ syntax/eruby.vim 11 Aug 2005 09:18:15 -0000 @@ -0,0 +1,62 @@ +" Vim syntax file +" Language: eRuby +" Maintainer: Doug Kearns +" Info: $Id$ +" URL: http://vim-ruby.sourceforge.net +" Anon CVS: See above site +" Licence: GPL (http://www.gnu.org) +" Disclaimer: +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" ---------------------------------------------------------------------------- + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +if !exists("main_syntax") + let main_syntax = 'eruby' +endif + +if version < 600 + so :p:h/html.vim + syn include @rubyTop :p:h/ruby.vim +else + runtime! syntax/html.vim + unlet b:current_syntax + syn include @rubyTop syntax/ruby.vim +endif + +syn region erubyOneLiner matchgroup=erubyDelimiter start="^\s*\zs%" end="$" contains=@rubyTop,erubyDelimiter keepend +syn region erubyBlock matchgroup=erubyDelimiter start="<%=\=" end="%>" contains=@rubyTop containedin=ALLBUT,erubyComment keepend +syn region erubyComment matchgroup=erubyDelimiter start="<%#" end="%>" keepend + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_eruby_syntax_inits") + if version < 508 + let did_ruby_syntax_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink erubyDelimiter Delimiter + HiLink erubyComment Comment + + delcommand HiLink +endif +let b:current_syntax = "eruby" + +if main_syntax == 'eruby' + unlet main_syntax +endif + +" vim: sw=2 sts=2 ts=8 ff=unix nowrap: Index: bin/vim-ruby-install.rb =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/bin/vim-ruby-install.rb,v retrieving revision 1.3 diff -u -r1.3 vim-ruby-install.rb --- bin/vim-ruby-install.rb 8 Aug 2005 03:39:41 -0000 1.3 +++ bin/vim-ruby-install.rb 11 Aug 2005 09:18:15 -0000 @@ -23,6 +23,7 @@ ftdetect/ruby.vim ftplugin/ruby.vim indent/ruby.vim + syntax/eruby.vim syntax/ruby.vim } # XXX: what do we do with 'filetype/filetype.vim' ??? Index: CONTRIBUTORS =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/CONTRIBUTORS,v retrieving revision 1.2 diff -u -r1.2 CONTRIBUTORS --- CONTRIBUTORS 9 Aug 2005 11:57:21 -0000 1.2 +++ CONTRIBUTORS 11 Aug 2005 09:18:15 -0000 @@ -7,6 +7,7 @@ Nikolai Weibull Other contributors: + Michael Brailsford Sean Flanagan Ken Miller Hugh Sasse From dougkearns at gmail.com Mon Aug 15 10:52:14 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Mon Aug 15 10:54:00 2005 Subject: PATCH: default installation directories Message-ID: <20050815145214.GA4236@localhost.localdomain> This is just a quick patch to use $VIM/vimfiles and $HOME/{.vim,vimfiles} rather than $VIMRUNTIME as the two default installation directories offered by vim-ruby-install.rb. $VIM is determined by: 1. checking for an env variable VIM or if this is not found - as in the default case 2. by parsing vim --version on UNIX or reading the 'path' key under HKEY_LOCAL_MACHINE\Software\Vim\Gvim on Windows Perhaps $VIMRUNTIME should be a fall-back but I think there are some pretty significant problems if we can't find $VIM. It could undoubtedly be improved... Regards, Doug PS. Apologies for the incorrect threading of the two previous messages. I stuck them in my drafts folder late one night and forgot to edit the In-Reply-To header...*sigh* I know how this stuff really annoys some people. ;-) Index: README =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/README,v retrieving revision 1.5 diff -u -r1.5 README --- README 6 Nov 2003 10:17:33 -0000 1.5 +++ README 15 Aug 2005 14:39:33 -0000 @@ -26,10 +26,10 @@ - Thank you very much for taking an interest. Contents of the project: - - The compiler, ftplugin, indent and syntax directories contain the ruby.vim - files that are to be copied somewhere Vim can see them. - - install.rb performs this copying. - - build.rb creates a tarball for easy distribution. + - The compiler, ftdetect, ftplugin, indent and syntax directories contain + the ruby.vim files that are to be copied to a location somewhere in the Vim + 'runtimepath'. + - vim-ruby-install.rb performs this copying. How you get these files into Vim: - By downloading the project via a snapshot or anonymous CVS, you can keep @@ -37,8 +37,9 @@ directory. - By downloading one of the tarballs, you can easily install the latest stable or development version wherever you like on your machine. No - README, no install.rb, just Vim files. You would typically install these - wherever Vim is installed, in the (for example) "vim62" directory. + README, no vim-ruby-install.rb, just Vim files. You would typically + install these into either $VIM/vimfiles, for system-wide use, or $HOME/.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. @@ -70,7 +71,8 @@ (gsinclair at soyabean.com.au). - 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. + nothing about the syntax file, for instance. (Come to think of it, nor does + Doug - djk) Project gossip: - Two of the configuration file maintainers, Doug Kearns and Gavin Sinclair, Index: bin/vim-ruby-install.rb =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/bin/vim-ruby-install.rb,v retrieving revision 1.4 diff -u -r1.4 vim-ruby-install.rb --- bin/vim-ruby-install.rb 11 Aug 2005 13:51:28 -0000 1.4 +++ bin/vim-ruby-install.rb 15 Aug 2005 14:39:33 -0000 @@ -2,10 +2,10 @@ # vim-ruby-install: install the Vim config files for Ruby editing # -# * scope out the target directry and get user to confirm +# * scope out the target directory and get user to confirm # * if no directory found, ask user # * allow user to force a search for a Windows gvim installation -# * find source files from gem or from current directory +# * find source files from gem or from top level directory # * copy to target directory, taking account of # * line endings (NL for Unix-ish; CRLF for Windows) # * permissions (755 for directories; 644 for files) @@ -26,11 +26,11 @@ syntax/eruby.vim syntax/ruby.vim } -# XXX: what do we do with 'filetype/filetype.vim' ??? - +#FIXME: ftdetect/ruby.vim - vim 6.3+ only? This won't cause problems for +# earlier versions; it just won't work! # - # Miscelleneous functions in the user's environment. + # Miscellaneous functions in the user's environment. # class Env # @@ -47,18 +47,15 @@ # # Returns the path to the directory where the vim configuration files will be copied from. - # The first preference is the current directory. If that fails, we look for the RubyGems - # package 'vim-ruby'. Failing that, we return +nil+. + # The first preference is the directory above this script. If that fails, we look for the + # RubyGems package 'vim-ruby'. Failing that, we return +nil+. # def Env.determine_source_directory - # 1. Try the current directory. - if SOURCE_FILES.all? { |path| FileTest.file?(path) } - return '.' - # 2. Try the directory above this installation script. - elsif SOURCE_FILES.map { |f| File.join(File.dirname($0), '..', f) }.all? { |path| FileTest.file?(path) } - return File.join(File.dirname($0), '..') + # 1. Try the directory above this installation script. + if SOURCE_FILES.map { |f| File.join(File.dirname($0), '..', f) }.all? { |path| FileTest.file?(path) } + return File.expand_path(File.join(File.dirname($0), '..')) end - # 3. Try the gem 'vim-ruby'. + # 2. Try the gem 'vim-ruby'. begin require 'rubygems' raise "Need RubyGems 0.8+" if Gem::RubyGemsPackageVersion < '0.8' @@ -77,6 +74,29 @@ return nil end + # Returns the Vim installation directory ($VIM). + # FIXME: print warning if vim command not in PATH or appropriate key not in registry? + def Env.determine_vim_dir + installation_dir = ENV['VIM'] || + case Env.determine_target_os + when :UNIX + IO.popen('vim --version 2>/dev/null') do |version| + dir = version.read[/fall-back for \$VIM: "(.*)"/, 1] + end + when :WINDOWS + require 'win32/registry' + path = '' + Win32::Registry::HKEY_LOCAL_MACHINE.open('SOFTWARE\Vim\Gvim') do |reg| + path = reg['path', Win32::Registry::REG_SZ] + end + # FIXME: Does Registry#[] ever return nil? Exceptions? + unless path.empty? or path.nil? + dir = path.sub(/\\vim\d\d\\gvim.exe/i, '') + end + end + return installation_dir + end + def Env.ask_user(message) print message gets.strip @@ -158,21 +178,14 @@ # user options; but is ultimately created with one in mind. # class TargetDirectory::Finder - POTENTIAL_DIRECTORIES = { - :UNIX => [ - "/usr/local/share/vim", - "/usr/local/vim", - "/usr/share/vim", - "/usr/vim", - "/opt/share/vim", - "/opt/vim" - ], - :WINDOWS => [ File.join(ENV['PROGRAMFILES'], 'vim') ] - } # Guides the user through a selection process, ending in a chosen directory. def find_target_directory - # 1. Try the potentials (if there are any). + # 1. Was a directory specified using the --directory option? + if option_dir = $options[:target_dir] + return option_dir + end + # 2. Try the potentials (if there are any). if dirs = _potential_directories and not dirs.empty? puts puts "Possible Vim installation directories:" @@ -186,23 +199,15 @@ return chosen_directory end end - # 2. We didn't find any, or the user wants to enter another. + # 3. We didn't find any, or the user wants to enter another. if dirs.empty? puts puts "Couldn't find any Vim installation directories." end - loop do - dir = Env.ask_user "Please enter the full path to your Vim installation directory: " - dir = File.expand_path(dir) - if FileTest.directory?(dir) - entered_directory = dir - puts - return entered_directory - else - puts " *** That directory doesn't exist!" - end - end - # 3. We don't get here; every path contains a return statement. + entered_directory = Env.ask_user "Please enter the full path to your Vim installation directory: " + entered_directory = File.expand_path(entered_directory) + return entered_directory + # 4. We don't get here; every path contains a return statement. end private @@ -210,17 +215,26 @@ # Return an array of _potential_ directories (i.e. they exist). Take the options into # account. def _potential_directories - dirs = POTENTIAL_DIRECTORIES[Env.determine_target_os].select { |d| FileTest.directory?(d) } - dirs.map { |d| _vim_runtime_directory(d) } - end - - # Given a directory like '/usr/share/vim', returns a directory like '/usr/share/vim/vim63'. - def _vim_runtime_directory(dir) - if File.basename(dir) =~ /vim\d+/ - dir - else - Dir.glob("#{dir}/vim*").select { |d| d =~ /vim\d+/ }.sort.last - end + dirs = [] + dirs << _vim_user_dir + dirs << _vim_system_dir + return dirs.compact.map { |dir| File.expand_path(dir) } + end + + # Return the Vim system preferences directory + def _vim_system_dir + dir = ENV['VIM'] || Env.determine_vim_dir + system_dir = dir + "/vimfiles" if dir + return system_dir + end + + # Return the Vim user preferences directory + def _vim_user_dir + extension = { :UNIX => "/.vim", :WINDOWS => "/vimfiles" } + platform = Env.determine_target_os + dir = ENV['HOME'] + user_dir = dir + extension[platform] if dir + return user_dir end end # class TargetDirectory::Finder @@ -331,7 +345,7 @@ vim-ruby-install.rb: Install the vim-ruby configuration files About: - * Detects the Vim runtime directory + * Detects the Vim user and system-wide preferences directories * User to confirm before proceeding * User may specify other directory * Takes config files from current directory or from vim-ruby gem @@ -368,15 +382,30 @@ Cygwin or MinGW. * This installer is quite new (2004-09-20). Please report bugs to - gsinclair@soyabea.com.au. + gsinclair@soyabean.com.au. }.gsub(/^ /, '') end op.parse!(ARGV) source_dir = Env.determine_source_directory -if source_dir.nil? then raise "Can't find source directory"; end -target_dir = $options[:target_dir] || TargetDirectory.finder.find_target_directory -VimRubyInstaller.new(source_dir, target_dir).install +if source_dir.nil? + raise "Can't find source directory" +end -# vim: ft=ruby +target_dir = TargetDirectory.finder.find_target_directory +if not File.directory?(target_dir) + puts + puts "Target directory '#{target_dir}' does not exist." + response = Env.ask_user "Do you want to create it? [Yn] " + if response.strip =~ /^y(es)?$/i + FileUtils.mkdir_p(target_dir, :verbose => true) + else + puts + puts "Installation aborted." + exit + end +end + +VimRubyInstaller.new(source_dir, target_dir).install +# vim: ft=ruby sw=2 sts=2 ts=8: From hgs at dmu.ac.uk Mon Aug 15 11:29:36 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Mon Aug 15 11:24:09 2005 Subject: PATCH: default installation directories In-Reply-To: <20050815145214.GA4236@localhost.localdomain> References: <20050815145214.GA4236@localhost.localdomain> Message-ID: On Tue, 16 Aug 2005, Doug Kearns wrote: > This is just a quick patch to use $VIM/vimfiles and > $HOME/{.vim,vimfiles} rather than $VIMRUNTIME as the two default > installation directories offered by vim-ruby-install.rb. Looks like what I'd wish for. I'll `cvs update -d` and try this. > - end > - end > - # 3. We don't get here; every path contains a return statement. > + entered_directory = Env.ask_user "Please enter the full path to your Vim installation directory: " > + entered_directory = File.expand_path(entered_directory) > + return entered_directory > + # 4. We don't get here; every path contains a return statement. > end Isn't the statement # 4 redundant now that it is *straight after* a return statement? (I suppose it should have been a raise or assert before, but still....) Hugh From dougkearns at gmail.com Mon Aug 15 11:58:10 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Mon Aug 15 11:59:03 2005 Subject: PATCH: default installation directories In-Reply-To: References: <20050815145214.GA4236@localhost.localdomain> Message-ID: <20050815155810.GB4236@localhost.localdomain> On Mon, Aug 15, 2005 at 04:29:36PM +0100, Hugh Sasse wrote: > On Tue, 16 Aug 2005, Doug Kearns wrote: > > >This is just a quick patch to use $VIM/vimfiles and > >$HOME/{.vim,vimfiles} rather than $VIMRUNTIME as the two default > >installation directories offered by vim-ruby-install.rb. > > Looks like what I'd wish for. I'll `cvs update -d` and try this. I thought you'd be glued to the cricket Hugh? ;-) > >- end > >- end > >- # 3. We don't get here; every path contains a return statement. > >+ entered_directory = Env.ask_user "Please enter the full path to your > >Vim installation directory: " > >+ entered_directory = File.expand_path(entered_directory) > >+ return entered_directory > >+ # 4. We don't get here; every path contains a return statement. > > end > > Isn't the statement # 4 redundant now that it is *straight after* a > return statement? Yes. > (I suppose it should have been a raise or assert before, but > still....) Regards, Doug From hgs at dmu.ac.uk Tue Aug 16 05:24:58 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue Aug 16 05:19:36 2005 Subject: PATCH: default installation directories In-Reply-To: <20050815155810.GB4236@localhost.localdomain> References: <20050815145214.GA4236@localhost.localdomain> <20050815155810.GB4236@localhost.localdomain> Message-ID: On Tue, 16 Aug 2005, Doug Kearns wrote: > On Mon, Aug 15, 2005 at 04:29:36PM +0100, Hugh Sasse wrote: >> On Tue, 16 Aug 2005, Doug Kearns wrote: >> >>> This is just a quick patch to use $VIM/vimfiles and >>> $HOME/{.vim,vimfiles} rather than $VIMRUNTIME as the two default >>> installation directories offered by vim-ruby-install.rb. >> >> Looks like what I'd wish for. I'll `cvs update -d` and try this. > > I thought you'd be glued to the cricket Hugh? ;-) Many are, but not me. > >>> - end >>> - end >>> - # 3. We don't get here; every path contains a return statement. >>> + entered_directory = Env.ask_user "Please enter the full path to your >>> Vim installation directory: " >>> + entered_directory = File.expand_path(entered_directory) >>> + return entered_directory >>> + # 4. We don't get here; every path contains a return statement. >>> end >> >> Isn't the statement # 4 redundant now that it is *straight after* a >> return statement? > > Yes. OK. It occurs to me that the user could supply something unreachable, so I'll have a look at that as I get chance. > >> (I suppose it should have been a raise or assert before, but >> still....) > > Regards, > Doug Hugh From hgs at dmu.ac.uk Tue Aug 16 07:25:42 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue Aug 16 07:20:07 2005 Subject: PATCH: default installation directories In-Reply-To: References: <20050815145214.GA4236@localhost.localdomain> <20050815155810.GB4236@localhost.localdomain> Message-ID: Oh, I see those patches aren't in the CVS yet. OK. Reading through I noticed a couple of things that may cause problems, so I've added comments and express them in the form of a patch for convenience. I think my mods to _same_contents *may* cover macs as well now, which I think used \r as a line ending. Probably not MacOSX. HTH Hugh --- vim-ruby/bin/vim-ruby-install.rb.orig 2005-08-16 11:39:51.236954000 +0100 +++ vim-ruby/bin/vim-ruby-install.rb 2005-08-16 12:09:37.698997000 +0100 @@ -119,6 +119,8 @@ def _ensure_directory_exists(path) dir = path.dirname unless dir.directory? + # FileUtils.mkdir_p already checks if it exists and is a + # directory. What if it exists as a file? (HGS) mkpath(dir) end end @@ -220,6 +222,9 @@ dir else Dir.glob("#{dir}/vim*").select { |d| d =~ /vim\d+/ }.sort.last + # I think this may fail at vim version 10 or if vim + # 6.22 were replaced by Vim 7. Not sure of a good fix at this + # time (HGS) end end @@ -279,8 +284,9 @@ # Test two files for equality of contents, ignoring line endings. def _same_contents?(p1, p2) - contents1 = p1.read.split("\n").map { |line| line.chomp } - contents2 = p2.read.split("\n").map { |line| line.chomp } + ending = /[\r\n]+/ + contents1 = p1.read.split(ending).map { |line| line.chomp } + contents2 = p2.read.split(ending).map { |line| line.chomp } contents1 == contents2 end From dougkearns at gmail.com Tue Aug 16 11:28:20 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Aug 16 11:29:10 2005 Subject: PATCH: default installation directories In-Reply-To: References: <20050815145214.GA4236@localhost.localdomain> <20050815155810.GB4236@localhost.localdomain> Message-ID: <20050816152820.GC4236@localhost.localdomain> On Tue, Aug 16, 2005 at 12:25:42PM +0100, Hugh Sasse wrote: > Oh, I see those patches aren't in the CVS yet. OK. Well it's Gavin's installer so I was going to wait for his comments since this changes it's behaviour. However, it seems he might be away or similar so I'll commit it. > Reading through > I noticed a couple of things that may cause problems, so I've added > comments and express them in the form of a patch for convenience. > > I think my mods to _same_contents *may* cover macs as well now, > which I think used \r as a line ending. Probably not MacOSX. Does Ruby run on 'Macs'? > HTH > Hugh > > --- vim-ruby/bin/vim-ruby-install.rb.orig 2005-08-16 > 11:39:51.236954000 +0100 > +++ vim-ruby/bin/vim-ruby-install.rb 2005-08-16 12:09:37.698997000 +0100 > @@ -119,6 +119,8 @@ > def _ensure_directory_exists(path) > dir = path.dirname > unless dir.directory? > + # FileUtils.mkdir_p already checks if it exists and is a > + # directory. What if it exists as a file? (HGS) Yes, I'm not sure what this indirection is about either so I'll just add your comment until Gavin can elucidate further. > Dir.glob("#{dir}/vim*").select { |d| d =~ /vim\d+/ }.sort.last > + # I think this may fail at vim version 10 or if vim > + # 6.22 were replaced by Vim 7. Not sure of a good fix at this > + # time (HGS) This code was removed by the patch. > # Test two files for equality of contents, ignoring line endings. > def _same_contents?(p1, p2) > - contents1 = p1.read.split("\n").map { |line| line.chomp } > - contents2 = p2.read.split("\n").map { |line| line.chomp } > + ending = /[\r\n]+/ > + contents1 = p1.read.split(ending).map { |line| line.chomp } > + contents2 = p2.read.split(ending).map { |line| line.chomp } > contents1 == contents2 > end Doesn't this make the 'map' call redundant too? FWIW, I'm not sure that silently replacing a file with one which differs only in it's line endings is a good idea anyway. Regards, Doug From hgs at dmu.ac.uk Tue Aug 16 11:49:31 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Tue Aug 16 11:43:58 2005 Subject: PATCH: default installation directories In-Reply-To: <20050816152820.GC4236@localhost.localdomain> References: <20050815145214.GA4236@localhost.localdomain> <20050815155810.GB4236@localhost.localdomain> <20050816152820.GC4236@localhost.localdomain> Message-ID: On Wed, 17 Aug 2005, Doug Kearns wrote: > On Tue, Aug 16, 2005 at 12:25:42PM +0100, Hugh Sasse wrote: >> Oh, I see those patches aren't in the CVS yet. OK. > > Well it's Gavin's installer so I was going to wait for his comments > since this changes it's behaviour. However, it seems he might be away or > similar so I'll commit it. OK, I can't remember how one might reverse a single change like this later but I think it can be done.... > >> Reading through >> I noticed a couple of things that may cause problems, so I've added >> comments and express them in the form of a patch for convenience. >> >> I think my mods to _same_contents *may* cover macs as well now, >> which I think used \r as a line ending. Probably not MacOSX. > > Does Ruby run on 'Macs'? I think so, but I've never used one. Just trying to keep things open. > >> HTH >> Hugh >> [...] >> def _ensure_directory_exists(path) >> dir = path.dirname >> unless dir.directory? >> + # FileUtils.mkdir_p already checks if it exists and is a >> + # directory. What if it exists as a file? (HGS) > > Yes, I'm not sure what this indirection is about either so I'll just add > your comment until Gavin can elucidate further. OK. > > > >> Dir.glob("#{dir}/vim*").select { |d| d =~ /vim\d+/ }.sort.last >> + # I think this may fail at vim version 10 or if vim >> + # 6.22 were replaced by Vim 7. Not sure of a good fix at this >> + # time (HGS) > > This code was removed by the patch. Oh, sorry. > > > >> # Test two files for equality of contents, ignoring line endings. >> def _same_contents?(p1, p2) >> - contents1 = p1.read.split("\n").map { |line| line.chomp } >> - contents2 = p2.read.split("\n").map { |line| line.chomp } >> + ending = /[\r\n]+/ >> + contents1 = p1.read.split(ending).map { |line| line.chomp } >> + contents2 = p2.read.split(ending).map { |line| line.chomp } >> contents1 == contents2 >> end > > Doesn't this make the 'map' call redundant too? Yes, I think so. I was reluctant to change too much at once without testing it to death. > > FWIW, I'm not sure that silently replacing a file with one which differs > only in it's line endings is a good idea anyway. Possibly this is to work around past problems where Unix distros ended up with DOS-ish files, which choked the interpreter. > > Regards, > Doug Thank you, Hugh From dougkearns at gmail.com Wed Aug 17 10:39:54 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Wed Aug 17 10:42:37 2005 Subject: PATCH: highlighting optional 'do' in loops Message-ID: <20050817143954.GD4236@localhost.localdomain> This should allow for the optional 'do' and ':' in looping constructs (for|until|while) to mostly be highlighted correctly...mostly... Regards, Doug Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.58 diff -u -r1.58 ruby.vim --- syntax/ruby.vim 17 Aug 2005 12:43:27 -0000 1.58 +++ syntax/ruby.vim 17 Aug 2005 14:23:21 -0000 @@ -148,7 +148,7 @@ syn match rubyControl "\<\%(if\|unless\|while\|until\)\>" display " *do* requiring *end* - syn region rubyDoBlock matchgroup=rubyControl start="\%(\<\%(for\|until\|while\)\s.*\s\)\@" end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold + syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold " *{* requiring *}* syn region rubyCurlyBlock start="{" end="}" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold @@ -157,10 +157,8 @@ syn region rubyNoDoBlock matchgroup=rubyControl start="\<\%(case\|begin\)\>" start="\%(^\|\.\.\.\=\|[;=([<>~+-\*/]\)\s*\zs\%(if\|unless\)\>" end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold " statement with optional *do* - syn region rubyOptDoBlock matchgroup=rubyControl start="\" start="\%(^\|;\)\s*\zs\%(while\|until\)\>" end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo fold - - " optional *do* - syn match rubyControl "\%(\<\%(for\|until\|while\)\s.*\s\)\@<=\%(do\|:\)\>" + syn region rubyOptDoLine matchgroup=rubyControl start="\<\%(for\|until\|while\)\>" end="\%(\\|:\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo + syn region rubyOptDoBlock start="\<\%(for\|until\|while\)\>" matchgroup=rubyControl end="\" contains=ALLBUT,@rubyExtendedStringSpecial,rubyTodo nextgroup=rubyOptDoLine fold if !exists("ruby_minlines") let ruby_minlines = 50 From dougkearns at gmail.com Thu Aug 18 05:55:01 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Aug 18 05:57:12 2005 Subject: PATCH: highlighting of heredocs used as method args Message-ID: <20050818095501.GA4365@localhost.localdomain> This should highlight heredocs used as method args properly. Such as: puts < References: <20050811131715.GA4252@localhost.localdomain> Message-ID: <20050824234803.GC5327@puritan.pnetwork> Doug Kearns wrote: > Nikolai, you're the only one I've come across who actually uses this > so let me know if there are any problems. Please excuse my tardiness. Actually, I have my own funky handling of identifiers. I don't think that what you've done should cause any problems, though. This is what I have: syn match rubyScopeSpecifier display containedin=rubyClassVariable,rubyInstanceVariable,rubyGlobalVariable "\%(@\+\|\$\)" syn match rubyClassVariable "@@\h\w*" display syn match rubyInstanceVariable "@\h\w*" display syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" display I like having global variables highlighted (so as to not use thum). And I like having the scope-specifier highlighted in @blah and @@bluh. Having them highlighted makes them stand out, without hurting my eyes, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);} From mailing-lists.vim-ruby-development at rawuncut.elitemail.org Sun Aug 28 07:53:52 2005 From: mailing-lists.vim-ruby-development at rawuncut.elitemail.org (Nikolai Weibull) Date: Sun Aug 28 07:47:13 2005 Subject: [PATCH] Suggestion for updated ftplugin/ruby.vim Message-ID: <20050828115352.GA5299@puritan.pnetwork> These are other additions to ftplugin/ruby.vim found in Ned Konz script. I think that they make sense in almost any setting, so they should go in the distribution. Comments before I commit?, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);} From dougkearns at gmail.com Sun Aug 28 09:21:01 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sun Aug 28 11:45:17 2005 Subject: [PATCH] Suggestion for updated ftplugin/ruby.vim In-Reply-To: <20050828115352.GA5299@puritan.pnetwork> References: <20050828115352.GA5299@puritan.pnetwork> Message-ID: <20050828132101.GA19520@localhost.localdomain> On Sun, Aug 28, 2005 at 01:53:52PM +0200, Nikolai Weibull wrote: > These are other additions to ftplugin/ruby.vim found in Ned Konz script. > I think that they make sense in almost any setting, so they should go in > the distribution. Comments before I commit?, Because I'm lazy can you point me to Ned's script? You might want to search the archives since this came up when Gavin was first organising the project. I don't remember the details but he was certainly conservative. That said, given your 100 odd ftplugins you are the master... ;-) Regards, Doug From mailing-lists.vim-ruby-development at rawuncut.elitemail.org Sun Aug 28 12:39:43 2005 From: mailing-lists.vim-ruby-development at rawuncut.elitemail.org (Nikolai Weibull) Date: Sun Aug 28 12:33:02 2005 Subject: [PATCH] Suggestion for updated ftplugin/ruby.vim In-Reply-To: <20050828132101.GA19520@localhost.localdomain> References: <20050828115352.GA5299@puritan.pnetwork> <20050828132101.GA19520@localhost.localdomain> Message-ID: <20050828163943.GB5299@puritan.pnetwork> Doug Kearns wrote: > On Sun, Aug 28, 2005 at 01:53:52PM +0200, Nikolai Weibull wrote: > > These are other additions to ftplugin/ruby.vim found in Ned Konz script. > > I think that they make sense in almost any setting, so they should go in > > the distribution. Comments before I commit?, > Because I'm lazy can you point me to Ned's script? http://bike-nomad.com/vim/ruby.vim I am, however, doubtful about setting iskeyword to include ':'. The reason for doing so is that we have stuff like ConstantA::ConstantB kind of stuff and that we want to be able to treat that as one thing on occasion. I think, however, that this causes too many issues with other stuff to be reasonable. > You might want to search the archives since this came up when Gavin was > first organising the project. I don't remember the details but he was > certainly conservative. It seems it hasn't changed since http://rubyforge.org/pipermail/vim-ruby-devel/2003q3/000073.html. > That said, given your 100 odd ftplugins you are the master... ;-) I'm taking Vim one step closer to becoming Emacs per file :-D. Here's another thing I've been playing with, but I have the feeling that electricity isn't something that most Vim-users appreciate...What do you think? (Btw, that regex isn't quite right...I'll have to fix that.) inoremap :call CompleteStatement() function! s:CompleteStatement() " TODO: we can check contents of ". register to make sure that they were " inserted while typing here... if getline('.') =~ '^\s*\%(begin\|case\|class\|def\|for\|if\|module\|unless\|until\|while\)\>\|do\%(\s*|[^|]*|\s*\)\=$' let n = indent('.') let ind = '' let i = 0 while i < n let ind .= ' ' let i += 1 endwhile call append(line('.'), ind . 'end') endif endfunction It automatically inserts a matching 'end' when necessary. Totally off-topic: By the way, do you know why pasting text selected in conkeror is so slow?, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);} -------------- next part -------------- " Vim filetype plugin " Language: Ruby " Maintainer: Gavin Sinclair " Info: $Id: ruby.vim,v 1.7 2004/01/10 23:06:11 gsinclair Exp $ " URL: http://vim-ruby.sourceforge.net " Anon CVS: See above site " Licence: GPL (http://www.gnu.org) " Disclaimer: " This program is distributed in the hope that it will be useful, " but WITHOUT ANY WARRANTY; without even the implied warranty of " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " GNU General Public License for more details. " ---------------------------------------------------------------------------- " " 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 let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim " Matchit support if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 let b:match_words = \ '\%(\%(\%(^\|[;=]\)\s*\)\@<=\%(class\|module\|while\|begin\|until' . \ '\|for\|if\|unless\|def\|case\)\|\:' . \ '\<\%(else\|elsif\|ensure\|rescue\|when\)\>:' . \ '\%(^\|[^.]\)\@<=\' let b:match_skip = \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . \ "\'" endif setlocal formatoptions-=t formatoptions+=croql setlocal include=^\\s*\\<\\(load\\\|\w*require\\)\\> setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.rb','') setlocal suffixesadd=.rb setlocal define=^\\s*def setlocal comments=:# setlocal commentstring=#\ %s if !exists("s:rubypath") if executable("ruby") if &shellxquote == "'" let s:rubypath = system('ruby -e "print $:.join(%q{,})"' ) else let s:rubypath = system("ruby -e 'print $:.join(%q{,})'" ) endif let s:rubypath = substitute(s:rubypath,',.$',',,','') 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:rubypath = ".,," endif endif let &l:path = s:rubypath let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< " \ "| unlet! b:match_ignorecase b:match_words b:match_skip" let &cpo = s:cpo_save unlet s:cpo_save " " Instructions for enabling "matchit" support: " " 1. Look for the latest "matchit" plugin at " " http://www.vim.org/scripts/script.php?script_id=39 " " It is also packaged with Vim, in the $VIMRUNTIME/macros directory. " " 2. Copy "matchit.txt" into a "doc" directory (e.g. $HOME/.vim/doc). " " 3. Copy "matchit.vim" into a "plugin" directory (e.g. $HOME/.vim/plugin). " " 4. Ensure this file (ftplugin/ruby.vim) is installed. " " 5. Ensure you have this line in your $HOME/.vimrc: " filetype plugin on " " 6. Restart Vim and create the matchit documentation: " " :helptags ~/.vim/doc " " Now you can do ":help matchit", and you should be able to use "%" on Ruby " keywords. Try ":echo b:match_words" to be sure. " " Thanks to Mark J. Reed for the instructions. See ":help vimrc" for the " locations of plugin directories, etc., as there are several options, and it " differs on Windows. Email gsinclair@soyabean.com.au if you need help. " " vim: sw=2 sts=2 ts=8 ff=unix: From dougkearns at gmail.com Mon Aug 29 02:01:05 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Mon Aug 29 02:02:03 2005 Subject: [PATCH] Suggestion for updated ftplugin/ruby.vim In-Reply-To: <20050828163943.GB5299@puritan.pnetwork> References: <20050828115352.GA5299@puritan.pnetwork> <20050828132101.GA19520@localhost.localdomain> <20050828163943.GB5299@puritan.pnetwork> Message-ID: <20050829060105.GA3648@localhost.localdomain> On Sun, Aug 28, 2005 at 06:39:43PM +0200, Nikolai Weibull wrote: > Doug Kearns wrote: > > Because I'm lazy can you point me to Ned's script? > > http://bike-nomad.com/vim/ruby.vim Sorry I didn't notice it was included in the header of our ftplugin - see laziness above. ;-) > I am, however, doubtful about setting iskeyword to include ':'. The > reason for doing so is that we have stuff like ConstantA::ConstantB kind > of stuff and that we want to be able to treat that as one thing on > occasion. I think, however, that this causes too many issues with other > stuff to be reasonable. I agree. I don't actually think I'd want to match that rather than the individual constant names very often. Then you need to ask whether '@', and '$' etc should be included as well? I'm happy with the default for now. We should probably include the browsefilter setting and I'm not sure that your redefinition of 'define' to search for method definitions makes sense... That seems like a job for ctags. Other than that, it looks good to me. Thanks. > Here's another thing I've been playing with, but I have the feeling that > electricity isn't something that most Vim-users appreciate...What do you > think? (Btw, that regex isn't quite right...I'll have to fix that.) > > inoremap :call CompleteStatement() > > function! s:CompleteStatement() > " TODO: we can check contents of ". register to make sure that they were > " inserted while typing here... > if getline('.') =~ '^\s*\%(begin\|case\|class\|def\|for\|if\|module\|unless\|until\|while\)\>\|do\%(\s*|[^|]*|\s*\)\=$' > let n = indent('.') > let ind = '' > let i = 0 > while i < n > let ind .= ' ' > let i += 1 > endwhile > call append(line('.'), ind . 'end') > endif > endfunction > > It automatically inserts a matching 'end' when necessary. I like it. Pit Capitain has submitted a similar patch to the tracker and I've been thinking about a good way to include some of these 'extras'. Do you have any more? > Totally off-topic: > > By the way, do you know why pasting text selected in conkeror is so > slow?, No, sorry. I haven't experienced any slowness. How are you selecting it? Regards, Doug From dougkearns at gmail.com Mon Aug 29 02:04:46 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Mon Aug 29 02:06:44 2005 Subject: PATCH: link rubyIdentifier to NONE when ruby_no_identifiers is set In-Reply-To: <20050824234803.GC5327@puritan.pnetwork> References: <20050811131715.GA4252@localhost.localdomain> <20050824234803.GC5327@puritan.pnetwork> Message-ID: <20050829060446.GB3648@localhost.localdomain> On Thu, Aug 25, 2005 at 01:48:03AM +0200, Nikolai Weibull wrote: > Doug Kearns wrote: > > > Nikolai, you're the only one I've come across who actually uses this > > so let me know if there are any problems. > > Please excuse my tardiness. Actually, I have my own funky handling of > identifiers. I don't think that what you've done should cause any > problems, though. > > This is what I have: > > syn match rubyScopeSpecifier display containedin=rubyClassVariable,rubyInstanceVariable,rubyGlobalVariable "\%(@\+\|\$\)" > syn match rubyClassVariable "@@\h\w*" display > syn match rubyInstanceVariable "@\h\w*" display > syn match rubyGlobalVariable "$\%(\h\w*\|-.\)" display > > I like having global variables highlighted (so as to not use thum). And > I like having the scope-specifier highlighted in @blah and @@bluh. > Having them highlighted makes them stand out, without hurting my eyes, I wonder if this would be worth including as an option? Regards, Doug From mailing-lists.vim-ruby-development at rawuncut.elitemail.org Mon Aug 29 05:20:25 2005 From: mailing-lists.vim-ruby-development at rawuncut.elitemail.org (Nikolai Weibull) Date: Mon Aug 29 05:13:45 2005 Subject: [PATCH] Suggestion for updated ftplugin/ruby.vim In-Reply-To: <20050829060105.GA3648@localhost.localdomain> References: <20050828115352.GA5299@puritan.pnetwork> <20050828132101.GA19520@localhost.localdomain> <20050828163943.GB5299@puritan.pnetwork> <20050829060105.GA3648@localhost.localdomain> Message-ID: <20050829092025.GA9780@puritan.pnetwork> Doug Kearns wrote: > > http://bike-nomad.com/vim/ruby.vim > > Sorry I didn't notice it was included in the header of our ftplugin - > see laziness above. ;-) No problem :-). > > I am, however, doubtful about setting iskeyword to include ':'. The > > reason for doing so is that we have stuff like ConstantA::ConstantB > > kind of stuff and that we want to be able to treat that as one thing > > on occasion. I think, however, that this causes too many issues > > with other stuff to be reasonable. > I agree. I don't actually think I'd want to match that rather than the > individual constant names very often. Then you need to ask whether > '@', and '$' etc should be included as well? I'm happy with the > default for now. Mm. > We should probably include the browsefilter setting and I'm not sure > that your redefinition of 'define' to search for method definitions > makes sense... That seems like a job for ctags. Yeah, browsefilter would be nice I suppose. 'define' may not so much. > > Here's another thing I've been playing with, but I have the feeling > > that electricity isn't something that most Vim-users > > appreciate...What do you think? (Btw, that regex isn't quite > > right...I'll have to fix that.) > > inoremap :call CompleteStatement() > > > > function! s:CompleteStatement() > > " TODO: we can check contents of ". register to make sure that they were > > " inserted while typing here... > > if getline('.') =~ '^\s*\%(begin\|case\|class\|def\|for\|if\|module\|unless\|until\|while\)\>\|do\%(\s*|[^|]*|\s*\)\=$' > > let n = indent('.') > > let ind = '' > > let i = 0 > > while i < n > > let ind .= ' ' > > let i += 1 > > endwhile > > call append(line('.'), ind . 'end') > > endif > > endfunction > > It automatically inserts a matching 'end' when necessary. > I like it. Pit Capitain has submitted a similar patch to the tracker and > I've been thinking about a good way to include some of these 'extras'. > Do you have any more? No, that's about it. His version is in a sense better, as it works fine while pasting code. Mine will add extra ends when pasting. I guess one could hide it behind some variable, like b:ruby_electric_enter or something similar. > > By the way, do you know why pasting text selected in conkeror is so > > slow?, > No, sorry. I haven't experienced any slowness. How are you selecting it? Well, either with the mouse (yuck), or manually with keys (which is rather difficult). Then, when I try to paste in Vim, it takes like 3 seconds for Vim to grab the selection and actually insert it. Very weird. No such problem with plain Firefox, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);} From dougkearns at gmail.com Thu Sep 1 11:24:30 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Sep 1 11:27:40 2005 Subject: PATCH: eRuby highlighting improvements Message-ID: <20050901152430.GA13316@localhost.localdomain> This adds some general improvements to the eRuby highlighting. The highlighting of the more complex files seems to suffer from a rather nasty 'rainbow' effect. Should we consider something like using a different background colour for the eRuby blocks? Regards, Doug Index: syntax/eruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/eruby.vim,v retrieving revision 1.3 diff -u -b -r1.3 eruby.vim --- syntax/eruby.vim 1 Sep 2005 10:55:59 -0000 1.3 +++ syntax/eruby.vim 1 Sep 2005 15:16:24 -0000 @@ -1,7 +1,7 @@ " Vim syntax file " Language: eRuby " Maintainer: Doug Kearns -" Info: $Id: eruby.vim,v 1.3 2005/09/01 10:55:59 dkearns Exp $ +" Info: $Id$ " URL: http://vim-ruby.sourceforge.net " Anon CVS: See above site " Licence: GPL (http://www.gnu.org) @@ -10,7 +10,6 @@ " but WITHOUT ANY WARRANTY; without even the implied warranty of " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " GNU General Public License for more details. -" ---------------------------------------------------------------------------- " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -33,9 +32,10 @@ syn include @rubyTop syntax/ruby.vim endif -syn region erubyOneLiner matchgroup=erubyDelimiter start="^%" end="$" contains=@rubyTop,erubyDelimiter keepend oneline -syn region erubyBlock matchgroup=erubyDelimiter start="<%=\=" end="%>" contains=@rubyTop containedin=ALLBUT,erubyComment keepend -syn region erubyComment matchgroup=erubyDelimiter start="<%#" end="%>" keepend +syn region erubyOneLiner matchgroup=erubyDelimiter start="^%" end="$" contains=@rubyTop containedin=ALLBUT,erubyBlock,erubyComment,erubyExpression keepend oneline +syn region erubyBlock matchgroup=erubyDelimiter start="<%" end="%>" contains=@rubyTop containedin=ALLBUT,erubyBlock,erubyComment,erubyExpression +syn region erubyExpression matchgroup=erubyDelimiter start="<%=" end="%>" contains=@rubyTop containedin=ALLBUT,erubyComment,erubyExpression +syn region erubyComment matchgroup=erubyDelimiter start="<%#" end="%>" contains=rubyTodo,@Spell containedin=ALLBUT,erubyBlock,erubyComment,erubyExpression keepend " Define the default highlighting. " For version 5.7 and earlier: only when not done already Index: syntax/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/syntax/ruby.vim,v retrieving revision 1.68 diff -u -b -r1.68 ruby.vim --- syntax/ruby.vim 30 Aug 2005 10:54:04 -0000 1.68 +++ syntax/ruby.vim 1 Sep 2005 15:16:27 -0000 @@ -138,6 +138,10 @@ syn region rubyString start=+\%(\%(class\s*\|\%(\.\|::\)\)\_s*\)\@ Does anyone have any suggestions on how the %% escape should be highlighted in eRuby files? How should this: <%%= foobar %> be differentiated from: <%= foobar %> ? Thanks, Doug From dougkearns at gmail.com Thu Sep 1 12:33:04 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu Sep 1 12:34:42 2005 Subject: PATCH: new eruby compiler plugin Message-ID: <20050901163304.GC13316@localhost.localdomain> Here's a first cut at a compiler plugin for eruby. I suppose we should support erb as well, or perhaps instead? It's not particularly useful yet. ;-) Regards, Doug Index: bin/vim-ruby-install.rb =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/bin/vim-ruby-install.rb,v retrieving revision 1.9 diff -u -r1.9 vim-ruby-install.rb --- bin/vim-ruby-install.rb 27 Aug 2005 15:05:42 -0000 1.9 +++ bin/vim-ruby-install.rb 1 Sep 2005 16:30:12 -0000 @@ -18,6 +18,7 @@ require 'pathname' SOURCE_FILES = %w{ + compiler/eruby.vim compiler/ruby.vim compiler/rubyunit.vim ftdetect/ruby.vim Index: compiler/eruby.vim =================================================================== RCS file: compiler/eruby.vim diff -N compiler/eruby.vim --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ compiler/eruby.vim 1 Sep 2005 16:30:12 -0000 @@ -0,0 +1,35 @@ +" Vim compiler file +" Language: eRuby +" Maintainer: Doug Kearns +" Info: $Id$ +" URL: http://vim-ruby.sourceforge.net +" Anon CVS: See above site +" Licence: GPL (http://www.gnu.org) +" Disclaimer: +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" ---------------------------------------------------------------------------- + +if exists("current_compiler") + finish +endif +let current_compiler = "rubyunit" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +let s:cpo_save = &cpo +set cpo-=C + +CompilerSet makeprg=eruby + +CompilerSet errorformat=%E%f:%l:%m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap ts=8 ff=unix From dougkearns at gmail.com Fri Sep 2 02:08:54 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri Sep 2 02:09:39 2005 Subject: PATCH: new eruby compiler plugin In-Reply-To: <20050901163304.GC13316@localhost.localdomain> References: <20050901163304.GC13316@localhost.localdomain> Message-ID: <20050902060854.GD13316@localhost.localdomain> On Fri, Sep 02, 2005 at 02:33:04AM +1000, Doug Kearns wrote: > Here's a first cut at a compiler plugin for eruby. I suppose we should > support erb as well, or perhaps instead? erb, unfortunately, doesn't include the filename in it's output. I'll submit a patch. > It's not particularly useful yet. ;-) This should be an improvement... Regards, Doug Index: compiler/eruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/compiler/eruby.vim,v retrieving revision 1.1 diff -u -r1.1 eruby.vim --- compiler/eruby.vim 1 Sep 2005 16:35:57 -0000 1.1 +++ compiler/eruby.vim 2 Sep 2005 06:08:24 -0000 @@ -1,7 +1,7 @@ " Vim compiler file " Language: eRuby " Maintainer: Doug Kearns -" Info: $Id: eruby.vim,v 1.1 2005/09/01 16:35:57 dkearns Exp $ +" Info: $Id$ " URL: http://vim-ruby.sourceforge.net " Anon CVS: See above site " Licence: GPL (http://www.gnu.org) @@ -15,7 +15,7 @@ if exists("current_compiler") finish endif -let current_compiler = "rubyunit" +let current_compiler = "eruby" if exists(":CompilerSet") != 2 " older Vim always used :setlocal command -nargs=* CompilerSet setlocal @@ -26,7 +26,10 @@ CompilerSet makeprg=eruby -CompilerSet errorformat=%E%f:%l:%m, +CompilerSet errorformat=eruby:\ %f:%l:%m, + \%E%f:%l:\ %m, + \%-Z%p^, + \%C%m, \%-G%.%# let &cpo = s:cpo_save From hgs at dmu.ac.uk Fri Sep 2 04:39:22 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri Sep 2 04:33:26 2005 Subject: eRuby % escape highlighting In-Reply-To: <20050901160436.GB13316@localhost.localdomain> References: <20050901160436.GB13316@localhost.localdomain> Message-ID: On Fri, 2 Sep 2005, Doug Kearns wrote: > Does anyone have any suggestions on how the %% escape should be > highlighted in eRuby files? Thanks for working on this stuff, but I'm in the thick of something just now, and can't examine these details. But since the thing involves Rails and hence eruby I hope to get to this bit soon. In short, to let you know you are not being ignored! Thank you, Hugh From dougkearns at gmail.com Fri Sep 2 10:47:09 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri Sep 2 10:49:43 2005 Subject: [PATCH] Suggestion for updated ftplugin/ruby.vim In-Reply-To: <20050829092025.GA9780@puritan.pnetwork> References: <20050828115352.GA5299@puritan.pnetwork> <20050828132101.GA19520@localhost.localdomain> <20050828163943.GB5299@puritan.pnetwork> <20050829060105.GA3648@localhost.localdomain> <20050829092025.GA9780@puritan.pnetwork> Message-ID: <20050902144709.GE13316@localhost.localdomain> On Mon, Aug 29, 2005 at 11:20:25AM +0200, Nikolai Weibull wrote: > Doug Kearns wrote: > > We should probably include the browsefilter setting and I'm not sure > > that your redefinition of 'define' to search for method definitions > > makes sense... That seems like a job for ctags. > > Yeah, browsefilter would be nice I suppose. 'define' may not so much. I've committed this with the 'define' line commented out, for now, and I've added the browsefilter variable. Thanks, Doug From dougkearns at gmail.com Fri Sep 2 10:48:39 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri Sep 2 10:50:48 2005 Subject: PATCH: new eRuby ftplugin Message-ID: <20050902144839.GF13316@localhost.localdomain> Just a first cut...send your improvements. Regards, Doug Index: ftplugin/eruby.vim =================================================================== RCS file: ftplugin/eruby.vim diff -N ftplugin/eruby.vim --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ftplugin/eruby.vim 2 Sep 2005 14:36:23 -0000 @@ -0,0 +1,79 @@ +" Vim filetype plugin +" Language: eRuby +" Maintainer: Doug Kearns +" Info: $Id$ +" URL: http://vim-ruby.sourceforge.net +" Anon CVS: See above site +" Licence: GPL (http://www.gnu.org) +" Disclaimer: +" This program is distributed in the hope that it will be useful, +" but WITHOUT ANY WARRANTY; without even the implied warranty of +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +" GNU General Public License for more details. +" ---------------------------------------------------------------------------- + +" Only do this when not done yet for this buffer +if (exists("b:did_ftplugin")) + finish +endif + +let s:save_cpo = &cpo +set cpo-=C + +" Define some defaults in case the included ftplugins don't set them. +let s:undo_ftplugin = "" +let s:browsefilter = "Ruby Files (*.rb)\t*.rb\n" . + \ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" . + \ "All Files (*.*)\t*.*\n" +let s:match_words = "" + +runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +unlet b:did_ftplugin + +" Override our defaults if these were set by an included ftplugin. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin + unlet b:undo_ftplugin +endif +if exists("b:browsefilter") + let s:browsefilter = b:browsefilter + unlet b:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words + unlet b:match_words +endif + +runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim +let b:did_ftplugin = 1 + +" Combine the new set of values with those previously included. +if exists("b:undo_ftplugin") + let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin +endif +if exists ("b:browsefilter") + let s:browsefilter = b:browsefilter . s:browsefilter +endif +if exists("b:match_words") + let s:match_words = b:match_words . ',' . s:match_words +endif + +" Change the browse dialog on Win32 to show mainly eRuby-related files +if has("gui_win32") + let b:browsefilter="eRuby Files (*.rhtml)\t*.rhtml\n" . s:browsefilter +endif + +" Load the combined list of match_words for matchit.vim +if exists("loaded_matchit") + let b:match_words = s:match_words +endif + +" TODO: comments= +setlocal commentstring=<%#%s%> + +let b:undo_ftplugin = "setl cms< " + \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin + +let &cpo = s:save_cpo + +" vim: sw=2 sts=2 ts=8 ff=unix: From dougkearns at gmail.com Wed Sep 7 11:06:31 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Wed Sep 7 11:09:03 2005 Subject: PATCH: improve b:match_words pattern Message-ID: <20050907150631.GA9809@localhost.localdomain> This improves the b:match_words pattern. Among other things, it now handles the if/unless/while/until/rescue modifiers. It could be refined but the patterns largely match those in the syntax file which is useful for updating purposes and does no harm. Regards, Doug Index: ftplugin/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/ftplugin/ruby.vim,v retrieving revision 1.8 diff -u -r1.8 ruby.vim --- ftplugin/ruby.vim 2 Sep 2005 14:45:32 -0000 1.8 +++ ftplugin/ruby.vim 7 Sep 2005 14:50:53 -0000 @@ -28,11 +28,24 @@ " Matchit support if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 + " TODO: improve optional do loops let b:match_words = - \ '\%(\%(\%(^\|[;=]\)\s*\)\@<=\%(class\|module\|while\|begin\|until' . - \ '\|for\|if\|unless\|def\|case\)\|\:' . - \ '\<\%(else\|elsif\|ensure\|rescue\|when\)\>:' . - \ '\%(^\|[^.]\)\@<=\' + \ '\%(' . + \ '\%(\%(\%(\.\@' . + \ '\|' . + \ '\%(\%(^\|\.\.\.\=\|[;=([<>~\*/%!&^|+-]\)\s*\)\@<=\%(if\|unless\)\>' . + \ '\|' . + \ '\%(\%(^\|;\)\s*\)\@<=\%(until\|while\)\>' . + \ '\)' . + \ ':' . + \ '\%(' . + \ '\%(\%(\%(\.\@' . + \ '\|' . + \ '\%(\%(^\|;\)\s*\)\@<=\' . + \ '\)' . + \ ':' . + \ '\%(\%(\%(\.\@' . + \ ',=begin:=end' let b:match_skip = \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . \ "\ Need to escape the \'s... Regards, Doug Index: ftplugin/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/ftplugin/ruby.vim,v retrieving revision 1.8 diff -u -r1.8 ruby.vim --- ftplugin/ruby.vim 2 Sep 2005 14:45:32 -0000 1.8 +++ ftplugin/ruby.vim 8 Sep 2005 05:52:37 -0000 @@ -35,8 +35,8 @@ \ '\%(^\|[^.]\)\@<=\' let b:match_skip = \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . - \ "\'" + \ "\\'" endif From dougkearns at gmail.com Sat Sep 10 03:13:08 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sat Sep 10 03:13:40 2005 Subject: PATCH: improve b:match_words pattern In-Reply-To: <20050907150631.GA9809@localhost.localdomain> References: <20050907150631.GA9809@localhost.localdomain> Message-ID: <20050910071308.GA23127@localhost.localdomain> On Thu, Sep 08, 2005 at 01:06:31AM +1000, Doug Kearns wrote: > This improves the b:match_words pattern. Among other things, it now > handles the if/unless/while/until/rescue modifiers. > > It could be refined but the patterns largely match those in the syntax > file which is useful for updating purposes and does no harm. Except searchpairs() doesn't work the way I thought it did so multiline patterns are difficult to implement and probably not worth the effort right now. This means something like: if true x. end end won't work. Strangely enough I can only find one example of this at the moment but in the past I've come across a significant number and received a bug report against the syntax file. The pattern below does not attempt to handle loops with the optional do properly yet. So you can currently only jump between the 'do and 'end' in this example. If anyone has more experience with matchit and has a solution please let me know. Loops without the 'do' should work as expected. for ... do ... end Most of the problems in these config files seem to stem from this optional do... Regards, Doug Index: ftplugin/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/ftplugin/ruby.vim,v retrieving revision 1.9 diff -u -r1.9 ruby.vim --- ftplugin/ruby.vim 8 Sep 2005 08:22:40 -0000 1.9 +++ ftplugin/ruby.vim 9 Sep 2005 12:09:22 -0000 @@ -28,11 +28,23 @@ " Matchit support if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 - let b:match_words = - \ '\%(\%(\%(^\|[;=]\)\s*\)\@<=\%(class\|module\|while\|begin\|until' . - \ '\|for\|if\|unless\|def\|case\)\|\:' . - \ '\<\%(else\|elsif\|ensure\|rescue\|when\)\>:' . - \ '\%(^\|[^.]\)\@<=\' + + " TODO: improve optional do loops + let b:match_words = + \ '\%(' . + \ '\%(\%(\.\|\:\:\)\s*\)\@' . + \ '\|' . + \ '\%(\%(^\|\.\.\.\=\|[\,;=([<>~\*/%!&^|+-]\)\s*\)\@<=\%(if\|unless\|until\|while\)\>' . + \ '\)' . + \ ':' . + \ '\%(' . + \ '\%(\%(\.\|\:\:\)\s*\)\@' . + \ '\|' . + \ '\%(\%(^\|;\)\s*\)\@<=\' . + \ '\)' . + \ ':' . + \ '\%(\%(\.\|\:\:\)\s*\)\@' + let b:match_skip = \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . \ "\\ This includes the gems load path in 'path' so that :find and friends will search there first. Is my limited understanding of gems correct? Regards, Doug Index: ftplugin/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/ftplugin/ruby.vim,v retrieving revision 1.10 diff -u -r1.10 ruby.vim --- ftplugin/ruby.vim 10 Sep 2005 07:46:45 -0000 1.10 +++ ftplugin/ruby.vim 11 Sep 2005 09:05:33 -0000 @@ -67,9 +67,9 @@ if !exists("s:rubypath") if executable("ruby") if &shellxquote == "'" - let s:rubypath = system('ruby -e "print $:.join(%q{,})"' ) + let s:rubypath = system('ruby -e "print (begin; require %q{rubygems}; Gem.all_load_paths; rescue LoadError; []; end + $:).join(%q{,})"') else - let s:rubypath = system("ruby -e 'print $:.join(%q{,})'" ) + let s:rubypath = system("ruby -e 'print (begin; require %q{rubygems}; Gem.all_load_paths; rescue LoadError; []; end + $:).join(%q{,})'") endif let s:rubypath = substitute(s:rubypath,',.$',',,','') else From mailing-lists.vim-ruby-development at rawuncut.elitemail.org Sun Sep 11 07:16:51 2005 From: mailing-lists.vim-ruby-development at rawuncut.elitemail.org (Nikolai Weibull) Date: Sun Sep 11 07:09:47 2005 Subject: PATCH: include gems load path in 'path' In-Reply-To: <20050911093938.GA3911@localhost.localdomain> References: <20050911093938.GA3911@localhost.localdomain> Message-ID: <20050911111651.GB8823@puritan.pnetwork> Doug Kearns wrote: > Is my limited understanding of gems correct? My Gems knowledge is even more limited, but that seems to be working, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);} From dougkearns at gmail.com Sun Sep 11 07:57:13 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sun Sep 11 07:57:55 2005 Subject: [BUG] Broken indentation In-Reply-To: <20050410113430.GA12225@code-monkey.de> References: <20050410113430.GA12225@code-monkey.de> Message-ID: <20050911115713.GB3911@localhost.localdomain> On Sun, Apr 10, 2005 at 01:34:30PM +0200, Tilman Sauerbeck wrote: > Hi, > here's a snippet of code that isn't indented correctly by Vim: > > foo do > bar rescue nil > end > > The final "end" should be placed in column 0, but it's not. This has now been fixed. Regards, Doug From dougkearns at gmail.com Sun Sep 11 12:07:05 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sun Sep 11 12:09:54 2005 Subject: ANN: New devel release Message-ID: <20050911160705.GC3911@localhost.localdomain> Between the cricket and the F1 I've managed to find time to make a new devel release. http://rubyforge.org/frs/?group_id=16 Feel free to download it, break it, and report any problems here. Regards, Doug From tilman at code-monkey.de Sun Sep 11 12:28:29 2005 From: tilman at code-monkey.de (Tilman Sauerbeck) Date: Sun Sep 11 12:21:24 2005 Subject: [BUG] Broken indentation In-Reply-To: <20050911115713.GB3911@localhost.localdomain> References: <20050410113430.GA12225@code-monkey.de> <20050911115713.GB3911@localhost.localdomain> Message-ID: <20050911182829.2e8dc0b9.tilman@code-monkey.de> On Sun, 11 Sep 2005 21:57:13 +1000 Doug Kearns wrote: > On Sun, Apr 10, 2005 at 01:34:30PM +0200, Tilman Sauerbeck wrote: > > Hi, > > here's a snippet of code that isn't indented correctly by Vim: > > > > foo do > > bar rescue nil > > end > > > > The final "end" should be placed in column 0, but it's not. > > This has now been fixed. Cool, thanks! :) Regards, Tilman -- learn to quote: http://www.netmeister.org/news/learn2quote.html From dougkearns at gmail.com Tue Sep 13 08:20:02 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Tue Sep 13 08:20:40 2005 Subject: Vim 7 - Occult Completion Message-ID: <20050913122002.GA12536@localhost.localdomain> Bram has made a start on occult completion (similar to intellisense) for vim 7. He's asked for assistance with supporting other languages so I thought it might be time for us to start helping Sam Roberts out with his ctags improvements? See: http://groups.yahoo.com/group/vimdev/message/40564 Regards, Doug From sroberts at uniserve.com Wed Sep 14 09:00:29 2005 From: sroberts at uniserve.com (Sam Roberts) Date: Wed Sep 14 08:53:47 2005 Subject: Vim 7 - Occult Completion In-Reply-To: <20050913122002.GA12536@localhost.localdomain> References: <20050913122002.GA12536@localhost.localdomain> Message-ID: <20050914130029.GB436@ensemble.local> Quoting dougkearns@gmail.com, on Tue, Sep 13, 2005 at 10:20:02PM +1000: > Bram has made a start on occult completion (similar to intellisense) for > vim 7. He's asked for assistance with supporting other languages so I > thought it might be time for us to start helping Sam Roberts out with > his ctags improvements? > > See: http://groups.yahoo.com/group/vimdev/message/40564 Fwiw, my hack to rdoc to generate tags "sort of" works, but the prototype made me think its not the right way to go. I can't recall the name anymore, but stdlib has library now that has a SAX-like API that tells you about the code as it is being parsed - I think this is the way to go. It is actually quite easy to generate tags, the requirements are that you have access to the full source of the line so that you can construct a regex. But I don't have the time to work on this (or anything) right now. Cheers, Sam From dougkearns at gmail.com Thu Sep 15 02:09:45 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu, 15 Sep 2005 16:09:45 +1000 Subject: ANN: New stable release Message-ID: <20050915060945.GA3018@localhost.localdomain> I've just sent up vim-ruby-2005.09.15. Regards, Doug From dougkearns at gmail.com Thu Sep 15 04:48:28 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu, 15 Sep 2005 18:48:28 +1000 Subject: ANN: New stable release In-Reply-To: <20050915060945.GA3018@localhost.localdomain> References: <20050915060945.GA3018@localhost.localdomain> Message-ID: <20050915084828.GB3018@localhost.localdomain> On Thu, Sep 15, 2005 at 04:09:45PM +1000, Doug Kearns wrote: > I've just sent up vim-ruby-2005.09.15. Sent to Bram too... Regards, Doug From hgs at dmu.ac.uk Thu Sep 15 18:15:56 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Thu, 15 Sep 2005 23:15:56 +0100 (WEST) Subject: ANN: New stable release In-Reply-To: <20050915060945.GA3018@localhost.localdomain> References: <20050915060945.GA3018@localhost.localdomain> Message-ID: On Thu, 15 Sep 2005, Doug Kearns wrote: > I've just sent up vim-ruby-2005.09.15. I've given this a spin on an XP machine. I tried using an eruby file and observed from ftdetect/ruby.vim that *.erb is not included with *.rhtml. So I added that to where it had been installed (in my vimfiles directory). I then re-edited my thing.erb file, and it still came up as being xml. So I edited C:/Program Files/vim/vim63/filetype.vim and added an entry mapping "*.erb,*.rhtml\t\tsetf eruby" and this worked. The other thing that didn't work as expected was that the installer didn't know that C:/Program Files/vim/vim63/ was a goot place to look.. Maybe I'm keeping it in a silly place, but vim seems happy enough. * * * Now, earlier today I installed the gem on a sun system. It told me to run the installer afterwards, but didn't remind me where it was hidden. Is that relatively easy to fix? When I get a moment I'll poke around with gem environment.... HTH Hugh From dougkearns at gmail.com Fri Sep 16 05:30:54 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri, 16 Sep 2005 19:30:54 +1000 Subject: ANN: New stable release In-Reply-To: References: <20050915060945.GA3018@localhost.localdomain> Message-ID: <20050916093054.GC3018@localhost.localdomain> G'day Hugh, On Thu, Sep 15, 2005 at 11:15:56PM +0100, Hugh Sasse wrote: > On Thu, 15 Sep 2005, Doug Kearns wrote: > > > I've just sent up vim-ruby-2005.09.15. > > I've given this a spin on an XP machine. Thanks. > I tried using an eruby > file and observed from ftdetect/ruby.vim that *.erb is not included > with *.rhtml. Are *.erb files the same as *.rhtml files or are they simply Ruby embedded in _any_ other filetype? > So I added that to where it had been installed (in my > vimfiles directory). I then re-edited my thing.erb file, and it > still came up as being xml. Is it actually an XML file other than XHTML? Currently only X(HTML) is supported. > So I edited C:/Program Files/vim/vim63/filetype.vim and added an > entry mapping "*.erb,*.rhtml\t\tsetf eruby" and this worked. OK, seeing as you seem to think it's now working I'll assume it was an XHTML file which was incorrectly being picked up as filetype=XML. I'm just guessing but it sounds as though scripts.vim is setting the filetype and ftdetect/ruby.vim isn't getting a chance. Could you send me the file privately? > The other thing that didn't work as expected was that the installer > didn't know that C:/Program Files/vim/vim63/ was a goot place to > look.. Maybe I'm keeping it in a silly place, but vim seems happy > enough. That's intentional as I don't think that is "a good place to look". ;-) I don't do sysadmin work though so maybe I'm missing something. Why would you want to install the files into $VIMRUNTIME? Are you running multiple versions of Vim and trying to restrict the use of the vim-ruby files to a single version, perhaps? If you keep it in $VIMRUNTIME the next time you update Vim you'll overwrite the vim-ruby files. While the Vim release might have the latest files it's certainly not going to have newer versions than this project. ;-) > * * * > > Now, earlier today I installed the gem on a sun system. It told me > to run the installer afterwards, but didn't remind me where it was > hidden. Is that relatively easy to fix? When I get a moment I'll > poke around with gem environment.... I'm assuming that people running rubygems will have $GEM_HOME/bin in their PATH. Have you just blown that assumption out of the water? ;-) When you say "remind me" are you referring to the INSTALL instructions? Thanks, Doug PS. We haven't had the usual flood of post-release discussion so I'm hoping all is, generally, running smoothly... From hgs at dmu.ac.uk Fri Sep 16 06:59:32 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 16 Sep 2005 11:59:32 +0100 (WEST) Subject: ANN: New stable release In-Reply-To: <20050916093054.GC3018@localhost.localdomain> References: <20050915060945.GA3018@localhost.localdomain> <20050916093054.GC3018@localhost.localdomain> Message-ID: On Fri, 16 Sep 2005, Doug Kearns wrote: > G'day Hugh, > > On Thu, Sep 15, 2005 at 11:15:56PM +0100, Hugh Sasse wrote: >> On Thu, 15 Sep 2005, Doug Kearns wrote: >> >>> I've just sent up vim-ruby-2005.09.15. >> >> I've given this a spin on an XP machine. > > Thanks. > >> I tried using an eruby >> file and observed from ftdetect/ruby.vim that *.erb is not included >> with *.rhtml. > > Are *.erb files the same as *.rhtml files or are they simply Ruby > embedded in _any_ other filetype? I don't think there's an official definition for these extensions, but I use .erb for _any_ other filetype, when .rhtml is not appropriate. I don't know what others do. (Ruby is very Unixy (for want of a word!) and people don't discuss extension names that much :-)) > >> So I added that to where it had been installed (in my >> vimfiles directory). I then re-edited my thing.erb file, and it >> still came up as being xml. > > Is it actually an XML file other than XHTML? Currently only X(HTML) is > supported. Yes, I've be exploring Festival speech and this is a sable file. If that means nothing, then its just XML, which I've ERB'd to factor out repetition. > >> So I edited C:/Program Files/vim/vim63/filetype.vim and added an >> entry mapping "*.erb,*.rhtml\t\tsetf eruby" and this worked. > > OK, seeing as you seem to think it's now working I'll assume it was an > XHTML file which was incorrectly being picked up as filetype=XML. I'm > just guessing but it sounds as though scripts.vim is setting the > filetype and ftdetect/ruby.vim isn't getting a chance. Could you send me > the file privately? I'll see if I can find a more concise example. There's lots of junk in it, but it was the first that I was playing with. Will you still need this if the ".erb implies html" assumption is false? > >> The other thing that didn't work as expected was that the installer >> didn't know that C:/Program Files/vim/vim63/ was a goot place to >> look.. Maybe I'm keeping it in a silly place, but vim seems happy >> enough. > > That's intentional as I don't think that is "a good place to look". ;-) > I don't do sysadmin work though so maybe I'm missing something. Why > would you want to install the files into $VIMRUNTIME? Are you running I only have one a/c on the machine just now, but I'd like others to get the benefit. Similary on Unix. I usually put the vim stuff to be system wide so everyone benefits, and if I have to help them I can spin up vim and have it work sensibly. [cf the PragProg advice about use one edior and learn it well: you don't want it to change too much just because you're logged in as someone else (who never uses that editor, anyway).] > multiple versions of Vim and trying to restrict the use of the vim-ruby I was running 62 and 63 at the same time for a while, but I thought it would install in the latest. > files to a single version, perhaps? If you keep it in $VIMRUNTIME the > next time you update Vim you'll overwrite the vim-ruby files. While the Which is fair enough. I know we've had problems with keeping in sync with the vim distro before, so I usually install again after updating vim. Not that I've updated vim that often, only been using it since about 5.7. > Vim release might have the latest files it's certainly not going to have > newer versions than this project. ;-) > >> * * * >> >> Now, earlier today I installed the gem on a sun system. It told me >> to run the installer afterwards, but didn't remind me where it was >> hidden. Is that relatively easy to fix? When I get a moment I'll >> poke around with gem environment.... > > I'm assuming that people running rubygems will have $GEM_HOME/bin in > their PATH. Have you just blown that assumption out of the water? ;-) Ah. Maybe I've not configured my settings correctly: GEM_HOME: Undefined variable. whereis gem => gem: /usr/local/bin/gem gem environment Rubygems Environment: - VERSION: 0.8.11 (0.8.11) - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8 - GEM PATH: - /usr/local/lib/ruby/gems/1.8 - REMOTE SOURCES: - http://gems.rubyforge.org > > When you say "remind me" are you referring to the INSTALL instructions? gem query -l -n vim => *** LOCAL GEMS *** vim-ruby (2005.09.15, 2005.07.27) Ruby configuration files for Vim. Run 'vim-ruby-install.rb' to complete installation. So it has detected the need for this? > > Thanks, > Doug > > PS. We haven't had the usual flood of post-release discussion so I'm > hoping all is, generally, running smoothly... Or those in .ac.?? and .edu are going nuts in preparation for the start of the academic year and have not had chance to tackle this. Thank you, Hugh From dougkearns at gmail.com Fri Sep 16 08:43:26 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri, 16 Sep 2005 22:43:26 +1000 Subject: ANN: New stable release In-Reply-To: References: <20050915060945.GA3018@localhost.localdomain> <20050916093054.GC3018@localhost.localdomain> Message-ID: <20050916124326.GA3411@localhost.localdomain> On Fri, Sep 16, 2005 at 11:59:32AM +0100, Hugh Sasse wrote: > On Fri, 16 Sep 2005, Doug Kearns wrote: > I don't think there's an official definition for these extensions, > but I use .erb for _any_ other filetype, when .rhtml is not > appropriate. I don't know what others do. (Ruby is very Unixy (for > want of a word!) and people don't discuss extension names that much > :-)) Right, well this is going to be 'interesting' to implement. I guess we'd need to run scripts.vim to determine the main filetype... > I'll see if I can find a more concise example. There's lots of junk > in it, but it was the first that I was playing with. Will you still > need this if the ".erb implies html" assumption is false? No, thanks. A simple XML file with .erb extension is exhibiting this behaviour. I may just be misunderstanding the way filetype detection works. > I only have one a/c on the machine just now, but I'd like others to > get the benefit. Similary on Unix. I usually put the vim stuff to > be system wide so everyone benefits, and if I have to help them I > can spin up vim and have it work sensibly. [cf the PragProg advice > about use one edior and learn it well: you don't want it to change > too much just because you're logged in as someone else (who never > uses that editor, anyway).] Right. Obviously the installer allows you to install it anywhere you like but, I would think, the scenario you describe is best served by an install in $VIM/vimfiles. > > multiple versions of Vim and trying to restrict the use of the vim-ruby > > I was running 62 and 63 at the same time for a while, but I thought > it would install in the latest. If you install in $VIM/vimfiles then these files will be available, system-wide, to all versions. However, the ftdetect mechanism was introduced in 6.3 so earlier versions will require a filetype.vim to be constructed as per :help new-filetype. So even if you didn't manually add a new filetype.vim, 6.2 would still have access to all the updated vim-ruby files. The only difference would be that eRuby files weren't autodetected. I can't really see a down side to this setup. Perhaps this is where we should start rambling about POLS? ;-) > > files to a single version, perhaps? If you keep it in $VIMRUNTIME the > > next time you update Vim you'll overwrite the vim-ruby files. While the > > Which is fair enough. I know we've had problems with keeping in > sync with the vim distro before, so I usually install again after > updating vim. Not that I've updated vim that often, only been using > it since about 5.7. You are but a young pup. ;-) > > Vim release might have the latest files it's certainly not going to have > > newer versions than this project. ;-) > > > >> * * * > >> > >> Now, earlier today I installed the gem on a sun system. It told me > >> to run the installer afterwards, but didn't remind me where it was > >> hidden. Is that relatively easy to fix? When I get a moment I'll > >> poke around with gem environment.... > > > > I'm assuming that people running rubygems will have $GEM_HOME/bin in > > their PATH. Have you just blown that assumption out of the water? ;-) > > Ah. Maybe I've not configured my settings correctly: > GEM_HOME: Undefined variable. Nope - sky high! ;-) It seems that GEM_HOME is only required for a 'user' install. Though the core assumption is still correct. > > When you say "remind me" are you referring to the INSTALL instructions? > gem query -l -n vim => > > *** LOCAL GEMS *** > > vim-ruby (2005.09.15, 2005.07.27) > Ruby configuration files for Vim. Run 'vim-ruby-install.rb' to > complete installation. > > So it has detected the need for this? This is all Gavin's work and I assume that he knew what he was doing as he's a rubygems developer. ;-) I just performed a default system-wide install of rubygems and it appears to install the executable scripts in /usr/bin - the same place 'gem' is located. So there shouldn't be any need to specify a location for the installer script. If it's not in your PATH maybe your installation is, in some way, 'corrupted'? > > PS. We haven't had the usual flood of post-release discussion so I'm > > hoping all is, generally, running smoothly... > > Or those in .ac.?? and .edu are going nuts in preparation for the > start of the academic year and have not had chance to tackle this. I'll await their return to these matters then. ;-) Thanks, Doug From hgs at dmu.ac.uk Fri Sep 16 11:01:50 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 16 Sep 2005 16:01:50 +0100 (WEST) Subject: ANN: New stable release In-Reply-To: <20050916124326.GA3411@localhost.localdomain> References: <20050915060945.GA3018@localhost.localdomain> <20050916093054.GC3018@localhost.localdomain> <20050916124326.GA3411@localhost.localdomain> Message-ID: On Fri, 16 Sep 2005, Doug Kearns wrote: > On Fri, Sep 16, 2005 at 11:59:32AM +0100, Hugh Sasse wrote: >> On Fri, 16 Sep 2005, Doug Kearns wrote: > > > >> I don't think there's an official definition for these extensions, >> but I use .erb for _any_ other filetype, when .rhtml is not >> appropriate. I don't know what others do. (Ruby is very Unixy (for >> want of a word!) and people don't discuss extension names that much >> :-)) > > Right, well this is going to be 'interesting' to implement. I guess we'd > need to run scripts.vim to determine the main filetype... > > > >> I'll see if I can find a more concise example. There's lots of junk >> in it, but it was the first that I was playing with. Will you still >> need this if the ".erb implies html" assumption is false? > > No, thanks. A simple XML file with .erb extension is exhibiting this > behaviour. I may just be misunderstanding the way filetype detection > works. I'm not certain how it works either. I think there are at least two things going on, extension and syntax checking... > > > >> I only have one a/c on the machine just now, but I'd like others to >> get the benefit. Similary on Unix. I usually put the vim stuff to >> be system wide so everyone benefits, and if I have to help them I >> can spin up vim and have it work sensibly. [cf the PragProg advice >> about use one edior and learn it well: you don't want it to change >> too much just because you're logged in as someone else (who never >> uses that editor, anyway).] > > Right. Obviously the installer allows you to install it anywhere you > like but, I would think, the scenario you describe is best served by an > install in $VIM/vimfiles. OK. I didn't create that because it wasn't there. I'll maybe try that tonight. > >>> multiple versions of Vim and trying to restrict the use of the vim-ruby >> >> I was running 62 and 63 at the same time for a while, but I thought >> it would install in the latest. > > If you install in $VIM/vimfiles then these files will be available, > system-wide, to all versions. However, the ftdetect mechanism was OK. > introduced in 6.3 so earlier versions will require a filetype.vim to be > constructed as per :help new-filetype. So even if you didn't manually > add a new filetype.vim, 6.2 would still have access to all the updated > vim-ruby files. The only difference would be that eRuby files weren't > autodetected. > > I can't really see a down side to this setup. Perhaps this is where we > should start rambling about POLS? ;-) I think that's right now I understand how it works. So now I would not be surprised. > >>> files to a single version, perhaps? If you keep it in $VIMRUNTIME the >>> next time you update Vim you'll overwrite the vim-ruby files. While the >> [...] >> updating vim. Not that I've updated vim that often, only been using >> it since about 5.7. > > You are but a young pup. ;-) Only in vim years :-) I used vi before that, and even SOS on a DEC System 10 more years back than would interest most people! > >>>> * * * >>>> >>> >>> I'm assuming that people running rubygems will have $GEM_HOME/bin in >>> their PATH. Have you just blown that assumption out of the water? ;-) >> >> Ah. Maybe I've not configured my settings correctly: >> GEM_HOME: Undefined variable. > > > > Nope - sky high! ;-) ? (To quote `ed` :-)) > > It seems that GEM_HOME is only required for a 'user' install. Though the > core assumption is still correct. > >>> When you say "remind me" are you referring to the INSTALL instructions? >> gem query -l -n vim => >> >> *** LOCAL GEMS *** >> >> vim-ruby (2005.09.15, 2005.07.27) >> Ruby configuration files for Vim. Run 'vim-ruby-install.rb' to >> complete installation. >> >> So it has detected the need for this? > > This is all Gavin's work and I assume that he knew what he was doing as > he's a rubygems developer. ;-) See below. > > I just performed a default system-wide install of rubygems and it > appears to install the executable scripts in /usr/bin - the same place > 'gem' is located. So there shouldn't be any need to specify a location > for the installer script. OK: whereis vim-ruby-install.rb => vim-ruby-install: /usr/local/bin/vim-ruby-install.rb Oh, I didn't expect an install script to end up there, in the normal PATH. I thought it would be hidden within the place gems are stored for use the one time. > brains# vim-ruby-install.rb Possible Vim installation directories: 1) //.vim 2) /usr/local/share/vim/vimfiles Please select one (or anything else to specify another directory): 2 Target directory '/usr/local/share/vim/vimfiles' does not exist. Do you want to create it? [Yn] y mkdir -p /usr/local/share/vim/vimfiles mkdir -p -m 755 /usr/local/share/vim/vimfiles/compiler compiler/eruby.vim -> /usr/local/share/vim/vimfiles/compiler/eruby.vim compiler/ruby.vim -> /usr/local/share/vim/vimfiles/compiler/ruby.vim compiler/rubyunit.vim -> /usr/local/share/vim/vimfiles/compiler/rubyunit.vim mkdir -p -m 755 /usr/local/share/vim/vimfiles/ftdetect ftdetect/ruby.vim -> /usr/local/share/vim/vimfiles/ftdetect/ruby.vim mkdir -p -m 755 /usr/local/share/vim/vimfiles/ftplugin ftplugin/eruby.vim -> /usr/local/share/vim/vimfiles/ftplugin/eruby.vim ftplugin/ruby.vim -> /usr/local/share/vim/vimfiles/ftplugin/ruby.vim mkdir -p -m 755 /usr/local/share/vim/vimfiles/indent indent/ruby.vim -> /usr/local/share/vim/vimfiles/indent/ruby.vim mkdir -p -m 755 /usr/local/share/vim/vimfiles/syntax syntax/eruby.vim -> /usr/local/share/vim/vimfiles/syntax/eruby.vim syntax/ruby.vim -> /usr/local/share/vim/vimfiles/syntax/ruby.vim brains# exit brains# logout brains hgs 252 %> gem query -l -n vim *** LOCAL GEMS *** vim-ruby (2005.09.15, 2005.07.27) Ruby configuration files for Vim. Run 'vim-ruby-install.rb' to complete installation. brains hgs 253 %> So not quite that magic then. I thought that suggesion would disappear. > > >>> PS. We haven't had the usual flood of post-release discussion so I'm >>> hoping all is, generally, running smoothly... >> >> Or those in .ac.?? and .edu are going nuts in preparation for the >> start of the academic year and have not had chance to tackle this. > > I'll await their return to these matters then. ;-) I'm one of those, but took the plunge nonetheless. > > Thanks, > Doug > Thank you, Hugh From dougkearns at gmail.com Fri Sep 16 11:12:15 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sat, 17 Sep 2005 01:12:15 +1000 Subject: ANN: New stable release In-Reply-To: References: <20050915060945.GA3018@localhost.localdomain> <20050916093054.GC3018@localhost.localdomain> <20050916124326.GA3411@localhost.localdomain> Message-ID: <20050916151215.GB3411@localhost.localdomain> On Fri, Sep 16, 2005 at 04:01:50PM +0100, Hugh Sasse wrote: > brains# vim-ruby-install.rb > > Possible Vim installation directories: > 1) //.vim Maybe if the user is root we should just offer the system-wide directory? Just out of interest is HOME often set to / for root? It's been a long time since I've used anything other than linux where it usually seems to be set to /root. Regards, Doug From hgs at dmu.ac.uk Fri Sep 16 11:44:41 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Fri, 16 Sep 2005 16:44:41 +0100 (WEST) Subject: ANN: New stable release In-Reply-To: <20050916151215.GB3411@localhost.localdomain> References: <20050915060945.GA3018@localhost.localdomain> <20050916093054.GC3018@localhost.localdomain> <20050916124326.GA3411@localhost.localdomain> <20050916151215.GB3411@localhost.localdomain> Message-ID: On Sat, 17 Sep 2005, Doug Kearns wrote: > On Fri, Sep 16, 2005 at 04:01:50PM +0100, Hugh Sasse wrote: > > > >> brains# vim-ruby-install.rb >> >> Possible Vim installation directories: >> 1) //.vim > > Maybe if the user is root we should just offer the system-wide > directory? > > Just out of interest is HOME often set to / for root? It's been a long > time since I've used anything other than linux where it usually seems to > be set to /root. For Solaris, yes. I don't presently have access to /(Net|Free)BSD/, but I think DEC/Compaq/HP/%s use / as well. Thank you, Hugh From dougkearns at gmail.com Fri Sep 16 11:40:07 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sat, 17 Sep 2005 01:40:07 +1000 Subject: ANN: New stable release In-Reply-To: References: <20050915060945.GA3018@localhost.localdomain> <20050916093054.GC3018@localhost.localdomain> <20050916124326.GA3411@localhost.localdomain> Message-ID: <20050916154006.GC3411@localhost.localdomain> On Fri, Sep 16, 2005 at 04:01:50PM +0100, Hugh Sasse wrote: > On Fri, 16 Sep 2005, Doug Kearns wrote: > > No, thanks. A simple XML file with .erb extension is exhibiting this > > behaviour. I may just be misunderstanding the way filetype detection > > works. > > I'm not certain how it works either. I think there are at least two > things going on, extension and syntax checking... I was misreading the documentation... *sigh* We should be using 'set filetype=eruby' instead of 'setfiletype eruby'. I'll fix that now. Regards, Doug From dougkearns at gmail.com Tue Sep 20 23:53:25 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Wed, 21 Sep 2005 13:53:25 +1000 Subject: Default eRuby compiler makeprg Message-ID: <20050921035325.GA30155@localhost.localdomain> What should the default eRuby compiler plugin 'makeprg' be - eruby or erb? I'm leaning towards erb because it's included with standard Ruby distribution but I have no idea which is more commonly used... Thanks, Doug From hgs at dmu.ac.uk Wed Sep 21 05:20:17 2005 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Wed, 21 Sep 2005 10:20:17 +0100 (WEST) Subject: Default eRuby compiler makeprg In-Reply-To: <20050921035325.GA30155@localhost.localdomain> References: <20050921035325.GA30155@localhost.localdomain> Message-ID: On Wed, 21 Sep 2005, Doug Kearns wrote: > What should the default eRuby compiler plugin 'makeprg' be - eruby or > erb? > > I'm leaning towards erb because it's included with standard Ruby > distribution but I have no idea which is more commonly used... I see no advantage in the other direction, so I'd say erb also.... > > Thanks, > Doug thank you Hugh From dougkearns at gmail.com Wed Sep 21 09:23:50 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Wed, 21 Sep 2005 23:23:50 +1000 Subject: Default eRuby compiler makeprg In-Reply-To: References: <20050921035325.GA30155@localhost.localdomain> Message-ID: <20050921132350.GA3719@localhost.localdomain> On Wed, Sep 21, 2005 at 10:20:17AM +0100, Hugh Sasse wrote: > On Wed, 21 Sep 2005, Doug Kearns wrote: > > > What should the default eRuby compiler plugin 'makeprg' be - eruby or > > erb? > > > > I'm leaning towards erb because it's included with standard Ruby > > distribution but I have no idea which is more commonly used... > > I see no advantage in the other direction, so I'd say erb also.... OK. I've also changed the 'efm' format to use basically the same one as ruby since people seem happy enough with the way that works. I've also added a ruby_compiler variable which you can set to "eruby" if you want to use that for 'makprg'. It's debatable whether this is simpler than just adding the relevant line to ~/.vim/after/compiler ;-) Thanks, Doug From dougkearns at gmail.com Wed Sep 21 10:22:29 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu, 22 Sep 2005 00:22:29 +1000 Subject: New eRuby indent file Message-ID: <20050921142229.GC3719@localhost.localdomain> I've just stuck a new indent file for eRuby in CVS. It does nothing other than source the (X)HTML indent file for now. Regards, Doug From dougkearns at gmail.com Wed Sep 21 10:10:47 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Thu, 22 Sep 2005 00:10:47 +1000 Subject: Default eRuby compiler makeprg In-Reply-To: <20050921132350.GA3719@localhost.localdomain> References: <20050921035325.GA30155@localhost.localdomain> <20050921132350.GA3719@localhost.localdomain> Message-ID: <20050921141047.GB3719@localhost.localdomain> On Wed, Sep 21, 2005 at 11:23:50PM +1000, Doug Kearns wrote: > On Wed, Sep 21, 2005 at 10:20:17AM +0100, Hugh Sasse wrote: > > On Wed, 21 Sep 2005, Doug Kearns wrote: > > > > > What should the default eRuby compiler plugin 'makeprg' be - eruby or > > > erb? > > > > > > I'm leaning towards erb because it's included with standard Ruby > > > distribution but I have no idea which is more commonly used... > > > > I see no advantage in the other direction, so I'd say erb also.... > > OK. I've also changed the 'efm' format to use basically the same one as > ruby since people seem happy enough with the way that works. I've also > added a ruby_compiler variable which you can set to "eruby" if you want eruby_compiler Regards, Doug From dougkearns at gmail.com Thu Sep 22 11:20:23 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Fri, 23 Sep 2005 01:20:23 +1000 Subject: PATCH: rubyunit compiler improvements Message-ID: <20050922152023.GD3719@localhost.localdomain> I've just replaced the garbage in CVS with something that smells marginally better. The previous version was only temporary but, well... Anyway, this new one seems to produce much the same output as the GUI test runners. Regards, Doug Index: compiler/rubyunit.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/compiler/rubyunit.vim,v retrieving revision 1.7 diff -u -r1.7 rubyunit.vim --- compiler/rubyunit.vim 10 Sep 2005 14:51:02 -0000 1.7 +++ compiler/rubyunit.vim 22 Sep 2005 14:49:24 -0000 @@ -24,18 +24,16 @@ let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=ruby +CompilerSet makeprg=testrb -CompilerSet errorformat=\%Etest%[%^\ ]%#(%[%^\ ]%#)\ [%f:%l]:, - \%E\ %\\+%f:%l:%m, - \%Z%m%\\%., - \%C%m%\\%., - \%-GLoaded%.%#, - \%-GStarted%.%#, - \%-G%[EF%.]%.%#, - \%-GFinished\ in%.%#, - \%-G\ %\\+%\\d%\\+)\ Failure:, - \%-G\ %\\+%\\d%\\+)\ Error: +CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:, + \%C%m\ [%f:%l]:, + \%E\ %\\+%\\d%\\+)\ Error:, + \%C%m:, + \%C\ \ \ \ %f:%l:%.%#, + \%C%m, + \%Z\ %#, + \%-G%.%# let &cpo = s:cpo_save unlet s:cpo_save From dougkearns at gmail.com Sat Sep 24 10:48:25 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Sun, 25 Sep 2005 00:48:25 +1000 Subject: ANN: New stable release - 2005.09.24 Message-ID: <20050924144825.GE3719@localhost.localdomain> I've just sent up vim-ruby-2005.09.24. Regards, Doug From dougkearns at gmail.com Mon Sep 26 03:11:18 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Mon, 26 Sep 2005 17:11:18 +1000 Subject: PATCH: rubyunit compiler improvements In-Reply-To: <20050922152023.GD3719@localhost.localdomain> References: <20050922152023.GD3719@localhost.localdomain> Message-ID: <20050926071118.GF3719@localhost.localdomain> On Fri, Sep 23, 2005 at 01:20:23AM +1000, Doug Kearns wrote: > I've just replaced the garbage in CVS with something that smells > marginally better. > > The previous version was only temporary but, well... Anyway, this new > one seems to produce much the same output as the GUI test runners. I've just remembered a request of Sam's, from the beginning of time, for the standard Ruby compiler efm to be included in the Test::Unit one to pick up the syntax errors and similar that require churns out from Test::Unit. I'll have a look at that for the next release... Regards, Doug From dougkearns at gmail.com Tue Sep 27 10:38:22 2005 From: dougkearns at gmail.com (Doug Kearns) Date: Wed, 28 Sep 2005 00:38:22 +1000 Subject: PATCH: include gems load path in 'path' In-Reply-To: <20050911093938.GA3911@localhost.localdomain> References: <20050911093938.GA3911@localhost.localdomain> Message-ID: <20050927143822.GG3719@localhost.localdomain> On Sun, Sep 11, 2005 at 07:39:38PM +1000, Doug Kearns wrote: > > This includes the gems load path in 'path' so that :find and friends > will search there first. > > Is my limited understanding of gems correct? This should be an improvement. Because of the multiple directory approach Gems takes the 'path' may be __very__ long... ;-) Perhaps this inclusion of the Gems search path should be configurable? Regards, Doug Index: ftplugin/ruby.vim =================================================================== RCS file: /var/cvs/vim-ruby/vim-ruby/ftplugin/ruby.vim,v retrieving revision 1.13 diff -u -r1.13 ruby.vim --- ftplugin/ruby.vim 27 Sep 2005 05:08:01 -0000 1.13 +++ ftplugin/ruby.vim 27 Sep 2005 14:28:56 -0000 @@ -66,10 +66,11 @@ if !exists("s:rubypath") if 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:rubypath = system('ruby -e "print (begin; require %q{rubygems}; Gem.all_load_paths; rescue LoadError; []; end + $:).join(%q{,})"') + let s:rubypath = system('ruby -e "' . s:code . '"') else - let s:rubypath = system("ruby -e 'print (begin; require %q{rubygems}; Gem.all_load_paths; rescue LoadError; []; end + $:).join(%q{,})'") + let s:rubypath = system("ruby -e '" . s:code . "'") endif let s:rubypath = substitute(s:rubypath, '\%(^\|,\)\.\%(,\|$\)', ',,', '') else