All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 *vim-markdown* Vim Markdown
3 ===============================================================================
6 1. Introduction |vim-markdown-introduction|
7 2. Installation |vim-markdown-installation|
8 3. Options |vim-markdown-options|
9 1. Disable Folding |vim-markdown-disable-folding|
10 2. Change fold style |vim-markdown-change-fold-style|
11 3. Set header folding level |vim-markdown-set-header-folding-level|
12 4. Disable Default Key Mappings |vim-markdown-disable-default-key-mappings|
13 5. Enable TOC window auto-fit |vim-markdown-enable-toc-window-auto-fit|
14 6. Text emphasis restriction to single-lines
15 |vim-markdown-text-emphasis-restriction-to-single-lines|
16 7. Syntax Concealing |vim-markdown-syntax-concealing|
17 8. Fenced code block languages |vim-markdown-fenced-code-block-languages|
18 9. Follow named anchors |vim-markdown-follow-named-anchors|
19 10. Syntax extensions |vim-markdown-syntax-extensions|
20 1. LaTeX math |vim-markdown-latex-math|
21 2. YAML Front Matter |vim-markdown-yaml-front-matter|
22 3. TOML Front Matter |vim-markdown-toml-front-matter|
23 4. JSON Front Matter |vim-markdown-json-front-matter|
24 11. Adjust new list item indent |vim-markdown-adjust-new-list-item-indent|
25 12. Do not require .md extensions for Markdown links
26 |vim-markdown-do-not-require-.md-extensions-for-markdown-links|
27 13. Auto-write when following link
28 |vim-markdown-auto-write-when-following-link|
29 14. Change default file extension |vim-markdown-auto-extension-ext|
30 4. Mappings |vim-markdown-mappings|
31 5. Commands |vim-markdown-commands|
32 6. Credits |vim-markdown-credits|
33 7. License |vim-markdown-license|
34 8. References |vim-markdown-references|
36 ===============================================================================
37 *vim-markdown-introduction*
40 Syntax highlighting, matching rules and mappings for the original Markdown [1]
43 ===============================================================================
44 *vim-markdown-installation*
47 If you use Vundle [2], add the following line to your '~/.vimrc':
49 Plugin 'godlygeek/tabular'
50 Plugin 'plasticboy/vim-markdown'
52 The 'tabular' plugin must come _before_ 'vim-markdown'.
59 If you use Pathogen [3], do this:
62 git clone https://github.com/plasticboy/vim-markdown.git
64 To install without Pathogen using the Debian vim-addon-manager [4], do this:
66 git clone https://github.com/plasticboy/vim-markdown.git
69 vim-addon-manager install markdown
71 If you are not using any package manager, download the tarball [5] and do this:
74 tar --strip=1 -zxf vim-markdown-master.tar.gz
76 ===============================================================================
77 *vim-markdown-options*
80 -------------------------------------------------------------------------------
81 *vim-markdown-disable-folding*
84 Add the following line to your '.vimrc' to disable the folding configuration:
86 let g:vim_markdown_folding_disabled = 1
88 This option only controls Vim Markdown specific folding configuration.
90 To enable/disable folding use Vim's standard folding configuration.
94 -------------------------------------------------------------------------------
95 *vim-markdown-change-fold-style*
98 To fold in a style like python-mode [6], add the following to your '.vimrc':
100 let g:vim_markdown_folding_style_pythonic = 1
102 Level 1 heading which is served as a document title is not folded.
103 'g:vim_markdown_folding_level' setting is not active with this fold style.
105 To prevent foldtext from being set add the following to your '.vimrc':
107 let g:vim_markdown_override_foldtext = 0
109 -------------------------------------------------------------------------------
110 *vim-markdown-set-header-folding-level*
111 Set header folding level ~
113 Folding level is a number between 1 and 6. By default, if not specified, it is
116 let g:vim_markdown_folding_level = 6
118 Tip: it can be changed on the fly with:
120 :let g:vim_markdown_folding_level = 1
123 -------------------------------------------------------------------------------
124 *vim-markdown-disable-default-key-mappings*
125 Disable Default Key Mappings ~
127 Add the following line to your '.vimrc' to disable default key mappings:
129 let g:vim_markdown_no_default_key_mappings = 1
131 You can also map them by yourself with '<Plug>' mappings.
133 -------------------------------------------------------------------------------
134 *vim-markdown-enable-toc-window-auto-fit*
135 Enable TOC window auto-fit ~
137 Allow for the TOC window to auto-fit when it's possible for it to shrink. It
138 never increases its default size (half screen), it only shrinks.
140 let g:vim_markdown_toc_autofit = 1
142 -------------------------------------------------------------------------------
143 *vim-markdown-text-emphasis-restriction-to-single-lines*
144 Text emphasis restriction to single-lines ~
146 By default text emphasis works across multiple lines until a closing token is
147 found. However, it's possible to restrict text emphasis to a single line (ie,
148 for it to be applied a closing token must be found on the same line). To do so:
150 let g:vim_markdown_emphasis_multiline = 0
152 -------------------------------------------------------------------------------
153 *vim-markdown-syntax-concealing*
156 Concealing is set for some syntax.
158 For example, conceal '[link text](link url)' as just 'link text'. Also,
159 '_italic_' and '*italic*' will conceal to just _italic_. Similarly '__bold__',
160 '**bold**', '___italic bold___', and '***italic bold***' will conceal to just
161 **bold**, **bold**, **_italic bold_**, and **_italic bold_** respectively.
163 To enable conceal use Vim's standard conceal configuration.
167 To disable conceal regardless of 'conceallevel' setting, add the following to
170 let g:vim_markdown_conceal = 0
172 To disable math conceal with LaTeX math syntax enabled, add the following to
175 let g:tex_conceal = ""
176 let g:vim_markdown_math = 1
178 -------------------------------------------------------------------------------
179 *vim-markdown-fenced-code-block-languages*
180 Fenced code block languages ~
182 You can use filetype name as fenced code block languages for syntax
183 highlighting. If you want to use different name from filetype, you can add it
184 in your '.vimrc' like so:
186 let g:vim_markdown_fenced_languages = ['csharp=cs']
188 This will cause the following to be highlighted using the 'cs' filetype syntax.
194 Default is "['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini']".
196 -------------------------------------------------------------------------------
197 *vim-markdown-follow-named-anchors*
198 Follow named anchors ~
200 This feature allows ge to follow named anchors in links of the form
201 'file#anchor' or just '#anchor', where file may omit the '.md' extension as
202 usual. Two variables control its operation:
204 let g:vim_markdown_follow_anchor = 1
206 This tells vim-markdown whether to attempt to follow a named anchor in a link
207 or not. When it is 1, and only if a link can be split in two parts by the
208 pattern '#', then the first part is interpreted as the file and the second one
209 as the named anchor. This also includes urls of the form '#anchor', for which
210 the first part is considered empty, meaning that the target file is the current
211 one. After the file is opened, the anchor will be searched.
215 let g:vim_markdown_anchorexpr = "'<<'.v:anchor.'>>'"
217 This expression will be evaluated substituting 'v:anchor' with a quoted string
218 that contains the anchor to visit. The result of the evaluation will become the
219 real anchor to search in the target file. This is useful in order to convert
220 anchors of the form, say, 'my-section-title' to searches of the form 'My
221 Section Title' or '<<my-section-title>>'.
225 -------------------------------------------------------------------------------
226 *vim-markdown-syntax-extensions*
229 The following options control which syntax extensions will be turned on. They
232 -------------------------------------------------------------------------------
233 *vim-markdown-latex-math*
236 Used as '$x^2$', '$$x^2$$', escapable as '\$x\$' and '\$\$x\$\$'.
238 let g:vim_markdown_math = 1
240 -------------------------------------------------------------------------------
241 *vim-markdown-yaml-front-matter*
244 Highlight YAML front matter as used by Jekyll or Hugo [7].
246 let g:vim_markdown_frontmatter = 1
248 -------------------------------------------------------------------------------
249 *vim-markdown-toml-front-matter*
252 Highlight TOML front matter as used by Hugo [7].
254 TOML syntax highlight requires vim-toml [8].
256 let g:vim_markdown_toml_frontmatter = 1
258 -------------------------------------------------------------------------------
259 *vim-markdown-json-front-matter*
262 Highlight JSON front matter as used by Hugo [7].
264 JSON syntax highlight requires vim-json [9].
266 let g:vim_markdown_json_frontmatter = 1
268 -------------------------------------------------------------------------------
269 *vim-markdown-adjust-new-list-item-indent*
270 Adjust new list item indent ~
272 You can adjust a new list indent. For example, you insert a single line like
277 Then if you type 'o' to insert new line in vim and type '* item2', the result
283 vim-markdown automatically insert the indent. By default, the number of spaces
284 of indent is 4. If you'd like to change the number as 2, just write:
286 let g:vim_markdown_new_list_item_indent = 2
288 -------------------------------------------------------------------------------
289 *vim-markdown-do-not-require-.md-extensions-for-markdown-links*
290 Do not require .md extensions for Markdown links ~
292 If you want to have a link like this '[link text](link-url)' and follow it for
293 editing in vim using the 'ge' command, but have it open the file "link-url.md"
294 instead of the file "link-url", then use this option:
296 let g:vim_markdown_no_extensions_in_markdown = 1
298 This is super useful for GitLab and GitHub wiki repositories.
300 Normal behaviour would be that vim-markup required you to do this '[link text
301 ](link-url.md)', but this is not how the Gitlab and GitHub wiki repositories
302 work. So this option adds some consistency between the two.
304 -------------------------------------------------------------------------------
305 *vim-markdown-auto-write-when-following-link*
306 Auto-write when following link ~
308 If you follow a link like this '[link text](link-url)' using the 'ge' shortcut,
309 this option will automatically save any edits you made before moving you:
311 let g:vim_markdown_autowrite = 1
313 -------------------------------------------------------------------------------
314 *vim-markdown-auto-extension-ext*
315 Change default file extension ~
317 If you would like to use a file extension other than '.md' you may do so using
318 the 'vim_markdown_auto_extension_ext' variable:
320 let g:vim_markdown_auto_extension_ext = 'txt'
322 ===============================================================================
323 *vim-markdown-mappings*
326 The following work on normal and visual modes:
329 - 'gx': open the link under the cursor in the same browser as the standard
330 'gx' command. '<Plug>Markdown_OpenUrlUnderCursor'
332 The standard 'gx' is extended by allowing you to put your cursor anywhere
335 For example, all the following cursor positions will work:
337 [Example](http://example.com)
345 Known limitation: does not work for links that span multiple lines.
348 - 'ge': open the link under the cursor in Vim for editing. Useful for
349 relative markdown links. '<Plug>Markdown_EditUrlUnderCursor'
351 The rules for the cursor position are the same as the 'gx' command.
354 - ']]': go to next header. '<Plug>Markdown_MoveToNextHeader'
357 - '[[': go to previous header. Contrast with ']c'.
358 '<Plug>Markdown_MoveToPreviousHeader'
361 - '][': go to next sibling header if any.
362 '<Plug>Markdown_MoveToNextSiblingHeader'
365 - '[]': go to previous sibling header if any.
366 '<Plug>Markdown_MoveToPreviousSiblingHeader'
369 - ']c': go to Current header. '<Plug>Markdown_MoveToCurHeader'
372 - ']u': go to parent header (Up). '<Plug>Markdown_MoveToParentHeader'
374 This plugin follows the recommended Vim plugin mapping interface, so to change
375 the map ']u' to 'asdf', add to your '.vimrc':
377 map asdf <Plug>Markdown_MoveToParentHeader
379 To disable a map use:
381 map <Plug> <Plug>Markdown_MoveToParentHeader
383 ===============================================================================
384 *vim-markdown-commands*
387 The following requires ':filetype plugin on'.
392 Decrease level of all headers in buffer: 'h2' to 'h1', 'h3' to 'h2', etc.
394 If range is given, only operate in the range.
396 If an 'h1' would be decreased, abort.
398 For simplicity of implementation, Setex headers are converted to Atx.
401 - ':HeaderIncrease': Analogous to ':HeaderDecrease', but increase levels
407 Convert all Setex style headers in buffer to Atx.
409 If a range is given, e.g. hit ':' from visual mode, only operate on the
413 - ':TableFormat': Format the table under the cursor like this [10].
415 Requires Tabular [11].
417 The input table _must_ already have a separator line as the second line of
418 the table. That line only needs to contain the correct pipes '|', nothing
422 - ':Toc': create a quickfix vertical window navigable table of contents with
425 Hit '<Enter>' on a line to jump to the corresponding line of the markdown
429 - ':Toch': Same as ':Toc' but in an horizontal window.
432 - ':Toct': Same as ':Toc' but in a new tab.
435 - ':Tocv': Same as ':Toc' for symmetry with ':Toch' and ':Tocv'.
437 ===============================================================================
438 *vim-markdown-credits*
441 The main contributors of vim-markdown are:
443 - **Ben Williams** (A.K.A. **plasticboy**). The original developer of vim-
444 markdown. Homepage [12].
446 If you feel that your name should be on this list, please make a pull request
447 listing your contributions.
449 ===============================================================================
450 *vim-markdown-license*
453 The MIT License (MIT)
455 Copyright (c) 2012 Benjamin D. Williams
457 Permission is hereby granted, free of charge, to any person obtaining a copy of
458 this software and associated documentation files (the "Software"), to deal in
459 the Software without restriction, including without limitation the rights to
460 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
461 of the Software, and to permit persons to whom the Software is furnished to do
462 so, subject to the following conditions:
464 The above copyright notice and this permission notice shall be included in all
465 copies or substantial portions of the Software.
467 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
468 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
469 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
470 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
471 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
472 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
475 ===============================================================================
476 *vim-markdown-references*
479 [1] http://daringfireball.net/projects/markdown/
480 [2] https://github.com/gmarik/vundle
481 [3] https://github.com/tpope/vim-pathogen
482 [4] http://packages.qa.debian.org/v/vim-addon-manager.html
483 [5] https://github.com/plasticboy/vim-markdown/archive/master.tar.gz
484 [6] https://github.com/klen/python-mode
485 [7] https://gohugo.io/content/front-matter/
486 [8] https://github.com/cespare/vim-toml
487 [9] https://github.com/elzr/vim-json
488 [10] http://www.cirosantilli.com/markdown-style-guide/#tables
489 [11] https://github.com/godlygeek/tabular
490 [12] http://plasticboy.com/