1" Vim filetype plugin file
2" Language:    MS-DOS .bat files
3" Maintainer:  Mike Williams <[email protected]>
4" Last Change: 14th April 2019
5
6" Only do this when not done yet for this buffer
7if exists("b:did_ftplugin")
8  finish
9endif
10
11" Don't load another plugin for this buffer
12let b:did_ftplugin = 1
13
14let s:cpo_save = &cpo
15set cpo&vim
16
17" BAT comment formatting
18setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
19setlocal commentstring=::\ %s
20setlocal formatoptions-=t formatoptions+=rol
21
22" Define patterns for the browse file filter
23if has("gui_win32") && !exists("b:browsefilter")
24  let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
25endif
26
27let b:undo_ftplugin = "setlocal comments< formatoptions<"
28    \ . "| unlet! b:browsefiler"
29
30let &cpo = s:cpo_save
31unlet s:cpo_save
32