Markdown Cheatsheet
Latex in vim
- vim italics issue (because Latex uses underscores):
- vim will display italic text as italics as long as the environment variable
TERM
is set toxterm-256color
(looks ugly!) - if
TERM
is not set to anything, vim will highlight the italic text (looks even more ugly!)
- vim will display italic text as italics as long as the environment variable
- solution: see here
Syntax Highlighting
Code Blocks
Indentation
- If you want to add a block of code to a list item, you have to add an extra 4 spaces for every level of that list. You also have to make sure that you leave a blank line before the code block., stackexchange
Common issues in vim
- the following characters must be escaped or in a code block:
_
$
- asterisk
*
- hash
#
- be careful with spaces
- no additional space behind triple backticks!
Markdown Viewer
retext
pip install retext
- retext wiki
- config options
- config file:
nvim .config/ReText\ project/ReText.conf
- markdown extensions
- for github flavored markdown:
pip install pymdown-extensions
- add this on top of the document:
<!-- Required extensions: pymdownx.betterem, pymdownx.tilde, pymdownx.emoji, pymdownx.tasklist, pymdownx.superfences -->
Note: Install the old markdown
package version python3.8 -m pip install markdown==3.2
first.
command | description |
---|---|
retext markdown_file.md |
edit markdown_file.md |
retext --preview markdown_file.md |
preview markdown_file.md |
Tipp: | Shortcuts: s. Menu → File und Edit |
ctrl e | preview on/off |
ctrl l | live preview on/off (die live updates brauchen manchmal bisschen) |
grip
pip install grip
- see manpages.ubuntu.com
- “Preview GitHub Markdown files like Readme locally”
- view in Firefox
grip file.md 6420
(to open a second file on a different port, here6420
)