We are in the thick of summer. That’s for sure. That means I’m spending afternoons strategically in the shade—and writing.As I’ve mentioned—probably—in other posts, most of the work of writing gets done in the head while doing other things. But at some point, all those notes and thoughts will get collected into the text editor and chopped up and re-arranged and eventually exported to the world.That inevitable process of creative typing should be as painless as possible. Unless you like pain, which is fine too. Here I’ve collected some of my favorite Emacs configurations for streamlining, simplifying, or otherwise sweetening my workflow.“Old painless is waiting.”My blog explores writing techniques, especially how Emacs boosts your productivity and performance. Sign up for my newsletter to unlock the real cheat codes and some DRM-free reading material:Table of ContentsReplace punctuation at pointA more Org-friendly word counterCompletion frameworksPick a themeIntegrated dictionaryOrg Mode scratch bufferSpacious paddingSimplify Org export optionsBack and forward buttonsWrap regionReplace punctuation at pointHow many times have you been editing a sentence, decide to change the punctuation, type a period, question mark, or exclamation point, and then have to delete the punctuation you just replaced? It happens to me all the time. It happened so frequently, I demanded a little Emacs magic to save me the extra step of deleting the unwanted punctuation. I wanted to just keep writing right on through!So this little function here does just that. If Emacs detects your point on a punctuation mark, and you type a punctuation mark, the inserted mark will write over the existing mark.(defun csm/replace-punctuation-at-point () "Replace punctuation at point (., !, ?) with the character typed by the user." (interactive) (let ((char (this-command-keys))) ;; Get the key pressed by the user (if (and (member (char-after) '(?. ?! ??)) ;; Check if current char is ., !, or ? (member (string-to-char char) '(?. ?! ??))) ;; Check if typed char is ., !, or ? (progn (delete-char 1) ;; Delete existing punctuation (insert char)) ;; Insert new punctuation (self-insert-command 1)))) ;; Default behavior: insert character;; Bind this function to punctuation keys(define-key global-map "." 'csm/replace-punctuation-at-point)(define-key global-map "!" 'csm/replace-punctuation-at-point)(define-key global-map "?" 'csm/replace-punctuation-at-point)A more Org-friendly word counterAs I’ve mentioned ad nauseam, word counts are important for writers. The more accurate the better. Word counts help us plan, stay sharp, on point, and provide important data to editors. But what if your document is full of Org comments, cold (unexported, or ignored) headings?This modified word counter function gives you a more accurate count by ignoring lines start with ’*’ or ’#’.(defun csm/org-word-count () "Count words in region/buffer, estimate pages, and reading time.Excludes lines beginning with * or #. Prints result in echo area." (interactive) (let* ((start (if (use-region-p) (region-beginning) (point-min))) (end (if (use-region-p) (region-end) (point-max))) (word-count (save-excursion (goto-char start) (let ((count 0) (inhibit-field-text-motion t)) (while (< (point) end) (beginning-of-line) (unless (looking-at-p "^[*#