Vim question

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

From within vim:

:h quickfix

-- Thomas Adam

···

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?

--
"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"

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.

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.

Thanks, everyone, for the replies.

Jim

Sure. If you look here:

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

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

···

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.

--
"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 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.com/Z45dt

  AKA

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

and most likely this particular page:

http://www.vim.org/scripts/script.php?script_id=188

though this page

http://www.vim.org/scripts/script.php?script_id=163

has a nice option, too.

James

···

--

http://www.ruby-doc.org - The Ruby Documentation Site
http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML
http://www.rubystuff.com - The Ruby Store for Ruby Stuff
http://www.jamesbritt.com - Playing with Better Toys

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.pinkjuice.com/vim/

which also includes

   Vim as XML Editor

James