coachher /.emacs

;; .emacs
;; author: shailesh kochhar
;; date: april 16, 2008

;; load paths
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(add-to-list 'load-path "~/.emacs.d/site-lisp/ecb-2.32")

;;;;; load modules ;;;;;
;; cedet
(load-file "~/.emacs.d/site-lisp/cedet-1.0pre4/common/cedet.el")
;; mmm-mako
(load-file "~/.emacs.d/site-lisp/mmm-mako-0.2/mmm-mako.el")

;;; built-ins
(require 'mmm-auto)      ; multiple major modes
(require 'ido)           ; interactively do things
(require 'ecb)           ; emacs code browser
(require 'ecb-autoloads) ; autoloads

(setq semanticdb-default-save-directory "~/.emacs.d/semanticdb")
(semantic-load-enable-gaudy-code-helpers)  ; enable syntax highlighting with semantic
(ido-mode t)                   ; enable ido
(setq mmm-global-mode 'maybe)  ; set mmm-mode to load when necessary



;;;;; General config preferences ;;;;;
;; enable modes by default 
(c-subword-mode t)                       ; camel-case and '_' as word boundaries
(column-number-mode t)                   ; display column numbers
(delete-selection-mode t)                ; overwrite selection with typing
(global-font-lock-mode t)                ; syntax highlighing
(setq font-lock-maximum-decoration t)    ; maximizing font coloration
(global-hl-line-mode t)                  ; highlight the current line
(mouse-wheel-mode t)                     ; enable mouse wheels
(show-paren-mode t)                      ; highlight matching parens
(tool-bar-mode nil)                      ; turn off toolbar
(transient-mark-mode t)                  ; highlight the current selection

(setq-default indent-tabs-mode nil)      ; indent using spaces by default
(setq-default tab-width 4)               ; indent to 4 characters by default
(setq inhibit-startup-screen t)          ; no splash screen
(setq make-backup-files nil)             ; no annoying ~ backup files
(fset 'yes-or-no-p 'y-or-n-p)            ; Make "yes or no" "y or n"
(setq scroll-step 1)                     ; scroll one line at end of page
(setq fill-column 78)                    ; set line-wrap column to 78
(setq tramp-default-method "ssh")        ; force tramp to use ssh
(setq fill-column 78)                    ; wrap at 78 chars

(add-to-list 'vc-handled-backends 'SVN)  ; setup svn

; Enable otherwise disabled commands
(put 'set-goal-column 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'narrow-to-region 'disabled nil)



;;;; modes ;;;;
;; python
(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(autoload 'python-mode "python-mode" "Python editing mode." t)

;; mako
(add-to-list 'auto-mode-alist '("\\.mako$" . html-mode))
(mmm-add-mode-ext-class 'html-mode "\\.mako$" 'mako)



;;;; navigation ;;;;
(global-set-key '[S-down] '(lambda () (interactive) (scroll-down 1)))    ; Scroll without moving cursor
(global-set-key '[S-up] '(lambda () (interactive) (scroll-up 1)))    
(setq mouse-wheel-scroll-amount (quote (1 ((shift) . 1) ((control))))) ; Mouse scroll
(setq scroll-conservatively 10)    ; Scroll one line at a time



;;;; keybindings ;;;;
;; fullscreen
(global-set-key [f6] '(lambda () (interactive) (point-to-register ?1)))    ; F6 stores a position in a file
(global-set-key [f7] '(lambda () (interactive) (register-to-point ?1)))    ; F7 brings you back to this position
(global-set-key [f3] 'undo)