From slabounty at nexatech.com Fri May 21 09:21:25 2010 From: slabounty at nexatech.com (Scott LaBounty) Date: Fri, 21 May 2010 08:21:25 -0500 Subject: % Matching With Vim/Ruby Message-ID: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> All, Not sure if this is the right list or not, but I'm trying to get matching to work (using %) in vim in a ruby file. For example if I have the following code: 1.upto(10) do |n| puts n end If the cursor is on the "do", I'd like to hit the "%" key and have it go to "end". I have the following in an .vim/after/ftplugin/ruby.vim if exists("loaded_matchit") if !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\)\>:\%(^\|[^.]\)\@<=\' endif endif which is what I had in an older system. I believe that matchit.vim is loaded already (by default). Any ideas on getting this to work or alternative ways of doing this? Scott Confidentiality Statement: This message is confidential and may contain confidential information it is intended only for the individual[s] named herein. If this message is being sent from a member of the legal department, it may also be legally privileged. If you are not the named addressee[s] you must delete this email immediately; do not disseminate, distribute or copy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dougkearns at gmail.com Fri May 21 10:04:32 2010 From: dougkearns at gmail.com (Doug Kearns) Date: Sat, 22 May 2010 00:04:32 +1000 Subject: % Matching With Vim/Ruby In-Reply-To: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> Message-ID: On Fri, May 21, 2010 at 11:21 PM, Scott LaBounty wrote: > All, > > > > Not sure if this is the right list or not, but I?m trying to get matching to > work (using %) in vim in a ruby file. For example if I have the following > code: > > > > 1.upto(10) do |n| > > ??? puts n > > end > > > > If the cursor is on the ?do?, I?d like to hit the ?%? key and have it go to > ?end?. This works 'out of the box' with the b:match_words defined in the distributed ftplugin. Is there a particular reason you're redefining it? Doug From slabounty at nexatech.com Fri May 21 10:34:13 2010 From: slabounty at nexatech.com (Scott LaBounty) Date: Fri, 21 May 2010 09:34:13 -0500 Subject: % Matching With Vim/Ruby In-Reply-To: References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> Message-ID: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> -----Original Message----- From: vim-ruby-devel-bounces at rubyforge.org [mailto:vim-ruby-devel-bounces at rubyforge.org] On Behalf Of Doug Kearns Sent: Friday, May 21, 2010 7:05 AM To: Vim-Ruby Devel ML Subject: Re: % Matching With Vim/Ruby On Fri, May 21, 2010 at 11:21 PM, Scott LaBounty wrote: > All, > > > > Not sure if this is the right list or not, but I'm trying to get matching to > work (using %) in vim in a ruby file. For example if I have the following > code: > > > > 1.upto(10) do |n| > > puts n > > end > > > > If the cursor is on the "do", I'd like to hit the "%" key and have it go to > "end". This works 'out of the box' with the b:match_words defined in the distributed ftplugin. Is there a particular reason you're redefining it? Doug _______________________________________________ vim-ruby-devel mailing list vim-ruby-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/vim-ruby-devel ___________________________________________________________________________ Doug, Thanks for the reply. It didn't seem to be working out of the box (actually, I hadn't realized it should). I just removed my file and confirmed that it doesn't seem to work for me. I checked and I do have the ruby files in my /usr/share/vim/vim72 directory. Anything else I should check? Scott Confidentiality Statement: This message is confidential and may contain confidential information it is intended only for the individual[s] named herein. If this message is being sent from a member of the legal department, it may also be legally privileged. If you are not the named addressee[s] you must delete this email immediately; do not disseminate, distribute or copy. From slabounty at nexatech.com Fri May 21 13:35:25 2010 From: slabounty at nexatech.com (Scott LaBounty) Date: Fri, 21 May 2010 12:35:25 -0500 Subject: % Matching With Vim/Ruby In-Reply-To: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> Message-ID: <11AC4014A0B68944B0512974BDF4BBB04F6D0CB047@MXCCR.nexatech.local> -----Original Message----- From: vim-ruby-devel-bounces at rubyforge.org [mailto:vim-ruby-devel-bounces at rubyforge.org] On Behalf Of Scott LaBounty Sent: Friday, May 21, 2010 7:34 AM To: Vim-Ruby Devel ML Subject: RE: % Matching With Vim/Ruby -----Original Message----- From: vim-ruby-devel-bounces at rubyforge.org [mailto:vim-ruby-devel-bounces at rubyforge.org] On Behalf Of Doug Kearns Sent: Friday, May 21, 2010 7:05 AM To: Vim-Ruby Devel ML Subject: Re: % Matching With Vim/Ruby On Fri, May 21, 2010 at 11:21 PM, Scott LaBounty wrote: > All, > > > > Not sure if this is the right list or not, but I'm trying to get matching to > work (using %) in vim in a ruby file. For example if I have the following > code: > > > > 1.upto(10) do |n| > > puts n > > end > > > > If the cursor is on the "do", I'd like to hit the "%" key and have it go to > "end". This works 'out of the box' with the b:match_words defined in the distributed ftplugin. Is there a particular reason you're redefining it? Doug _______________________________________________ vim-ruby-devel mailing list vim-ruby-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/vim-ruby-devel ___________________________________________________________________________ Doug, Thanks for the reply. It didn't seem to be working out of the box (actually, I hadn't realized it should). I just removed my file and confirmed that it doesn't seem to work for me. I checked and I do have the ruby files in my /usr/share/vim/vim72 directory. Anything else I should check? Scott Doug, et al., I just checked and there is a matchit.vim in my /usr/share/vim/addons/plugin and /usr/share/vim/vim72/macros. Do I need to copy these elsewhere to get them to work? Sorry for all the questions, but I haven't done a lot of vim work lately. Scott Confidentiality Statement: This message is confidential and may contain confidential information it is intended only for the individual[s] named herein. If this message is being sent from a member of the legal department, it may also be legally privileged. If you are not the named addressee[s] you must delete this email immediately; do not disseminate, distribute or copy. From dougkearns at gmail.com Sat May 22 00:11:35 2010 From: dougkearns at gmail.com (Doug Kearns) Date: Sat, 22 May 2010 14:11:35 +1000 Subject: % Matching With Vim/Ruby In-Reply-To: <11AC4014A0B68944B0512974BDF4BBB04F6D0CB047@MXCCR.nexatech.local> References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CB047@MXCCR.nexatech.local> Message-ID: On Sat, May 22, 2010 at 3:35 AM, Scott LaBounty wrote: > Doug, et al., > > I just checked and there is a matchit.vim in my /usr/share/vim/addons/plugin and /usr/share/vim/vim72/macros. Do I need to copy these elsewhere to get them to work? This should be sourced/loaded provided you don't have the 'compatible' option set (it is by default) and /usr/share/vim/addons/ is in your 'runtimepath' which it presumably is although I'm not familiar with that hierarchy. You can test these with: :set compatible? :set rtp? You can test that the matchit plugin was loaded by running :let loaded_matchit which should return "loaded_matchit #1" if it has been. Now for the ruby specific b:match_words value to be set you'll need to load the ruby ftplugin. This is achieved with :filetype plugin on which turns on both filetype detection and the loading of ftplugins. So at a minimum a vimrc containing the following should work. set nocompatible set rtp+=/usr/share/vim/addons filetype plugin on These are often provided by the system vimrc file anyway but YMMV. What OS are you running? > Sorry for all the questions, but I haven't done a lot of vim work lately. No problem, ask away. Doug From slabounty at nexatech.com Sat May 22 13:39:20 2010 From: slabounty at nexatech.com (Scott LaBounty) Date: Sat, 22 May 2010 12:39:20 -0500 Subject: % Matching With Vim/Ruby In-Reply-To: References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CB047@MXCCR.nexatech.local>, Message-ID: <11AC4014A0B68944B0512974BDF4BBB04F6D26A6AE@MXCCR.nexatech.local> Doug, It was the run time path. After I put that in, everything worked great. Thanks, I greatly appreciate the help. Scott Confidentiality Statement: This message is confidential and may contain confidential information it is intended only for the individual[s] named herein. If this message is being sent from a member of the legal department, it may also be legally privileged. If you are not the named addressee[s] you must delete this email immediately; do not disseminate, distribute or copy. From dougkearns at gmail.com Sat May 22 14:41:41 2010 From: dougkearns at gmail.com (Doug Kearns) Date: Sun, 23 May 2010 04:41:41 +1000 Subject: % Matching With Vim/Ruby In-Reply-To: <11AC4014A0B68944B0512974BDF4BBB04F6D26A6AE@MXCCR.nexatech.local> References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CB047@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D26A6AE@MXCCR.nexatech.local> Message-ID: On Sun, May 23, 2010 at 3:39 AM, Scott LaBounty wrote: > Doug, > > It was the run time path. After I put that in, everything worked great. Thanks, I greatly appreciate the help. I just had a quick search for that */addons path and it would seem you're running Debian or some derived distro? I think you might want to look at the vim-addons command for the Debian Way (TM) of doing this but I'm old-school, and off to sleep, so I didn't investigate any further. :) Regards, Doug From slabounty at nexatech.com Sat May 22 17:36:32 2010 From: slabounty at nexatech.com (Scott LaBounty) Date: Sat, 22 May 2010 16:36:32 -0500 Subject: % Matching With Vim/Ruby In-Reply-To: References: <11AC4014A0B68944B0512974BDF4BBB04F6D0CAF68@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CAFA8@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D0CB047@MXCCR.nexatech.local> <11AC4014A0B68944B0512974BDF4BBB04F6D26A6AE@MXCCR.nexatech.local>, Message-ID: <11AC4014A0B68944B0512974BDF4BBB04F6D26A6AF@MXCCR.nexatech.local> Doug,self Yep, I'm running Ubuntu 10.04. I'll check on the vim-addons and see what I can find. I'm pretty old school myself, using vim going back to the 90's or thereabouts. I'll check out the vim-addons and see what I can find. Once again, I appreciate the help. Scott Confidentiality Statement: This message is confidential and may contain confidential information it is intended only for the individual[s] named herein. If this message is being sent from a member of the legal department, it may also be legally privileged. If you are not the named addressee[s] you must delete this email immediately; do not disseminate, distribute or copy. From dougkearns at gmail.com Thu May 27 08:23:58 2010 From: dougkearns at gmail.com (Doug Kearns) Date: Thu, 27 May 2010 22:23:58 +1000 Subject: Last Change headers Message-ID: G'day folks, I was just about to fire off the runtime files to Bram for inclusion in 7.3 when I noticed that we seem to have lost our "Last Change" header lines from these files. It looks like they were replaced with CVS Id keywords at some time and these were then removed when we moved to git. Would anyone have any objection to these lines being added? I suspect I'll be having this discussion with Bram otherwise... Doug From vim-ruby-devel at tpope.info Thu May 27 08:48:39 2010 From: vim-ruby-devel at tpope.info (Tim Pope) Date: Thu, 27 May 2010 08:48:39 -0400 Subject: Last Change headers In-Reply-To: References: Message-ID: On Thu, May 27, 2010 at 8:23 AM, Doug Kearns wrote: > I was just about to fire off the runtime files to Bram for inclusion > in 7.3 when I noticed that we seem to have lost our "Last Change" > header lines from these files. It looks like they were replaced with > CVS Id keywords at some time and these were then removed when we moved > to git. > > Would anyone have any objection to these lines being added? I suspect > I'll be having this discussion with Bram otherwise... > Based on the interaction I just had with him when updating my files, I'd say adding this header is highly advisable. Cheers, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From hgs at dmu.ac.uk Thu May 27 09:08:30 2010 From: hgs at dmu.ac.uk (Hugh Sasse) Date: Thu, 27 May 2010 14:08:30 +0100 (BST) Subject: Last Change headers In-Reply-To: References: Message-ID: On Thu, 27 May 2010, Tim Pope wrote: > On Thu, May 27, 2010 at 8:23 AM, Doug Kearns wrote: > > > I was just about to fire off the runtime files to Bram for inclusion > > in 7.3 when I noticed that we seem to have lost our "Last Change" > > header lines from these files. It looks like they were replaced with > > CVS Id keywords at some time and these were then removed when we moved > > to git. > > > > Would anyone have any objection to these lines being added? I suspect > > I'll be having this discussion with Bram otherwise... > > > > Based on the interaction I just had with him when updating my files, I'd say > adding this header is highly advisable. > > Cheers, > Tim > I'd say put them back with dates corrected if possible, on the basis that whatever ensures we don't miss the boat is probably worth it. Hugh From dougkearns at gmail.com Thu May 27 10:15:25 2010 From: dougkearns at gmail.com (Doug Kearns) Date: Fri, 28 May 2010 00:15:25 +1000 Subject: Last Change headers In-Reply-To: References: Message-ID: On Thu, May 27, 2010 at 11:08 PM, Hugh Sasse wrote: > I'd say put them back with dates corrected if possible, on the basis that > whatever ensures we don't miss the boat is probably worth it. OK, done and done. Thanks, Doug