emacs-config/init.el

48 lines
1.9 KiB
EmacsLisp
Raw Normal View History

2012-11-21 23:46:21 +00:00
;; Generic Emacs stuff
(add-to-list 'load-path "~/.emacs.d")
;; Always use spaces instead of tabs, a tab is 4 spaces by default
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;; WhiteSpace hilighting
(require 'whitespace)
(setq whitespace-style (quote (face trailing tabs tab-mark empty lines-tail)))
(setq-default whitespace-line-column 80)
(global-whitespace-mode 1)
;; C, use k&r style by default (naev)
(setq-default c-default-style "k&r"
c-basic-offset 3)
2012-11-21 23:46:21 +00:00
;; Python!
;; Prevent ropemacs from overriding emacs shortcuts
;;(setq ropemacs-enable-shortcuts nil)
;;(setq ropemacs-local-prefix "C-c C-p")
;; Load of a bunch of stuff for pymacs : http://pymacs.progiciels-bpi.ca/pymacs.html#installation
;;(autoload 'pymacs-apply "pymacs")
;;(autoload 'pymacs-call "pymacs")
;;(autoload 'pymacs-eval "pymacs" nil t)
;;(autoload 'pymacs-exec "pymacs" nil t)
;;(autoload 'pymacs-load "pymacs" nil t)
;;(autoload 'pymacs-autoload "pymacs")
;;(eval-after-load "pymacs"
;; '(add-to-list 'pymacs-load-path YOUR-PYMACS-DIRECTORY"))
;;(require 'pymacs)
;; Load ropemacs
;;(pymacs-load "ropemacs" "rope-")
;; PHP and Drupal-Modes
(require 'php-mode)
(require 'drupal-mode)
(add-to-list 'auto-mode-alist '("\\.\\(module\\|test\\|install\\|theme\\)$" . drupal-mode))
(add-to-list 'auto-mode-alist '("\\.\\(php\\|inc\\)$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.info" . conf-windows-mode))
(defun my-php-hook-function ()
(set (make-local-variable 'compile-command) (format "phpcs --report=emacs --standard=PEAR %s" (buffer-file-name))))
2012-11-21 23:46:21 +00:00
(add-hook 'php-mode-hook 'my-php-hook-function)
(defun my-drupal-hook-function ()
(set (make-local-variable 'compile-command) (format "phpcs --report=emacs --extensions=php,module,inc,install,test,profile,theme --standard=Drupal %s" (buffer-file-name))))
2012-11-21 23:46:21 +00:00
(add-hook 'drupal-mode-hook 'my-drupal-hook-function)
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))