blob: 0c5cde2503243e983834d8a9dcc58f4893c8556d [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim filetype plugin file
2" Language: MS-DOS .bat files
3" Maintainer: Mike Williams <mrw@eandem.co.uk>
Bram Moolenaar2cfb4a22020-05-07 18:56:00 +02004" Last Change: 7th May 2020
Bram Moolenaar071d4272004-06-13 20:20:40 +00005
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
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020014let s:cpo_save = &cpo
15set cpo&vim
16
Bram Moolenaar071d4272004-06-13 20:20:40 +000017" BAT comment formatting
Bram Moolenaar5c736222010-01-06 20:54:52 +010018setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
Bram Moolenaar911ead12019-04-21 00:03:35 +020019setlocal commentstring=::\ %s
Bram Moolenaar071d4272004-06-13 20:20:40 +000020setlocal formatoptions-=t formatoptions+=rol
21
Bram Moolenaar2cfb4a22020-05-07 18:56:00 +020022" Lookup DOS keywords using Windows command help.
23if executable('help.exe')
24 if has('terminal')
25 setlocal keywordprg=:term\ help.exe
26 else
27 setlocal keywordprg=help.exe
28 endif
29endif
30
Bram Moolenaar071d4272004-06-13 20:20:40 +000031" Define patterns for the browse file filter
32if has("gui_win32") && !exists("b:browsefilter")
Bram Moolenaar5c736222010-01-06 20:54:52 +010033 let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
Bram Moolenaar071d4272004-06-13 20:20:40 +000034endif
Bram Moolenaard38b0552012-04-25 19:07:41 +020035
Bram Moolenaar2cfb4a22020-05-07 18:56:00 +020036let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<"
Bram Moolenaar1aeaf8c2012-05-18 13:46:39 +020037 \ . "| unlet! b:browsefiler"
38
39let &cpo = s:cpo_save
40unlet s:cpo_save