Skip to content

kaushikgopal/MarkdownEditing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarkdownEditing

Markdown plugin for Sublime Text. Provides a decent Markdown color scheme (light and dark) with more robust syntax highlighting and useful Markdown editing features for Sublime Text. 3 flavors are supported: Standard Markdown, GitHub flavored Markdown, MultiMarkdown.

MarkdownEditing

Dark and yellow theme available.

Your kind donations will help me pause my daily job and put more serious effort into the development of this plugin for the next 2 milestones (2.4.0 and 3.0.0). When they are completed, donation button will be removed. Thanks.

[paypal]

Overview

Features

  • Asterisks and underscores are autopaired and will wrap selected text
    • If you start an empty pair and hit backspace, both elements are deleted
    • If you start an empty pair and hit space, the right element is deleted
  • Backticks are paired
  • At the end of a list item, pressing Enter will automatically insert the new list item bullet.
    • Pressing Tab on the blank list item will indent it and switch the list bullet to another one (Order is *, -, + in a cycle).
    • Pressing Shift Tab on the blank list item will unindent it in the same way as above.
    • Sequential Tab s or Shift Tab s are supported.
    • You can disable automatic bullet switching or choose which bullets to be used, in your settings file.
  • Left bracket pairing is modified to eliminate the selection and leave the cursor at a point where you can insert a [] or () pair for a link
  • Displays Markdown headers in the Project Symbol List (Ctrl Shift R). They will start with #, so you will know they belong to markdown files at a glance. Also they will be on top of the list because of the presedence of #.
  • ~ wraps selected text with ~~ (strikethrough).
  • Typing # when there's a selection will surround it with # to make it a headline. Multiple presses add additional hashes, increasing the level of the header. Once you hit 6 hashes, it will reset to 0 on the next press. The mde.match_header_hashes will determine if the # are mirrored on both sides or just at the beginning of the line.
  • Typing return at the end of a line that begins with hashmarks will insert closing hashmarks on the headline. They're not required for Markdown, it's just aesthetics, and you can change the mde.match_header_hashes option in your settings to disable.
  • Setext-style headers can be completed with Tab. That is, typing Tab on a line containing only = or - characters will add or remove enough characters to it to match the length of the line above.

Key Bindings

OS X Windows/Linux Description
V CtrlWinV Pastes the contents of the clipboard as an inline link on selected text.
R CtrlWinR Pastes the contents of the clipboard as a reference link.
K CtrlWinK Inserts a standard inline link.
K ShiftWinK Inserts an inline image.
B I CtrlShiftB CtrlShiftI These are bound to bold and italic. They work both with and without selections. If there is no selection, they will just transform the word under the cursor. These keybindings will unbold/unitalicize selection if it is already bold/italic.
^1...6 Ctrl1...6 These will add the corresponding number of hashmarks for headlines. Works on blank lines and selected text in tandem with the above headline tools. If you select an entire existing headline, the current hashmarks will be removed and replaced with the header level you requested. This command respects the mde.match_header_hashes preference setting.
6 Ctrl6 Inserts a footnote and jump to its definition. If your cursor is in a definition, it will jump back to the marker.
F AltShiftF Locates footnote markers without definitions and inserts their markers for the definition.
G AltShiftG Locates link references without definitions and inserts their labels at the bottom for the definition.

GFM Spesific Features

Underscores in words doesn't mess with bold or italic style:

underscore-in-words

Fenced code blocks gets syntax highlighting inside:

fenced-code-block

Keyboard shortcuts gets highlighted like in GitHub:

keyboard-shortcut

Strikethrough is supported:

strikethrough

Commands for Command Palette

Fix Underlined Headers

Adjusts every setext-style header to add or remove = or - characters as needed to match the lengths of their header text.

Add Missing Link Labels

Scans document for referenced link usages ([some link][some_ref] and [some link][]) and checks if they are all defined. If there are undefined link references, command will automatically create their definition snippet at the bottom of the file.

Installation

Note: Sublime text has a native tiny package for Markdown. However, when MarkdownEditing is enabled, native package causes some conflicts. For this reason, MarkdownEditing will automatically disable it. Since it doesn't bring anything new over MarkdownEditing, this is not a loss. But remember, when you disable MarkdownEditing, you have to reenable the native one manually (if you want).

If you are using Sublime Text 2, you have to disable the native package manually. To do that, add Markdown to your ignored_packages list in ST user settings:

"ignored_packages": [..., "Markdown"],

The preferred method of installation is via Sublime Package Control.

  1. Install Sublime Package Control
  2. From inside Sublime Text, open Package Control's Command Pallet: CTRL SHIFT P (Windows, Linux) or CMD SHIFT P on Mac.
  3. Type install package and hit Return. A list of available packages will be displayed.
  4. Type MarkdownEditing and hit Return. The package will be downloaded to the appropriate directory.
  5. Restart Sublime Text to complete installation. Open a Markdown file and this custom theme. The features listed above should now be available.

Manual Installation

  1. Download or clone this repository to a directory MarkdownEditing in the Sublime Text Packages directory for your platform:
    • Mac: git clone https://github.com/SublimeText-Markdown/MarkdownEditing.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/MarkdownEditing
    • Windows: git clone https://github.com/SublimeText-Markdown/MarkdownEditing.git %APPDATA%\Sublime/ Text/ 2/\MarkdownEditing
    • Linux: git clone https://github.com/SublimeText-Markdown/MarkdownEditing.git ~/.Sublime\ Text\ 2/Packages/MarkdownEditing
  2. Restart Sublime Text to complete installation. Open a Markdown file and this custom theme. The features listed above should now be available.

Configuration

The plugin contains 3 different Markdown flavors: Standard Markdown, GitHub flavored Markdown, MultiMarkdown. Default is GitHub flavored Markdown. If you want to set another one as default, open a Markdown file and select your flavor from the menu: View > Syntax > Open all with current extension as. You're done.

You may want to have a look at the default settings files. They are located at:

Packages/MarkdownEditing/Markdown.sublime-settings         [GitHub flavored Markdown]
Packages/MarkdownEditing/Markdown (Standard).sublime-settings
Packages/MarkdownEditing/MultiMarkdown.sublime-settings

If you want to override any of the default settings, you can open the appropriate user settings file using the Preferences > Package Settings > Markdown Editing menu. Each flavor has a different settings file.

Bold and italic markers are configurable through ST shell variables. You can use Preferences > Package Settings > Markdown Editing menu to see the default settings file. In order to override it, copy & paste its content into the user settings file (Packages/User/Bold and Italic Markers.tmPreferences) from the menu and make your edits. It is pretty straightforward.

In order to activate the dark or the yellow theme, put one of these lines to your user settings file of the flavor (Packages/User/[flavor].sublime-settings):

"color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme",
"color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Yellow.tmTheme",

If you want to go with your already existing theme, you can reenable it with the same method as above. Keep in mind that, that theme may not cover all the parts of the Markdown syntax that this plugin defines.

By default, when you install the plugin, files with these extensions will be assigned to Markdown syntax: "md", "txt", "mdown", "markdown", "markdn". If you want to prevent any of these extensions to be opened as Markdown, follow these steps:

  1. Click on the language menu at bottom right
  2. Select "Open all with current extension as"
  3. Choose your preferred syntax for that extension

Tips

  • Sublime Text has a Distraction Free mode which is great with Markdown writing. Key binding for it: Shift F11 on Windows/Linux, Ctrl Shift F on Mac OS X.

  • If you install FullScreenStatus plugin, MarkdownEditing will provide an extra functionality for Distraction Free mode. When you switch to Distraction Free mode, your current line will always be vertically centered as you edit. You can enable this functionality for normal mode, too, via settings.

  • If you work with Markdown tables too often, you may want to have a look at another plugin named TableEditor. It brings huge improvements for table editing. Several table formats are supported.

  • There is a plugin named Typewriter which provides a typewriter like writing environment. Excerpt from its homepage:

    Typewriter Typing disables your cursor keys and all bindings that move the cursor and/or select text, leaving you only with letters, numbers, symbols, Backspace, Delete and Enter.

  • Markdown files usually contains URLs. If you want to open URLs under the cursor with a keybinding, you may want to install OpenUrl plugin. It will work on other file types, too.

  • See this excellent list on Macstories for more tips and tricks.

Similar Plugins

  • Knockdown

    Knockdown offers useful Markdown features and a custom Markdown theme. All of its unique features except its theme are ported to MarkdownEditing and some of them are actually improved further in MarkdownEditing.

  • Sublime Markdown Extended

  • SmartMarkdown

Contributing

See CONTRIBUTING.md file.

Credits

MarkdownEditing was originally created by Brett Terpstra and has become a community project with the goal of consolidating the best features from the varied collection of Markdown packages for Sublime Text. Current development is headed up by Ali Ayas.

Related blog posts from Brett:

This plugin contains portions of code from Knockdown.

Footnote commands were submitted by J. Nicholas Geist and originated at geekabouttown.

License

MarkdownEditing is released under the MIT License.

About

The humble beginnings of a better Markdown editing package for Sublime Text 2 (Currently OS X-only)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%