Created
July 4, 2012 08:39
-
-
Save videlalvaro/3046124 to your computer and use it in GitHub Desktop.
my emacs file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (add-to-list 'load-path "~/Library/emacs") | |
| ;; js-mode | |
| (autoload 'js2-mode "js2" nil t) | |
| (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) | |
| ;; less-mode | |
| (require 'less-css-mode) | |
| ;;erlang-mode | |
| (setq load-path (cons "/usr/local/lib/erlang/lib/tools-2.6.6.3/emacs" | |
| load-path)) | |
| (setq erlang-root-dir "/usr/local/lib/erlang") | |
| (setq exec-path (cons "/usr/local/lib/erlang/bin" exec-path)) | |
| (require 'erlang-start) | |
| (defvar inferior-erlang-prompt-timeout t) | |
| (add-to-list 'auto-mode-alist '("\\.erl?$" . erlang-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.hrl?$" . erlang-mode)) | |
| (defun my-erlang-mode-hook () | |
| ;; when starting an Erlang shell in Emacs, default in the node name | |
| (setq inferior-erlang-machine-options '("-sname" "emacs")) | |
| ;; add Erlang functions to an imenu menu | |
| (imenu-add-to-menubar "imenu") | |
| ;; customize keys | |
| (local-set-key [return] 'newline-and-indent) | |
| ) | |
| ;; Some Erlang customizations | |
| (add-hook 'erlang-mode-hook 'my-erlang-mode-hook) | |
| (add-to-list 'load-path "~/Library/emacs/distel/elisp") | |
| (require 'distel) | |
| (distel-setup) | |
| (load "~/Library/emacs/haskellmode-emacs/haskell-site-file") | |
| (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
| (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) | |
| ;; parentheses mode | |
| (add-to-list 'load-path "~/Library/emacs/highlight-parentheses") | |
| (require 'highlight-parentheses) | |
| (define-globalized-minor-mode global-highlight-parentheses-mode | |
| highlight-parentheses-mode | |
| (lambda () | |
| (highlight-parentheses-mode t))) | |
| (global-highlight-parentheses-mode t) | |
| ;; color themes | |
| (add-to-list 'load-path "~/Library/emacs/color-theme") | |
| (require 'color-theme) | |
| (eval-after-load "color-theme" | |
| '(progn | |
| (color-theme-initialize) | |
| (color-theme-arjen))) | |
| ;; tabs as spaces | |
| (setq-default indent-tabs-mode nil) | |
| ;; file backups | |
| (setq make-backup-files t) | |
| (setq version-control t) | |
| (setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/")))) | |
| ;; line numbering | |
| (line-number-mode 1) | |
| (column-number-mode 1) | |
| (transient-mark-mode 1) ; highlight text selection | |
| (delete-selection-mode 1) ; delete selected text when typing | |
| ;; always remove whitespace after save. | |
| (add-hook 'before-save-hook 'delete-trailing-whitespace) | |
| (custom-set-variables | |
| ;; custom-set-variables was added by Custom. | |
| ;; If you edit it by hand, you could mess it up, so be careful. | |
| ;; Your init file should contain only one such instance. | |
| ;; If there is more than one, they won't work right. | |
| '(column-number-mode t) | |
| '(scroll-bar-mode nil) | |
| '(size-indication-mode t) | |
| '(slime-net-coding-system (quote utf-8-unix)) | |
| '(tool-bar-mode nil)) | |
| (custom-set-faces | |
| ;; custom-set-faces was added by Custom. | |
| ;; If you edit it by hand, you could mess it up, so be careful. | |
| ;; Your init file should contain only one such instance. | |
| ;; If there is more than one, they won't work right. | |
| ) | |
| (add-to-list 'load-path "~/Library/emacs/yaml-mode") | |
| (require 'yaml-mode) | |
| (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode)) | |
| ;; PHP mode | |
| (setq c-basic-offset 4) | |
| (add-to-list 'load-path "~/Library/emacs/pi-php-mode") | |
| (load "pi-php-mode") | |
| (add-to-list 'auto-mode-alist '("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode)) | |
| ;; run php lint when press f8 key | |
| ;; php lint | |
| (defun phplint-thisfile () | |
| (interactive) | |
| (compile (format "php -l %s" (buffer-file-name)))) | |
| (add-hook 'php-mode-hook | |
| '(lambda () | |
| (local-set-key [f8] 'phplint-thisfile))) | |
| ;; end of php lint | |
| ;;; This was installed by package-install.el. | |
| ;;; This provides support for the package system and | |
| ;;; interfacing with ELPA, the package archive. | |
| ;;; Move this code earlier if you want to reference | |
| ;;; packages in your .emacs. | |
| (when | |
| (load | |
| (expand-file-name "~/.emacs.d/elpa/package.el")) | |
| (package-initialize)) | |
| ;; GIT | |
| (add-to-list 'load-path "~/Library/emacs/magit/") | |
| (require 'magit) | |
| ;; mk-project | |
| (add-to-list 'load-path "~/Library/emacs/mk-project") | |
| (require 'mk-project) | |
| (global-set-key "\C-cpf" 'project-find-file-ido) | |
| ;;IDO MODE | |
| (ido-mode t) | |
| (setq ido-enable-flex-matching t) | |
| ;; ORG MODE | |
| (require 'org) | |
| (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) | |
| (define-key global-map "\C-cl" 'org-store-link) | |
| (define-key global-map "\C-ca" 'org-agenda) | |
| (setq org-log-done t) | |
| ;; MARKDOWN | |
| (autoload 'markdown-mode "markdown-mode.el" | |
| "Major mode for editing Markdown files" t) | |
| (setq auto-mode-alist | |
| (cons '("\\.md" . markdown-mode) auto-mode-alist)) | |
| (setenv "PATH" (getenv "PATH")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment