Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (97 sloc) 3.66 KB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Initialization file for writing
; Author: Matthew Darling
; First started: March 5th, 2012
; First used for work: May 1st, 2013
; First used for a real job: June 2nd, 2014
;;; Markdown is great, and this mode is good
(req-package markdown-mode
:mode (("\\.html\\'" . markdown-mode)
("\\.txt\\'" . markdown-mode)
("\\.md\\'" . markdown-mode)))
;;; Display the word count in the modeline
; Note the use of hooks rather than the :mode keyword
; This is mainly because other modes inherit from text-mode-hook
(req-package wc-mode
:init
(progn
(add-hook 'text-mode-hook 'wc-mode)
(add-hook 'markdown-mode-hook 'wc-mode)
(add-hook 'html-mode-hook 'wc-mode)))
;;; On-the-fly spellchecking
(req-package flyspell
:init
(progn
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'markdown-mode-hook 'flyspell-mode)
(add-hook 'html-mode-hook 'flyspell-mode)))
;;; Art Bollocks mode, for avoiding ridiculous writing
; Many thanks to Sacha Chua, these configurations were found here:
; http://sachachua.com/blog/2011/12/emacs-artbollocks-mode-el-and-writing-more-clearly/
(req-package artbollocks-mode
:init
(progn
(add-hook 'markdown-mode-hook 'artbollocks-mode)
(add-hook 'html-mode-hook 'artbollocks-mode))
:config
(progn
;; Avoid these phrases
(setq weasel-words-regex
(concat "\\b" (regexp-opt
'("one of the"
"should"
"just"
"sort of"
"a lot"
"probably"
"maybe"
"perhaps"
"I think"
"really"
"pretty"
"maybe"
"nice"
"action"
"utilize"
"leverage") t) "\\b"))
(setq artbollocks nil)
;; Make sure keywords are case-insensitive
(defadvice search-for-keyword (around sacha activate)
"Match in a case-insensitive way."
(let ((case-fold-search t))
ad-do-it))))
;;;; LaTeX
(req-package tex
:require tex-mik
:config
(progn
(add-hook 'TeX-mode-hook 'TeX-PDF-mode) ;Generate PDFs (this is file local)
(setq TeX-parse-self t) ;Parse when loading a file
(setq TeX-auto-save t) ;Parse when saving a file
(setq doc-view-ghostscript-program
"C:/Program Files/Ghostscript/gs9.06/bin/gswin64.exe")
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(add-hook 'TeX-mode-hook 'TeX-fold-mode) ;Fold stuff like \section and \emph
;Use csquotes when pressing ", see: http://tex.stackexchange.com/a/39302
(setq LaTeX-csquotes-close-quote "}"
LaTeX-csquotes-open-quote "\\enquote{")
;If I want really nice syntax highlighting in my document, Minted needs this
;see https://github.com/gpoore/minted
(setq TeX-engine-alist '((pdflatex_sh "pdftlatex shell escape"
"pdflatex --file-line-error --shell-escape"
"pdflatex --file-line-error --shell-escape"
"pdflatex")))
))
;;;; Working with Tumblr
(req-package tumblesocks
:config
(progn
(setq tumblesocks-blog "lamattgrind.tumblr.com")
(if (require 'sasl nil t)
(setq oauth-nonce-function #'sasl-unique-id)
(setq oauth-nonce-function #'oauth-internal-make-nonce))
(setq tumblesocks-post-default-state "ask")))
(req-package-finish)
(provide 'mattd-writing)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;