7
|
1 " Vim filetype plugin file
|
32004
|
2 " Language: MS-DOS/Windows .bat files
|
|
3 " Maintainer: Mike Williams <mrmrdubya@gmail.com>
|
|
4 " Last Change: 12th February 2023
|
|
5 "
|
|
6 " Options Flags:
|
|
7 " dosbatch_colons_comment - any value to treat :: as comment line
|
7
|
8
|
|
9 " Only do this when not done yet for this buffer
|
|
10 if exists("b:did_ftplugin")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 " Don't load another plugin for this buffer
|
|
15 let b:did_ftplugin = 1
|
|
16
|
3513
|
17 let s:cpo_save = &cpo
|
|
18 set cpo&vim
|
|
19
|
7
|
20 " BAT comment formatting
|
32004
|
21 setlocal comments=b:rem,b:@rem,b:REM,b:@REM
|
|
22 if exists("dosbatch_colons_comment")
|
|
23 setlocal comments+=:::
|
|
24 setlocal commentstring=::\ %s
|
|
25 else
|
|
26 setlocal commentstring=REM\ %s
|
|
27 endif
|
7
|
28 setlocal formatoptions-=t formatoptions+=rol
|
|
29
|
20317
|
30 " Lookup DOS keywords using Windows command help.
|
|
31 if executable('help.exe')
|
|
32 if has('terminal')
|
|
33 setlocal keywordprg=:term\ help.exe
|
|
34 else
|
|
35 setlocal keywordprg=help.exe
|
|
36 endif
|
|
37 endif
|
|
38
|
7
|
39 " Define patterns for the browse file filter
|
|
40 if has("gui_win32") && !exists("b:browsefilter")
|
2034
|
41 let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
|
7
|
42 endif
|
3492
|
43
|
20317
|
44 let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<"
|
3513
|
45 \ . "| unlet! b:browsefiler"
|
|
46
|
|
47 let &cpo = s:cpo_save
|
|
48 unlet s:cpo_save
|