Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruslan Brest's Markdown syntax #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 76 additions & 22 deletions misc/syntax/markdown.syntax
Original file line number Diff line number Diff line change
@@ -1,30 +1,84 @@
# Markdown syntax highlighting
# Markdown syntax highlight config for MC (MidnigntCommander)
# (not full, but usable)
#
# https://gist.github.com/rb2/1f6b23ea5ea848c75a8c
#
# Authors:
# Ruslan Brest, http://rb.labtodo.com, 2013
#
# Usage:
#
# $ mc --version
# GNU Midnight Commander 4.8.15
#
# 1. copy to `~/.local/share/mc/syntax/markdown.syntax`
# 2. Add these 2 lines to `~/.config/mc/mcedit/Syntax`:
#
# file ..\*\\.(md|markdown|txt|text)$ Markdown
# include /home/rb/.local/share/mc/syntax/markdown.syntax

context default lightgray
spellcheck
# links
keyword whole [*](*) yellow
keyword \*\* white
keyword \* yellow
keyword \\_ lightgray
keyword wholeleft __ white
keyword wholeright __ white
keyword wholeleft _ yellow
keyword wholeright _ yellow

context linestart #### \n red
spellcheck

context linestart # \n brightred
spellcheck
context default
## Links
## keyword [*](http*) brightcyan/17
keyword [*] cyan
keyword <*> yellow
keyword (http*) brightmagenta
keyword (ftp*) brightmagenta
keyword (//*) brightmagenta

## **Bold** or __Bold__
keyword \*\**\*\* yellow
keyword __*__ yellow
## *italic* or _italic_
keyword \s\**\*\s white
keyword \s_*_\s white


## Horisontal ruler
keyword linestart -+ white

## List
keyword linestart \* brightgreen
keyword linestart - brightgreen

context linestart > \n green
# keyword \{0123456789\} white

## Headings
#context linestart #+ \n lightgray brightred bold
context linestart #+ \n black yellow bold
spellcheck

context linestart \s\s\s\s \n cyan
## (not Markdown) TODO
context linestart TODO: \n brightred


## Code, tt, pre
context ``` ``` brightred
context ` ` brightred

context ``` ``` cyan
context linestart From:\s \n\n cyan
keyword linestart From: brightgreen
keyword linestart From\s brightred
keyword <*@*> white
keyword whole +@+ white
keyword linestart To: brightmagenta
keyword linestart Subject: brightred/Orange
keyword linestart +: brown

context `` `` cyan
context linestart Date:\s \n\n cyan
keyword linestart From: brightgreen
keyword linestart From\s brightred
keyword <*@*> white
keyword whole +@+ white
keyword linestart To: brightmagenta
keyword linestart Subject: brightred/Orange
keyword linestart +: brown

context linestart Title:\s \n\n cyan
keyword linestart Author: brightgreen
keyword linestart +: brown

context " " green
spellcheck

context ` ` cyan