From: Anselm Helbig <anselm.helbig+news2009@googlemail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Ruby
Date: Tue, 12 May 2009 00:06:19 +0200 [thread overview]
Message-ID: <87eiuvi9b8.wl%anselm.helbig+news2009@googlemail.com> (raw)
In-Reply-To: <mailman.7026.1242077469.31690.help-gnu-emacs@gnu.org>
At Mon, 11 May 2009 23:59:48 +0400,
Vladimir Passwordoff <passvvordoff@gmail.com> wrote:
>
> [1 <text/plain; ISO-8859-1 (7bit)>]
>
> [2 <text/html; ISO-8859-1 (7bit)>]
> Can anyone, who program on Ruby, share the bit of ~/.emacs with ruby configuration, and the ruby-files for emacs? I only install the irb and ruby-mode, but ri, flymode - i
> cannot.
See the emacswiki for setting up flymake
http://www.emacswiki.org/emacs/FlymakeRuby
I'm using emacs-rails which already sets this up for you:
http://dima-exe.ru/rails-on-emacs
(I don't really like the fact that emacs-rails configures so much
stuff for you: it's generally easier to turn on a feature you want
than to turn off a feature that you don't want - in the latter case
you don't know where it was activated and what was done to configure
it.)
For ri, I use the fastri gem which includes the `ri-emacs'
executable. Note that you have to start a fastri-server before you can
use it (should be done in some startup script). You still need to get
ri-ruby.el from http://rubyforge.org/projects/ri-emacs/ and put it
somewhere in your emacs load-path:
(mapc (lambda (func)
(autoload func "ri-ruby" nil t))
'(ri ri-ruby-complete-symbol ri-ruby-show-args))
;; this only works if ri-emacs can be found in your PATH
(setq ri-ruby-script (locate-file "ri-emacs" exec-path))
;; the default ANSI colours are not really readable with a light background
(setq ansi-color-names-vector ["black" "red" "#009900" "yellow" "blue" "magenta" "#990099" "white"])
(setq ansi-color-map (ansi-color-make-color-map))
(add-hook 'ruby-mode-hook
(lambda ()
(local-set-key "\M-\C-i" 'ri-ruby-complete-symbol)
(local-set-key (kbd "<f4>") 'ri-ruby-show-args)))
Apart from the rails-specific stuff I only have these smaler
customizations for ruby:
;; allows for navigation by word in camel-cased constants
(defun turn-on-c-subword-mode () (c-subword-mode 1))
(add-hook 'ruby-mode-hook 'turn-on-c-subword-mode)
;; highlight some keywords
(font-lock-add-keywords 'ruby-mode
'(("\\<\\(FIXME\\|HACK\\|XXX\\|FLUNK\\|TODO\\|ToDo\\)" 1
font-lock-warning-face prepend)))
;; highlights matching blocks, get it from
;; http://www.emacswiki.org/emacs/ruby-block.el
(autoload 'ruby-block-mode "ruby-block" nil t)
(add-hook 'ruby-mode-hook (lambda () (ruby-block-mode t)))
My other customizations are either too specific (rails) or too general
to mention here.
HTH,
Anselm
--
Anselm Helbig
mailto:anselm.helbig+news2009@googlemail.com
next parent reply other threads:[~2009-05-11 22:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.7026.1242077469.31690.help-gnu-emacs@gnu.org>
2009-05-11 22:06 ` Anselm Helbig [this message]
2009-05-11 19:59 Ruby Vladimir Passwordoff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eiuvi9b8.wl%anselm.helbig+news2009@googlemail.com \
--to=anselm.helbig+news2009@googlemail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.