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