[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

vim question

jeem.hughes

6/14/2005 2:52:00 PM

The survey thread reminded me that I wanted to ask this:

How can I run the file I'm currently editing, see the output, then
position the cursor on a line number (like a test failure or syntax
error) and jump to that line back in my source file?

Thanks for any help.

Jim

7 Answers

Thomas Adam

6/14/2005 3:24:00 PM

0

On Tue, Jun 14, 2005 at 11:55:30PM +0900, jeem wrote:
> The survey thread reminded me that I wanted to ask this:
>
> How can I run the file I'm currently editing, see the output, then
> position the cursor on a line number (like a test failure or syntax
> error) and jump to that line back in my source file?
>

From within vim:

:h quickfix

-- Thomas Adam

--
"One of us is a cigar stand, and one of us is a lovely blue incandescent
guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"


R. Mark Volkmann

6/14/2005 7:06:00 PM

0

Quoting Thomas Adam <thomas@edulinux.homeunix.org>:

> On Tue, Jun 14, 2005 at 11:55:30PM +0900, jeem wrote:
> > The survey thread reminded me that I wanted to ask this:
> >
> > How can I run the file I'm currently editing, see the output, then
> > position the cursor on a line number (like a test failure or syntax
> > error) and jump to that line back in my source file?
> >
>
> From within vim:
>
> :h quickfix

Can you provide a little more detail? I went through all that documentation and
nothing jumped out at me as a way of executing the Ruby script in the current
buffer.

--
R. Mark Volkmann
Partner, Object Computing, Inc.


Thomas Adam

6/14/2005 7:11:00 PM

0

On Wed, Jun 15, 2005 at 04:06:28AM +0900, R. Mark Volkmann wrote:
> Can you provide a little more detail? I went through all that
> documentation and nothing jumped out at me as a way of executing the
> Ruby script in the current buffer.

Sure. If you look here:

http://www.rubygarden.org/ruby?Vim...

under the heading "QuickFix" mode, that'll show you what you can enter
into Vim, either in command mode, or add it as en entry to
~/.vim/compiler/ruby.vim -- then, when you want to run the script you're
editing, you can do:

:make

And that should evaluate it within the context of Ruby.

-- Thomas Adam

--
"One of us is a cigar stand, and one of us is a lovely blue incandescent
guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"


james_b

6/14/2005 10:19:00 PM

0

R. Mark Volkmann wrote:
>
>
> Can you provide a little more detail? I went through all that documentation and
> nothing jumped out at me as a way of executing the Ruby script in the current
> buffer.


I obtained from now-vague sources a menu + function set that would do
assorted Ruby stuff, including executing the current buffer.

I believe it may be found here:

http://rubyurl...

AKA

http://www.vim.org/scripts/script_search_results.php?keywords=Ruby&script_type=&order_by=rating&direction=descending&sea...

and most likely this particular page:

http://www.vim.org/scripts/script.php?scr...

though this page

http://www.vim.org/scripts/script.php?scr...

has a nice option, too.

James
--

http://www.ru... - The Ruby Documentation Site
http://www.r... - News, Articles, and Listings for Ruby & XML
http://www.rub... - The Ruby Store for Ruby Stuff
http://www.jame... - Playing with Better Toys


james_b

6/14/2005 10:23:00 PM

0

R. Mark Volkmann wrote:
>
> Can you provide a little more detail? I went through all that documentation and
> nothing jumped out at me as a way of executing the Ruby script in the current
> buffer.

and also see this page:

http://www.pinkjuic...

which also includes

http://www.pinkjuice.com/how...


James


Nicholas Urie

6/14/2005 10:24:00 PM

0

jeem wrote:
> The survey thread reminded me that I wanted to ask this:
>
> How can I run the file I'm currently editing, see the output, then
> position the cursor on a line number (like a test failure or syntax
> error) and jump to that line back in my source file?
>
> Thanks for any help.
>
> Jim
>

This only answers part of your question, but I like to keep a separate
terminal window open with the results of running the file. Then you can
easily jump to a line in gVim using for example if you have an error on
line 35:

35G

to jump to line 35, or

145G

to jump to line 145. (the above commands should be typed directly into
command mode, make sure to use an uppercase G)

It might or might not be the most elegant solution, but it's fast and it
works.

jeem.hughes

6/15/2005 2:20:00 AM

0

Thanks, everyone, for the replies.

Jim