0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/ftplugin/dosbatch.vim

41 lines
1011 B
VimL
Raw Normal View History

2004-06-13 20:20:40 +00:00
" Vim filetype plugin file
" Language: MS-DOS .bat files
" Maintainer: Mike Williams <mrw@eandem.co.uk>
2020-05-07 18:56:00 +02:00
" Last Change: 7th May 2020
2004-06-13 20:20:40 +00: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
2012-05-18 13:46:39 +02:00
let s:cpo_save = &cpo
set cpo&vim
2004-06-13 20:20:40 +00:00
" BAT comment formatting
2010-01-06 20:54:52 +01:00
setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
2019-04-21 00:03:35 +02:00
setlocal commentstring=::\ %s
2004-06-13 20:20:40 +00:00
setlocal formatoptions-=t formatoptions+=rol
2020-05-07 18:56:00 +02: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
2004-06-13 20:20:40 +00:00
" Define patterns for the browse file filter
if has("gui_win32") && !exists("b:browsefilter")
2010-01-06 20:54:52 +01:00
let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
2004-06-13 20:20:40 +00:00
endif
2012-04-25 19:07:41 +02:00
2020-05-07 18:56:00 +02:00
let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<"
2012-05-18 13:46:39 +02:00
\ . "| unlet! b:browsefiler"
let &cpo = s:cpo_save
unlet s:cpo_save