This post is just to have a copy of my init.el. I will keep it updated. Last update 18 March 2012.
(add-to-list 'load-path "~/.emacs.d/elisp")
(load "php-mode")
; (load "groovy-mode")
; turn on syntax highlighting
(global-font-lock-mode 1)
; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start
(autoload 'groovy-mode "groovy-mode" "Major mode for editing Groovy code." t)
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))
; make Groovy mode electric by default.
(add-hook 'groovy-mode-hook
'(lambda ()
(require 'groovy-electric)
(groovy-electric-mode)))
; Only spaces, no tabs, indent by 4 spaces
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
(setq indent-line-function 'insert-tab)
(defun my-c-mode-hook ()
(setq indent-tabs-mode nil
c-basic-offset 4))
(add-hook 'c-mode-common-hook 'my-c-mode-hook)
; Indent when going to a new line
(define-key global-map (kbd "RET") 'newline-and-indent)
; Always end a file with a newline
(setq require-final-newline nil)
; scroll one line at a time (less "jumpy" than defaults)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling
(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse
(setq scroll-step 1) ;; keyboard scroll one line at a time
(setq scroll-step 1
scroll-conservatively 10000) ;; smooth scrolling
; set font size in points * 10
(set-face-attribute 'default nil :height 90)
; Show column-number in the mode line and line numbers on the side
(column-number-mode 1)
(global-linum-mode t)
;; ========== Place Backup Files in Specific Directory ==========
;; Enable backup files.
(setq make-backup-files t)
;; Enable versioning with default values (keep five last versions, I think!)
(setq version-control t)
;; Save all backup file in this directory.
(setq backup-directory-alist (quote ((".*" . "/tmp"))))
Recent Comments