robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Christian Clasonvim-patch:93197fde0f1d7ed6966023

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