Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; emacs configuration
- (push "/usr/local/bin" exec-path)
- (add-to-list 'load-path "~/.emacs.d/elpa")
- (setq x-select-enable-clipboard t)
- (global-set-key (kbd "C-y") 'redo)
- (global-set-key (kbd "<f2>") 'clipboard-kill-region)
- (global-set-key (kbd "<f3>") 'clipboard-kill-ring-save)
- (global-set-key (kbd "<f4>") 'yank) ; paste
- (global-set-key (kbd "<f5>") 'undo)
- (global-set-key (kbd "<home>") 'move-beginning-of-line)
- (global-set-key (kbd "<end>") 'move-end-of-line)
- ;;(global-set-key (kbd "C-z") 'undo)
- ;;(global-set-key (kbd "C-c") 'clipboard-kill-ring-save)
- ;;(global-set-key (kbd "C-v") 'yank)
- ;;(global-set-key (kbd "C-x") 'clipboard-kill-region)
- ;;(global-set-key (kbd "<C-f4>") 'yank-pop) ; paste previous
- (setq make-backup-files nil)
- (setq auto-save-default nil)
- (setq-default tab-width 2)
- (setq-default indent-tabs-mode nil)
- (setq inhibit-startup-message t)
- (fset 'yes-or-no-p 'y-or-n-p)
- (delete-selection-mode t)
- (scroll-bar-mode -1)
- ;;(tool-bar-mode -1)
- (blink-cursor-mode t)
- (show-paren-mode t)
- (column-number-mode t)
- (set-fringe-style -1)
- (tooltip-mode -1)
- (set-frame-font "Menlo-16")
- (load-theme 'tango)
- (require 'package)
- (package-initialize)
- (add-to-list
- 'package-archives
- '("melpa" . "http://melpa.milkbox.net/packages/") t)
- (add-to-list
- 'package-archives
- '("github" . "https://github.com/auto-complete/") t)
- (when (not package-archive-contents)
- (package-refresh-contents))
- (setq url-http-attempt-keepalives nil)
- ;;(add-to-list
- ;; 'ac-dictionary-directories "~/.emacs.d/elpa/auto-complete-1.3.1/dict")
- ;; (require 'auto-complete-config)
- ;;(ac-config-default)
- (add-to-list 'load-path "~/.emacs.d")
- (defun ruby-mode-hook ()
- (autoload 'ruby-mode "ruby-mode" nil t)
- (add-to-list 'auto-mode-alist '("Capfile" . ruby-mode))
- (add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
- (add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
- (add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
- (add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
- (add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode))
- (add-hook 'ruby-mode-hook '(lambda ()
- (setq ruby-deep-arglist t)
- (setq ruby-deep-indent-paren (setq load-path (cons "~/.emacs.d/elisp" load-path))
- (require 'auto-complete)
- (require 'auto-complete-config)
- (global-auto-complete-mode t)
- nil)
- (setq c-tab-always-indent nil)
- (require 'inf-ruby)
- (package-initialize)
- (setq url-http-attempt-keepalives nil)
- (require 'ruby-compilation)
- (define-key ruby-mode-map (kbd "M-r") 'run-rails-test-or-ruby-buffer))))
- (defun rhtml-mode-hook ()
- (autoload 'rhtml-mode "rhtml-mode" nil t)
- (add-to-list 'auto-mode-alist '("\\.erb\\'" . rhtml-mode))
- (add-to-list 'auto-mode-alist '("\\.rjs\\'" . rhtml-mode))
- (add-hook 'rhtml-mode '(lambda ()
- (define-key rhtml-mode-map (kbd "M-s") 'save-buffer))))
- (defun yaml-mode-hook ()
- (autoload 'yaml-mode "yaml-mode" nil t)
- (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
- (add-to-list 'auto-mode-alist '("\\.yaml$" . yaml-mode)))
- (defun css-mode-hook ()
- (autoload 'css-mode "css-mode" nil t)
- (add-hook 'css-mode-hook '(lambda ()
- (setq css-indent-level 2)
- (setq css-indent-offset 2))))
- (defun is-rails-project ()
- (when (textmate-project-root)
- (file-exists-p (expand-file-name "config/environment.rb" (textmate-project-root)))))
- (global-set-key (kbd "C-z") 'undo)
- (defun run-rails-test-or-ruby-buffer ()
- (interactive)
- (if (is-rails-project)
- (let* ((path (buffer-file-name))
- (filename (file-name-nondirectory path))
- (test-path (expand-file-name "test" (textmate-project-root)))
- (command (list ruby-compilation-executable "-I" test-path path)))
- (pop-to-buffer (ruby-compilation-do filename command)))
- (ruby-compilation-this-buffer)))
- (require 'package)
- (setq package-archives (cons '("tromey" . "http://tromey.com/elpa/") package-archives))
- (package-initialize)
- (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
- (require 'el-get)
- (add-to-list 'load-path (expand-file-name "~/.emacs.d/rails"))
- (require 'rails)
- (setq el-get-sources
- '((:name ruby-mode
- :type elpa
- :load "ruby-mode.el"
- :after (lambda () (ruby-mode-hook)))
- (:name inf-ruby :type elpa)
- (:name ruby-compilation :type elpa)
- (:name css-mode
- :type elpa
- :after (lambda () (css-mode-hook)))
- (:name textmate
- :type git
- :url "git://github.com/defunkt/textmate.el"
- :load "textmate.el")
- (:name rvm
- :type git
- :url "http://github.com/djwhitt/rvm.el.git"
- :load "rvm.el"
- :compile ("rvm.el")
- :after (lambda() (rvm-use-default)))
- (:name rhtml
- :type git
- :url "https://github.com/crazycode/rhtml.git"
- :features rhtml-mode
- :after (lambda () (rhtml-mode-hook)))
- (:name yaml-mode
- :type git
- :url "http://github.com/yoshiki/yaml-mode.git"
- :features yaml-mode
- :after (lambda () (yaml-mode-hook)))
- ))
- (el-get 'sync)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement