Ruby and IDE

Perhaps you mean something different, but wouldn't

!bash

work just fine in vim?

Although, I just have one gvim window open all the time and one
terminal running screen. Works for me.

···

On 4/28/05, tsuraan <tsuraan@xyons.net> wrote:

> One feature i find vi/nvi/vim/whatever is lacking is the ability to
> have an interactive shell inside a buffer, i can be in
> one xemacs session, and C-X2-C-Xo m-x shell and i have a command
> prompt sitting right there, which i can even copy and paste from. I've
> never found a way to do this in vi, and i find it much more productive
> to be able to do everything from one terminal than constantly
> switching backwards and forwards between processes. Just my $0.02 :slight_smile:

That's definitely a weak point of vim. There's a python script that
can put a shell in a vim buffer, but it's very unstable and nearly
useless. I've heard that the next version will have support for that,
but who knows... I mostly just code with multiple consoles and gpm, so
switching to a shell is just alt-f2 or whatever. It's still not nearly
as nice as emacs's integrated stuff though.

Yohanes Santoso wrote:

kyu <kyu@console-pimps.org> writes:

One feature i find vi/nvi/vim/whatever is lacking is the ability to
have an interactive shell inside a buffer, i can be in
one xemacs session, and C-X2-C-Xo m-x shell and i have a command
   
That's scary. Try this instead:

(defvar ys::eshell-wins nil)
(global-set-key "\C-cs" (lambda (win-num)
      (interactive "p")
      (message "win-num %s" win-num)
      (let ((assoc-buffer (cdr (assoc win-num ys::eshell-wins))))
        (if (not (buffer-live-p assoc-buffer))
      (progn ; the requested buffer not there (setq assoc-buffer (eshell t))
        (setq ys::eshell-wins (assq-delete-all win-num ys::eshell-wins))
        (add-to-list 'ys::eshell-wins (cons win-num assoc-buffer))))
        (switch-to-buffer assoc-buffer)
        (rename-buffer (concat "*eshell-" (int-to-string win-num) "*"))
        assoc-buffer)))

To open shell #1: C-1 C-c s or if your environment doesn't transmit
C-<number> (like from a putty session), then use M-1 C-c s or the traditional C-u 1 C-c s

Shell #2: C-2 C-c s or M-2 C-c s or C-u 2 C-c s

and so on.

YS.

That's 1000000000000x better, thanks! :slight_smile:

Austin Ziegler wrote:

I don't think that many people have found the heavyweight nature
of an IDE to be beneficial to Ruby development. This may change.

I find the keybindings to syntactic-based code-navigation and
refactorings in modern Java editors very beneficial to development.
Implemented properly this feels quite natural and "lightweight". I'd
like to see the same features in Ruby editors.

Ruby will screw things up for just about any
IDE with the mere existence of #method_missing.

Programmers may find features like "type-based code-completion" and
"find declaration" are still valuable, even if these features don't
know about messages handled in #method_missing.

I don't use an IDE in Ruby -- even for some big projects that I'm
working on -- because I don't *need* an IDE in Ruby.
... Ruby doesn't *need* an IDE.

We don't have a syntactic-based editor for Ruby yet. I think for
anyone who's used one for Java will tell you they definitely *need* it
for development. Perhaps the same will be true for Ruby in the future
...

Rob

That's what C-z is for!

I actually like switching processes, I don't know why.

···

On 5/2/05, Aredridel <aredridel@gmail.com> wrote:

> One feature i find vi/nvi/vim/whatever is lacking is the ability to have
> an interactive shell inside a buffer, i can be in
> one xemacs session, and C-X2-C-Xo m-x shell and i have a command prompt
> sitting right there, which i can even copy and paste from. I've never
> found a way to do this in vi, and i find it much more productive to be
> able to do everything from one terminal than constantly switching
> backwards and forwards between processes. Just my $0.02 :slight_smile:

Lothar Scholz wrote:

Hello Richard,

> No, the problem is that often you can't tell the type of a ruby
variable RD> until runtime (but can you do that for PHP either?). And we
do discuss how

Almost all PHP projects i know are functional. So you don't have a
problem with code completition - just show all variables and functions
or simply the ones with the given prefix. In the few cases where there
is a $self-> reference they run into the same problems, but PHP code
is much easier structured so your mentioned heuristic and a few more
work very well.

Does the KDevelop class browser really show all available methods ?
Rubys scoping rules with includes of modules (global, local) are
very complex, is this really handled ?

No, the KDevelop class browser isn't very clever at all, just some regular
expression matching. I'd like the next version to use the ruby bison
grammar and tokeniser.

If so - then even as a
competitor - i must show deep respect.

I don't see you as a competitor, as I've been mainly working on the QtRuby
and Korundum bindings, and have spent only a couple of months or so on
KDevelop ruby support. If Arachno was a killer development environment for
those apis I would be very pleased. For instance, I mailed you the other
month about the debugger conventions that QtRuby uses, in case you wanted
to make some minor changes to the Arachno debugger to handle QtRuby.

If not then it is much easier, but remember that most people want to use
code insight/autocomplete as a reference and a help to learn the API.
Then it is maybe more confusing to show something incomplete and
errornous. I observe my competitors very well (here i mostly mean Wing-IDE
for Python) and even while there system is very sophisticated i hear a lot
of comments that it is confusing.

Thats why my in current plans it had a lower priority. But i come to the
conclusion that this is far more wanted then i expected. So i will
implement my interpretation of a good code insight system very soon.
I have now changed my schedule in a way that in 3 3 month i hope i
can come up with something but as i wrote before it will look and
behave a little bit different...

Yes, I've never felt that code completion is a killer feature either, along
with it being difficult to implement for ruby. Fast access to the api docs
is more important because just knowing the name of a method via code
completion probably won't be sufficient to know how to use it.

Sweet! Thanks for the pointers.

martin

···

vruz <horacio.lopez@gmail.com> wrote:

maybe you mean something like:=20
Sign in · GitLab

or perhaps:
http://www.yzis.org

vruz:

or perhaps:
http://www.yzis.org

I'd really love to see something like this for Gnome and Ruby instead of
KDE and Lua - why is life so short?

Malte

everytime the vim vs emacs thread comes up i like to make these two
points:

>> C-X2-C-Xo m-x shell

and that's ALL you have to do to get a command line in emacs :slight_smile:

Actually, if you just do M-x eshell, you already have a shell. The
other commands are just for splitting your window into 2 frames and
switching focus to the frame where you'll start the shell.

ok, but this is scarier:

[snip]

What's so scary about lisp code? Wanna show me some vim-script?

one advantage is that vim has is that you can extend your editor using
the (or all for that matter) scripting language of your choice,
vimscript, tcl, perl, ruby, python. to extend emacs you use something
like have the lisp code above.

This is indeed great, the downside however is that on some
distributions, probably not all those languages will be enabled by
default (allthough i'm not sure about that), so that in the end
vimscript is the only way to be sure that your extensions will run
everywhere. There is no such problem with emacs-lisp-code. (unless you
want it to run on both GNU Emacs and Xemacs)

another advantage is that if you're a touch-typist, vim is very
efficient at editing code. i think it's very handy that to delete 5
lines of text you can type: 5dd or do it the long way: Vjjjjjd

compared to emacs: C-spacebar, cursor to your target, C-w

the first key combo assumes your terminal will support it otherwise
you're stuck with: M-x set-mark-command

Right, right.... but an experienced emacs user would probably just do
C-5 C-k. Which is for me faster than first switching mode in vim
(Esc), then do the 5dd, then switching back to insert mode (i).

What is the point of this "emacs is better" or "vim is better" ?

I use Emacs most of the time, but I regularly use vi(m) for editing
config files. I think the most important thing is that *you* can work
efficiently with the tools *you* use, whether your editor is Emacs,
Vi(m), a full-blown IDE...

Ruben

···

At Fri, 29 Apr 2005 21:44:54 +0900, tony summerfelt wrote:

Is that the same? You've got:

  public class SimpleTable
  public static class Column

What effect does the "static" have on SimpleTable::Column in Java?

-austin

···

On 4/29/05, David Holroyd <ruby-talk@badgers-in-foil.co.uk> wrote:

On Fri, Apr 29, 2005 at 10:26:38PM +0900, Austin Ziegler wrote:

What he's saying is what I said, in part. In PDF::Writer,
recently, I did the following:

  class SimpleTable
    class Column
      ...
    end
    ...
  end

To do this in Java -- especially since Column is accessible as
SimpleTable::Column (it's a full blown class, not just a nested
class, if that's even possible in Java -- it's been a long time)

FYI, the Java version of this construct would look something like,

  public class SimpleTable {
      public static class Column {
          ...
      }
      ...
  }

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

You can do :shell, but currently it's impossible to switch between the
shell window and your buffers.

Kent.

···

On 4/29/05, Joe Van Dyk <joevandyk@gmail.com> wrote:

Perhaps you mean something different, but wouldn't

!bash

work just fine in vim?

Although, I just have one gvim window open all the time and one
terminal running screen. Works for me.

tony summerfelt wrote:

everytime the vim vs emacs thread comes up i like to make these two points:

C-X2-C-Xo m-x shell

and that's ALL you have to do to get a command line in emacs :slight_smile:

That's scary. Try this instead:

ok, but this is scarier:

(defvar ys::eshell-wins nil)
(global-set-key "\C-cs" (lambda (win-num)
              (interactive "p")
              (message "win-num %s" win-num)
              (let ((assoc-buffer (cdr (assoc win-num ys::eshell-wins))))
                (if (not (buffer-live-p assoc-buffer))
                (progn ; the requested buffer not there (setq assoc-buffer (eshell t))
                  (setq ys::eshell-wins (assq-delete-all win-num ys::eshell-wins))
                  (add-to-list 'ys::eshell-wins (cons win-num assoc-buffer))))
                (switch-to-buffer assoc-buffer)
                (rename-buffer (concat "*eshell-" (int-to-string win-num) "*"))
                assoc-buffer)))

one advantage is that vim has is that you can extend your editor using the (or all for that matter) scripting language of your choice, vimscript, tcl, perl, ruby, python. to extend emacs you use something like have the lisp code above.

another advantage is that if you're a touch-typist, vim is very efficient at editing code. i think it's very handy that to delete 5 lines of text you can type: 5dd or do it the long way: Vjjjjjd

compared to emacs: C-spacebar, cursor to your target, C-w

the first key combo assumes your terminal will support it otherwise you're stuck with: M-x set-mark-command

Err, in emacs to delete 5 lines i would type: C-u 5 c-k, which isn't much longer than <Escape>5dd :slight_smile:

I'm using Intellij IDEA on my full-time job and I definitely can say
that I *don't* need an IDEA like IDE for Ruby. I've been programming
Ruby since 2000 and vim is all I need.

Kent.

···

On 4/29/05, Rob . <rob.02004@gmail.com> wrote:

Austin Ziegler wrote:
> I don't use an IDE in Ruby -- even for some big projects that I'm
> working on -- because I don't *need* an IDE in Ruby.
> ... Ruby doesn't *need* an IDE.

We don't have a syntactic-based editor for Ruby yet. I think for
anyone who's used one for Java will tell you they definitely *need* it
for development. Perhaps the same will be true for Ruby in the future
...

Rob
Ruby Editor Plugin for jEdit

Perhaps you mean something different, but wouldn't

!bash

work just fine in vim?

What emacs lets you do is have a split screen, where one buffer is running a console and the other buffer is editing code. In vim, you can't do this. If you do :split and !bash (or :shell), the executed program will completely replace vim, rather than just running in the active buffer. Supposedly the next vim will let this sort of thing work properly though.

Although, I just have one gvim window open all the time and one
terminal running screen. Works for me.

Yeah, I tend to do work in console mode, so one vim with splits and vsplits (1280x1024 console), and a bunch of terminals work reasonably well. Still, a properly embedded shell would be cool.

Austin Ziegler wrote:
> I don't think that many people have found the heavyweight nature
> of an IDE to be beneficial to Ruby development. This may change.

I find the keybindings to syntactic-based code-navigation and
refactorings in modern Java editors very beneficial to development.
Implemented properly this feels quite natural and "lightweight". I'd
like to see the same features in Ruby editors.

> Ruby will screw things up for just about any
> IDE with the mere existence of #method_missing.

Programmers may find features like "type-based code-completion" and
"find declaration" are still valuable, even if these features don't
know about messages handled in #method_missing.

> I don't use an IDE in Ruby -- even for some big projects that I'm
> working on -- because I don't *need* an IDE in Ruby.
> ... Ruby doesn't *need* an IDE.

We don't have a syntactic-based editor for Ruby yet. I think for
anyone who's used one for Java will tell you they definitely *need* it
for development. Perhaps the same will be true for Ruby in the future
...

Rob
Ruby Editor Plugin for jEdit

···

On 4/29/05, Rob . <rob.02004@gmail.com> wrote:
--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

(Second try. Sorry about the first, folks.)

Austin Ziegler wrote:

I don't think that many people have found the heavyweight nature
of an IDE to be beneficial to Ruby development. This may change.

I find the keybindings to syntactic-based code-navigation and
refactorings in modern Java editors very beneficial to
development. Implemented properly this feels quite natural and
"lightweight". I'd like to see the same features in Ruby editors.

Refactoring in Ruby is a slightly different beast. (Well, truth be
told, it's a majorly different beast. I tend to be able to refactor
my code with simple :%s/oldname/newname/g). That said, the problem
of refactoring is being worked on, and it should (hopefully) be
independent of any IDE.

Ruby will screw things up for just about any IDE with the mere
existence of #method_missing.

Programmers may find features like "type-based code-completion" and
"find declaration" are still valuable, even if these features don't
know about messages handled in #method_missing.

Type-based code completion is the very thing that will NOT work in
Ruby. It *can't*. The best you can get is a "statistically likely"
code completion that may break under a lot of circumstances.

Find declaration could be useful ... but, again, depends on type
information that is only available at runtime.

I don't use an IDE in Ruby -- even for some big projects that I'm
working on -- because I don't *need* an IDE in Ruby. ... Ruby
doesn't *need* an IDE.

We don't have a syntactic-based editor for Ruby yet. I think for
anyone who's used one for Java will tell you they definitely
*need* it for development. Perhaps the same will be true for Ruby
in the future ...

Doubtful, at least for the near future. Don't get me wrong -- Ruby
will benefit from certain IDE efforts. The inclusion of ri
information will be very useful if you can do that in the jedit Ruby
plugin. I have been playing with jedit and while I don't find it
nearly as usable as vim (long experience), it is an impressive
editor and I support what you're doing with the plugin.

But an IDE is very different.

IMO, a good Ruby IDE will support debugging; have ri and rdoc
information easily and quickly available, and that's about it.

-austin

···

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

> Hopefully, the next version of vim will add more by way of embeddability
> support, so that you can integrate a vim window as the editor component
> of a larger app (I'd love to run vim within kate, for instance). A shell
> within vim would be ideal, but vim within kate would be a decent
> compromise for anyone using X.
>
> martin

maybe you mean something like:
Sign in · GitLab

AFAIK this project is abandoned :frowning:
In older KDevelop versions you could select kvim as editor.

or perhaps:
http://www.yzis.org

This looks promising!

cheers,
vruz

Stefan

···

On Friday 29 April 2005 09:15, vruz wrote:

Aredridel <aredridel@gmail.com> writes:

···

On 5/2/05, Aredridel <aredridel@gmail.com> wrote:

> One feature i find vi/nvi/vim/whatever is lacking is the ability to have
> an interactive shell inside a buffer, i can be in
> one xemacs session, and C-X2-C-Xo m-x shell and i have a command prompt
> sitting right there, which i can even copy and paste from. I've never
> found a way to do this in vi, and i find it much more productive to be
> able to do everything from one terminal than constantly switching
> backwards and forwards between processes. Just my $0.02 :slight_smile:

That's what C-z is for!

Except vim won't interpret that if in insert mode, or is that configurable?

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

Martin DeMello wrote:

···

vruz <horacio.lopez@gmail.com> wrote:

maybe you mean something like:=20
http://www.freehackers.org/kvim/vimpart.html

or perhaps:
http://www.yzis.org

Sweet! Thanks for the pointers.

As it's a Kate part you can use it in KDevelop as well as Kate. I haven't
tried it though - I don't know if it has ruby syntax highlighting.

-- Richard

With the above definition, one could say,

  SimpleTable.Column col = new SimpleTable.Column();

Without the 'static', instances of the inner class are associated (I
forget the appropriate terminology) with instances of the outer class.

This means for client code to construct a Column, it needs,

  SimpleTable tab = new SimpleTable();
  SimpleTable.Column col = tab.new SimpleTable.Column();

However, now, methods of Column can access member variables of the outer
SimpleTable class instance (the compiler synthesises an additional,
hidden 'this' reference in non-static inner classes, IIRC).

(The syntax *is* simpler when constructing a Column from an instance
method of the outer class.)

So, static inner classes behave the same as top-level classes, and
non-static inner classes exist to confuse the unwary.

dave

···

On Sat, Apr 30, 2005 at 12:15:49AM +0900, Austin Ziegler wrote:

On 4/29/05, David Holroyd <ruby-talk@badgers-in-foil.co.uk> wrote:
> On Fri, Apr 29, 2005 at 10:26:38PM +0900, Austin Ziegler wrote:
>> What he's saying is what I said, in part. In PDF::Writer,
>> recently, I did the following:
>>
>> class SimpleTable
>> class Column
>> ...
>> end
>> ...
>> end
>>
>> To do this in Java -- especially since Column is accessible as
>> SimpleTable::Column (it's a full blown class, not just a nested
>> class, if that's even possible in Java -- it's been a long time)
> FYI, the Java version of this construct would look something like,
>
> public class SimpleTable {
> public static class Column {
> ...
> }
> ...
> }

Is that the same? You've got:

  public class SimpleTable
  public static class Column

What effect does the "static" have on SimpleTable::Column in Java?

--
http://david.holroyd.me.uk/

I try to keep an open mind about trying new things all the time. But
I tried to use Emacs for two days and my wrists and hands hurt SOOO
bad that I had to go back to vim.

Do you have to bind the ctrl key to the caps lock key in order to use
Emacs over a long period of time?

···

On 4/29/05, Ruben <Ruben.Vandeginste@cs.kuleuven.ac.be> wrote:

At Fri, 29 Apr 2005 21:44:54 +0900, tony summerfelt wrote:
>
> everytime the vim vs emacs thread comes up i like to make these two
> points:
>
> >> C-X2-C-Xo m-x shell
>
> and that's ALL you have to do to get a command line in emacs :slight_smile:

Actually, if you just do M-x eshell, you already have a shell. The
other commands are just for splitting your window into 2 frames and
switching focus to the frame where you'll start the shell.

> ok, but this is scarier:
[snip]

What's so scary about lisp code? Wanna show me some vim-script?

> one advantage is that vim has is that you can extend your editor using
> the (or all for that matter) scripting language of your choice,
> vimscript, tcl, perl, ruby, python. to extend emacs you use something
> like have the lisp code above.

This is indeed great, the downside however is that on some
distributions, probably not all those languages will be enabled by
default (allthough i'm not sure about that), so that in the end
vimscript is the only way to be sure that your extensions will run
everywhere. There is no such problem with emacs-lisp-code. (unless you
want it to run on both GNU Emacs and Xemacs)

> another advantage is that if you're a touch-typist, vim is very
> efficient at editing code. i think it's very handy that to delete 5
> lines of text you can type: 5dd or do it the long way: Vjjjjjd
>
> compared to emacs: C-spacebar, cursor to your target, C-w
>
> the first key combo assumes your terminal will support it otherwise
> you're stuck with: M-x set-mark-command

Right, right.... but an experienced emacs user would probably just do
C-5 C-k. Which is for me faster than first switching mode in vim
(Esc), then do the 5dd, then switching back to insert mode (i).

What is the point of this "emacs is better" or "vim is better" ?

I use Emacs most of the time, but I regularly use vi(m) for editing
config files. I think the most important thing is that *you* can work
efficiently with the tools *you* use, whether your editor is Emacs,
Vi(m), a full-blown IDE...