Commits

Jeffrey Stoffers committed 6760b6d

More Packages

Comments (0)

Files changed (2)

.emacs.d/config.el

+;;;---------------------------------------------------------------------
+;;; Emacs Configuration
+;;;---------------------------------------------------------------------
+
+;; Turn off all window chrome
+(tool-bar-mode -1)
+(menu-bar-mode -1)
+(scroll-bar-mode -1)
+(setq inhibit-splash-screen 1)
+
+;; No stupid ~ backup files everywhere
+(setq backup-directory-alist '(("." . "~/.emacs.d/backups"))
+      backup-by-copying 1
+      delete-old-versions 1
+      kept-new-versions 6
+      kept-old-versions 2
+      version-control 1)
+
+;; Cursor position in modeline
+(line-number-mode 1)
+(column-number-mode 1)
+
+;; Code editing tweaks
+(show-paren-mode 1) ;Match parens
+(setq compilation-scroll-output 1) ;Scroll flyspell
+(electric-indent-mode 1) ;Indent on enter
+
+;; No stupid #*# autosave files everywhere
+(setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))
+
+;; Three characters is too much typing
+(defalias 'yes-or-no-p 'y-or-n-p)
+
+;; Set font
+(add-to-list 'default-frame-alist '(font . "Deja Vu Sans Mono-10"))
+
+;; Set the color theme
+(load-theme 'zenburn t)
+
+;; Use mail mode when composing email in mutt
+(add-to-list 'auto-mode-alist '("/mutt" . mail-mode))
+
+(global-set-key "\C-x\C-b" 'ibuffer)
+(ido-mode 1)
+
+;; Indent region or indent the buffer if no region is selected
+;; http://emacsredux.com/blog/2013/03/27/indent-region-or-buffer/
+(defun indent-buffer ()
+  "Indent the currently visited buffer."
+  (interactive)
+  (indent-region (point-min) (point-max)))
+
+(defun indent-region-or-buffer ()
+  "Indent a region if selected, otherwise the whole buffer."
+  (interactive)
+  (save-excursion
+    (if (region-active-p)
+        (progn
+          (indent-region (region-beginning) (region-end))
+          (message "Indented selected region."))
+      (progn
+        (indent-buffer)
+        (message "Indented buffer.")))))
+
+(global-set-key (kbd "C-M-\\") 'indent-region-or-buffer)
+
+(setq browse-url-browser-function 'w3m-browse-url)
+(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
+;; optional keyboard short-cut
+(global-set-key "\C-xm" 'browse-url-at-point)
+(setq w3m-use-cookies t)
+
+;;https://sites.google.com/site/steveyegge2/effective-emacs
+(global-set-key "\C-w" 'backward-kill-word)
+(global-set-key "\C-x\C-k" 'kill-region)
+(global-set-key "\C-x\C-m" 'execute-extended-command)
+
+(define-key isearch-mode-map (kbd "C-o") 'isearch-occur)
+
+;; Hilight colums over 80 characters when whitespace mode is enabled
+(setq whitespace-line-column 80
+      whitespace-style '(face tabs trailing lines-tail))
+
+;; Spellcheck buffer when enabling flyspell mode
+;(add-hook 'flyspell-mode-hook 'flyspell-buffer)
+
+;;;---------------------------------------------------------------------
+;;; Nrepl setup
+;;;---------------------------------------------------------------------
+(add-hook 'nrepl-interaction-mode-hook 'nrepl-turn-on-eldoc-mode)
+(add-hook 'nrepl-interaction-mode-hook 'paredit-mode)
+(add-hook 'nrepl-interaction-mode-hook 'rainbow-delimiters-mode)
+
+(setq nrepl-hide-special-buffers t)
+(setq nrepl-popup-stacktraces nil)
+(add-to-list 'same-window-buffer-names "*nrepl*")
+
+(add-hook 'nrepl-mode-hook 'paredit-mode)
+(add-hook 'nrepl-mode-hook 'rainbow-delimiters-mode)
+
+;;;-----------------------------------------------------------------------------
+;;; auto-complete setup
+;;;-----------------------------------------------------------------------------
+(require 'auto-complete-config)
+(ac-config-default)
+
+(require 'ac-nrepl)
+(add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
+(add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
+(eval-after-load "auto-complete" '(add-to-list 'ac-modes 'nrepl-mode))
+
+(defun set-auto-complete-as-completion-at-point-function ()
+(setq completion-at-point-functions '(auto-complete)))
+(add-hook 'auto-complete-mode-hook
+	  'set-auto-complete-as-completion-at-point-function)
+
+(add-hook 'nrepl-mode-hook 'set-auto-complete-as-completion-at-point-function)
+(add-hook 'nrepl-interaction-mode-hook
+	  'set-auto-complete-as-completion-at-point-function)
+
+;;;---------------------------------------------------------------------
+;;; Org-Mode Configuration
+;;;---------------------------------------------------------------------
+(global-set-key "\C-cl" 'org-store-link)
+(global-set-key "\C-cc" 'org-capture)
+(global-set-key "\C-ca" 'org-agenda)
+(global-set-key "\C-cb" 'org-iswitchb)
+
+(setq org-directory "~/doc/org")
+(setq org-default-notes-file (concat org-directory "/notes.org"))
+
+(setq org-mobile-directory "/scpc:necronian@irc.uberpurple.com:org")
+(setq org-mobile-inbox-for-pull (concat org-directory "/index.org"))
+(setq org-mobile-files (quote ("movies.org")))
+
+(org-babel-do-load-languages
+ 'org-babel-load-languages
+ '((emacs-lisp . t)
+   (ruby . t)
+   (perl . t)
+   (makefile . t)
+   (sh . t)
+   (lisp . t)
+   (ledger . t)
+   (java . t)
+   (latex . t)
+   (gnuplot . t)
+   (ditaa . t)
+   (css . t)
+   (calc . t)
+   (clojure . t)
+   (C . t)
+   (sql . t)))
+
+(load (expand-file-name "/home/necronian/.quicklisp/slime-helper.el"))
+(setq inferior-lisp-program "sbcl")
+
+;;;-----------------------------------------------------------------------------
+;;; kibit configuration
+;;;-----------------------------------------------------------------------------
+;; Teach compile the syntax of the kibit output
+(require 'compile)
+(add-to-list 'compilation-error-regexp-alist-alist
+         '(kibit "At \\([^:]+\\):\\([[:digit:]]+\\):" 1 2 nil 0))
+(add-to-list 'compilation-error-regexp-alist 'kibit)
+
+;; A convenient command to run "lein kibit" in the project to which
+;; the current emacs buffer belongs to.
+(defun kibit ()
+  "Run kibit on the current project.
+   Display the results in a hyperlinked *compilation* buffer."
+  (interactive)
+  (compile "lein kibit"))
+
+(defun kibit-current-file ()
+  "Run kibit on the current file.
+   Display the results in a hyperlinked *compilation* buffer."
+  (interactive)
+  (compile (concat "lein kibit " buffer-file-name)))
+
+;; WINDOWS BLOWS
+(when (eq system-type 'windows-nt)
+  (require 'tramp)
+  (setq tramp-default-method "plink"
+	ispell-program-name "hunspell.exe"
+	ispell-dictionary-alist
+	'((nil "[A-Za-z]" "[^A-Za-z]" "[']" t ("-d" "en_US") nil utf-8))))
+
+;; MISC BINDINGS
+(global-set-key (kbd "<f5>") 'to-purple)
+(global-set-key (kbd "^c z") 'magit-status)
+(autoload 'window-number-mode "window-number" t)
 (require 'package)
-(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
-(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
-(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
+
+(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
+			 ("org" . "http://orgmode.org/elpa/")
+                         ("marmalade" . "http://marmalade-repo.org/packages/")
+                         ("melpa" . "http://melpa.milkbox.net/packages/")))
+
 (package-initialize)
 
 ;;;---------------------------------------------------------------------
 ;;; List of packages to install
 ;;;---------------------------------------------------------------------
-(defvar my-packages '(
+(defvar my-packages '( ;One Per line makes m-x sort happy
 		      ac-nrepl
+		      clojure-mode
+		      slamhound
+		      cljdoc
+		      magit
+		      slime
+		      ac-slime
+		      slime-repl
 		      auto-complete
-		      color-theme-sanityinc-tomorrow
 		      nrepl
+		      notmuch
+		      erc-image
+		      erc-tweet
+		      lua-mode
+		      flymake-lua
 		      org-plus-contrib
 		      paredit
 		      rainbow-delimiters
 		      w3m
+		      zenburn-theme
 		      ))
 
 ;;;---------------------------------------------------------------------
 ;;; Install Packages through package install
 ;;;---------------------------------------------------------------------
-(package-refresh-contents)
+;(package-refresh-contents)
 (dolist (p my-packages)
   (when (not (package-installed-p p))
     (package-install p)))
 
 ;;;---------------------------------------------------------------------
-;;; Emacs Configuration
+;;; Configure emacs here after packages have been loaded.
 ;;;---------------------------------------------------------------------
-
-;; Check if running os x windowed
-(defvar macosx-p (string-match "ns" (symbol-name window-system)))
-
-;; Turn off all window chrome if not running OS X windowed 
-(unless macosx-p
-  (menu-bar-mode -1)
-  (tool-bar-mode -1))
-(scroll-bar-mode -1)
-
-;; Cursor position in modeline
-(setq line-number-mode t
-      column-number-mode t)
-
-;; Disable annoying splash screen
-(setq inhibit-splash-screen t)
-
-;; Hilight matching parens
-(show-paren-mode 1)
-
-;; No stupid ~ backup files everywhere
-(push '("." . "~/.emacs.d/backups") backup-directory-alist)
-(setq backup-by-copying t)
-(setq delete-old-versions t
-  kept-new-versions 6
-  kept-old-versions 2
-  version-control t)
-
-;; No stupid #*# autosave files everywhere
-(setq auto-save-file-name-transforms
-      `((".*" ,temporary-file-directory t)))
-
-;; Three characters is too much typing
-(defalias 'yes-or-no-p 'y-or-n-p)
-
-;; Set font
-(add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-10"))
-
-;; Set the color theme
-;(load-theme 'zenburn t)
-(require 'color-theme-sanityinc-tomorrow)
-(color-theme-sanityinc-tomorrow-blue)
-
-;; Use mail mode when composing email in mutt
-(add-to-list 'auto-mode-alist '("/mutt" . mail-mode))
-
-;;; ibuffer
-(require 'ibuffer)
-(global-set-key "\C-x\C-b" 'ibuffer)
-
-;; Use iswitchb-mode for C-x b
-(iswitchb-mode)
-
-;;https://sites.google.com/site/steveyegge2/effective-emacs
-(global-set-key "\C-w" 'backward-kill-word)
-(global-set-key "\C-x\C-k" 'kill-region)
-(global-set-key "\C-x\C-m" 'execute-extended-command)
-
-(define-key isearch-mode-map (kbd "C-o") 'isearch-occur)
-
-;; Hilight colums over 72 characters when whitespace mode is enabled
-(setq whitespace-line-column 72
-      whitespace-style '(face tabs trailing lines-tail))
-
-;; Spellcheck buffer when enablinf flyspell mode
-(add-hook 'flyspell-mode-hook 'flyspell-buffer)
-
-;;;---------------------------------------------------------------------
-;;; Nrepl setup
-;;;---------------------------------------------------------------------
-(add-hook 'nrepl-interaction-mode-hook 'nrepl-turn-on-eldoc-mode)
-(add-hook 'nrepl-interaction-mode-hook 'paredit-mode)
-(add-hook 'nrepl-interaction-mode-hook 'rainbow-delimiters-mode)
-
-(setq nrepl-hide-special-buffers t)
-(setq nrepl-popup-stacktraces nil)
-(add-to-list 'same-window-buffer-names "*nrepl*")
-
-(add-hook 'nrepl-mode-hook 'paredit-mode)
-(add-hook 'nrepl-mode-hook 'rainbow-delimiters-mode)
-
-(require 'auto-complete-config)
-(ac-config-default)
-(require 'ac-nrepl)
-(add-hook 'nrepl-mode-hook 'ac-nrepl-setup)
-(add-hook 'nrepl-interaction-mode-hook 'ac-nrepl-setup)
-(eval-after-load "auto-complete"
-  '(add-to-list 'ac-modes 'nrepl-mode))
-
-(defun set-auto-complete-as-completion-at-point-function ()
-(setq completion-at-point-functions '(auto-complete)))
-(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function)
-
-(add-hook 'nrepl-mode-hook 'set-auto-complete-as-completion-at-point-function)
-(add-hook 'nrepl-interaction-mode-hook 'set-auto-complete-as-completion-at-point-function)
-
-;;;---------------------------------------------------------------------
-;;; Org-Mode Configuration
-;;;---------------------------------------------------------------------
-(global-set-key "\C-cl" 'org-store-link)
-(global-set-key "\C-cc" 'org-capture)
-(global-set-key "\C-ca" 'org-agenda)
-(global-set-key "\C-cb" 'org-iswitchb)
-
-(setq org-directory "~/doc/org")
-(setq org-default-notes-file (concat org-directory "/notes.org"))
-
-(setq org-mobile-directory "/scpc:necronian@irc.uberpurple.com:org")
-(setq org-mobile-inbox-for-pull (concat org-directory "/index.org"))
-(setq org-mobile-files (quote ("movies.org")))
-
-(org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . t)
-   (ruby . t)
-   (perl . t)
-   (makefile . t)
-   (sh . t)
-   (lisp . t)
-   (ledger . t)
-   (java . t)
-   (latex . t)
-   (gnuplot . t)
-   (ditaa . t)
-   (css . t)
-   (calc . t)
-   (clojure . t)
-   (C . t)
-   (sql . t)))
+(add-hook 'after-init-hook (lambda () (load (concat user-emacs-directory "config.el"))))