Update modules/lang/*
This commit is contained in:
parent
f0adef1b01
commit
e14e25ecb4
68 changed files with 1487 additions and 750 deletions
22
modules/lang/markdown/autoload.el
Normal file
22
modules/lang/markdown/autoload.el
Normal 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)))))
|
||||
|
59
modules/lang/markdown/config.el
Normal file
59
modules/lang/markdown/config.el
Normal 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)
|
||||
|
6
modules/lang/markdown/packages.el
Normal file
6
modules/lang/markdown/packages.el
Normal file
|
@ -0,0 +1,6 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/markdown/packages.el
|
||||
|
||||
(@package markdown-mode)
|
||||
(@package markdown-toc)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue