| 
									
										
										
										
											2010-05-21 12:05:36 +02:00
										 |  |  | " Vim filetype plugin | 
					
						
							|  |  |  | " Language:		Markdown | 
					
						
							|  |  |  | " Maintainer:		Tim Pope <vimNOSPAM@tpope.org> | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Last Change:		2016 Aug 29 | 
					
						
							| 
									
										
										
										
											2010-05-21 12:05:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if exists("b:did_ftplugin") | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s | 
					
						
							| 
									
										
										
										
											2013-06-01 14:50:56 +02:00
										 |  |  | setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: | 
					
						
							| 
									
										
										
										
											2010-05-21 12:05:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-14 21:17:39 +01:00
										 |  |  | if exists('b:undo_ftplugin') | 
					
						
							|  |  |  |   let b:undo_ftplugin .= "|setl cms< com< fo< flp<" | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   let b:undo_ftplugin = "setl cms< com< fo< flp<" | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2010-05-21 12:05:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | function! MarkdownFold() | 
					
						
							|  |  |  |   let line = getline(v:lnum) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Regular headers | 
					
						
							|  |  |  |   let depth = match(line, '\(^#\+\)\@<=\( .*$\)\@=') | 
					
						
							|  |  |  |   if depth > 0 | 
					
						
							|  |  |  |     return ">" . depth | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   " Setext style headings | 
					
						
							|  |  |  |   let nextline = getline(v:lnum + 1) | 
					
						
							|  |  |  |   if (line =~ '^.\+$') && (nextline =~ '^=\+$') | 
					
						
							|  |  |  |     return ">1" | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if (line =~ '^.\+$') && (nextline =~ '^-\+$') | 
					
						
							|  |  |  |     return ">2" | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   return "=" | 
					
						
							|  |  |  | endfunction | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if has("folding") && exists("g:markdown_folding") | 
					
						
							|  |  |  |   setlocal foldexpr=MarkdownFold() | 
					
						
							|  |  |  |   setlocal foldmethod=expr | 
					
						
							|  |  |  |   let b:undo_ftplugin .= " foldexpr< foldmethod<" | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-21 12:05:36 +02:00
										 |  |  | " vim:set sw=2: |