Skip to content

Instantly share code, notes, and snippets.

@jmatt
Last active October 1, 2015 15:57
Show Gist options
  • Save jmatt/2019332 to your computer and use it in GitHub Desktop.
Save jmatt/2019332 to your computer and use it in GitHub Desktop.
emacs24 setup.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; J. Matt Peterson's new emacs setup. ;;;;
;;;; https://gist.github.com/2019332 ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'hippie-exp)
;;; Setup PATH environment.
(setenv "PATH"
(concat
(getenv "PATH") ":"
"/usr/local/bin" ":"
"~/bin"))
;;; Ensure package can be found.
(add-to-list 'load-path "~/.emacs.d/elpa/")
;;; marmalade package repo and setup.
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa-stable" . "http://melpa-stable.milkbox.net/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
;;; my packages
(defvar my-packages
'(ac-helm
ac-nrepl
auto-complete
auto-complete-nxml
cider
clojure-mode
clojurescript-mode
color-theme-sanityinc-tomorrow
dash
dash-at-point
find-file-in-git-repo
gist
helm
htmlize
ido-ubiquitous
jedi
jedi-direx
js3-mode
magit
paredit
qsimpleq-theme
rainbow-mode
smex
smooth-scroll
solarized-theme
tango-2-theme
textmate
tidy
undo-tree
virtualenv
wget
yaml-mode
zenburn-theme)
"A list of packages to ensure are installed at launch.")
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
;;; themes
(cond
((and (window-system) (eq system-type 'darwin))
(load-theme 'sanityinc-tomorrow-night t))
((and (window-system) (eq system-type 'nt))
(load-theme 'solarized-dark t))
((window-system)
(load-theme 'deeper-blue))
(t (load-theme 'sanityinc-tomorrow-night t))) ; default to tango-2
;;; fonts
(cond
((and (window-system) (eq system-type 'darwin))
(progn
(set-face-attribute 'default nil :font "-outline-Menlo-normal-normal-normal-mono-15-*-*-*-c-*-iso8859-1")
(set-face-font 'italic "-outline-Menlo-normal-italic-normal-mono-*-*-*-*-c-*-iso8859-1")
(set-face-font 'bold "-outline-Menlo-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1" )
(set-face-font 'bold-italic "-outline-Menlo-bold-italic-normal-mono-*-*-*-*-c-*-iso8859-1")))
((and (window-system) (eq system-type 'windows-nt)) ;; Windows Case.
(progn
(set-face-attribute 'default nil :font "-outline-Consolas-normal-normal-normal-mono-15-*-*-*-c-*-iso8859-1")
(set-face-font 'italic "-outline-Consolas-normal-italic-normal-mono-*-*-*-*-c-*-iso8859-1")
(set-face-font 'bold "-outline-Consolas-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1" )
(set-face-font 'bold-italic "-outline-Consolas-bold-italic-normal-mono-*-*-*-*-c-*-iso8859-1"))))
;;; start in the home directory.
(cd "~")
;;; move backups
;; (setq backup-directory-alist '(("." . "~/.emacs.d/backups/"))
;; tramp-backup-directory-alist backup-directory-alist)
(setenv "TMPDIR" "/tmp")
;;; add default auto-complete
(require 'auto-complete-config)
(ac-config-default)
(setq ac-sources (append '(ac-source-words-in-same-mode-buffers) ac-sources))
;;; scpaste
(setq scpaste-http-destination "https://jmatt.org/scp"
scpaste-scp-port "6400"
scpaste-scp-destination "r2d2:scp")
;;; python
(setq
python-shell-interpreter "ipython"
python-shell-interpreter-args ""
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "
python-shell-completion-setup-code
"from IPython.core.completerlib import module_completion"
python-shell-completion-module-string-code
"';'.join(module_completion('''%s'''))\n"
python-shell-completion-string-code
"';'.join(get_ipython().Completer.all_completions('''%s'''))\n")
(global-set-key (kbd "C-x f") 'find-file-in-project)
(global-set-key "\C-cd" 'dash-at-point)
(add-to-list 'dash-at-point-mode-alist '(python-mode . "python"))
(add-to-list 'dash-at-point-mode-alist '(clojure-mode . "clojure"))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(custom-safe-themes
(quote
("e16a771a13a202ee6e276d06098bc77f008b73bbac4d526f160faa2d76c1dd0e" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "8eef22cd6c122530722104b7c82bc8cdbb690a4ccdd95c5ceec4f3efa5d654f5" "446c73cdfb49f1dab4c322e51ac00a536fb0e3cb7e6809b9f4616e0858012e92" "968d1ad07c38d02d2e5debffc5638332696ac41af7974ade6f95841359ed73e3" "c4e6fe8f5728a5d5fd0e92538f68c3b4e8b218bcfb5e07d8afff8731cc5f3df0" "543976df2de12eb2ac235c79c7bc1dac6c58f4a34ae6f72237d6e70d8384f37a" "2b5aa66b7d5be41b18cc67f3286ae664134b95ccc4a86c9339c886dfd736132d" "690585947abcb3fc7f52e6683b8375f00eef7ea55d028dcf81c9f5accb4dffe5" "5339210234ec915d7d3fd87bfeb506bfc436ff7277a55516ab1781ec85c57224" "050beead9159996a613ba4bc734de8b13b882f1c6596d1dffa4f51d096662cf6" "09820052b8d8261fb71cb537ac63fdad1def22af777029911e52654f724d9884" "1177fe4645eb8db34ee151ce45518e47cc4595c3e72c55dc07df03ab353ad132" "7fa9dc3948765d7cf3d7a289e40039c2c64abf0fad5c616453b263b601532493" "75d4ccc5e912b93f722e57cca3ca1a15e079032cd69fd9bc67268b4c85639663" "e57e7b19da7b4cd0e5512d5e9bc20d31c9cf50112c462de15a76bce0ea3c5ef5" "5dfacaf380068d9ed06e0872a066a305ab6a1217f25c3457b640e76c98ae20e6" "085b401decc10018d8ed2572f65c5ba96864486062c0a2391372223294f89460" "bb08c73af94ee74453c90422485b29e5643b73b05e8de029a6909af6a3fb3f58" "71b172ea4aad108801421cc5251edb6c792f3adbaecfa1c52e94e3d99634dee7" "06f0b439b62164c6f8f84fdda32b62fb50b6d00e8b01c2208e55543a6337433a" "628278136f88aa1a151bb2d6c8a86bf2b7631fbea5f0f76cba2a0079cd910f7d" "82d2cac368ccdec2fcc7573f24c3f79654b78bf133096f9b40c20d97ec1d8016" "1b8d67b43ff1723960eb5e0cba512a2c7a2ad544ddb2533a90101fd1852b426e" "b7553781f4a831d5af6545f7a5967eb002c8daeee688c5cbf33bf27936ec18b3" default)))
'(inhibit-startup-screen t)
'(menu-bar-open nil)
'(scroll-bar-mode nil)
'(tool-bar-mode nil)
'(virtualenv-root "~/.venvs")
'(virtualenv-workon-starts-python t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment