all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Ruby and RubyOn Rails setup - Cannot enable indentation and snippets
@ 2013-01-01 12:27 Sayth Renshaw
  2013-01-01 14:24 ` Dmitry Gutov
       [not found] ` <mailman.16475.1357050313.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Sayth Renshaw @ 2013-01-01 12:27 UTC (permalink / raw)
  To: help-gnu-emacs

Hi

I have been trying to configure emacs24 now for sometime to be good using ruby and later rails. I am on Fedora 18.

Well the biggest issue I have is that emacs will not indent ruby correctly, well it doesn't indent at all.

I have tried several variations all done by hand by myself, emacs-starter-kit with ruby loaded, prelude emacs(indents end keyword correctly but does not indent the block) with ruby loaded and cannot get proper indentation, snippets and/or autocompletion. I can get some bits in the installs but it is not ideal.

By default Sublime text2 does all this and I cannot manage to emacs configured.

This is my .emacs(left out references to marmalade etc) I put together using ruby-mode, rinari, rsense and yasnippet.
I get the features of rsense, however I cannot get it to indent correctly or have yasnippet insert snippet from tab press.

Example indentation

Correct
multi_array.each do
  x.each do |y|
    puts y

  end
end

Emacs
multi_array.each do
x.each do |y|
puts y
end
end


If anyone can advise on what to improve it would be greatly appreciated.

(setq-default indent-tabs-mode nil)    ; use only spaces and no tabs
(setq default-tab-width 4)

(require 'pep8)
(require 'pylint)

;; org mode
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))

 (global-set-key "\C-cl" 'org-store-link)
 (global-set-key "\C-cc" 'org-capture)
 (global-set-key "\C-ca" 'org-agenda)
 (global-set-key "\C-cb" 'org-iswitchb)

(require 'yasnippet-bundle)
(yas/global-mode)
(add-hook 'rinari-minor-mode-hook
          #'(lambda ()
              (setq yas/mode-symbol 'rails-mode)))

(add-hook 'ruby-mode-hook
          #'(lambda ()
              (setq yas/mode-symbol 'ruby-mode)))

(setq ruby-indent-level 4)
(require 'rinari)
(add-to-list 'load-path "/home/sayth/.emacs.d/rhtml")
(require 'rhtml-mode)

(autoload 'ruby-mode "ruby-mode"
    "Mode for editing ruby source files")
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
(autoload 'run-ruby "inf-ruby"
    "Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby"
    "Set local key defs for inf-ruby in ruby-mode")
(add-hook 'ruby-mode-hook
    '(lambda ()
        (inf-ruby-keys)))

(setq load-path (cons (expand-file-name "~/.emacs.d/rails-reloaded") load-path))
  (require 'rails-autoload)

(setq rsense-home "/home/sayth/opt/rsense-0.3")
(add-to-list 'load-path (concat rsense-home "/etc"))
(require 'rsense)
(add-hook 'ruby-mode-hook
          (lambda ()
            (add-to-list 'ac-sources 'ac-source-rsense-method)
            (add-to-list 'ac-sources 'ac-source-rsense-constant)))

Sayth


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-01-05 21:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-01 12:27 Ruby and RubyOn Rails setup - Cannot enable indentation and snippets Sayth Renshaw
2013-01-01 14:24 ` Dmitry Gutov
     [not found] ` <mailman.16475.1357050313.855.help-gnu-emacs@gnu.org>
2013-01-02 13:24   ` Sayth Renshaw
2013-01-02 14:52     ` Dmitry Gutov
     [not found]     ` <mailman.16528.1357138350.855.help-gnu-emacs@gnu.org>
2013-01-03  6:25       ` Sayth Renshaw
2013-01-03 14:23         ` Dmitry Gutov
2013-01-03 15:15           ` Dmitry Gutov
2013-01-04 11:11             ` Sayth Renshaw
2013-01-04 16:11               ` Dmitry Gutov
     [not found]                 ` <CAN2of03ausUrsd9LNqoN=r4o3YmD8YF=8ObiHqQxEx4QaUvKHw@mail.gmail.com>
2013-01-05  5:42                   ` Dmitry Gutov
2013-01-05 12:53                     ` Sayth Renshaw
2013-01-05 13:04                       ` Sayth Renshaw
2013-01-05 14:59                       ` Dmitry Gutov
2013-01-05 21:07                         ` Sayth Renshaw

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.