Ruby Editor

Greetings:

I am new to Ruby (from C++) so these are quite basic questions i'm
afraid.

My questions are also more about Editor mechanics rather than Ruby per
se-if anyone can suggest a better forum, my apologies, just let me
know and i'll re-post.

I have spent the few weeks with Ruby using irb from the Terminal and
Text Edit, while i got a better sense from the Ruby Community
regarding the editors of choice. So yesterday i bought a license to
TextMate, which by the way, might just be the most beautiful (and t/4
useful) App i have ever seen, let alone owned and used.

My question relates to "commands" (i believe this term has two
meanings in TM-i'm using it to refer to one of the three automation
means). "Scope"?

1. Can I specify different lexical scopes for different
"languages" (that might not be the TM lingo-i mean "Ruby," "HTML,"
"Text," etc.)?

2. If i leave this field empty, is my default, "unlimited scope?"

3. When i go to the Bundle Editor, i get a drop down of like 20 or so
languages-3-5 of these i'll use regularly, another 3-4 ocasionally,
and the rest, unlikely. I see i can "filter" which i've done before in
other editors, so i know from painful experience that when i've had to
re-add one or more of these, and i do an update, all default bundle
items write over my customizations. T/4, i would like to put my 3-5
"everyday set" in a different folder to prevent this. Is there a
better solution w/ TM?

Thanks,

-alex

Greetings:

I am new to Ruby (from C++) so these are quite basic questions i'm
afraid.

My questions are also more about Editor mechanics rather than Ruby per
se-if anyone can suggest a better forum, my apologies, just let me
know and i'll re-post.

I have spent the few weeks with Ruby using irb from the Terminal and
Text Edit, while i got a better sense from the Ruby Community
regarding the editors of choice. So yesterday i bought a license to
TextMate, which by the way, might just be the most beautiful (and t/4
useful) App i have ever seen, let alone owned and used.

My question relates to "commands" (i believe this term has two
meanings in TM-i'm using it to refer to one of the three automation
means). "Scope"?

1. Can I specify different lexical scopes for different
"languages" (that might not be the TM lingo-i mean "Ruby," "HTML,"
"Text," etc.)?

2. If i leave this field empty, is my default, "unlimited scope?"

3. When i go to the Bundle Editor, i get a drop down of like 20 or so
languages-3-5 of these i'll use regularly, another 3-4 ocasionally,
and the rest, unlikely. I see i can "filter" which i've done before in
other editors, so i know from painful experience that when i've had to
re-add one or more of these, and i do an update, all default bundle
items write over my customizations. T/4, i would like to put my 3-5
"everyday set" in a different folder to prevent this. Is there a
better solution w/ TM?

I don't use TextMate myself, however James Edward Gray II who is a prolific
and helpful contributor to this list has written a book (which I haven't
read) all about TextMate. It might be worth checking out.

http://www.pragmaticprogrammer.com/titles/textmate/index.html

Thanks,

···

On 7/20/07, alex_land <doug.ybarbo@gmail.com> wrote:

-alex

Hi,

···

Am Samstag, 21. Jul 2007, 07:50:00 +0900 schrieb alex_land:

[...] regarding the editors of choice.

I suppose myself to be the most critical Vim user abroad.
I sure took long to accept Vim as a software to be at least installed.
I deeply recommend to use and getting used to Vim.

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

Mr. Gray not only wrote "the" book on TextMate (available also as a pdf ebook at the Pragmatic Programmers' site at a discount versus the print book) but he also wrote a lot of bundles for TextMate, I believe.
Get the book. Read a little bit of it at a time. Just learn something new every day or two or ten. As you learn your way around TextMate you will find your productivity increasing rapidly, particularly with Ruby, Rails and HTML.
For some languages there may be better solutions available.
PHP, especially big projects, for example is probably best done with Zend's IDE.
TextMate also works well with Transmit, Panic software's nice FTP app.
TextMate's big weakness is with non-western languages. Japanese for example. It can display the characters (if they're in the font you are using) but things go crazy when you use the Kotoeri input system. This is why in Japan many Rubyists are using Jedit or something.

John Joyce

···

On Jul 20, 2007, at 6:46 PM, Logan Capaldo wrote:

On 7/20/07, alex_land <doug.ybarbo@gmail.com> wrote:

Greetings:

I am new to Ruby (from C++) so these are quite basic questions i'm
afraid.

My questions are also more about Editor mechanics rather than Ruby per
se-if anyone can suggest a better forum, my apologies, just let me
know and i'll re-post.

I have spent the few weeks with Ruby using irb from the Terminal and
Text Edit, while i got a better sense from the Ruby Community
regarding the editors of choice. So yesterday i bought a license to
TextMate, which by the way, might just be the most beautiful (and t/4
useful) App i have ever seen, let alone owned and used.

My question relates to "commands" (i believe this term has two
meanings in TM-i'm using it to refer to one of the three automation
means). "Scope"?

1. Can I specify different lexical scopes for different
"languages" (that might not be the TM lingo-i mean "Ruby," "HTML,"
"Text," etc.)?

2. If i leave this field empty, is my default, "unlimited scope?"

3. When i go to the Bundle Editor, i get a drop down of like 20 or so
languages-3-5 of these i'll use regularly, another 3-4 ocasionally,
and the rest, unlikely. I see i can "filter" which i've done before in
other editors, so i know from painful experience that when i've had to
re-add one or more of these, and i do an update, all default bundle
items write over my customizations. T/4, i would like to put my 3-5
"everyday set" in a different folder to prevent this. Is there a
better solution w/ TM?

I don't use TextMate myself, however James Edward Gray II who is a prolific
and helpful contributor to this list has written a book (which I haven't
read) all about TextMate. It might be worth checking out.

http://www.pragmaticprogrammer.com/titles/textmate/index.html

Thanks,

-alex

Bertram Scharpf wrote:

Hi,

[...] regarding the editors of choice.

I suppose myself to be the most critical Vim user abroad.
I sure took long to accept Vim as a software to be at least installed.
I deeply recommend to use and getting used to Vim.

Bertram

I deeply respect Vim. I am convinced that there is no more elegant way to do simple or complex manipulation of text/code. However, learning Dvorak put a damper on my ability to use Vim. Instead, I am learning Emacs. If Vim is the most elegant editor, Emacs is the most customizable. That is a strength and a weakness--I probably won't feel completely satisfied with the editor until I have put another 30 hours into writing customizations and scripts for the program.

These two editors have a steep learning curve, if you want to use them effectively. (Don't bother trying, otherwise.) I would think that Vim is a little better for beginners, because it will force you to learn without being overly difficult. It is too easy to use Emacs without learning about its advanced features, and that would be a waste.

Welcome to the cult,
Dan

···

Am Samstag, 21. Jul 2007, 07:50:00 +0900 schrieb alex_land:

For what it's worth, I run Linux and currently use Cream as my editor
of choice. Before that, it was Scite.

Cream is actually a special configuration for GVim, which makes its
interface look more like that of other text editors (menus, mice, and
real-time editing), so you can have most of the power without so much
of a learning curve. It has very nice syntax highlighting, and I love
the fact that you can configure it to show a black background and
white text.

···

On 7/21/07, Bertram Scharpf <lists@bertram-scharpf.de> wrote:

Hi,

Am Samstag, 21. Jul 2007, 07:50:00 +0900 schrieb alex_land:
> [...] regarding the editors of choice.

I suppose myself to be the most critical Vim user abroad.
I sure took long to accept Vim as a software to be at least installed.
I deeply recommend to use and getting used to Vim.

Bertram

--
Bira

http://sinfoniaferida.blogspot.com

John Joyce wrote:

Greetings:

I am new to Ruby (from C++) so these are quite basic questions i'm
afraid.

My questions are also more about Editor mechanics rather than Ruby per
se-if anyone can suggest a better forum, my apologies, just let me
know and i'll re-post.

I have spent the few weeks with Ruby using irb from the Terminal and
Text Edit, while i got a better sense from the Ruby Community
regarding the editors of choice. So yesterday i bought a license to
TextMate, which by the way, might just be the most beautiful (and t/4
useful) App i have ever seen, let alone owned and used.

My question relates to "commands" (i believe this term has two
meanings in TM-i'm using it to refer to one of the three automation
means). "Scope"?

1. Can I specify different lexical scopes for different
"languages" (that might not be the TM lingo-i mean "Ruby," "HTML,"
"Text," etc.)?

2. If i leave this field empty, is my default, "unlimited scope?"

3. When i go to the Bundle Editor, i get a drop down of like 20 or so
languages-3-5 of these i'll use regularly, another 3-4 ocasionally,
and the rest, unlikely. I see i can "filter" which i've done before in
other editors, so i know from painful experience that when i've had to
re-add one or more of these, and i do an update, all default bundle
items write over my customizations. T/4, i would like to put my 3-5
"everyday set" in a different folder to prevent this. Is there a
better solution w/ TM?

I don't use TextMate myself, however James Edward Gray II who is a
prolific
and helpful contributor to this list has written a book (which I haven't
read) all about TextMate. It might be worth checking out.

http://www.pragmaticprogrammer.com/titles/textmate/index.html

Thanks,

-alex

Mr. Gray not only wrote "the" book on TextMate (available also as a pdf
ebook at the Pragmatic Programmers' site at a discount versus the print
book) but he also wrote a lot of bundles for TextMate, I believe.
Get the book. Read a little bit of it at a time. Just learn something
new every day or two or ten. As you learn your way around TextMate you
will find your productivity increasing rapidly, particularly with Ruby,
Rails and HTML.
For some languages there may be better solutions available.
PHP, especially big projects, for example is probably best done with
Zend's IDE.
TextMate also works well with Transmit, Panic software's nice FTP app.
TextMate's big weakness is with non-western languages. Japanese for
example. It can display the characters (if they're in the font you are
using) but things go crazy when you use the Kotoeri input system. This
is why in Japan many Rubyists are using Jedit or something.

TextMate has a much bigger weakness ... it only runs on a Mac. :frowning:

···

On Jul 20, 2007, at 6:46 PM, Logan Capaldo wrote:

On 7/20/07, alex_land <doug.ybarbo@gmail.com> wrote:

I haven't had a problem with that.

That said, of course, I like nvi better. It's the only one of the vi
clones in which infinite undo is implemented in a logically sound way. :slight_smile:

-s

···

In message <46A1B002.8070604@gmail.com>, Dan Zwell writes:

I deeply respect Vim. I am convinced that there is no more elegant way
to do simple or complex manipulation of text/code. However, learning
Dvorak put a damper on my ability to use Vim.

sender: "Dan Zwell" date: "Sat, Jul 21, 2007 at 04:04:51PM +0900" <<<EOQ

I deeply respect Vim. I am convinced that there is no more elegant way
to do simple or complex manipulation of text/code. However, learning
Dvorak put a damper on my ability to use Vim. Instead, I am learning
Emacs. If Vim is the most elegant editor, Emacs is the most
customizable. That is a strength and a weakness--I probably won't feel
completely satisfied with the editor until I have put another 30 hours
into writing customizations and scripts for the program.

Just for the sake of completness (and for those that don't know vim):
currently there are 1947 vim plugins listed at vim.sf.net and about
1300 tips for customization. You can also extend vim in one of
vimscript, python, *ruby*, tcl and/or mzscheme... so I really don't
think Emacs is more customizable than Vim. Those being said, I love
Emacs just as much as Vim, they both rock!

Cheers,
Alex

This cult . . . ?
  http://www.splange.freeserve.co.uk/misc/vi.html

···

On Sat, Jul 21, 2007 at 04:04:51PM +0900, Dan Zwell wrote:

Welcome to the cult,

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
John Kenneth Galbraith: "If all else fails, immortality can always be
assured through spectacular error."

I deeply respect Vim. I am convinced that there is no more elegant way
to do simple or complex manipulation of text/code. However, learning
These two editors have a steep learning curve, if you want to use them
effectively. (Don't bother trying, otherwise.) I would think that Vim is
a little better for beginners, because it will force you to learn
without being overly difficult. It is too easy to use Emacs without
learning about its advanced features, and that would be a waste.

Apologies for continuing the "off-topic" replies to the original
question about how to best use TextMate for editing Ruby programs..
but ..

In regard to "vi" vs. "emacs", it doesn't have to be "either - or": I
use "viper" within Emacs and get the best of both worlds.

IMHO, the strength of "vi" ("vim", "nvi", etc.) are that it is the
best at "word processing" -- editing chunks of text, with a minimum of
keyboard input, and without having to use a mouse. While, in
contrast, the strength of "emacs" is that it can easily be extended in
very useful ways to accomplish things that are not normally
accomplished within an "editor". For example, take a look at "orgtbl-
mode.el", "table.el", "calendar.el", and, most amazingly, the
"calculator.el" mode.

Of course "vi" (and it's clones) are also customizable, and amazing
extensions have been built for them, but there is an order of
magnitude of difference between those of "vi" and those of "emacs" --
the latter of which have a depth that those of the former would have
to work very hard indeed to match.

In any case, with "viper" you can have both worlds: the best of vi's
superior editing keystrokes with the platformed extensibility of
emacs.

Finally, to bring this back to ruby, in the standard Emacs "site-lisp"
directory, I find these extensions for Ruby: inf-ruby.el, ruby-
electric.el, ruby-mode.el. The first one supports doing real-time
evaluation of ruby expressions within an "inferior" process. The
"electric" mode supports dynamic insertion of ruby syntactic elements
as a convenience to the programmer, and the last is the basic mode for
editing ruby programs -- which supports things like indention/
exdention, face-control for syntactic elements, etc.

The reason I bring these modules up is that, if you are concerned (as
some previously have stated) with the viability of your editing
environment, and consider TextMate not suitable because you don't
trust that their development will support their product as long as you
want to develop using it, then you may wish to consider using either a
vi clone with a ruby extension, or Emacs with these standard ruby
modules, or Emacs with these ruby modules AND viper-mode. Both vi and
emacs (not the extensions) are open-source, and have been around
longer than most of you (but not me -- I started writing assembly code
on Univac mainframes in the early 70s, before Emacs was even a glimmer
in Stallman's eyes :wink:

Now, perhaps we can discuss Ruby stuff again.. :wink:

For what it's worth, I run Linux and currently use Cream as my editor
of choice. Before that, it was Scite.

SciTE is still my favorite GUI editor. Vim is still my favorite editor,
period.

Cream is actually a special configuration for GVim, which makes its
interface look more like that of other text editors (menus, mice, and
real-time editing), so you can have most of the power without so much
of a learning curve. It has very nice syntax highlighting, and I love
the fact that you can configure it to show a black background and
white text.

I prefer to avoid hiding the power of Vim behind a point-and-click
facade. My opinion is my own, of course.

···

On Mon, Jul 23, 2007 at 04:03:57AM +0900, Bira wrote:

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
awj @reddit: "The terms never and always are never always true."

Textmate actually can handle the display and input of Japanese text
with the appropriate font for the former, and Hetima's Japanese CJK
input plugin.
http://hetima.com/textmate/index-e.html
I have found it to work well enough with a number of different input
method editors, including Kotoeri.

Nonetheless, there aren't all that many Textmate users in Japan -
though they do exist. Most (hardcore) rubyists in Japan seem to be
emacs/vim users, with a bias towards emacs. There are also a bunch who
use editors such as Hidemaru, RDT/Eclipse, and JEdit (as you
mentioned).

An interesting data-point to note is that most of the ruby core team
seems to prefer emacs, whereas most of the rails core team seems to
prefer Textmate.

···

On 7/21/07, John Joyce <dangerwillrobinsondanger@gmail.com> wrote:

TextMate's big weakness is with non-western languages. Japanese for
example. It can display the characters (if they're in the font you
are using) but things go crazy when you use the Kotoeri input system.
This is why in Japan many Rubyists are using Jedit or something.

That's hardly a weakness. The developer doesn't want to be bothered with developing for other systems. If you've used Xcode and Inteface Builder (or NeXTStep before) can you blame him?

But there is a TextMate Bundle compatible Windows app in the works from another developer who is getting much support from the TextMate maker!
Much like the long wait for the OS X Ruby one-click-installer (tried it today, works like a charm),
the Windows crowd will soon have it's own equivalent... (minus the OS)

···

On Jul 20, 2007, at 10:44 PM, M. Edward (Ed) Borasky wrote:

John Joyce wrote:

On Jul 20, 2007, at 6:46 PM, Logan Capaldo wrote:

On 7/20/07, alex_land <doug.ybarbo@gmail.com> wrote:

Greetings:

I am new to Ruby (from C++) so these are quite basic questions i'm
afraid.

My questions are also more about Editor mechanics rather than Ruby per
se-if anyone can suggest a better forum, my apologies, just let me
know and i'll re-post.

I have spent the few weeks with Ruby using irb from the Terminal and
Text Edit, while i got a better sense from the Ruby Community
regarding the editors of choice. So yesterday i bought a license to
TextMate, which by the way, might just be the most beautiful (and t/4
useful) App i have ever seen, let alone owned and used.

My question relates to "commands" (i believe this term has two
meanings in TM-i'm using it to refer to one of the three automation
means). "Scope"?

1. Can I specify different lexical scopes for different
"languages" (that might not be the TM lingo-i mean "Ruby," "HTML,"
"Text," etc.)?

2. If i leave this field empty, is my default, "unlimited scope?"

3. When i go to the Bundle Editor, i get a drop down of like 20 or so
languages-3-5 of these i'll use regularly, another 3-4 ocasionally,
and the rest, unlikely. I see i can "filter" which i've done before in
other editors, so i know from painful experience that when i've had to
re-add one or more of these, and i do an update, all default bundle
items write over my customizations. T/4, i would like to put my 3-5
"everyday set" in a different folder to prevent this. Is there a
better solution w/ TM?

I don't use TextMate myself, however James Edward Gray II who is a
prolific
and helpful contributor to this list has written a book (which I haven't
read) all about TextMate. It might be worth checking out.

http://www.pragmaticprogrammer.com/titles/textmate/index.html

Thanks,

-alex

Mr. Gray not only wrote "the" book on TextMate (available also as a pdf
ebook at the Pragmatic Programmers' site at a discount versus the print
book) but he also wrote a lot of bundles for TextMate, I believe.
Get the book. Read a little bit of it at a time. Just learn something
new every day or two or ten. As you learn your way around TextMate you
will find your productivity increasing rapidly, particularly with Ruby,
Rails and HTML.
For some languages there may be better solutions available.
PHP, especially big projects, for example is probably best done with
Zend's IDE.
TextMate also works well with Transmit, Panic software's nice FTP app.
TextMate's big weakness is with non-western languages. Japanese for
example. It can display the characters (if they're in the font you are
using) but things go crazy when you use the Kotoeri input system. This
is why in Japan many Rubyists are using Jedit or something.

TextMate has a much bigger weakness ... it only runs on a Mac. :frowning:

Alexandru E. Ungur wrote:

Just for the sake of completness (and for those that don't know vim):
currently there are 1947 vim plugins listed at vim.sf.net and about
1300 tips for customization. You can also extend vim in one of
vimscript, python, *ruby*, tcl and/or mzscheme... so I really don't
think Emacs is more customizable than Vim. Those being said, I love
Emacs just as much as Vim, they both rock!

Cheers,
Alex

I must confess that

a. I don't use most of the extras Vim gives over good old vi, and
b. Hard-core geek that I am, I never learned either Teco or Emacs.

Alexandru E. Ungur wrote:

You can also extend vim in one of
vimscript, python, *ruby*, tcl and/or mzscheme... so I really don't
think Emacs is more customizable than Vim.

That is precisely why I think Emacs is more customizable than Vim. Elisp is capable of controlling every aspect of the program, as I understand it. All plugins are in Elisp, and many of them can play nice together or extend each other. By running a few lines of elisp, I have even (accidentally) changed functions that were necessary to save or exit! (Like I said earlier, extreme customizability is not always an advantage. But if you like that sort of thing...)

With Vim, you have to delve into vimscript if you want to have complete control of the editor (or so I've read). Further, many plugins are written (mostly) in ruby, python, vimscript, etc. If you want to modify a plugin, it will inevitably not be written in a language that you are comfortable with. (Maybe others have had more luck with Vim plugins than me.)

Dan

P.s., just my opinions! Not trying to bash anyone's religion, here!

IMHO, the strength of "vi" ("vim", "nvi", etc.) are that it is the
best at "word processing" -- editing chunks of text, with a minimum of
keyboard input, and without having to use a mouse. While, in
contrast, the strength of "emacs" is that it can easily be extended in
very useful ways to accomplish things that are not normally
accomplished within an "editor". For example, take a look at "orgtbl-
mode.el", "table.el", "calendar.el", and, most amazingly, the
"calculator.el" mode.

For such things, I tend to use other tools. I want my text processor for
processing text, and other tools for other purposes. For instance, I use
irb as my calculator.

The reason I bring these modules up is that, if you are concerned (as
some previously have stated) with the viability of your editing
environment, and consider TextMate not suitable because you don't
trust that their development will support their product as long as you
want to develop using it, then you may wish to consider using either a
vi clone with a ruby extension, or Emacs with these standard ruby
modules, or Emacs with these ruby modules AND viper-mode. Both vi and
emacs (not the extensions) are open-source, and have been around
longer than most of you (but not me -- I started writing assembly code
on Univac mainframes in the early 70s, before Emacs was even a glimmer
in Stallman's eyes :wink:

I was around before both -- though, admittedly, I wasn't programming yet.

Now, perhaps we can discuss Ruby stuff again.. :wink:

See above, re: irb instead of emacs as my calculator.

···

On Mon, Jul 23, 2007 at 03:05:11AM +0900, aks wrote:

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
Brian K. Reid: "In computer science, we stand on each other's feet."

Since I have a severe case of "vi dyslexia", that interface is what
allows me to use the editor at all :). I suspect the Cream
configuration was made with people like me in mind.

It does allows you to enter command mode a will, however, so all the
power is still there for those who knows how to access it.

···

On 7/22/07, Chad Perrin <perrin@apotheon.com> wrote:

I prefer to avoid hiding the power of Vim behind a point-and-click
facade. My opinion is my own, of course.

--
Bira

http://sinfoniaferida.blogspot.com

But there is a TextMate Bundle compatible Windows app in the works from another developer who is getting much support from the TextMate maker!
Much like the long wait for the OS X Ruby one-click-installer (tried it today, works like a charm),
the Windows crowd will soon have it's own equivalent... (minus the OS)

That would be E (http://www.e-texteditor.com). I like it, personally, but it's far from polished, and there are a few caveats still being ironed out. For example, to remain compatible with as many TextMate bundles as it can, it employs the use of Cygwin to supply *nix commands and such, which can cause a few hiccups here and there if you don't generally use Cygwin anyway (which under Windows I can't do without).

>
>TextMate has a much bigger weakness ... it only runs on a Mac. :frowning:
>
That's hardly a weakness. The developer doesn't want to be bothered
with developing for other systems. If you've used Xcode and Inteface
Builder (or NeXTStep before) can you blame him?

It's a big enough weakness that I won't use it for that very reason. The
way I see it, any requirement to use an OS that I don't much like is a
weakness of the application in question.

But there is a TextMate Bundle compatible Windows app in the works
from another developer who is getting much support from the TextMate
maker!
Much like the long wait for the OS X Ruby one-click-installer (tried
it today, works like a charm),
the Windows crowd will soon have it's own equivalent... (minus the OS)

Whee . . . even worse than having to use a Mac.

This is just one man's opinion, of course.

···

On Sat, Jul 21, 2007 at 01:27:20PM +0900, John Joyce wrote:

On Jul 20, 2007, at 10:44 PM, M. Edward (Ed) Borasky wrote:

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
Larry Wall: "A script is what you give the actors. A program is what you
give the audience."