]> git.madduck.net Git - etc/vim.git/blob - doc/vim-markdown.txt

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

c430eb80bb0bf799be178bbacc2fcf16ca6c3575
[etc/vim.git] / doc / vim-markdown.txt
1 *vim-markdown*  Vim Markdown
2
3 ===============================================================================
4 Contents ~
5
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. Syntax extensions                         |vim-markdown-syntax-extensions|
14    1. LaTeX math                                      |vim-markdown-latex-math|
15    2. YAML frontmatter                          |vim-markdown-yaml-frontmatter|
16  4. Mappings                                            |vim-markdown-mappings|
17  5. Commands                                            |vim-markdown-commands|
18  6. Credits                                              |vim-markdown-credits|
19  7. License                                              |vim-markdown-license|
20  8. References                                        |vim-markdown-references|
21
22 ===============================================================================
23                                                     *vim-markdown-introduction*
24 Introduction ~
25
26 Syntax highlighting, matching rules and mappings for the original Markdown [1]
27 and extensions.
28
29 ===============================================================================
30                                                     *vim-markdown-installation*
31 Installation ~
32
33 If you use Vundle [2], add the following line to your '~/.vimrc':
34 >
35   Plugin 'godlygeek/tabular'
36   Plugin 'plasticboy/vim-markdown'
37 <
38 The 'tabular' plugin must come _before_ 'vim-markdown'.
39
40 Then run inside Vim:
41 >
42   :so ~/.vimrc
43   :PluginInstall
44 <
45 If you use Pathogen [3], do this:
46 >
47   cd ~/.vim/bundle
48   git clone https://github.com/plasticboy/vim-markdown.git
49 <
50 To install without Pathogen using the Debian vim-addon-manager [4], do this:
51 >
52   git clone https://github.com/plasticboy/vim-markdown.git
53   cd vim-markdown
54   sudo make install
55   vim-addon-manager install markdown
56 <
57 If you are not using any package manager, download the tarball [5] and do this:
58 >
59   cd ~/.vim
60   tar --strip=1 -zxf vim-markdown-master.tar.gz
61 <
62 ===============================================================================
63                                                          *vim-markdown-options*
64 Options ~
65
66 -------------------------------------------------------------------------------
67                                                  *vim-markdown-disable-folding*
68 Disable Folding ~
69
70 Add the following line to your '.vimrc' to disable the folding configuration:
71 >
72   let g:vim_markdown_folding_disabled = 1
73 <
74 This option only controls Vim Markdown specific folding configuration.
75
76 To enable/disable folding use Vim's standard folding configuration.
77 >
78   set [no]foldenable
79 <
80 -------------------------------------------------------------------------------
81                                                *vim-markdown-change-fold-style*
82 Change fold style ~
83
84 To fold in a style like python-mode [6], add the following to your '.vimrc':
85 >
86   let g:vim_markdown_folding_style_pythonic = 1
87 <
88 -------------------------------------------------------------------------------
89                                         *vim-markdown-set-header-folding-level*
90 Set header folding level ~
91
92 Folding level is a number between 1 and 6. By default, if not specified, it is
93 set to 1.
94 >
95   let g:vim_markdown_folding_level = 6
96 <
97 Tip: it can be changed on the fly with:
98 >
99   :let g:vim_markdown_folding_level = 1
100   :edit
101 <
102 -------------------------------------------------------------------------------
103                                     *vim-markdown-disable-default-key-mappings*
104 Disable Default Key Mappings ~
105
106 Add the following line to your '.vimrc' to disable default key mappings:
107 >
108   let g:vim_markdown_no_default_key_mappings = 1
109 <
110 You can also map them by yourself with '<Plug>' mappings.
111
112 -------------------------------------------------------------------------------
113                                                *vim-markdown-syntax-extensions*
114 Syntax extensions ~
115
116 The following options control which syntax extensions will be turned on. They
117 are off by default.
118
119 -------------------------------------------------------------------------------
120                                                       *vim-markdown-latex-math*
121 LaTeX math ~
122
123 Used as '$x^2$', '$$x^2$$', escapable as '\$x\$' and '\$\$x\$\$'.
124 >
125   let g:vim_markdown_math = 1
126 <
127 -------------------------------------------------------------------------------
128                                                 *vim-markdown-yaml-frontmatter*
129 YAML frontmatter ~
130
131 Highlight YAML frontmatter as used by Jekyll:
132 >
133   let g:vim_markdown_frontmatter = 1
134 <
135 ===============================================================================
136                                                         *vim-markdown-mappings*
137 Mappings ~
138
139 The following work on normal and visual modes:
140
141                                                                            *gx*
142 - 'gx': open the link under the cursor in the same browser as the standard
143   'gx' command. '<Plug>Markdown_OpenUrlUnderCursor'
144
145   The standard 'gx' is extended by allowing you to put your cursor anywhere
146   inside a link.
147
148   For example, all the following cursor positions will work:
149 >
150   [Example](http://example.com)
151   ^  ^    ^^   ^       ^
152   1  2    34   5       6
153
154   <http://example.com>
155   ^  ^               ^
156   1  2               3
157 <
158   Known limitation: does not work for links that span multiple lines.
159
160                                                                            *]]*
161 - ']]': go to next header. '<Plug>Markdown_MoveToNextHeader'
162
163                                                                            *[[*
164 - '[[': go to previous header. Contrast with ']c'.
165   '<Plug>Markdown_MoveToPreviousHeader'
166
167                                                                            *][*
168 - '][': go to next sibling header if any.
169   '<Plug>Markdown_MoveToNextSiblingHeader'
170
171                                                                            *[]*
172 - '[]': go to previous sibling header if any.
173   '<Plug>Markdown_MoveToPreviousSiblingHeader'
174
175                                                                            *]c*
176 - ']c': go to Current header. '<Plug>Markdown_MoveToCurHeader'
177
178                                                                            *]u*
179 - ']u': go to parent header (Up). '<Plug>Markdown_MoveToParentHeader'
180
181 This plugin follows the recommended Vim plugin mapping interface, so to change
182 the map ']u' to 'asdf', add to your '.vimrc':
183 >
184   map asdf <Plug>Markdown_MoveToParentHeader
185 <
186 To disable a map use:
187 >
188   map <Plug> <Plug>Markdown_MoveToParentHeader
189 <
190 ===============================================================================
191                                                         *vim-markdown-commands*
192 Commands ~
193
194                                                               *:HeaderDecrease*
195 - ':HeaderDecrease':
196
197   Decrease level of all headers in buffer: 'h2' to 'h1', 'h3' to 'h2', etc.
198
199   If range is given, only operate in the range.
200
201   If an 'h1' would be decreased, abort.
202
203   For simplicity of implementation, Setex headers are converted to Atx.
204
205                                                               *:HeaderIncrease*
206 - ':HeaderIncrease': Analogous to ':HeaderDecrease', but increase levels
207   instead.
208
209                                                                   *:SetexToAtx*
210 - ':SetexToAtx':
211
212   Convert all Setex style headers in buffer to Atx.
213
214   If a range is given, e.g. hit ':' from visual mode, only operate on the
215   range.
216
217                                                                  *:TableFormat*
218 - ':TableFormat': Format the table under the cursor like this [7].
219
220   Requires Tabular [8].
221
222   The input table _must_ already have a separator line as the second line of
223   the table. That line only needs to contain the correct pipes '|', nothing
224   else is required.
225
226                                                                          *:Toc*
227 - ':Toc': create a quickfix vertical window navigable table of contents with
228   the headers.
229
230   Hit '<Enter>' on a line to jump to the corresponding line of the markdown
231   file.
232
233                                                                         *:Toch*
234 - ':Toch': Same as ':Toc' but in an horizontal window.
235
236                                                                         *:Toct*
237 - ':Toct': Same as ':Toc' but in a new tab.
238
239                                                                         *:Tocv*
240 - ':Tocv': Same as ':Toc' for symmetry with ':Toch' and 'Tocv'.
241
242 ===============================================================================
243                                                          *vim-markdown-credits*
244 Credits ~
245
246 The main contributors of vim-markdown are:
247
248 - **Ben Williams** (A.K.A. **plasticboy**). The original developer of vim-
249   markdown. Homepage [9].
250
251 If you feel that your name should be on this list, please make a pull request
252 listing your contributions.
253
254 ===============================================================================
255                                                          *vim-markdown-license*
256 License ~
257
258 The MIT License (MIT)
259
260 Copyright (c) 2012 Benjamin D. Williams
261
262 Permission is hereby granted, free of charge, to any person obtaining a copy of
263 this software and associated documentation files (the "Software"), to deal in
264 the Software without restriction, including without limitation the rights to
265 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
266 of the Software, and to permit persons to whom the Software is furnished to do
267 so, subject to the following conditions:
268
269 The above copyright notice and this permission notice shall be included in all
270 copies or substantial portions of the Software.
271
272 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
273 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
274 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
275 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
276 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
277 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
278 SOFTWARE.
279
280 ===============================================================================
281                                                       *vim-markdown-references*
282 References ~
283
284 [1] http://daringfireball.net/projects/markdown/
285 [2] https://github.com/gmarik/vundle
286 [3] https://github.com/tpope/vim-pathogen
287 [4] http://packages.qa.debian.org/v/vim-addon-manager.html
288 [5] https://github.com/plasticboy/vim-markdown/archive/master.tar.gz
289 [6] https://github.com/klen/python-mode
290 [7] http://www.cirosantilli.com/markdown-style-guide/#tables
291 [8] https://github.com/godlygeek/tabular
292 [9] http://plasticboy.com/
293
294 vim: ft=help