15

Native syntax highlighting of code blocks is now part of the current development version of Markdown mode. Specifically, it works for those GFM or tilde-fenced code blocks for which the language name has been specified, like the JavaScript code block in your question. You can toggle this mode with C-c C-x C-f (markdown-toggle-fontify-code-blocks-natively). ...


15

With markdown-mode by Jason Blevins you can toggle folding of the heading with Tab (same as in org-mode).


7

This isn't easy enough to find, but what you want is goto-address-mode. You can activate it in the current buffer with M-x goto-address-mode or you can add it to markdown-mode-hook: (defun turn-on-goto-address-mode () (goto-address-mode 1)) (add-hook 'markdown-mode-hook #'turn-on-goto-address-mode)


7

If I understand the question, you are looking for a way to edit markdown files where you can show or hide sections, navigate by headings and so on. I've never used allout-mode but it does look like you could configure it to recognize markdown syntax. However, another option is to take a look at markdown-mode which supports navigation and folding, e.g. ...


6

The accepted answer for org-mode is written by me. org-mode is tricky because its own check-word-predicate is already defined. markdown is simpler because it uses default predicate provided by flyspell-mode, (defun flyspell-generic-textmode-verify () "Used for `flyspell-generic-check-word-predicate' in text modes." ;; (point) is next char after the ...


6

markdown-follow-thing-at-point (C-c C-o) and also markdown-follow-link-at-point will follow links. If you have a link like [filelink](/path/to/file.md) then calling one of the above functions while cursor is on the markdown link will take you to the file.


5

I wouldn't use align-regexp but the wonderful orgtbl-mode for this: if you enable this minor mode, it will automatically recognize the table, and change its size as needed (use tab to move around in the table).


4

What I've found so far is this. The "simplest" way is, as described in this stackoverflow answer and this gist, and as hinted by @Constantine in a comment, is to create a converter function and then use it. I went a tad further in laziness (this might already exist somewhere, but hey, I've only got the one use case right now). So here's what I have: The ...


4

I think indent-rigidly (C-x TAB or C-x C-i, see footnote) can help you. indent-rigidly is an interactive compiled Lisp function in `indent.el'. It is bound to C-x TAB. (indent-rigidly START END ARG &optional INTERACTIVE) Indent all lines starting in the region. If called interactively with no prefix argument, activate a transient ...


4

In the current development version of Markdown mode, links are now clickable without requiring any additional libraries. URLs can also be hidden, and you can hover your mouse pointer to see the URL and optional title text.


4

I have a quick & dirty proof of concept for markdown-mode. Idea: keep track of the current line (similar to hl-line-mode). Use a font-lock rule to remove the markup hiding for the current line (markdown-mode seems to use display and invisible text properties, so remove those). Re-fontify the local area when moving from one line to another. (defvar my/...


3

Markup hiding is now part of the current development version of Markdown mode. Markup for bold, italics, links, code, etc. can be hidden and toggled interactively using C-c C-x C-m (M-x markdown-toggle-markup-hiding). You can set the default value by customizing markdown-hide-markup. Additionally, this enables nice Unicode bullet characters for lists, ...


3

markdown-hide-markup needs to be set before markdown mode starts, so the markdown-mode-hook probably doesn't do anything. But it's buffer-local, so I think you need to use setq-default instead of setq. You set markdown-hide-markup to t, and then you toggle it, which might be turning it off. Not sure. This works for me: (use-package markdown-mode :ensure t ...


3

A markdown-minor-mode would be nice, yes. I currently have some ad-hoc code to highlight comments assuming markdown syntax for my typer-mode. It only supports a limited subset of markdown and only performs highlighting, but it shouldn't be difficult to extract it into its own markdown-minor-mode (probably easier than to try and adapt the code from markdown-...


3

This can be fixed by calling M-x customize-group RET markdown-faces while in Markdown mode. It opens a menu of various font face settings. Under Markdown Code Face, uncheck/delete everything and then save. This will make the code face the same as the default face.


3

To elaborate on theldoria's comments: If wc-mode is a major mode then either: ((markdown-mode . ((mode . wc)))) or: ((markdown-mode . ((eval . (wc-mode))))) If wc-mode is a minor mode, then: ((markdown-mode . ((eval . (wc-mode 1))))) I have assumed that markdown was an error, and have substituted markdown-mode.


3

Try rectangle-mark-mode, down N lines, forward 4 spaces, then open-rectangle.


3

Markup hiding is now part of the current development version of Markdown mode. Markup for headings, but also bold, italics, links, code, etc. can be hidden and toggled interactively using C-c C-x C-m (M-x markdown-toggle-markup-hiding). I should note that this is slightly different than what you asked in your question: even the final hash mark is hidden. ...


3

To debug performance problems, one approach is to use the built-in profiler: M-x profiler-start RET RET <reproduce the slowdown, ideally for a good 10s or so> M-x profiler-report RET Then browse the report (C-u RET is an important command there) to see where all that time is spent. Seeing your profiler report, you'll probably want to file a bug ...


2

I've found two ways that can be useful: enable hideshow mode (hs-minor-mode) and use the provided functions Apparently markdown-mode inherits from outline mode (or at least the functions are available here!) so you can use functions like hide-subtree and show-subtree.


2

How about this? (with-eval-after-load 'tex-mode (defun expand-and-insert-space () (interactive) (expand-abbrev) (insert "\ "))) (define-key latex-mode-map (kbd "<SPC>") 'expand-and-insert-space) (define-key latex-mode-map (kbd "<M-/>") 'expand-abbrev) EDITED to include eval-after-load


2

In general, the major-mode hooks run after the primary major-mode is established. Thus, you can reset the tab-width to 2 afterwards -- it happens so fast, you'll never see that it was set to 4 for a split second prior thereto. If you really want to take complete control, you may wish to consider creating your own major-mode. In the meantime, the following ...


2

It depends on how exactly you are rendering the LaTeX fragments. I'm not sure if this is possible with the markdown program, but it does work with Pandoc. To use this in markdown-mode, customize markdown-command (via M-x customize-variable) to pandoc -s --mathjax. This assumes you have pandoc installed, of course. There are other options available as well; ...


2

Thanks to chen bin, I have added a flyspell-generic-check-word-predicate function to Markdown mode. If you're using the latest development version, or use the next release version, then you won't have to use local modifications to achieve this. For those curious, perhaps to implement a predicate for another mode, the current function is below. It checks ...


2

Not an answer to the question (@DoMiNeLa10♦ already answered it perfectly), but I thought that it might be useful to point out that markdown is not the best highlighting mode for git commit messages. There is a perfect mode for this and it is called git-commit, available on Melpa. Adding (setq global-git-commit-mode t) to your init file will automatically ...


2

You can place the cursor in the middle of a clickable element by doing a "long click" (i.e. press, hold for more than 0.5s, and then release).


2

Your R output will be put in the file(s) produced by running knitr on your .Rmd file. IMHO, it doesn't make sense to have it inserted in the .Rmd file itself since that's 'input' not 'output'. I don't work in org-mode (yet?), but my understanding is that when working in that mode, it's possible to have the graphics output displayed in an emacs window. See ...


2

You can use texfrag-mode. It can be installed from melpa. After installation customize the variable texfrag-setup-alist by adding markdown-mode to the entry for texfrag-trac-wiki. Afterwards you can open your markdown file and run M-x texfrag-mode RET. Therewith you get the preview-latex menu as TeX in the menu bar. If you always want to turn on texfrag-...


Only top voted, non community-wiki answers of a minimum length are eligible