Editing ruby code with Emacs or Vim?


#1

Hi,

What is your opinion:
Which editor of the two above is better for editing/developing ruby
code - Vim or Emacs ?

This is not intended as a fire starter for another “Emacs vs. Vim
holy war” – I dont intend to start a diskussion about the key
feature for general editing of both editors.

I only want to know what editor has better (spezialized) features for
codeing Ruby.

Kind regarda and thank you very much for any help in advance !
mcc


#2

Meino Christian C. wrote:

Hi,

What is your opinion:
Which editor of the two above is better for editing/developing ruby
code - Vim or Emacs ?

This is not intended as a fire starter for another “Emacs vs. Vim
holy war” –

Too late! Pandora’s box has been opened.

No, actually is is a very good question, so long as it doesn’t devolve
into a “mine’s bigger” thread.

I’ve been using gvim for a while, but have been poking around with
xemacs. One big hurdle is figuring out how to assorted configuration;
for the life of me I cannot discover how to set up a different color
scheme.

A vi <=> emacs translation/migration guide would be handy, something
that maps basic tasks, common settings, and so on, between the two, for
people moving from one to the other.

Does anyone know of such a thing?

Oh, and to answer your initial question, my Ruby-coding experience with
vim has been quite pleasant. There is a ruby-vim gem with assorted
menus and macros for Ruby hacking, plus it is possible to compile vim so
that you can write vim functions in Ruby.

I’ve not learned enough about emacs to offer an opinion. But, Matz uses
it, which should count for something.


James B.

“In Ruby, no one cares who your parents were, all they care
about is if you know what you are talking about.”

  • Logan C.

#3

James B. wrote:

I’ve been using gvim for a while, but have been poking around with
xemacs. One big hurdle is figuring out how to assorted configuration;
for the life of me I cannot discover how to set up a different color
scheme.

Use the colorscheme command. type “:colorscheme torte” (without the
quotes, where “torte” is the name of a .vim file in /colors) in
command-mode to try one out, and once you’ve found one, add the line
“colorscheme torte” to .vimrc.

Cheers,
Dave


#4

On May 16, 2006, at 2:35 AM, Dave B. wrote:

“colorscheme torte” to .vimrc.

Cheers,
Dave

I think he meant he couldn’t figure out how to change the color
scheme in xemacs.


#5

On May 15, 2006, at 10:14 PM, Meino Christian C. wrote:

I only want to know what editor has better (spezialized) features for
codeing Ruby.

Kind regarda and thank you very much for any help in advance !
mcc

I use Vim, mostly because everytime I try to use emacs I can’t wrap
my brain around the key combos, although since I’ve switched to a mac
I have been picking up the basic editing shortcuts. (C-a, C-e, C-k, C-
y, etc.) I think it’s a crime that the vim concept of yanking means
pretty much the exact opposite of the Emacs concept of yanking (I
don’t car really which definition you choose, I just wish the letter
‘y’ meant the same thing in both). To go off on a tangent for a
moment if I may be allowed, I think the biggest problem with any text
editor, is that it’s exactly that a text editor. Everything has all
these neat features for manipulating and changing existing text, I
want a text creator/generator. Code completion is close, but it still
requires too much typing. I guess I should learn APL and get the
right kind of keyboard .


#6

On 5/16/06, Meino Christian C. removed_email_address@domain.invalid wrote:

I only want to know what editor has better (spezialized) features for
codeing Ruby.

Kind regarda and thank you very much for any help in advance !
mcc

I use Emacs since it’s more flexible and hackable. Running consoles, a
WEBrick instance, debuggers, IRB - all within full-fledged Emacs
buffers with all the benefits. You can’t do that with Vim.

And the above are really, just beginners stuff: Emacs is supposed to
be able to (not “hacked into”) have buffers functioning as anything
from mail-clients, newsgroup readers, IRC clients, to online Chess
clients. So imho, if you use Emacs you are guaranteed (at least more
than any other editor) to be able to get it to work as you want.


#7

Dave B. wrote:

command-mode to try one out, and once you’ve found one, add the line
“colorscheme torte” to .vimrc.

Thanks; I should have been more clear. Vim colors I understand. It’s
emacs colors that baffle me.


James B.

“Design depends largely on constraints.”

  • Charles Eames

#8

Logan C. wrote:

I think he meant he couldn’t figure out how to change the color scheme
in xemacs.

Ahem. Yes, you’re right. Sorry for the mistake, James.

Cheers,
Dave


#9

Meino Christian C. wrote:

I only want to know what editor has better (spezialized) features for
codeing Ruby.

to narrow the discussion: look thru older threads
http://groups.google.com/group/comp.lang.ruby/search?q=IDE+vim+emacs&start=0&scoring=d&
which until recently was a complete ruby-talk archive

to broaden the discussion: maybe look at Eclipse/RDT, jedit, komodo,
arachno ruby, textmate, scite and other editors.


#10

On 5/16/06, James B. removed_email_address@domain.invalid wrote:

quotes, where “torte” is the name of a .vim file in /colors) in

“Design depends largely on constraints.”

  • Charles Eames

Ok, this is tested for Emacs 21.3:

M-x (i.e. “run the builtin function”) customize-face

You’ll get in the minibuffer:

Customize face: (default all)

Just hit enter, and Emacs would create a large buffer with the
formatting options for each face. It’s much beyond just colors: you
can set e.g. variable names to be bold, have a different background
color, different font… pretty much whatever you want. Just find the
face you want to change; most are pretty obvious (“Variable Name”,
“String”, “Keyword”).

As with everything in Emacs, there are a some more advanced ways,
including stuff like choosing from whole color schemes. Didn’t really
use it, so I can’t comment; customizing the default scheme was enough
for me.


#11

“Alder G.” removed_email_address@domain.invalid writes:

I use Emacs since it’s more flexible and hackable. Running consoles, a
WEBrick instance, debuggers, IRB - all within full-fledged Emacs
buffers with all the benefits. You can’t do that with Vim.

And the above are really, just beginners stuff: Emacs is supposed to
be able to (not “hacked into”) have buffers functioning as anything

From mail-clients, newsgroup readers, IRC clients, to online Chess
clients. So imho, if you use Emacs you are guaranteed (at least more
than any other editor) to be able to get it to work as you want.

Emacs also tricks you into learning some lisp if you use it long
enough. You can count that as an advantage or a disadvantage, but
since it’s one of Matz’s favorite languages I would say it’s quite
fitting for Ruby in an indirect way. =)

-Phil H.


#12

On May 16, 2006, at 7:41 AM, James B. wrote:

Thanks; I should have been more clear. Vim colors I understand.
It’s emacs colors that baffle me.

The emacs wiki is awesome. It teaches me something new every week:

http://www.emacswiki.org/cgi-bin/wiki/ColorTheme


#13

Alder G. wrote:

Ok, this is tested for Emacs 21.3:

M-x (i.e. “run the builtin function”) customize-face

You’ll get in the minibuffer:

Customize face: (default all)

Yow.

use it, so I can’t comment; customizing the default scheme was enough
for me.

Thank you.

I’ll go look now for the :colorscheme equivalent.

:slight_smile:


James B.

“Programs must be written for people to read, and only incidentally
for machines to execute.”

  • H. Abelson and G. Sussman
    (in "The Structure and Interpretation of Computer Programs)

#14

On 5/16/06, James B. removed_email_address@domain.invalid wrote:

[snip]

(I suspect that, by no coincidence, Emacs is the Lisp of editors.)

Hm… I’m not sure what that’s supposed to mean, but it sounds humorous.
:slight_smile:

Though, now I think I feel an analogy coming on. Let’s see,… if
editors were human-powered transportation:

punchcards ~= Like walking there, but with a pebble in your shoe*.

ed ~= Those metal-wheeled roller skates you had when you were a kid.
Don’t try to make any sharp turns!

vi ~= The better roller skates, with the rubber thingy on the front to
“help you stop”. They got you to your friend’s house, but skinned
knees were par for the course.

vim ~= That bike with the cool shock absorbers and pads on the
handlebars and top tube. Put your helmet on kid, and don’t get your
pants caught in the chain!

emacs ~= A ten-speed! With water bottle, tire pump, rear view mirrors,
kick stand, the works. You’ve gotta get used to those weird curly
handlebars, but it’ll take you all over town. :slight_smile:

Hm… Now where did I leave my Gossamer Albatross parked
(http://www.sfoarts.org/exhibits/243/travel/human.html) …

(* Note, I’ve never had the pleasure of using punchcards.)


#15

On May 15, 2006, at 7:14 PM, Meino Christian C. wrote:

What is your opinion:
Which editor of the two above is better for editing/developing ruby
code - Vim or Emacs ?

Yes.


Eric H. - removed_email_address@domain.invalid - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com


#16

Ryan D. wrote:

On May 16, 2006, at 7:41 AM, James B. wrote:

Thanks; I should have been more clear. Vim colors I understand.
It’s emacs colors that baffle me.

The emacs wiki is awesome. It teaches me something new every week:

http://www.emacswiki.org/cgi-bin/wiki/ColorTheme

Thank you, that’s quite educational.

Seems I have to go install some color-scheme script or something, then
write or cut-n-paste some code.

(I suspect that, by no coincidence, Emacs is the Lisp of editors.)


James B.

“Programs must be written for people to read, and only incidentally
for machines to execute.”

  • H. Abelson and G. Sussman
    (in "The Structure and Interpretation of Computer Programs)

#17

Eric H. wrote:

On May 15, 2006, at 7:14 PM, Meino Christian C. wrote:

What is your opinion:
Which editor of the two above is better for editing/developing ruby
code - Vim or Emacs ?

Yes.

so there you have it, it’s NP-hard