aspvbs.vim 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. " Vim filetype plugin file
  2. " Language: aspvbs
  3. "
  4. " This runtime file is looking for a new maintainer.
  5. "
  6. " Former maintainer: Dan Sharp
  7. " Last Change: 2009 Jan 20
  8. " 2024 Jan 14 by Vim Project (browsefilter)
  9. if exists("b:did_ftplugin") | finish | endif
  10. " Make sure the continuation lines below do not cause problems in
  11. " compatibility mode.
  12. let s:save_cpo = &cpo
  13. set cpo-=C
  14. " Define some defaults in case the included ftplugins don't set them.
  15. let s:undo_ftplugin = ""
  16. let s:browsefilter = "HTML Files (*.html, *.htm)\t*.htm*\n"
  17. if has("win32")
  18. let s:browsefilter .= "All Files (*.*)\t*\n"
  19. else
  20. let s:browsefilter .= "All Files (*)\t*\n"
  21. endif
  22. let s:match_words = ""
  23. runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
  24. let b:did_ftplugin = 1
  25. " Override our defaults if these were set by an included ftplugin.
  26. if exists("b:undo_ftplugin")
  27. let s:undo_ftplugin = b:undo_ftplugin
  28. endif
  29. if exists("b:browsefilter")
  30. let s:browsefilter = b:browsefilter
  31. endif
  32. if exists("b:match_words")
  33. let s:match_words = b:match_words
  34. endif
  35. " ASP: Active Server Pages (with Visual Basic Script)
  36. " thanks to Gontran BAERTS
  37. if exists("loaded_matchit")
  38. let s:notend = '\%(\<end\s\+\)\@<!'
  39. let b:match_ignorecase = 1
  40. let b:match_words =
  41. \ s:notend . '\<if\>\%(.\{-}then\s\+\w\)\@!:\<elseif\>:^\s*\<else\>:\<end\s\+\<if\>,' .
  42. \ s:notend . '\<select\s\+case\>:\<case\>:\<case\s\+else\>:\<end\s\+select\>,' .
  43. \ '^\s*\<sub\>:\<end\s\+sub\>,' .
  44. \ '^\s*\<function\>:\<end\s\+function\>,' .
  45. \ '\<class\>:\<end\s\+class\>,' .
  46. \ '^\s*\<do\>:\<loop\>,' .
  47. \ '^\s*\<for\>:\<next\>,' .
  48. \ '\<while\>:\<wend\>,' .
  49. \ s:match_words
  50. endif
  51. " Change the :browse e filter to primarily show ASP-related files.
  52. if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
  53. let b:browsefilter="ASP Files (*.asp)\t*.asp\n" . s:browsefilter
  54. endif
  55. let b:undo_ftplugin = "unlet! b:match_words b:match_ignorecase b:browsefilter | " . s:undo_ftplugin
  56. " Restore the saved compatibility options.
  57. let &cpo = s:save_cpo
  58. unlet s:save_cpo