Skip to content

Instantly share code, notes, and snippets.

@eethann
Created June 4, 2012 21:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eethann/2870931 to your computer and use it in GitHub Desktop.
Save eethann/2870931 to your computer and use it in GitHub Desktop.
el-git drupal init.el
(add-to-list 'load-path "~/.emacs.d/elisp")
(add-to-list 'load-path "~/.emacs.d/elisp/php-mode")
(add-to-list 'load-path "~/.emacs.d/elisp/deft")
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil t)
(url-retrieve
"https://github.com/dimitri/el-get/raw/master/el-get-install.el"
(lambda (s)
(end-of-buffer)
(eval-print-last-sexp))))
;; now either el-get is `require'd already, or have been `load'ed by the
;; el-get installer.
(setq
el-get-sources
'(el-get ; el-get is self-hosting
escreen ; screen for emacs, C-\ C-h
php-mode-improved ; if you're into php...
switch-window ; takes over C-x o
auto-complete ; complete as you type with overlays
zencoding-mode ; http://www.emacswiki.org/emacs/ZenCoding
color-theme-solarized
color-theme-railscasts
rainbow-delimiters
paredit
any-ini-mode
clojure-mode
sunrise-commander
doxymacs
paredit
full-ack
; gist
pastebin
lua-mode
markdown-mode
css-mode
(:name yasnippet
:type git
:url "git://github.com/capitaomorte/yasnippet.git")
(:name flymake-jslint
:type git
:url "git://github.com/purcell/flymake-jslint.git"
:after (lambda ()
(add-hook 'js-mode-hook (lambda () (flymake-mode t)))))
(:name todotxt
:type git
:url "git://github.com/rpdillon/todotxt.el.git"
:features todotxt
:after (lambda ()
(global-set-key (kbd "C-x t") 'todotxt)
(setq todotxt-file "~/notes/todo.txt")))
(:name buffer-move ; have to add your own keys
:after (lambda ()
(global-set-key (kbd "<C-S-up>") 'buf-move-up)
(global-set-key (kbd "<C-S-down>") 'buf-move-down)
(global-set-key (kbd "<C-S-left>") 'buf-move-left)
(global-set-key (kbd "<C-S-right>") 'buf-move-right)))
(:name smex ; a better (ido like) M-x
:after (lambda ()
(setq smex-save-file "~/.emacs.d/.smex-items")
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)))
(:name egg ; git meet emacs, and a
; binding
:url "https://github.com/byplayer/egg.git"
:after (lambda ()
(global-set-key (kbd "C-x C-z") 'egg-status)))
(:name goto-last-change ; move pointer back to last change
:after (lambda ()
;; when using AZERTY keyboard, consider C-x C-_
(global-set-key (kbd "C-x C-/") 'goto-last-change)))
(:name asciidoc
:type elpa
:after (lambda ()
(autoload 'doc-mode "doc-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.adoc$" . doc-mode))
(add-hook 'doc-mode-hook '(lambda () (turn-on-auto-fill) (require 'asciidoc)))))
(:name deft
:after (lambda ()
(setq deft-extension "mkd")
(setq deft-directory "~/notes")
(setq deft-text-mode 'markdown-mode)
(setq deft-use-filename-as-title t)
(global-set-key (kbd "<F8>") 'deft)
(global-set-key (kbd "C-c d") 'deft)))
))
(unless (string-match "apple-darwin" system-configuration)
(loop for p in '(color-theme ; nice looking emacs
color-theme-solarized ; check out color-theme-solarized
)
do (add-to-list 'el-get-sources p)))
;; List of packages I'd like to install
(setq my-packages
(append
'(el-get
switch-window
vkill)
(mapcar 'el-get-source-name el-get-sources)))
(el-get 'sync my-packages)
;; OLD: install new packages and init already installed packages
;; (el-get 'sync)
(require 'color-theme)
(require 'color-theme-solarized)
(color-theme-solarized-dark)
(require 'org)
(require 'markdown-mode)
(when (require 'deft nil 'noerror)
)
;; Electric Settings
(electric-pair-mode t)
(electric-indent-mode t)
(electric-layout-mode t)
;; EGG Settings
(require 'egg)
;; IDO settings
(setq ido-enable-flex-matching t)
;; Helm Settings
(global-set-key (kbd "C-c h") 'helm-mini)
;; From drupal-emacs project
(fset 'yes-or-no-p 'y-or-n-p) ;replace y-e-s by y
(setq x-select-enable-primary nil)
(setq x-select-enable-clipboard t)
(setq visible-bell t)
(autoload 'php-mode "php-mode" "Major mode for editing PHP" t)
(autoload 'drupal-mode "drupal-mode" "Major mode for editing DRUPAL php code." t)
(autoload 'geben "geben" "PHP Debugger on Emacs" t)
(add-to-list 'auto-mode-alist '("\\.php$" . drupal-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . drupal-mode))
(add-to-list 'auto-mode-alist '("\\.module$" . drupal-mode))
(add-to-list 'auto-mode-alist '("\\.install$" . drupal-mode))
(add-hook 'drupal-mode-hook #'(lambda () (projectile-mode)))
(add-hook 'php-mode-hook #'(lambda () (projectile-mode)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment