Edit: Solved, see my answer in the thread! Thanks everyone, you are awesome!
Dear #emacs users,
I am trying to re-learn emacs after using #vim for several years.
One thing that I really liked in vim is that I can "reformat" long lines in a #markdown 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 <https://jblevins.org/projects/markdown-mode/> for how to set up MELPA Stable and then install markdown-mode. In that mode, M-q fills lines without breaking the formatting.
@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...