vim question

J

jeem

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
 
T

Thomas Adam

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
 
R

R. Mark Volkmann

Quoting Thomas Adam said:
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.
 
T

Thomas Adam

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?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
 
J

James Britt

R. Mark Volkmann said:
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_s..._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
 
N

Nicholas Urie

jeem said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,174
Messages
2,570,940
Members
47,485
Latest member
Andrewayne909

Latest Threads

Top