ps1xml.vim 1009 B

1234567891011121314151617181920212223242526272829303132333435
  1. " Vim filetype plugin file
  2. " Language: Windows PowerShell
  3. " URL: https://github.com/PProvost/vim-ps1
  4. " Last Change: 2021 Apr 02
  5. " Only do this when not done yet for this buffer
  6. if exists("b:did_ftplugin") | finish | endif
  7. " Don't load another plug-in for this buffer
  8. let b:did_ftplugin = 1
  9. let s:cpo_save = &cpo
  10. set cpo&vim
  11. setlocal tw=0
  12. setlocal commentstring=#%s
  13. setlocal formatoptions=tcqro
  14. " Change the browse dialog on Win32 to show mainly PowerShell-related files
  15. if has("gui_win32")
  16. let b:browsefilter =
  17. \ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
  18. \ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
  19. \ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
  20. \ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" .
  21. \ "All Files (*.*)\t*.*\n"
  22. endif
  23. " Undo the stuff we changed
  24. let b:undo_ftplugin = "setlocal tw< cms< fo<" .
  25. \ " | unlet! b:browsefilter"
  26. let &cpo = s:cpo_save
  27. unlet s:cpo_save