Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
129 lines (103 sloc) 3.89 KB
(add-to-list 'load-path "~/.emacs.d/vendor")
(add-to-list 'load-path "~/.emacs.d/vendor/ruby-mode")
(add-to-list 'load-path "~/.emacs.d/vendor/color-theme-6.6.0")
(add-to-list 'load-path "~/.emacs.d/vendor/emacs-rails")
(add-to-list 'load-path "~/.emacs.d/vendor/magit-0.7")
(add-to-list 'load-path "~/.emacs.d/vendor/rhtml")
(add-to-list 'load-path "~/.emacs.d/vendor/anything")
;; Show colors on emacs shell window
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;; F5 to refresh a file
(defun refresh-file ()
(interactive)
(revert-buffer t t t))
(global-set-key [f6] 'refresh-file)
;; Remove all the unecessary gui stuff
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
;; ido mode to interactively visit files and buffers
(require 'ido)
(ido-mode t)
;; Autoload rails mode and dependencies
(autoload 'ruby-mode "ruby-mode" "Major mode for editing ruby scripts." t)
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . ruby-mode))
(setq auto-mode-alist (cons '(".rb$" . ruby-mode) auto-mode-alist))
(require 'snippet)
;; emacs-rails
(require 'rails)
;; rinari's rhtml mode
(require 'rhtml-mode)
(setq auto-mode-alist (cons '(".rhtml$" . rhtml-mode) auto-mode-alist))
(setq auto-mode-alist (cons '(".html.erb$" . rhtml-mode) auto-mode-alist))
;; yaml mode
(require 'yaml-mode)
(setq auto-mode-alist (cons '(".yml$" . yaml-mode) auto-mode-alist))
;; disable backup
(setq backup-inhibited t)
;; disable auto save
(setq auto-save-default nil)
(setq auto-save-interval 0)
;; disable abbrevs
(setq save-abbrevs nil)
;; make emacs use the clipboard
(setq x-select-enable-clipboard t)
(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
;; prevent initial splash screen
(setq inhibit-splash-screen t)
;; initialize color themes
(require 'color-theme)
(color-theme-initialize)
;; favorite themes
(color-theme-dark-laptop)
;(color-theme-charcoal-black)
;(color-theme-gnome2)
;(color-theme-custom)
;; delete trailing whitespaces on save
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
(setq show-trailing-whitespace t)
(require 'magit)
(require 'apache-mode)
;; remove ruby utf-8 magic comment
(setq ruby-insert-encoding-magic-comment nil)
(require 'haml-mode)
(require 'sass-mode)
;; indent javascripts with 2 spaces
(setq js-indent-level 2)
;; New hotkey commands
(keyboard-translate ?\C-t ?\C-x)
(keyboard-translate ?\C-x ?\C-t)
(global-set-key "\C-x\C-m" 'execute-extended-command)
(define-key rhtml-mode-map "\C-x\C-m" 'execute-extended-command) ; overrride
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-c\C-k" 'kill-region)
(global-set-key "\C-h" 'backward-delete-char)
(global-set-key (kbd "S-C-<left>") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-<right>") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-<down>") 'shrink-window)
(global-set-key (kbd "S-C-<up>") 'enlarge-window)
(global-set-key (kbd "C-x <up>") 'windmove-up)
(global-set-key (kbd "C-x <down>") 'windmove-down)
(global-set-key (kbd "C-x <right>") 'windmove-right)
(global-set-key (kbd "C-x <left>") 'windmove-left)
(global-set-key "\C-c\C-g" 'previous-buffer)
(global-set-key "\C-c\C-r" 'next-buffer)
(global-set-key "\M-%" 'query-replace-regexp)
(global-set-key "\M-k" 'kill-whole-line)
(require 'elisp-load-dir)
(elisp-load-dir "~/.emacs.d/mtoledo/")
(setq auto-mode-alist (cons '(".zsh$" . sh-mode) auto-mode-alist))
(require 'anything-config)
(require 'anything-etags)
(setq anything-sources '(anything-c-source-buffers
anything-c-source-file-name-history
; anything-c-source-info-pages
; anything-c-source-info-elisp
; anything-c-source-man-pages
; anything-c-source-locate
anything-c-source-emacs-commands))
(require 'textmate)
(textmate-mode)
(require 'php-mode)