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 4. Mappings |vim-markdown-mappings|
30 5. Commands |vim-markdown-commands|
31 6. Credits |vim-markdown-credits|
32 7. License |vim-markdown-license|
33 8. References |vim-markdown-references|
35 ===============================================================================
36 *vim-markdown-introduction*
39 Syntax highlighting, matching rules and mappings for the original Markdown [1]
42 ===============================================================================
43 *vim-markdown-installation*
46 If you use Vundle [2], add the following line to your '~/.vimrc':
48 Plugin 'godlygeek/tabular'
49 Plugin 'plasticboy/vim-markdown'
51 The 'tabular' plugin must come _before_ 'vim-markdown'.
58 If you use Pathogen [3], do this:
61 git clone https://github.com/plasticboy/vim-markdown.git
63 To install without Pathogen using the Debian vim-addon-manager [4], do this:
65 git clone https://github.com/plasticboy/vim-markdown.git
68 vim-addon-manager install markdown
70 If you are not using any package manager, download the tarball [5] and do this:
73 tar --strip=1 -zxf vim-markdown-master.tar.gz
75 ===============================================================================
76 *vim-markdown-options*
79 -------------------------------------------------------------------------------
80 *vim-markdown-disable-folding*
83 Add the following line to your '.vimrc' to disable the folding configuration:
85 let g:vim_markdown_folding_disabled = 1
87 This option only controls Vim Markdown specific folding configuration.
89 To enable/disable folding use Vim's standard folding configuration.
93 -------------------------------------------------------------------------------
94 *vim-markdown-change-fold-style*
97 To fold in a style like python-mode [6], add the following to your '.vimrc':
99 let g:vim_markdown_folding_style_pythonic = 1
101 Level 1 heading which is served as a document title is not folded.
102 'g:vim_markdown_folding_level' setting is not active with this fold style.
104 To prevent foldtext from being set add the following to your '.vimrc':
106 let g:vim_markdown_override_foldtext = 0
108 -------------------------------------------------------------------------------
109 *vim-markdown-set-header-folding-level*
110 Set header folding level ~
112 Folding level is a number between 1 and 6. By default, if not specified, it is
115 let g:vim_markdown_folding_level = 6
117 Tip: it can be changed on the fly with:
119 :let g:vim_markdown_folding_level = 1
122 -------------------------------------------------------------------------------
123 *vim-markdown-disable-default-key-mappings*
124 Disable Default Key Mappings ~
126 Add the following line to your '.vimrc' to disable default key mappings:
128 let g:vim_markdown_no_default_key_mappings = 1
130 You can also map them by yourself with '<Plug>' mappings.
132 -------------------------------------------------------------------------------
133 *vim-markdown-enable-toc-window-auto-fit*
134 Enable TOC window auto-fit ~
136 Allow for the TOC window to auto-fit when it's possible for it to shrink. It
137 never increases its default size (half screen), it only shrinks.
139 let g:vim_markdown_toc_autofit = 1
141 -------------------------------------------------------------------------------
142 *vim-markdown-text-emphasis-restriction-to-single-lines*
143 Text emphasis restriction to single-lines ~
145 By default text emphasis works across multiple lines until a closing token is
146 found. However, it's possible to restrict text emphasis to a single line (ie,
147 for it to be applied a closing token must be found on the same line). To do so:
149 let g:vim_markdown_emphasis_multiline = 0
151 -------------------------------------------------------------------------------
152 *vim-markdown-syntax-concealing*
155 Concealing is set for some syntax.
157 For example, conceal '[link text](link url)' as just 'link text'. Also,
158 '_italic_' and '*italic*' will conceal to just _italic_. Similarly '__bold__',
159 '**bold**', '___italic bold___', and '***italic bold***' will conceal to just
160 **bold**, **bold**, **_italic bold_**, and **_italic bold_** respectively.
162 To enable conceal use Vim's standard conceal configuration.
166 To disable conceal regardless of 'conceallevel' setting, add the following to
169 let g:vim_markdown_conceal = 0
171 To disable math conceal with LaTeX math syntax enabled, add the following to
174 let g:tex_conceal = ""
175 let g:vim_markdown_math = 1
177 -------------------------------------------------------------------------------
178 *vim-markdown-fenced-code-block-languages*
179 Fenced code block languages ~
181 You can use filetype name as fenced code block languages for syntax
182 highlighting. If you want to use different name from filetype, you can add it
183 in your '.vimrc' like so:
185 let g:vim_markdown_fenced_languages = ['csharp=cs']
187 This will cause the following to be highlighted using the 'cs' filetype syntax.
193 Default is "['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini']".
195 -------------------------------------------------------------------------------
196 *vim-markdown-follow-named-anchors*
197 Follow named anchors ~
199 This feature allows ge to follow named anchors in links of the form
200 'file#anchor' or just '#anchor', where file may omit the '.md' extension as
201 usual. Two variables control its operation:
203 let g:vim_markdown_follow_anchor = 1
205 This tells vim-markdown whether to attempt to follow a named anchor in a link
206 or not. When it is 1, and only if a link can be split in two parts by the
207 pattern '#', then the first part is interpreted as the file and the second one
208 as the named anchor. This also includes urls of the form '#anchor', for which
209 the first part is considered empty, meaning that the target file is the current
210 one. After the file is opened, the anchor will be searched.
214 let g:vim_markdown_anchorexpr = "'<<'.v:anchor.'>>'"
216 This expression will be evaluated substituting 'v:anchor' with a quoted string
217 that contains the anchor to visit. The result of the evaluation will become the
218 real anchor to search in the target file. This is useful in order to convert
219 anchors of the form, say, 'my-section-title' to searches of the form 'My
220 Section Title' or '<<my-section-title>>'.
224 -------------------------------------------------------------------------------
225 *vim-markdown-syntax-extensions*
228 The following options control which syntax extensions will be turned on. They
231 -------------------------------------------------------------------------------
232 *vim-markdown-latex-math*
235 Used as '$x^2$', '$$x^2$$', escapable as '\$x\$' and '\$\$x\$\$'.
237 let g:vim_markdown_math = 1
239 -------------------------------------------------------------------------------
240 *vim-markdown-yaml-front-matter*
243 Highlight YAML front matter as used by Jekyll or Hugo [7].
245 let g:vim_markdown_frontmatter = 1
247 -------------------------------------------------------------------------------
248 *vim-markdown-toml-front-matter*
251 Highlight TOML front matter as used by Hugo [7].
253 TOML syntax highlight requires vim-toml [8].
255 let g:vim_markdown_toml_frontmatter = 1
257 -------------------------------------------------------------------------------
258 *vim-markdown-json-front-matter*
261 Highlight JSON front matter as used by Hugo [7].
263 JSON syntax highlight requires vim-json [9].
265 let g:vim_markdown_json_frontmatter = 1
267 -------------------------------------------------------------------------------
268 *vim-markdown-adjust-new-list-item-indent*
269 Adjust new list item indent ~
271 You can adjust a new list indent. For example, you insert a single line like
276 Then if you type 'o' to insert new line in vim and type '* item2', the result
282 vim-markdown automatically insert the indent. By default, the number of spaces
283 of indent is 4. If you'd like to change the number as 2, just write:
285 let g:vim_markdown_new_list_item_indent = 2
287 -------------------------------------------------------------------------------
288 *vim-markdown-do-not-require-.md-extensions-for-markdown-links*
289 Do not require .md extensions for Markdown links ~
291 If you want to have a link like this '[link text](link-url)' and follow it for
292 editing in vim using the 'ge' command, but have it open the file "link-url.md"
293 instead of the file "link-url", then use this option:
295 let g:vim_markdown_no_extensions_in_markdown = 1
297 This is super useful for GitLab and GitHub wiki repositories.
299 Normal behaviour would be that vim-markup required you to do this '[link text
300 ](link-url.md)', but this is not how the Gitlab and GitHub wiki repositories
301 work. So this option adds some consistency between the two.
303 -------------------------------------------------------------------------------
304 *vim-markdown-auto-write-when-following-link*
305 Auto-write when following link ~
307 If you follow a link like this '[link text](link-url)' using the 'ge' shortcut,
308 this option will automatically save any edits you made before moving you:
310 let g:vim_markdown_autowrite = 1
312 ===============================================================================
313 *vim-markdown-mappings*
316 The following work on normal and visual modes:
319 - 'gx': open the link under the cursor in the same browser as the standard
320 'gx' command. '<Plug>Markdown_OpenUrlUnderCursor'
322 The standard 'gx' is extended by allowing you to put your cursor anywhere
325 For example, all the following cursor positions will work:
327 [Example](http://example.com)
335 Known limitation: does not work for links that span multiple lines.
338 - 'ge': open the link under the cursor in Vim for editing. Useful for
339 relative markdown links. '<Plug>Markdown_EditUrlUnderCursor'
341 The rules for the cursor position are the same as the 'gx' command.
344 - ']]': go to next header. '<Plug>Markdown_MoveToNextHeader'
347 - '[[': go to previous header. Contrast with ']c'.
348 '<Plug>Markdown_MoveToPreviousHeader'
351 - '][': go to next sibling header if any.
352 '<Plug>Markdown_MoveToNextSiblingHeader'
355 - '[]': go to previous sibling header if any.
356 '<Plug>Markdown_MoveToPreviousSiblingHeader'
359 - ']c': go to Current header. '<Plug>Markdown_MoveToCurHeader'
362 - ']u': go to parent header (Up). '<Plug>Markdown_MoveToParentHeader'
364 This plugin follows the recommended Vim plugin mapping interface, so to change
365 the map ']u' to 'asdf', add to your '.vimrc':
367 map asdf <Plug>Markdown_MoveToParentHeader
369 To disable a map use:
371 map <Plug> <Plug>Markdown_MoveToParentHeader
373 ===============================================================================
374 *vim-markdown-commands*
377 The following requires ':filetype plugin on'.
382 Decrease level of all headers in buffer: 'h2' to 'h1', 'h3' to 'h2', etc.
384 If range is given, only operate in the range.
386 If an 'h1' would be decreased, abort.
388 For simplicity of implementation, Setex headers are converted to Atx.
391 - ':HeaderIncrease': Analogous to ':HeaderDecrease', but increase levels
397 Convert all Setex style headers in buffer to Atx.
399 If a range is given, e.g. hit ':' from visual mode, only operate on the
403 - ':TableFormat': Format the table under the cursor like this [10].
405 Requires Tabular [11].
407 The input table _must_ already have a separator line as the second line of
408 the table. That line only needs to contain the correct pipes '|', nothing
412 - ':Toc': create a quickfix vertical window navigable table of contents with
415 Hit '<Enter>' on a line to jump to the corresponding line of the markdown
419 - ':Toch': Same as ':Toc' but in an horizontal window.
422 - ':Toct': Same as ':Toc' but in a new tab.
425 - ':Tocv': Same as ':Toc' for symmetry with ':Toch' and ':Tocv'.
427 ===============================================================================
428 *vim-markdown-credits*
431 The main contributors of vim-markdown are:
433 - **Ben Williams** (A.K.A. **plasticboy**). The original developer of vim-
434 markdown. Homepage [12].
436 If you feel that your name should be on this list, please make a pull request
437 listing your contributions.
439 ===============================================================================
440 *vim-markdown-license*
443 The MIT License (MIT)
445 Copyright (c) 2012 Benjamin D. Williams
447 Permission is hereby granted, free of charge, to any person obtaining a copy of
448 this software and associated documentation files (the "Software"), to deal in
449 the Software without restriction, including without limitation the rights to
450 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
451 of the Software, and to permit persons to whom the Software is furnished to do
452 so, subject to the following conditions:
454 The above copyright notice and this permission notice shall be included in all
455 copies or substantial portions of the Software.
457 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
458 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
459 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
460 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
461 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
462 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
465 ===============================================================================
466 *vim-markdown-references*
469 [1] http://daringfireball.net/projects/markdown/
470 [2] https://github.com/gmarik/vundle
471 [3] https://github.com/tpope/vim-pathogen
472 [4] http://packages.qa.debian.org/v/vim-addon-manager.html
473 [5] https://github.com/plasticboy/vim-markdown/archive/master.tar.gz
474 [6] https://github.com/klen/python-mode
475 [7] https://gohugo.io/content/front-matter/
476 [8] https://github.com/cespare/vim-toml
477 [9] https://github.com/elzr/vim-json
478 [10] http://www.cirosantilli.com/markdown-style-guide/#tables
479 [11] https://github.com/godlygeek/tabular
480 [12] http://plasticboy.com/