-
Notifications
You must be signed in to change notification settings - Fork 0
/
text.el
27 lines (21 loc) · 948 Bytes
/
text.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;;; init/text.el --- Text mode customizations -*- lexical-binding: t; -*-
;;; Code:
(hook-mode text-mode-hook
(unless (member major-mode '(mail-mode org-mode))
visual-line-mode))
(hook-mode markdown-mode-hook
;; Normally, electric pair mode is on and helpful, but in Markdown
;; mode it makes URLs be automatically hidden before they're typed
;; in.
(electric-pair-local-mode -1)
(markdown-toggle-markup-hiding 1))
;; Actually, I prefer GitHub flavored markdown
(add-to-list 'major-mode-remap-alist '(markdown-mode . gfm-mode))
;; Make sure we delete selection on highlight.
(put 'markdown-enter-key 'delete-selection t)
(setf markdown-fontify-code-blocks-natively t)
;;; Keymaps:
(with-eval-after-load 'markdown-mode
;; Make markdown mode always indent / unintent with TAB / S-TAB
(keymap-set markdown-mode-map "TAB" 'markdown-demote-list-item)
(keymap-set markdown-mode-map "<backtab>" 'markdown-promote-list-item))