 ;;
 ;;; Code:
 (require 'company)
-(require 'hydra)
+(require 'darkroom)
+(require 'evil-leader)
 (require 'markdown-mode)
 (require 'org)
 (require 'orgalist)
+(require 'visual-fill)
 (require 'whitespace)
-(require 'darkroom)
 
 (declare-function pjones:open-line-above "../lisp/interactive.el")
 (declare-function pjones:add-fixme-lock "../lisp/code.el")

;; Basic settings.
(custom-set-variables
 '(markdown-reference-location 'end)
 '(markdown-command "nix-shell -p pandoc --run 'pandoc -f markdown -t html'"))

(defvar pjones:markdown-attachments-directory
  "attachments"

     (file-name-nondirectory name)
     (file-relative-name dest))))

;; A few extra key bindings:
(evil-leader/set-key-for-mode 'markdown-mode
  "SPC a" #'pjones:markdown-attach-file
  "SPC c" #'pjones:markdown-slide-fenced-code-block
  "SPC i" #'pjones:markdown-slide-fenced-code-insert
  "SPC l" #'markdown-live-preview-mode
  "SPC n" #'pjones:markdown-slide-notes
  "SPC p" #'markdown-preview
  "SPC r" #'markdown-cleanup-list-numbers)

(defun pjones:markdown-mode-hook ()
  "Set up key bindings and other crap for markdown-mode."
  (local-set-key (kbd "C-c C-o")    #'pjones:markdown-follow-thing-at-point)
  (local-set-key (kbd "C-c /")      #'markdown-complete)
  (local-set-key (kbd "C-<return>") #'markdown-insert-header-dwim)
  (local-set-key (kbd "M-<return>") #'pjones:markdown-insert-list-item)
  (whitespace-mode)
  (orgalist-mode)
  (orgtbl-mode)
