10

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


7

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). ...


6

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)


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 ...


5

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. ...


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

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

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 ...


3

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.


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

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


2

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, ...


2

Git uses .git/COMMIT_EDITMSG as the temporary file for the commit message. Since Emacs will be prompted to edit it by git, you can associate that file with markdown-mode by adding something like (add-to-list 'auto-mode-alist '("COMMIT_EDITMSG" . markdown-mode)) to your init file.


2

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 ...


1

I've been looking into this as well. The reason your attempt isn't working, is because of evil and the way it binds keys to a higher level keymap (as far as I understand the matter). Anyways, you can bind directly to the corresponding evil state you want to use the key in. The following should do the trick: (evil-define-key 'normal markdown-mode-map ...


1

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-...


1

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.


1

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.


1

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 ...


1

If you want to use C-c C-t for checkbox-toggle in markdown-mode then you could bind it to that key in markdown-mode-map. But that will prevent it acting as a prefix key... (Why don't you just bind it to some other, unused key?)


1

Since my comment fixed the problem, I'm posting it as an answer here. It seems that you don't have any executable called markdown in your PATH. Installing daringfireball.net/projects/markdown (preferably from some package manager like homebrew) should fix it.


1

After reading Window Choice in the emacs documentation, I was able to get the desired behaviour by setting split-height-threshold to nil. I added this to my .emacs file: (setq split-height-threshold nil)


1

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. ...


1

I made a new command for your request, the idea is: when the point is outside a list, just insert a newline as usual when the point is inside a list if the current list is empty, delete it and insert a newline otherwise, insert a new list item (defun markdown-enter-key-dwim () (interactive) (require 'subr-x) ; Needs Emacs 24.4 (...


1

You need to specify the mode-map for which you want to modify the <backspace> binding: (bind-key "<backspace>" #'cua-delete-region markdown-mode-map) What you were doing was overriding the binding in the global map. So you would see your custom binding effective only in the places where any other minor or major mode is NOT mapping the <...


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