2010-03-11 84 views

回答

28

你應該嘗試所有的RoR並解決你最喜歡的一個。

首先,您應該使用ECB,ruby-mode,emacs-rails和其他一些東西來檢查Marshall Vandegrift的excellent screencast。它給你一個很好的感覺,就是如何在Emacs上編寫RoR。

總之這裏有一些模式,你應該嘗試:

  • Rinari - 讓周圍的代碼,運行測試和管理控制檯,網絡服務器等一個簡單的框架,它的簡約和牯圍繞着一系列的鍵綁定。
  • Emacs-rails - Emacs RoR模式的祖父。它一段時間沒有更新,實際上主頁不再存在。但它非常強大,可以讓你做幾乎所有事情。
  • Emacs-rails-reloaded - 這是對原始emacs-rails的重新設計,我相信是同一個人。它使用偉大的anything模式來幫助您找到事物並解決問題。我目前正在使用這個AND rinari。

下面是有用的一些其他模式:

  • ECB - Emacs的代碼瀏覽器。用它來進行項目管理,並繞過你的代碼。
  • Yasnippet - 提供各種有用的片段,自動插入TAB鍵。
  • Nxhtml - 對於編輯RHTML,僱員再培訓局等

更多的模式,你可以嘗試:

  • Ri - 用於查看文檔裏嵌入。
  • Flymake-ruby - 即時語法檢查。
  • Ri - 用於查看文檔裏

哦,當然你需要紅寶石模式,其自帶的紅寶石源,並通過自己馬茨維護。

希望這有助於

+0

崇高的答案,謝謝!你能否提供一些關於Rinari和Emacs-rails-reloaded一起玩的細節? – aL3xa 2012-01-13 02:37:12

+0

說實話我不再使用emacs-rails-reloaded。它自2009年以來一直未更新,我甚至不確定它是否適用於更新版本的Rails。最近我發現Rinari是我需要導航一個rails應用程序的所有東西。 – thermans 2012-01-15 14:36:18

5

rspec-mode(運行容易單個或多個規範)

js2-mode(JavaScript語法高亮)

ido(查找文件/項目中的緩衝超快速)

3

由於我是rails(和emacs)的新手,我不想馬上使用rinari。我發現如果一個工具對我來說有太多的魔力,我就不會像我想的那樣快速地學習細節。我想我會最終使用它。然而,現在,我設置了一堆我在emacs中爲RAILS 3生成的shell,並在它們之間切換以完成我的工作。我用tmr加前綴以便我可以輕鬆找到它們。

(defun tmr-spork-shell() 
     "Invoke spork shell" ; Spork - love that name 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "spork"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "spork\n")) 

    (defun tmr-devlog-shell() 
     "Tail the development log, shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "devlog"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "tail -f log/development.log\n")) 

    (defun tmr-testlog-shell() 
     "Tail the test log, shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "testlog"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "tail -f log/test.log\n")) 

    (defun tmr-server-shell() 
     "Invoke rails ui server shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "server"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "rails s\n")) 

    (defun tmr-db-shell() 
     "Invoke rails dbconsole shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "dbconsole"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "rails dbconsole\n")) 

    (defun tmr-console-shell() 
     "Invoke rails console shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "console"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "rails console\n")) 

    ; I like to run all my tests in the same shell 
    (defun tmr-rspec-shell() 
     "Invoke rspec shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "rspec"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n"); makes sure rvm variables set with .rvmrc 
     (process-send-string nil "rspec spec\n")) ; This is debatable, since spork wont be up yet 

    ; The shell where I do most of my work 
    (defun tmr-shell() 
     "Invoke plain old shell" 
     (interactive) 
     (pop-to-buffer (get-buffer-create (generate-new-buffer-name "sh"))) 
     (shell (current-buffer)) 
     (process-send-string nil "cd .\n")); makes sure rvm variables set with .rvmrc 

    ; My everyday ide 
    (defun tmr-ide-lite() 
     "Spawn several shells for a mini Rails IDE" 
     (interactive) 
     (progn (tmr-spork-shell) 
      (tmr-shell) 
      (tmr-server-shell) 
      (tmr-rspec-shell))) 

    ; When I am doing a big debug session 
    (defun tmr-ide-full() 
     "Spawn several shells for a full Rails IDE" 
     (interactive) 
     (progn (tmr-spork-shell) 
      (tmr-shell) 
      (tmr-server-shell) 
      (tmr-console-shell) 
      (tmr-db-shell) 
      (tmr-devlog-shell) 
      (tmr-testlog-shell) 
      (tmr-rspec-shell))) 
2

另一種我覺得有用的未提及的模式是web-mode。這對編寫視圖非常有用,並且很好地處理.html.erb文件。它具有語法高亮和標記完成等功能。你可以在here找到它。

相關問題