본문 바로가기

Programming

Using markdown in GNU Emacs 24.3 on MacOSX

Using markdown is little bit difficult. For easy use and future reference, I am writing this article.


1. Visit below site and look around and get some useful tips.

http://www.emacswiki.org/emacs/MarkdownMode



2. emacs markdown mode is now currently managed on below site. Visit and download markdown-mode.el

http://jblevins.org/projects/markdown-mode/


And place markdown-mode.el to ~/.emacs.d/lisp, if this directory doesn't exists, create it.



3. open ~/.emacs file and add following lines to the end of file or somewhere you want to like below.


;;; Set location for external packages.

(add-to-list 'load-path "~/.emacs.d/lisp/")

;;; Load markdown

(autoload 'markdown-mode "markdown-mode"

   "Major mode for editing Markdown files" t)

(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))

(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))

(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))



4. if you are using homebrew, install markdown parser by typing like below


$ brew update ; brew install markdown ; which markdown

/usr/local/bin/markdown 



5. And launch Emacs, after loading it go to 

Options->Customize Emacs->Specific Options and then entering "markdown-command"

and set markdown command to '/usr/local/bin/markdown'



6. Enjoy your coding and preview M-x markdown-preview and C-c C-c m. :)