2010-05-04 14 views
11

Emacs的特性,包,附加組件等可以幫助您進行日常的Ruby On Rails開發?有什麼用於Rails開發的Emacs特性

+1

Ctrl-X,Ctrl-C? – Oded 2010-05-04 15:17:29

+2

逗號太多了。這是Cx Cc的正確名稱 – 2010-05-05 13:46:05

回答

7

以前版本的emacs-rails模式和Rinari(這兩種最流行的Rails開發模式)功能非常豐富,但是臃腫和麻煩。爲了保持一個小巧,乾淨,可靠,功能強大且易破解的內核,Rinari將避開大部分「花裏胡哨」的功能。但這並不是說這些額外的好東西可能沒有用處。

此頁面應該作爲鏈接到一些其他工具/軟件包的鏈接,這些工具/軟件包一般適用於Rinari和Rails。如果您對此列表中的新增內容有任何建議,或對於新的Rinari功能有任何建議,請通過http://groups.google.com/group/emacs-on-rails與我們聯繫。

基本方式主要爲使用Rails

大部分這些東西是從Rinari的文檔複製的。正如您可能已經猜到的,我更喜歡Rinary over emacs-rails。看看這兩個項目的活動 - emacs-rails大約一年沒有任何變化,而rinary仍在開發中。

+0

根據其描述,Rinari聽起來就像我在尋找的,但當前版本託管在Github上已損壞,正如我在[此評論]中指出的那樣, (http://stackoverflow.com/questions/2713096/emacs-rails-vs-rinari#comment17458856_2736256)。 – 2012-10-15 08:54:31

+0

我個人使用[Emacs Prelude](http://github.com/bbatsov/prelude)進行Rails開發。捆綁的'projectile'擴展爲我提供了我需要的項目導航功能,而我並不真正關心Rinari的其他功能。 – 2012-10-15 09:52:13

+0

我加了一個關於'射彈'的答案。順便說一句,你太謙虛了,不提這是你的工作。 :) – 2012-10-16 09:44:47

0

我試過Aptana Studio IDE(開源),它處理Rails項目。我發現我主要用它來瀏覽Rails項目的文件,因爲我更喜歡用Emacs來編輯文件,所以我暫時把Aptana放在一旁。 (但它在調試後可能會派上用場,所以我並沒有完全放棄它。)

我最近嘗試了不同的Emacs擴展來幫助Rails開發:ECB(Emacs代碼瀏覽器),Rinari和我遺忘的其他東西,其中沒有一個我完全滿意,或者無法工作。然而,我現在很開心地使用projectile,這是Bozhidar Batsov在上面評論中提到的。它增加了在項目中查找文件以及在其中查找文件的便利。它也不是隻針對Rails項目。

我最近發現的另一個非常有用的Emacs插件是tabbar擴展,它有點像瀏覽器的標籤欄。我將打開的選項卡中的導航與我的M左鍵和M右鍵關聯,這使得緩衝區之間的切換比以前更加方便。

與Emcas繼續,有bubble-buffer(下面的代碼),與我可以只按一個鍵(F5在我的情況),以緩衝區內容切換到最近訪問過的文件 - 雖然tabbar使這是一個有點畫蛇添足。我還包括用C-DEL立即殺死一個緩衝區的代碼,再加上一些很好的小函數,可以在保持點不變的情況下上下滾動緩衝區,只要它不會離開屏幕;此處的代碼將它們綁定到數字小鍵盤的*/。 (這些都不是我自己的工作。)

;; Use F5 to switch between buffers. Use C-DEL to remove the current buffer 
;; from the stack and retrieve the next buffer. The most-frequented buffers are 
;; always on the top of the stack. (Copied, with changes and a bugfix, from 
;; http://geosoft.no/development/emacs.html.) 
(defvar LIMIT 1) 
(defvar time 0) 
(defvar mylist nil) 
(defun time-now() 
    (car (cdr (current-time)))) 
(defun bubble-buffer() 
    (interactive) 
    (if (or (> (- (time-now) time) LIMIT) (null mylist)) 
     (progn (setq mylist (copy-alist (buffer-list))) 
      (delq (get-buffer " *Minibuf-0*") mylist) 
      (delq (get-buffer " *Minibuf-1*") mylist))) 
    (bury-buffer (car mylist)) 
    (setq mylist (cdr mylist)) 
    (setq newtop (car mylist)) 
    (switch-to-buffer (car mylist)) 
    (setq rest (cdr (copy-alist mylist))) 
    (while rest 
    (bury-buffer (car rest)) 
    (setq rest (cdr rest))) 
    (setq time (time-now))) 
(global-set-key [f5] 'bubble-buffer) 
(defun kill-buffer-without-questions() 
    ;; Kill default buffer without the extra emacs questions 
    (interactive) 
    (kill-buffer (buffer-name))) 
(global-set-key [C-delete] 'kill-buffer-without-questions) 

;; Scroll up and down without moving the cursor by pressing the numeric keypad's 
;; "/" and "*" keys. 
(defun scroll-down-keep-cursor() 
    ;; Scroll the text one line down while keeping the cursor 
    (interactive) 
    (scroll-down 1)) 
(defun scroll-up-keep-cursor() 
    ;; Scroll the text one line up while keeping the cursor 
    (interactive) 
    (scroll-up 1)) 
(global-set-key [kp-divide] 'scroll-down-keep-cursor) 
(global-set-key [kp-multiply] 'scroll-up-keep-cursor) 
相關問題