Created
July 22, 2016 09:35
-
-
Save pokehanai/e98bbcc9dc780c61a1ba22228ac3e388 to your computer and use it in GitHub Desktop.
Emacs config for markdown-mode with orgtbl-mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package markdown-mode | |
:defer t | |
:commands (org-table-begin org-table-end orgtbl-mode) | |
:config | |
(progn | |
(require 'org-table) | |
(eval-when-compile | |
(require 'whitespace)) | |
(defun advice:org-table-align:markdown () | |
"Replace \"+\" sign with \"|\" in org-table." | |
(save-excursion | |
(save-restriction | |
(narrow-to-region (org-table-begin) (org-table-end)) | |
(goto-char (point-min)) | |
(while (search-forward "-+-" nil t) | |
(replace-match "-|-"))))) | |
(add-hook 'markdown-mode-hook | |
(lambda () | |
(whitespace-mode 1) | |
(set (make-local-variable 'whitespace-action) nil) | |
(setq indent-tabs-mode nil) | |
(setq markdown-indent-on-enter nil) | |
(orgtbl-mode) | |
(advice-add 'org-table-align :after 'advice:org-table-align:markdown))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment