Tom Willis committed 8f8d9f4

a years worth of updates

  • Participants
  • Parent commits bf568be

Comments (0)

Files changed (23)

 ;; disable scroll bar, tool bar and menu bar to maximize real estate
 ;; for editing.
+;; automatic integration with clipboard
+(setq x-select-enable-clipboard t)
+;;strip down gui
 (if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
 (if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
-(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
+(if (fboundp 'menu-bar-mode) (menu-bar-mode t))
 ;;paren matching minor mode
+;; default window size
+;; (add-to-list 'default-frame-alist '(left . 0))
+;; (add-to-list 'default-frame-alist '(top . 0))
+;; (add-to-list 'default-frame-alist '(height . 800))
+;; (add-to-list 'default-frame-alist '(width . 1300))
 ;; turn on line numbers globally
 (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
-;; visual line mode
 ;;default terminal colors
 (setq term-default-bg-color "#000000")
 (setq term-default-fg-color "#dddd00")
-(provide 'defaults)
+;; associate various file types with modes
+(add-to-list 'auto-mode-alist '("\\.pt\\'" . nxml-mode))
+(add-to-list 'auto-mode-alist '("\\.html\\'" . nxml-mode))
+;; like ibuffer
+(defalias 'list-buffers 'ibuffer)
+;; tell programs the term is perfectly fine
+(setenv "TERM" "xterm")
-;; bootstraps everything
+;;;; emacs initialization file init.el ;;;;
+;; should be path where emacs was initiated set it back at the end to
+;; insure, not init file hijacked it and dropped the user somewhere
+;; they didn't expect to be
+(setq init-path (expand-file-name "."))
 ;; just in case one of these hijacks the path of the editor starts in
 ;; we'll save it for resetting at the end
-(setq init-path (expand-file-name "."))
+(setq local (expand-file-name "~/local"))
+(setq local-bin (concat local "/bin"))
+(setenv "PATH" (concat local-bin ":" (getenv "PATH"))) 
-(setq emacs-config-modules-dir (mapconcat 'identity (list
-					emacs-config-dir "modes") "/"))
+(setq emacs-config-modules-dir 
+      (concat emacs-config-dir "/modes"))
 (add-to-list 'load-path emacs-config-modules-dir)
 ;; run defaults.el
-(load-file (mapconcat 'identity (list emacs-config-dir "defaults.el") "/"))
+(load-file (concat emacs-config-dir "/defaults.el"))
 ;; run modules.el
-(load-file (mapconcat 'identity (list emacs-config-dir "modules.el") "/"))
+(load-file (concat emacs-config-dir "/modules.el"))
 ;; run keys.el
-(load-file (mapconcat 'identity (list emacs-config-dir "keys.el") "/"))
+(load-file (concat emacs-config-dir "/keys.el"))
-;;insure we're on the path the user expected
 (cd init-path)
 (global-set-key (kbd "<C-tab>") 'bury-buffer)
+(global-set-key (kbd "<f7>") 'compile)
+(global-set-key (kbd "<M-f1>") 'ibuffer)
 (provide 'keys)


+(require 'auto-complete)
+(global-auto-complete-mode t)


-;;; ECB and CEDET
-(setq cedet-dir (mapconcat 'identity (list emacs-lib-dir "cedet-1.0pre6") "/"))
-(setq cedet-common-dir (mapconcat 'identity (list cedet-dir "common") "/"))
-(setq ecb-dir (mapconcat 'identity (list emacs-lib-dir "ecb-2.40") "/"))
-;;add to load-path
-(add-to-list 'load-path cedet-dir)
-(add-to-list 'load-path cedet-common-dir)
-(add-to-list 'load-path ecb-dir)
-;; CEDET and ECB
-(require 'cedet)
-(require 'ecb)
-(setq ecb-tip-of-the-day nil)
-;; (global-ede-mode 1) ;; project mode
-;; (semantic-load-enable-code-helpers);; prototype help and smart completion
-;; (global-srecode-minor-mode 1) ;;template insertion 
-;; (global-semantic-idle-completions-mode)
-;;(setq ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
-(provide 'cedet-config)
+;; configure cedet globally
+(load-file (concat emacs-lib-dir "/cedet-1.0/common/cedet.el"))


+;; configure cedet globally
+(add-to-list  'load-path (concat emacs-lib-dir "/ecb-2.40"))
+(require 'ecb)


-;;erc settings
-(require 'erc)
-;;default channels list
+;; erc config file
+(setq erc-autojoin-mode t)
 (setq erc-autojoin-channels-alist
-'(("" "#repoze" "#python" "#pylons" "#mercurial" "#emacs")))
-;; display colors
-(setq erc-interpret-mirc-color t)
-;; Kill buffers for channels after /part
-(setq erc-kill-buffer-on-part t)
-;; Kill buffers for private queries after quitting the server
-(setq erc-kill-queries-on-quit t)
-;; Kill buffers for server messages after quitting the server
-(setq erc-kill-server-buffer-on-quit t)
+          '(("*" "#pyramid" "#pylons" "#toscawidgets" "#appengine" "#mercurial" "#turbogears")))


+;; expand-region
+(add-to-list 'load-path (concat emacs-lib-dir "/" "expand-region"))
+;; (add-hook 'nxml-mode-hook 'er/add-html-mode-expansions) 
+(require 'expand-region)
+(global-set-key (kbd "C-@") 'er/expand-region)


-;;configure flymake global 
+;; gui warnings are annoying
+(setq flymake-gui-warnings-enabled nil)
+;; (setq flymake-log-level 3)
 ;;shortcut keys for running through errors list
 (add-hook 'flymake-mode-hook 
       (lambda () 
-        (local-set-key [f2] 'flymake-goto-prev-error)
-        (local-set-key [f3] 'flymake-goto-next-error)
+        (local-set-key [f5] 'flymake-goto-prev-error)
+        (local-set-key [f6] 'flymake-goto-next-error)
-(load "~/emacs.d/lib/flymake-cursor");;puts errors in status bar
+(load (concat emacs-lib-dir "/" "flymake-cursor.el"));;puts errors in status bar


+(add-to-list 'load-path (concat emacs-lib-dir "/emacs-jabber-0.8.0"))
+(require 'jabber-autoloads)
+;; accounts
+(load-file  "~/.jabber-accounts.el")
+;; dont clobber me bro
+;; (define-jabber-alert echo "Show a message in the echo area"
+;;   (lambda (msg)
+;;     (unless (minibuffer-prompt)
+;;       (message "%s" msg))))


+;; Setting up all things for java, it won't be as good as eclipse
+;; but who cares
+(setq cedet-home (concat emacs-lib-dir "/" "cedet-1.0"))
+(setq ecb-home (concat emacs-lib-dir "/" "ecb-2.40"))
+(add-to-list 'load-path (concat cedet-home "/" "common"))
+(add-to-list 'load-path (concat ecb-home))
+;; jde mode
+(setq jdee-home (concat emacs-lib-dir "/" "jdee-"))
+(add-to-list 'load-path (concat jdee-home "/lisp"))
+(load-file (concat cedet-home "/common/" "cedet.el"))
+;;(load-file (concat ecb-home "/" "ecb.el"))
+(autoload 'ecb "ecb" t)
+(autoload 'jde "jde" t)
+;;malabar-mode can't get it to work
+;; (require 'cedet)
+;; (semantic-load-enable-minimum-features) ;; or enable more if you wish
+;; (setq malabar-home (concat emacs-lib-dir "/" "malabar-1.0"))
+;; (add-to-list 'load-path (concat malabar-home "/lisp"))
+;; (require 'malabar-mode)
+;; (setq malabar-groovy-lib-dir (concat malabar-home "/lib"))
+;; (add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))


+(autoload 'js2-mode "js2" nil t)
+(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))


+;; mmm mode config
+(add-to-list 'load-path (concat emacs-lib-dir "/" "mmm-mode-0.4.8"))
+(require 'mmm-auto)
+(setq mmm-global-mode 'maybe)
+(mmm-add-mode-ext-class 'css-mode "\\.html\\'" 'css-mode-html)
+(mmm-add-mode-ext-class 'js2-mode "\\.html\\'" 'js2-mode-html)


+(load-file (concat emacs-lib-dir "/nyan-mode/nyan-mode.el"))


- (load-file (mapconcat 'identity (list emacs-config-modules-dir "org-babel-config.el") "/"))
 ;; associate *.org with org-mode
 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
 (setq org-agenda-include-diary t)
 (setq org-agenda-include-all-todo t)
+(setq org-directory "~/.org")
+(setq org-mobile-directory "~/Dropbox/org")
+(setq org-mobile-inbox-for-pull "~/Dropbox/org/")


-;;python-config make emacs a decent ide for python
+;; thing to make python development productive
-;;; python customizations
-(setq python-ide-dir (mapconcat 'identity (list emacs-lib-dir "python-ide") "/"))
-(add-to-list 'load-path python-ide-dir)
+;; rope doesn't play well with python's import machinery yet...
+(setq rope-dist (concat emacs-lib-dir "/rope-dist"))
-(progn (cd python-ide-dir)
-       (normal-top-level-add-subdirs-to-load-path))
-(require 'auto-complete)
-(require 'auto-complete-config)
-(require 'pymacs)
-(require 'flymake)
+(add-to-list 'load-path (concat emacs-lib-dir "/" "auto-complete"))
+;; flymake-python config
+(setq python-flymake-dir (concat emacs-lib-dir "/" "flymake-python"))
+(add-to-list 'load-path python-flymake-dir)
+(setq pyflymake (concat python-flymake-dir "/" ""))
+(setq python-make (expand-file-name 
+		   "~/emacs.d/lib/flymake-python/"))
+(when (load "flymake" t)
+  (defun flymake-pylint-init ()
+    (let* ((temp-file (flymake-init-create-temp-buffer-copy
+                       'flymake-create-temp-inplace))
+           (local-file (file-relative-name temp-file
+					   (file-name-directory 
+					    buffer-file-name))))
+      (list pyflymake (list local-file)))))
+(add-to-list 'flymake-allowed-file-name-masks
+	     '("\\.py\\'" flymake-pylint-init))
+(add-hook 'find-file-hook 'flymake-find-file-hook)
-;; flymake hooks tell flymake to run when needed
-;; should be on the path, currently calls pyflakes and
-;; pep8
-(when (load "flymake" t)
-  (defun flymake-pyflakes-init ()
-    (let* (
-	   (temp-file (flymake-init-create-temp-buffer-copy 
-		       'flymake-create-temp-inplace))
-	   (local-file (file-relative-name temp-file
-					   (file-name-directory
-					   buffer-file-name))))
-      (list "" (list local-file))))
-  (add-to-list 'flymake-allowed-file-name-masks
-	       '("\\.py\\'" flymake-pyflakes-init)))
-(add-hook 'find-file-hook 'flymake-find-file-hook)
+;; (autoload 'auto-complete "python-mode" t)
+;; (autoload 'auto-complete-config "python-mode" t)
+(autoload 'flymake "python-mode" t)
 ;; Python mode customizations
+(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
+(setq interpreter-mode-alist (cons '("python" . python-mode)
+                                       interpreter-mode-alist))
 (autoload 'python-mode "python-mode" "Python Mode." t)
-(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
-(add-to-list 'interpreter-mode-alist '("python" . python-mode))
-(require 'python-mode)
 (add-hook 'python-mode-hook
-(lambda ()
-(set-variable 'py-indent-offset 4)
-(set-variable 'indent-tabs-mode nil)
-(define-key py-mode-map (kbd "RET") 'newline-and-indent)
-(smart-operator-mode-on) ))
+	  (lambda ()
+	    (set-variable 'py-indent-offset 4)
+	    (set-variable 'indent-tabs-mode nil)
+	    (autopair-mode)
+	    (define-key py-mode-map (kbd "RET") 'newline-and-indent)))
 ;; pymacs
-;;this is broken, and I don't know how to use it
-(autoload 'pymacs-apply "pymacs")
+(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)
+(setq local-env (expand-file-name "~/envs/2.7"))
+(setq local-python-site-packages 
+      (concat local-env "/lib/python2.7/site-packages"))
+(setenv "PYTHONPATH" local-python-site-packages);;pymacs installed here
+(setq pymacs-load-path (list (getenv "PYTHONPATH")
+ 			     rope-dist)) 
+(autoload 'pymacs "pymacs" t)
 (pymacs-load "ropemacs" "rope-")
 (setq ropemacs-enable-autoimport t)
+;; (autoload 'load-rope "python-mode" t)
-(add-to-list 'auto-mode-alist '("\\.doctest$" . doctest-mode))
-(autoload 'doctest-mode "doctest-mode" "doctest mode" t)
-(provide 'init_python)
+;; (require 'ipython)
+;; (setq py-python-command-args '( "-colors" "Linux"))
+;; (setq ipython-completion-command-string "print(';'.join(__IP.Completer.all_completions('%s')))\n")


+;; CSS and Rainbow modes 
+(require 'rainbow-mode)
+(defun all-css-modes() (css-mode) (rainbow-mode)) 
+;; Load both major and minor modes in one call based on file type 
+(add-to-list 'auto-mode-alist '("\\.css$" . all-css-modes)) 


-;;remember mode config
-(setq remember-lib-dir (mapconcat 'identity (list emacs-lib-dir "remember") "/"))
-(add-to-list 'load-path remember-lib-dir)
-(require 'remember)
-(setq remember-annotation-functions '(org-remember-annotation))
-(setq remember-handler-functions '(org-remember-handler))
-(add-hook 'remember-mode-hook 'org-remember-apply-template)
-(require 'remember-autoloads)
-(setq org-remember-templates
-      '(("Tasks" ?t "* TODO %?\n  %i\n  %a" "~/.org/")
-        ("Appointments" ?a "* Appointment: %?\n%^T\n%i\n  %a" "~/.org/")))
-(setq remember-annotation-functions '(org-remember-annotation))
-(setq remember-handler-functions '(org-remember-handler))
-(eval-after-load 'remember
-  '(add-hook 'remember-mode-hook 'org-remember-apply-template))
-(global-set-key (kbd "C-c r") 'remember) 
+;;remember mode config
+(setq remember-lib-dir (mapconcat 'identity (list emacs-lib-dir "remember") "/"))
+(add-to-list 'load-path remember-lib-dir)
+(require 'remember)
+(setq remember-annotation-functions '(org-remember-annotation))
+(setq remember-handler-functions '(org-remember-handler))
+(add-hook 'remember-mode-hook 'org-remember-apply-template)
+(require 'remember-autoloads)
+(setq org-remember-templates
+      '(("Tasks" ?t "* TODO %?\n  %i\n  %a" "~/.org/")
+        ("Appointments" ?a "* Appointment: %?\n%^T\n%i\n  %a" "~/.org/")
+	("Notes" ?n "* Note: %?\n\n %a\n %T" "~/.org/")))
+(setq remember-annotation-functions '(org-remember-annotation))
+(setq remember-handler-functions '(org-remember-handler))
+(eval-after-load 'remember
+  '(add-hook 'remember-mode-hook 'org-remember-apply-template))
+(global-set-key (kbd "C-c R") 'remember) 


+;; vm config file taken straight from INSTALL
+(setq vm-dist (concat emacs-lib-dir "/vm"))
+(add-to-list 'load-path
+	     (concat vm-dist "/lisp"))
+(add-to-list 'Info-default-directory-list
+	     (concat vm-dist "/info"))
+(require 'vm-autoloads)


-;; w3m configuration
-(setq w3m-lib-dir (mapconcat 'identity (list emacs-lib-dir "emacs-w3m") "/"))
-(add-to-list 'load-path w3m-lib-dir)
+(add-to-list 'load-path (concat emacs-lib-dir "/emacs-w3m"))
 (require 'w3m-load)
-(setq w3m-use-cookies 't)
+(setq browse-url-browser-function 'w3m-browse-url)
+(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
+(global-set-key "\C-xm" 'browse-url-at-point)
+(setq w3m-use-cookies t)
+(setq w3m-add-referer t)
+(setq w3m-follow-redirection 10)


+;; taken from
+;; wanderlust
+(setq wanderlust-home (concat emacs-lib-dir "/" "wanderlust"))
+(add-to-list 'load-path wanderlust-home)
+(autoload 'wl "wl" "Wanderlust" t)
+(autoload 'wl-other-frame "wl" "Wanderlust on new frame." t)
+(autoload 'wl-draft "wl-draft" "Write draft with Wanderlust." t)
+;; IMAP
+;; (setq elmo-imap4-default-server "")
+;; (setq elmo-imap4-default-user "<accountname>") 
+;; (setq elmo-imap4-default-authenticate-type 'clear) 
+;; (setq elmo-imap4-default-port '993)
+;; (setq elmo-imap4-default-stream-type 'ssl)
+;; (setq elmo-imap4-use-modified-utf7 t) 
+;; SMTP
+;; (setq wl-smtp-connection-type 'starttls)
+;; (setq wl-smtp-posting-port 587)
+;; (setq wl-smtp-authenticate-type "plain")
+;; (setq wl-smtp-posting-user "mattofransen")
+;; (setq wl-smtp-posting-server "")
+;; (setq wl-local-domain "")
+;; (setq wl-default-folder "%inbox")
+;; (setq wl-default-spec "%")
+;; (setq wl-draft-folder "%[Gmail]/Drafts") ; Gmail IMAP
+;; (setq wl-trash-folder "%[Gmail]/Trash")
+;; (setq wl-folder-check-async t) 
+;; (setq elmo-imap4-use-modified-utf7 t)
+;; (autoload 'wl-user-agent-compose "wl-draft" nil t)
+;; (if (boundp 'mail-user-agent)
+;;     (setq mail-user-agent 'wl-user-agent))
+;; (if (fboundp 'define-mail-user-agent)
+;;     (define-mail-user-agent
+;;       'wl-user-agent
+;;       'wl-user-agent-compose
+;;       'wl-draft-send
+;;       'wl-draft-kill
+;;       'mail-send-hook))


 (add-to-list 'load-path  yas-lib-dir)
 (require 'yasnippet) ;; not yasnippet-bundle
-(setq yas/extra-mode-hooks '(python-mode-hook django-mode-hook))
+;; (setq yas/extra-mode-hooks '(python-mode-hook django-mode-hook))
+(setq yas/extra-mode-hooks '(python-mode-hook))
 (setq yas/text-popup-function
- 'yas/dropdown-list-popup-for-template)
+  'yas/dropdown-list-popup-for-template)
-(yas/load-directory yas-snippet-dir)
+(yas/load-directory yas-snippet-dir);; this can be slow
 ;; (add-hook 'org-mode-hook
 ;;  #'(lambda ()
 ;; get's to be too much, throw it in a file lib/*-config.el
+;; cedet (in core now??)
+;; (load-file (concat emacs-config-modules-dir "/cedet-config.el"))
+;; ecb mode
+;; (load-file (concat emacs-config-modules-dir "/ecb-config.el"))
 ;; decent terminal inside emacs
 (require 'multi-term)
 (require 'anything-config)
 ;; interactively do things (IDO)
 (require 'ido)
 (ido-mode t)
 (require 'color-theme)
-;; irc
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "erc-config.el") "/"))
-;;slime (required by org-babel for clojure mode)
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "slime-config.el") "/"))
+(require 'autopair)
+(require 'imenu)
+;; (require 'ipython)
 ;; org-mode
-(load-file (mapconcat 'identity (list emacs-config-modules-dir "org-config.el") "/"))
+(load-file (concat emacs-config-modules-dir "/org-config.el"))
 ;; remember-mode
-(load-file (mapconcat 'identity (list emacs-config-modules-dir "remember-config.el") "/"))
+(load-file (concat emacs-config-modules-dir "/remember-config.el"))
 ;;flymake config
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "flymake-config.el") "/"))
+(load-file (concat emacs-config-modules-dir "/flymake-config.el"))
+;;vm config
+;; (load-file (concat emacs-config-modules-dir "/vm-config.el"))
 ;;TODO: gtd
 (require 'gtd)
 ;;yasnippet configuration
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "yasnippet-config.el") "/"))
+(load-file (concat emacs-config-modules-dir "/yasnippet-config.el"))
 ;;python config
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "python-config.el") "/"))
+(load-file (concat emacs-config-modules-dir "/python-config.el"))
-;;cedet-ecb config
-(require 'cedet-config);; jdee requires settings in here
+;;js config
+(load-file (concat emacs-config-modules-dir "/js-config.el"))
+;; jabber
+(load-file (concat emacs-config-modules-dir "/jabber-config.el"))
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "jdee-config.el") "/"))
+;; w3m
+;; (load-file (concat emacs-config-modules-dir "/w3m-config.el"))
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "wikipedia-config.el") "/"))
+;; erc
+(load-file (concat emacs-config-modules-dir "/erc-config.el"))
+;; mmm
+;; (load-file (concat emacs-config-modules-dir "/mmm-config.el"))
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "rudel-config.el") "/"))
+(load-file (concat emacs-config-modules-dir "/nyan-config.el"))
+;; auto-complete
+(load-file (concat emacs-config-modules-dir "/auto-complete-config.el"))
-(load-file (mapconcat 'identity (list
-				 emacs-config-modules-dir "w3m-config.el") "/"))
+;; rainbow-mode
+(load-file (concat emacs-config-modules-dir "/rainbow-config.el"))
+;; expand-region
+(load-file (concat emacs-config-modules-dir "/expand-region-config.el"))