Emacs的功能,软件包,附加组件等可以帮助您完成日常的Ruby On Rails开发?
Emacs的功能,软件包,附加组件等可以帮助您完成日常的Ruby On Rails开发?
两者的早期版本 emacs的护栏 模式,和 Rinari(Rails开发的两种最流行的模式)非常丰富,但是臃肿和繁琐。为了保持一个小巧,干净,可靠,功能强大且可以破解的核心,Rinari将避开许多“铃声和口哨”类型的功能。然而,这并不是说这些额外的好东西可能没用。
这个页面应该作为编组点,用于链接到一般与Rinari和Rails一起使用的一些其他工具/包。如果您对此列表或新Rinari功能有任何想法,请通过以下方式告知我们 http://groups.google.com/group/emacs-on-rails。
使用Rails的基本主要模式
Ruby模式,以及其他一些常规 可以找到Ruby-Emacs的好东西 你的红宝石的/ misc目录 分配和 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/misc/ (它也默认与Emacs 23.1捆绑在一起)
CSS模式 http://www.emacswiki.org/cgi-bin/emacs/css-mode-simple.el
JavaScript模式 http://www.emacswiki.org/cgi-bin/wiki/JavaScriptMode#toc1 其他工具
Rhtml Mode次要模式进行编辑 rhtml文件(没有MMM-Mode)看 RHTML模式
片段 http://code.google.com/p/yasnippet/ 和Rails片段 http://github.com/eschulte/yasnippets-rails/tree/master
ruby-debug支持 http://groups.google.com/group/emacs-on-rails/browse_thread/thread/dfaa224905b51487
偶像模式 http://www.emacswiki.org/cgi-bin/wiki/InteractivelyDoThings
nxhtml模式 - Emacs中Web开发的最佳模式 - 用于编辑erb文件的rhtml模式的一个很好的替代方案。
大部分内容都是从Rinari的文档中复制而来的。你可能已经猜到了我更喜欢Rinary而不是emacs-rails。看看这两个项目的活动 - emacs-rails大约一年没有任何变化,而rinary仍在开发中。
我用 emacs-rails
以及编辑css,js的一些模式(咖啡模式),haml,sass,yaml和片段模式(亚斯 - 摘录)。有关emacs的概述,请查看 Ruby on Rails上的wiki页面。。
我试过了 Aptana工作室 IDE(开源),处理Rails项目。我发现我主要使用它在Rails项目的文件中导航,因为我更喜欢使用Emacs来编辑文件,所以我暂时将Aptana放在一边。 (但是在调试时它可能会派上用场,所以我不会完全解雇它。)
我最近尝试了不同的Emacs扩展来帮助Rails开发:ECB(Emacs代码浏览器),Rinari,以及我忘记的其他东西,其中没有一个我完全满意,或者无法工作。但是,我现在很高兴使用 projectile
,Bozhidar Batsov在上面的评论中提到过。它增加了在项目中查找文件和在项目中进行grepping的便利性。它也不仅仅适用于Rails项目。
我最近发现的另一个非常有用的Emacs插件是 tabbar
扩展,有点像浏览器的标签栏。我已将打开的标签中的导航绑定到我的M-leftarrow和M-rightarrow键,这使得在缓冲区之间切换比以前更方便。
继续与埃卡斯,有 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)