Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

.emacs file for rails development (See related posts)

A .emacs Emacs initialization file for editing rails projects.
All depending libraries are stored in the ~/.elisp directory.

.elisp directory:

color-theme-6.6.0
ecb-2.32
eieio-0.17
emacs-rails
semantic-1.4.4
speedbar-0.14beta4
color-theme.el
find-recursive.el
ido.el
inf-ruby.el
psvn.el
ruby-electric.el
ruby-mode.el
ruby-style.el
rubydb2x.el
rubydb3x.el
snippet.el


   1  
   2  (setq load-path (cons "~/.elisp" load-path))
   3  
   4  ;; Setup initial emacs frames (windows) location and size
   5  (setq default-frame-alist
   6        '((wait-for-wm . nil)
   7  	(top . 0) (left . 0)
   8  	(width . 85) (height . 40)
   9  	(background-color . "gray15")
  10  	(foreground-color . "limegreen")
  11  	(cursor-color . "LightGoldenrod")
  12  	(mouse-color . "yellow")
  13          ))
  14  (setq initial-frame-alist 
  15        '((top . 30) (left . 300)
  16          (width . 110) (height . 55)
  17          )
  18        )
  19  
  20  ;; loads ido for easy buff switching.
  21  (require 'ido)
  22  (ido-mode t)
  23  
  24  ;; loads ruby-mode.
  25  (setq load-path (cons "~/.elisp/ruby-mode" load-path))
  26  (autoload 'ruby-mode "ruby-mode" "Load ruby-mode")
  27  (add-hook 'ruby-mode-hook 'turn-on-font-lock)
  28  
  29  ;; loads emacs-rails.
  30  (require 'snippet)
  31  (require 'find-recursive)
  32  (setq load-path (cons "~/.elisp/emacs-rails" load-path))
  33  (defun try-complete-abbrev (old)
  34    (if (expand-abbrev) t nil))
  35  
  36  (setq hippie-expand-try-functions-list
  37        '(try-complete-abbrev
  38          try-complete-file-name
  39          try-expand-dabbrev))
  40  
  41  (require 'rails)
  42  
  43  ;; associate ruby-mode with .rb and .rhtml files
  44  (add-to-list 'auto-mode-alist '("\.rb$" . ruby-mode))
  45  (add-to-list 'auto-mode-alist '("\.rhtml$". html-mode))
  46  
  47  ;; make #! scripts executable after saving them
  48  (add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
  49  
  50  ;; loads svn mode.
  51  ;;(require 'psvn)
  52  
  53  ;; If you have own color scheme and don't like to use emacs default
  54  ;; I recommend to use this package:
  55  ;; http://www.emacswiki.org/cgi-bin/wiki.pl?ColorTheme
  56  (require 'color-theme)
  57  (setq color-theme-is-global t)
  58  (color-theme-gray30)
  59  
  60  ;; These lines are required for ECB
  61  (add-to-list 'load-path "~/.elisp/eieio-0.17")
  62  (add-to-list 'load-path "~/.elisp/speedbar-0.14beta4")
  63  (add-to-list 'load-path "~/.elisp/semantic-1.4.4")
  64  (setq semantic-load-turn-everything-on t)
  65  (require 'semantic-load)
  66  ;; This installs ecb - it is activated with M-x ecb-activate
  67  (add-to-list 'load-path "~/.elisp/ecb-2.32")
  68  (require 'ecb-autoloads)
  69  (setq ecb-layout-name "left14")
  70  (setq ecb-layout-window-sizes (quote (("left14" (0.2564102564102564 . 0.6949152542372882) (0.2564102564102564 . 0.23728813559322035)))))

You need to create an account or log in to post comments to this site.


Click here to browse all 5276 code snippets

Related Posts