                                (?B . (:foreground "LightSteelBlue"))
                                (?C . (:foreground "OliveDrab"))))
     (setq org-capture-templates
-          '(("t" "todo" entry (file+headline "" "Tasks")
-             "* TODO [#A] %?")))
+          '(("t" "Todo" entry (file+headline "~/org/todo.org" "Tasks")
+             "* TODO [#A] %?")
+            ("j" "Journal" entry (file+datetree "~/org/journal.org")
+             "* %U\n  %?")
+            ("i" "Idea" entry (file+headline "~/org/idea.org" "Ideas")
+             "* %?\n  %U")
+            ("r" "Read" entry (file+headline "~/org/read.org" "Read")
+             "* %?\n  %U")))
     (setq org-log-done 'time)
-    ))
-
-(use-package fill-column-indicator
-  :ensure t
-  :config
-  (progn (setq fci-rule-color "gray")))
-
-(use-package exec-path-from-shell
-  :ensure t
-  :config
-  (when (memq window-system '(mac ns))
-    (exec-path-from-shell-initialize)))
-
-(use-package s
-  :pin melpa-stable
-  :ensure t)
-
-(use-package company
-  :ensure t
-  :defer t
-  :init (global-company-mode)
-  :config
-  (progn
-    ;; Use Company for completion
-    (bind-key [remap completion-at-point] #'company-complete company-mode-map)
-
-    ;; Disable silly completions
-    (push (apply-partially #'cl-remove-if
-                         (lambda (c)
-                         (or (string-match-p "[^\x00-\x7F]+" c) ;; remove non-ansi strings
-                             (string-match-p "^[0-9]+" c))))    ;; remove strings starting with numbers
-      company-transformers)
-  )
-)
+    (setq org-log-into-drawer t)
+    (setq org-babel-python-command "python3")
+    (org-babel-do-load-languages
+     'org-babel-load-languages
+     '((emacs-lisp . t)
+       (python . t)
+       (shell . t)))))
+
+(use-package org-roam
+  :after org
+  :hook
+  (after-init . org-roam-mode)
+  :custom
+  (org-roam-directory "~/org/ideas")
+  :bind (:map org-roam-mode-map
+              (("C-c z l" . org-roam)
+               ("C-c z f" . org-roam-find-file)
+               ("C-c z g" . org-roam-show-graph))
+              :map org-mode-map
+              (("C-c z i" . org-roam-insert))))
+
+(use-package deft
+  :bind ("<f8>" . deft)
+  :commands (deft)
+  :config
+  (setq deft-auto-save-interval 0)
+  (setq deft-default-extension "org")
+  (setq deft-directory "~/org/ideas"))
+
+;; ===============================================================
+;; Misc
+;; ===============================================================
 
 ;; Macbook "command" key should be meta because it's next to "space" where alt normally is
 (setq ns-command-modifier (quote meta))

;; Enable nice shortcuts for windmove
(windmove-default-keybindings)

;; Remove trailing whitespace from c/c++ code
;;(add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-hook 'c-mode-hook (lambda () (add-to-list 'write-file-functions 'delete-trailing-whitespace)))
(add-hook 'python-mode-hook (lambda () (add-to-list 'write-file-functions 'delete-trailing-whitespace)))
(add-hook 'tuareg-mode-hook (lambda () (add-to-list 'write-file-functions 'delete-trailing-whitespace)))

;; Enable C-c o for switching between header and implementation.
(add-hook 'c-mode-common-hook


(setq-default history-length 1000)
(savehist-mode t)

;; Use magit, disable builtin vc mode to prevent perf issues
(setq vc-handled-backends nil)

;; REVISIT not entirely confident about this...
;; Prevent compilation mode and grep mode from opening a strange amount of windows.
(setq split-height-threshold nil)
(setq split-width-threshold nil)

(setq compilation-scroll-output 'first-error)

;; Make dired open in the same window when using RET or ^
(put 'dired-find-alternate-file 'disabled nil) ; disables warning
(define-key dired-mode-map (kbd "RET") 'dired-find-alternate-file) ; was dired-advertised-find-file
(define-key dired-mode-map (kbd "^") (lambda () (interactive) (find-alternate-file "..")))  ; was dired-up-directory

;; Large json files can be really slow unless we use text-mode.
(add-to-list 'auto-mode-alist '("\\.json\\'" . text-mode))

;; Handy function for reverting all buffers (e.g. when switching git branches)
;; Source: http://www.emacswiki.org/emacs/RevertBuffer#toc2
