dosbatch.vim 1011 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. " Vim filetype plugin file
  2. " Language: MS-DOS .bat files
  3. " Maintainer: Mike Williams <mrw@eandem.co.uk>
  4. " Last Change: 7th May 2020
  5. " Only do this when not done yet for this buffer
  6. if exists("b:did_ftplugin")
  7. finish
  8. endif
  9. " Don't load another plugin for this buffer
  10. let b:did_ftplugin = 1
  11. let s:cpo_save = &cpo
  12. set cpo&vim
  13. " BAT comment formatting
  14. setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
  15. setlocal commentstring=::\ %s
  16. setlocal formatoptions-=t formatoptions+=rol
  17. " Lookup DOS keywords using Windows command help.
  18. if executable('help.exe')
  19. if has('terminal')
  20. setlocal keywordprg=:term\ help.exe
  21. else
  22. setlocal keywordprg=help.exe
  23. endif
  24. endif
  25. " Define patterns for the browse file filter
  26. if has("gui_win32") && !exists("b:browsefilter")
  27. let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
  28. endif
  29. let b:undo_ftplugin = "setlocal comments< formatoptions< keywordprg<"
  30. \ . "| unlet! b:browsefiler"
  31. let &cpo = s:cpo_save
  32. unlet s:cpo_save