 (add-hook 'text-mode-hook 'turn-on-flyspell)
 
 ; org-mode
+(use-package org
+  :ensure)
 (setq org-directory "~/notebook")
 (add-to-list 'auto-mode-alist (cons (concat org-directory "/.*") 'org-mode))
 (setq org-default-notes-file (concat org-directory "/notes.org"))
 (setq org-log-states-order-reversed nil)
 (setq org-agenda-files (list org-directory))
 
+(use-package markdown-mode
+  :ensure)
+
 ; js2-mode
-(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
+(use-package js2-mode
+  :ensure
+  :mode "\\.js\\'")
 
 ; emmet
-(add-hook 'sgml-mode-hook 'emmet-mode)
-(add-hook 'css-mode-hook 'emmet-mode)
-
-; python-mode
-(add-hook 'python-mode-hook 'auto-complete-mode)
-; need to pip install epc and jedi
-(add-hook 'python-mode-hook 'jedi:setup)
-(setq jedi:complete-on-dot t)
-(add-hook 'python-mode-hook 'sphinx-doc-mode)
+(use-package emmet-mode
+  :ensure
+  :commands emmet-mode
+  :init
+  (progn
+    (add-hook 'sgml-mode-hook 'emmet-mode)
+    (add-hook 'css-mode-hook 'emmet-mode)))
+
+(use-package python
+  :mode ("\\.py\\'" . python-mode)
+  :init
+  (progn
+    (add-hook 'python-mode-hook 'auto-complete-mode)
+    (add-hook 'python-mode-hook 'sphinx-doc-mode)))
+
+(use-package jedi
+  :ensure
+  :init
+  (progn
+    ; need to pip install epc and jedi
+    (add-hook 'python-mode-hook 'jedi:setup)
+    (setq jedi:complete-on-dot t)))
 ; TODO: in evil's insert state, map the normal autocomplete to jedi
 
-; misc
-(setq graphviz-dot-view-command "dotty")
-
-;
-; Color themes
-;
-
-(load-theme 'solarized-dark t)
+(use-package graphiviz-dot-mode
+  :mode "'\\.dot\\'"
+  :config
+  (setq graphviz-dot-view-command "dotty"))
+
+(use-package gist
+  :ensure
+  :defer t
+  :config
+  (setq gist-view-gist 1))
 
 
 ;
 ; Custom macros
 ;
+

;
; Minimal UI
;


; show column numbers too
(column-number-mode 1)

; save and restore previous sessions
(desktop-save-mode 1)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
