;; .emacs
;; date: april 16, 2008
;; setup load path
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(add-to-list 'load-path "~/.emacs.d/site-lisp/ecb-2.32")
;; cedet and semantic stuff
(load-file "~/.emacs.d/site-lisp/cedet-1.0pre4/common/cedet.el")
(setq semanticdb-default-save-directory "~/.emacs.d/semanticdb")
(semantic-load-enable-gaudy-code-helpers)
(require 'ido) ; interactively do things
(ido-mode t) ; enable
(require 'ecb) ; emacs code browser
(require 'ecb-autoloads) ; autoloads
;;;;; general config preferences ;;;;;
;; enable modes by default
(column-number-mode t) ; display column numbers
(delete-selection-mode t) ; overwrite selection with typing
(global-hl-line-mode t) ; highlight the current line
(mouse-wheel-mode t) ; enable mouse wheels
(resize-minibuffer-mode t) ; minibuffer scales to fit content
(show-paren-mode t) ; highlight matching parens
(transient-mark-mode t) ; highlight the current selection
(c-subword-mode t) ; camel-case and '_' as word boundaries
(setq inhibit-startup-screen t) ; no splash screen
(setq make-backup-files nil) ; no annoying ~ backup files
(setq-default indent-tabs-mode nil) ; indent using spaces by default
(setq-default tab-width 4) ; indent to 4 characters by default
(fset 'yes-or-no-p 'y-or-n-p) ; Make "yes or no" "y or n"
(setq font-lock-maximum-decoration t) ; maximizing font coloration
(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
(add-to-list 'vc-handled-backends 'SVN) ; setup svn
;; transparency for carbon-emacs
(set-frame-parameter nil 'alpha '(97))
; 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)
;;;;; function definitions ;;;;;
;; Fullscreen editing
(defun fullscreen ()
(interactive)
(set-frame-parameter nil 'fullscreen
(if (frame-parameter nil 'fullscreen) nil 'fullboth)))
;;;; 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-step 1) ; Scroll one line at a time
;;;; keybindings ;;;;
;; fullscreen
(global-set-key [f11] '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 [f2] 'undo)
;;;; modes ;;;;
;; python
(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
;; for emacsclient to connect
(server-start)