 (setup "saveplace"
        (setq save-place-file "~/.emacs.d/cache/saveplace")
        (setq-default save-place t))
+
+;; save minibuffer history
+(savehist-mode 1)
+(setq history-length         1500)
+(setq search-ring-max        1000)
+(setq regexp-search-ring-max 1000)
+(setq savehist-file "~/.emacs.d/cache/history")
+(setq savehist-additional-variables '(search-ring
+                                      regexp-search-ring
+                                      kill-ring
+                                      compile-command))
 
 ; try to keep windows within a max margin
 (setup "automargin"

                    (define-key phi-search-default-map (kbd "<C-down>") 'phi-search-mc/mark-next)
                    (define-key phi-search-default-map (kbd "<C-up>")   'phi-search-mc/mark-previous)
                    (define-key phi-search-default-map (kbd "C-c C-k")  'phi-search-mc/mark-all)))

;; undo tree
(global-undo-tree-mode)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (C          . t)
   (R          . t)
   (matlab     . t)
   (sh         . t)
   (ruby       . t)
   (python     . t)
   (haskell    . t)))
(add-to-list 'org-src-lang-modes '("c" . c))
(add-to-list 'org-src-lang-modes '("r" . ess-mode))
(add-to-list 'org-src-lang-modes '("h" . haskell))
