| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim filetype plugin file | 
					
						
							| 
									
										
										
										
											2023-02-20 20:44:55 +00:00
										 |  |  | " Language:    MS-DOS/Windows .bat files | 
					
						
							|  |  |  | " Maintainer:  Mike Williams <mrmrdubya@gmail.com> | 
					
						
							|  |  |  | " Last Change: 12th February 2023 | 
					
						
							| 
									
										
										
										
											2024-01-14 20:59:02 +01:00
										 |  |  | "              2024 Jan 14 by Vim Project (browsefilter) | 
					
						
							| 
									
										
										
										
											2023-02-20 20:44:55 +00:00
										 |  |  | " | 
					
						
							|  |  |  | " Options Flags: | 
					
						
							|  |  |  | " dosbatch_colons_comment       - any value to treat :: as comment line | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Only do this when not done yet for this buffer | 
					
						
							|  |  |  | if exists("b:did_ftplugin") | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Don't load another plugin for this buffer | 
					
						
							|  |  |  | let b:did_ftplugin = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " BAT comment formatting | 
					
						
							| 
									
										
										
										
											2023-02-20 20:44:55 +00:00
										 |  |  | setlocal comments=b:rem,b:@rem,b:REM,b:@REM | 
					
						
							|  |  |  | if exists("dosbatch_colons_comment") | 
					
						
							|  |  |  |   setlocal comments+=::: | 
					
						
							|  |  |  |   setlocal commentstring=::\ %s | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   setlocal commentstring=REM\ %s | 
					
						
							|  |  |  | endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | setlocal formatoptions-=t formatoptions+=rol | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-07 18:56:00 +02:00
										 |  |  | " Lookup DOS keywords using Windows command help. | 
					
						
							|  |  |  | if executable('help.exe') | 
					
						
							|  |  |  |   if has('terminal') | 
					
						
							|  |  |  |     setlocal keywordprg=:term\ help.exe | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     setlocal keywordprg=help.exe | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Define patterns for the browse file filter | 
					
						
							| 
									
										
										
										
											2024-01-14 20:59:02 +01:00
										 |  |  | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | 
					
						
							|  |  |  |   let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\n" | 
					
						
							|  |  |  |   if has("win32") | 
					
						
							|  |  |  |     let b:browsefilter ..= "All Files (*.*)\t*\n" | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     let b:browsefilter ..= "All Files (*)\t*\n" | 
					
						
							|  |  |  |   endif | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | endif | 
					
						
							| 
									
										
										
										
											2012-04-25 19:07:41 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-07 18:56:00 +02:00
										 |  |  | let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<" | 
					
						
							| 
									
										
										
										
											2024-01-14 20:59:02 +01:00
										 |  |  |     \ . "| unlet! b:browsefilter" | 
					
						
							| 
									
										
										
										
											2012-05-18 13:46:39 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save |