 
 (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan)
 
-;; https://github.com/magnars/.emacs.d/blob/master/defuns/lisp-defuns.el
-(defun eval-and-replace ()
-  "Replace the preceding sexp with its value."
-  (interactive)
-  (backward-kill-sexp)
-  (condition-case nil
-    (prin1 (eval (read (current-kill 0)))
-           (current-buffer))
-    (error (message "Invalid expression")
-           (insert (current-kill 0)))))
-
-;; https://github.com/magnars/.emacs.d/blob/master/key-bindings.el
-(global-set-key (kbd "C-c C-e") 'eval-and-replace)
+;; flycheck-haskell
+(add-hook 'flycheck-mode-hook #'flycheck-haskell-setup)
 
 ;; structured-haskell-mode
 (require 'shm)
 (require 'shm-case-split)
 (add-hook 'haskell-mode-hook 'structured-haskell-mode)
-(define-key shm-map (kbd "C-c C-s") 'shm/case-split)
 (set-face-background 'shm-current-face "#eee8d5")
 (set-face-background 'shm-quarantine-face "lemonchiffon")
 (setq shm-idle-timeout 0)
 
-;; flycheck-haskell
-(add-hook 'flycheck-mode-hook #'flycheck-haskell-setup)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;              Dependently typed functional programming languages
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; idris-mode
 
 ;; proof-general
 


(setq-default fill-column 80)

;; save the state of Emacs from one session to another
;; http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html
(desktop-save-mode 1)

;; https://ghc.haskell.org/trac/ghc/wiki/Emacs#MakethequotesinGHCerrormessagesdisplaynicely
(setq locale-coding-system 'utf-8)

  "w" 'save-buffer
  "=" 'align-regexp
  "?" 'git-messenger:popup-message
  "/" 'ag-regexp
  )

(global-set-key (kbd "C-=") 'text-scale-increase)
(global-set-key (kbd "C--") 'text-scale-decrease)

(global-set-key (kbd "<C-tab>") 'next-buffer)

;; https://github.com/magnars/.emacs.d/blob/master/key-bindings.el
(global-set-key (kbd "C-c C-e") 'eval-and-replace)

(define-key 'help-command (kbd "C-m") 'discover-my-major)

(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)

(global-set-key (kbd "C-'") 'er/expand-region)

(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)

(define-key shm-map (kbd "C-c C-s") 'shm/case-split)

(add-hook 'ruby-mode-hook
  (lambda ()
    (local-set-key (kbd "C-c C-c") 'inf-ruby-console-auto)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;              Better defaults
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; anzu
(require 'anzu)
(diminish 'anzu-mode)
(global-anzu-mode +1)

;; flx-ido
(require 'flx-ido)
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil)

;; popwin
(require 'popwin)
(popwin-mode 1)

;; smooth-scrolling
(require 'smooth-scrolling)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
