Update modules/lang/*

This commit is contained in:
Henrik Lissner 2017-02-19 18:57:16 -05:00
parent f0adef1b01
commit e14e25ecb4
68 changed files with 1487 additions and 750 deletions

View file

@ -0,0 +1,22 @@
;;; lang/markdown/autoload.el
;; Implement strike-through formatting
(defvar +text--markdown-regex-del
"\\(^\\|[^\\]\\)\\(\\(~\\{2\\}\\)\\([^ \n \\]\\|[^ \n ]\\(?:.\\|\n[^\n]\\)*?[^\\ ]\\)\\(\\3\\)\\)")
;;;###autoload
(defun +markdown/insert-del ()
"Surround region in github strike-through delimiters."
(interactive)
(let ((delim "~~"))
(if (markdown-use-region-p)
;; Active region
(let ((bounds (markdown-unwrap-things-in-region
(region-beginning) (region-end)
+text--markdown-regex-del 2 4)))
(markdown-wrap-or-insert delim delim nil (car bounds) (cdr bounds)))
;; Bold markup removal, bold word at point, or empty markup insertion
(if (thing-at-point-looking-at +text--markdown-regex-del)
(markdown-unwrap-thing-at-point nil 2 4)
(markdown-wrap-or-insert delim delim 'word nil nil)))))

View file

@ -0,0 +1,59 @@
;;; lang/markdown/config.el
(@def-package markdown-mode
:mode ("\\.m\\(d\\|arkdown\\)$" "/README$"
("/README\\.md$" . gfm-mode))
:init
(setq markdown-enable-wiki-links t
markdown-enable-math t
markdown-italic-underscore t
markdown-make-gfm-checkboxes-buttons t
markdown-gfm-additional-languages '("sh"))
:config
(@set :electric 'markdown-mode :chars "+" "#")
(@add-hook markdown-mode
(auto-fill-mode +1)
(setq line-spacing 2
fill-column 70))
(sp-local-pair
'(markdown-mode gfm-mode)
"\`\`\`" "\`\`\`" :post-handlers '(("||\n" "RET")))
(@map :map gfm-mode-map
"`" 'self-insert-command
:map markdown-mode-map
"<backspace>" nil
"<M-left>" nil
"<M-right>" nil
"M-*" 'markdown-insert-list-item
"M-b" 'markdown-insert-bold
"M-i" 'markdown-insert-italic
"M-`" '+markdown/insert-del
:m "gj" 'markdown-next-visible-heading
:m "gk" 'markdown-previous-visible-heading
;; Assumes you have a markdown renderer plugin in chrome
:n "M-r" 'browse-url-of-file
;; TODO: Make context sensitive
:n "[p" 'markdown-promote
:n "]p" 'markdown-demote
:n "[l" 'markdown-next-link
:n "]l" 'markdown-previous-link
:n "gf" 'markdown-follow-thing-at-point
:i "M--" 'markdown-insert-hr
(:localleader
:nv "o" 'markdown-open
:nv "b" 'markdown-preview
(:prefix "i"
:nv "t" 'markdown-toc-generate-toc
:nv "i" 'markdown-insert-image
:nv "l" 'markdown-insert-link
:nv "L" 'markdown-insert-reference-link-dwim))))
(@def-package markdown-toc
:commands markdown-toc-generate-toc)

View file

@ -0,0 +1,6 @@
;; -*- no-byte-compile: t; -*-
;;; lang/markdown/packages.el
(@package markdown-mode)
(@package markdown-toc)