2014-07-10 21:05:51 -07:00
|
|
|
" Vim filetype plugin file
|
2023-02-21 08:50:29 -07:00
|
|
|
" Language: MS-DOS/Windows .bat files
|
|
|
|
" Maintainer: Mike Williams <mrmrdubya@gmail.com>
|
|
|
|
" Last Change: 12th February 2023
|
2024-01-15 03:12:32 -07:00
|
|
|
" 2024 Jan 14 by Vim Project (browsefilter)
|
2023-02-21 08:50:29 -07:00
|
|
|
"
|
|
|
|
" Options Flags:
|
|
|
|
" dosbatch_colons_comment - any value to treat :: as comment line
|
2014-07-10 21:05:51 -07: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
|
|
|
|
|
|
|
|
let s:cpo_save = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
|
|
|
" BAT comment formatting
|
2023-02-21 08:50:29 -07: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
|
2014-07-10 21:05:51 -07:00
|
|
|
setlocal formatoptions-=t formatoptions+=rol
|
|
|
|
|
2021-04-27 22:30:18 -07: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
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
" Define patterns for the browse file filter
|
2024-01-15 03:12:32 -07: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
|
2014-07-10 21:05:51 -07:00
|
|
|
endif
|
|
|
|
|
2021-04-27 22:30:18 -07:00
|
|
|
let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<"
|
2024-01-15 03:12:32 -07:00
|
|
|
\ . "| unlet! b:browsefilter"
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
let &cpo = s:cpo_save
|
|
|
|
unlet s:cpo_save
|