digitalcourage.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Diese Instanz wird betrieben von Digitalcourage e.V. für die Allgemeinheit. Damit wir das nachhaltig tun können, erheben wir einen jährlichen Vorausbeitrag von 1€/Monat per SEPA-Lastschrifteinzug.

Server stats:

852
active users

Edit: Solved, see my answer in the thread! Thanks everyone, you are awesome!

Dear users,

I am trying to re-learn emacs after using for several years.

One thing that I really liked in vim is that I can "reformat" long lines in a file by marking the lines (VISUAL mode) and then hitting "gq". This kept the markdown format, e.g. lists are still lists, but the lines are wrapped at whatever I set as the maximum line length.

It seems I am missing the right search terms because I only find "M-q" aka fill-paragraph, but this does not respect e.g. markdown lists.

Does anyone have pointers or search terms for me?

@johanneskastl Emacs doesn't have a built-in Markdown mode, so you'll have to install one. See <jblevins.org/projects/markdown> for how to set up MELPA Stable and then install markdown-mode. In that mode, M-q fills lines without breaking the formatting.

jblevins.orgMarkdown Mode for EmacsA major mode for GNU Emacs for editing Markdown-formatted text files.
Johannes Kastl

@jks Thanks for the confirmation. I forgot to mention that I have this package installed and have assumed it should do the trick. But maybe I borked my configuration and it is not detecting the file as markdown.

@johanneskastl Check if your modeline has the word Markdown in parentheses, possibly followed by other indicators.

If not, the mode is not active for the current file. In that case, try M-x markdown-mode RET. If it helps, the problem is in your auto-mode-alist. If not, the package is not properly installed, and you may want to try removing and reinstalling it.

If you *are* using Markdown mode and M-q messes up the formatting, then it might be an overridden keybinding.

@jks See my reply in the thread, apparently I messed up the package and it was not working properly...