mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Remove markdown config
This commit is contained in:
parent
ef2f89b752
commit
34cfa2e404
40
init.org
40
init.org
@ -1105,46 +1105,6 @@
|
|||||||
(add-to-list 'org-file-apps '("\\.pdf\\'" . emacs))
|
(add-to-list 'org-file-apps '("\\.pdf\\'" . emacs))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Markdown
|
|
||||||
|
|
||||||
This makes =.md=-files open in =markdown-mode=.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
I sometimes use a specialized markdown format, where inline math-blocks
|
|
||||||
can be achieved by surrounding a LaTeX formula with =$math$= and
|
|
||||||
=$/math$=. Writing these out became tedious, so I wrote a small function.
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(defun insert-markdown-inline-math-block ()
|
|
||||||
"Inserts an empty math-block if no region is active, otherwise wrap a
|
|
||||||
math-block around the region."
|
|
||||||
(interactive)
|
|
||||||
(let* ((beg (region-beginning))
|
|
||||||
(end (region-end))
|
|
||||||
(body (if (region-active-p) (buffer-substring beg end) "")))
|
|
||||||
(when (region-active-p)
|
|
||||||
(delete-region beg end))
|
|
||||||
(insert (concat "$math$ " body " $/math$"))
|
|
||||||
(search-backward " $/math$")))
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
Most of my writing in this markup is in Norwegian, so the dictionary is
|
|
||||||
set accordingly. The markup is also sensitive to line breaks, so
|
|
||||||
=auto-fill-mode= is disabled. Of course we want to bind our lovely
|
|
||||||
function to a key!
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(add-hook 'markdown-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(auto-fill-mode 0)
|
|
||||||
(visual-line-mode 1)
|
|
||||||
(ispell-change-dictionary "norsk")
|
|
||||||
(local-set-key (kbd "C-c b") 'insert-markdown-inline-math-block)) t)
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Haskell
|
** Haskell
|
||||||
|
|
||||||
=haskell-doc-mode= is similar to =eldoc=, it displays documentation in
|
=haskell-doc-mode= is similar to =eldoc=, it displays documentation in
|
||||||
|
Loading…
Reference in New Issue
Block a user