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. Syntax extensions |vim-markdown-syntax-extensions|
19 1. LaTeX math |vim-markdown-latex-math|
20 2. YAML Front Matter |vim-markdown-yaml-front-matter|
21 3. TOML Front Matter |vim-markdown-toml-front-matter|
22 4. JSON Front Matter |vim-markdown-json-front-matter|
23 10. Adjust new list item indent |vim-markdown-adjust-new-list-item-indent|
24 4. Mappings |vim-markdown-mappings|
25 5. Commands |vim-markdown-commands|
26 6. Credits |vim-markdown-credits|
27 7. License |vim-markdown-license|
28 8. References |vim-markdown-references|
30 ===============================================================================
31 *vim-markdown-introduction*
34 Syntax highlighting, matching rules and mappings for the original Markdown [1]
37 ===============================================================================
38 *vim-markdown-installation*
41 If you use Vundle [2], add the following line to your '~/.vimrc':
43 Plugin 'godlygeek/tabular'
44 Plugin 'plasticboy/vim-markdown'
46 The 'tabular' plugin must come _before_ 'vim-markdown'.
53 If you use Pathogen [3], do this:
56 git clone https://github.com/plasticboy/vim-markdown.git
58 To install without Pathogen using the Debian vim-addon-manager [4], do this:
60 git clone https://github.com/plasticboy/vim-markdown.git
63 vim-addon-manager install markdown
65 If you are not using any package manager, download the tarball [5] and do this:
68 tar --strip=1 -zxf vim-markdown-master.tar.gz
70 ===============================================================================
71 *vim-markdown-options*
74 -------------------------------------------------------------------------------
75 *vim-markdown-disable-folding*
78 Add the following line to your '.vimrc' to disable the folding configuration:
80 let g:vim_markdown_folding_disabled = 1
82 This option only controls Vim Markdown specific folding configuration.
84 To enable/disable folding use Vim's standard folding configuration.
88 -------------------------------------------------------------------------------
89 *vim-markdown-change-fold-style*
92 To fold in a style like python-mode [6], add the following to your '.vimrc':
94 let g:vim_markdown_folding_style_pythonic = 1
96 Level 1 heading which is served as a document title is not folded.
97 'g:vim_markdown_folding_level' setting is not active with this fold style.
99 To prevent foldtext from being overridden, add the following to your '.vimrc':
101 let g:vim_markdown_override_foldtext = 0
103 -------------------------------------------------------------------------------
104 *vim-markdown-set-header-folding-level*
105 Set header folding level ~
107 Folding level is a number between 1 and 6. By default, if not specified, it is
110 let g:vim_markdown_folding_level = 6
112 Tip: it can be changed on the fly with:
114 :let g:vim_markdown_folding_level = 1
117 -------------------------------------------------------------------------------
118 *vim-markdown-disable-default-key-mappings*
119 Disable Default Key Mappings ~
121 Add the following line to your '.vimrc' to disable default key mappings:
123 let g:vim_markdown_no_default_key_mappings = 1
125 You can also map them by yourself with '<Plug>' mappings.
127 -------------------------------------------------------------------------------
128 *vim-markdown-enable-toc-window-auto-fit*
129 Enable TOC window auto-fit ~
131 Allow for the TOC window to auto-fit when it's possible for it to shrink. It
132 never increases its default size (half screen), it only shrinks.
134 let g:vim_markdown_toc_autofit = 1
136 -------------------------------------------------------------------------------
137 *vim-markdown-text-emphasis-restriction-to-single-lines*
138 Text emphasis restriction to single-lines ~
140 By default text emphasis works across multiple lines until a closing token is
141 found. However, it's possible to restrict text emphasis to a single line (ie,
142 for it to be applied a closing token must be found on the same line). To do so:
144 let g:vim_markdown_emphasis_multiline = 0
146 -------------------------------------------------------------------------------
147 *vim-markdown-syntax-concealing*
150 Concealing is set for some syntax.
152 For example, conceal '[link text](link url)' as just 'link text'.
153 Also, '_italic_' and '*italic*' will conceal to just 'italic'.
154 Similarly '__bold__', '**bold**', '___italic bold___', and '***italic bold***'
155 will conceal to 'bold', 'bold', 'italic bold', and 'italic bold' respectively.
157 To enable conceal use Vim's standard conceal configuration.
161 To disable conceal regardless of 'conceallevel' setting, add the following to
164 let g:vim_markdown_conceal = 0
166 -------------------------------------------------------------------------------
167 *vim-markdown-fenced-code-block-languages*
168 Fenced code block languages ~
170 You can use filetype name as fenced code block languages for syntax
171 highlighting. If you want to use different name from filetype, you can add it
172 in your '.vimrc' like so:
174 let g:vim_markdown_fenced_languages = ['csharp=cs']
176 This will cause the following to be highlighted using the 'cs' filetype syntax.
182 Default is "['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini']".
184 -------------------------------------------------------------------------------
185 *vim-markdown-syntax-extensions*
188 The following options control which syntax extensions will be turned on. They
191 -------------------------------------------------------------------------------
192 *vim-markdown-latex-math*
195 Used as '$x^2$', '$$x^2$$', escapable as '\$x\$' and '\$\$x\$\$'.
197 let g:vim_markdown_math = 1
199 -------------------------------------------------------------------------------
200 *vim-markdown-yaml-front-matter*
203 Highlight YAML front matter as used by Jekyll or Hugo [7].
205 let g:vim_markdown_frontmatter = 1
207 -------------------------------------------------------------------------------
208 *vim-markdown-toml-front-matter*
211 Highlight TOML front matter as used by Hugo [7].
213 TOML syntax highlight requires vim-toml [8].
215 let g:vim_markdown_toml_frontmatter = 1
217 -------------------------------------------------------------------------------
218 *vim-markdown-json-front-matter*
221 Highlight JSON front matter as used by Hugo [7].
223 JSON syntax highlight requires vim-json [9].
225 let g:vim_markdown_json_frontmatter = 1
227 -------------------------------------------------------------------------------
228 *vim-markdown-adjust-new-list-item-indent*
229 Adjust new list item indent ~
231 You can adjust a new list indent. For example, you insert a single line like
236 Then if you type 'o' to insert new line in vim and type '* item2', the result
242 vim-markdown automatically insert the indent. By default, the number of spaces
243 of indent is 4. If you'd like to change the number as 2, just write:
245 let g:vim_markdown_new_list_item_indent = 2
247 ===============================================================================
248 *vim-markdown-mappings*
251 The following work on normal and visual modes:
254 - 'gx': open the link under the cursor in the same browser as the standard
255 'gx' command. '<Plug>Markdown_OpenUrlUnderCursor'
257 The standard 'gx' is extended by allowing you to put your cursor anywhere
260 For example, all the following cursor positions will work:
262 [Example](http://example.com)
270 Known limitation: does not work for links that span multiple lines.
273 - 'ge': open the link under the cursor in Vim for editing. Useful for
274 relative markdown links. '<Plug>Markdown_EditUrlUnderCursor'
276 The rules for the cursor position are the same as the 'gx' command.
279 - ']]': go to next header. '<Plug>Markdown_MoveToNextHeader'
282 - '[[': go to previous header. Contrast with ']c'.
283 '<Plug>Markdown_MoveToPreviousHeader'
286 - '][': go to next sibling header if any.
287 '<Plug>Markdown_MoveToNextSiblingHeader'
290 - '[]': go to previous sibling header if any.
291 '<Plug>Markdown_MoveToPreviousSiblingHeader'
294 - ']c': go to Current header. '<Plug>Markdown_MoveToCurHeader'
297 - ']u': go to parent header (Up). '<Plug>Markdown_MoveToParentHeader'
299 This plugin follows the recommended Vim plugin mapping interface, so to change
300 the map ']u' to 'asdf', add to your '.vimrc':
302 map asdf <Plug>Markdown_MoveToParentHeader
304 To disable a map use:
306 map <Plug> <Plug>Markdown_MoveToParentHeader
308 ===============================================================================
309 *vim-markdown-commands*
312 The following requires ':filetype plugin on'.
317 Decrease level of all headers in buffer: 'h2' to 'h1', 'h3' to 'h2', etc.
319 If range is given, only operate in the range.
321 If an 'h1' would be decreased, abort.
323 For simplicity of implementation, Setex headers are converted to Atx.
326 - ':HeaderIncrease': Analogous to ':HeaderDecrease', but increase levels
332 Convert all Setex style headers in buffer to Atx.
334 If a range is given, e.g. hit ':' from visual mode, only operate on the
338 - ':TableFormat': Format the table under the cursor like this [10].
340 Requires Tabular [11].
342 The input table _must_ already have a separator line as the second line of
343 the table. That line only needs to contain the correct pipes '|', nothing
347 - ':Toc': create a quickfix vertical window navigable table of contents with
350 Hit '<Enter>' on a line to jump to the corresponding line of the markdown
354 - ':Toch': Same as ':Toc' but in an horizontal window.
357 - ':Toct': Same as ':Toc' but in a new tab.
360 - ':Tocv': Same as ':Toc' for symmetry with ':Toch' and ':Tocv'.
362 ===============================================================================
363 *vim-markdown-credits*
366 The main contributors of vim-markdown are:
368 - **Ben Williams** (A.K.A. **plasticboy**). The original developer of vim-
369 markdown. Homepage [12].
371 If you feel that your name should be on this list, please make a pull request
372 listing your contributions.
374 ===============================================================================
375 *vim-markdown-license*
378 The MIT License (MIT)
380 Copyright (c) 2012 Benjamin D. Williams
382 Permission is hereby granted, free of charge, to any person obtaining a copy of
383 this software and associated documentation files (the "Software"), to deal in
384 the Software without restriction, including without limitation the rights to
385 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
386 of the Software, and to permit persons to whom the Software is furnished to do
387 so, subject to the following conditions:
389 The above copyright notice and this permission notice shall be included in all
390 copies or substantial portions of the Software.
392 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
393 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
394 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
395 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
396 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
397 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
400 ===============================================================================
401 *vim-markdown-references*
404 [1] http://daringfireball.net/projects/markdown/
405 [2] https://github.com/gmarik/vundle
406 [3] https://github.com/tpope/vim-pathogen
407 [4] http://packages.qa.debian.org/v/vim-addon-manager.html
408 [5] https://github.com/plasticboy/vim-markdown/archive/master.tar.gz
409 [6] https://github.com/klen/python-mode
410 [7] https://gohugo.io/content/front-matter/
411 [8] https://github.com/cespare/vim-toml
412 [9] https://github.com/elzr/vim-json
413 [10] http://www.cirosantilli.com/markdown-style-guide/#tables
414 [11] https://github.com/godlygeek/tabular
415 [12] http://plasticboy.com/