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 |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 5 | " 2024 Jan 14 by Vim Project (browsefilter) |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 6 | " 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring') |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 7 | |
| 8 | " Only do this when not done yet for this buffer |
| 9 | if exists("b:did_ftplugin") | finish | endif |
| 10 | |
| 11 | " Don't load another plug-in for this buffer |
| 12 | let b:did_ftplugin = 1 |
| 13 | |
| 14 | let s:cpo_save = &cpo |
| 15 | set cpo&vim |
| 16 | |
| 17 | setlocal tw=0 |
Riley Bruins | 0a08306 | 2024-06-03 20:40:45 +0200 | [diff] [blame] | 18 | setlocal commentstring=#\ %s |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 19 | setlocal formatoptions=tcqro |
| 20 | |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 21 | " Change the browse dialog on Win32 and GTK to show mainly PowerShell-related files |
| 22 | if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 23 | let b:browsefilter = |
| 24 | \ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" . |
| 25 | \ "PowerShell Script Files (*.ps1)\t*.ps1\n" . |
| 26 | \ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" . |
Doug Kearns | 93197fd | 2024-01-14 20:59:02 +0100 | [diff] [blame] | 27 | \ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n" |
| 28 | if has("win32") |
| 29 | let b:browsefilter .= "All Files (*.*)\t*\n" |
| 30 | else |
| 31 | let b:browsefilter .= "All Files (*)\t*\n" |
| 32 | endif |
Bram Moolenaar | 130cbfc | 2021-04-07 21:07:20 +0200 | [diff] [blame] | 33 | endif |
| 34 | |
| 35 | " Undo the stuff we changed |
| 36 | let b:undo_ftplugin = "setlocal tw< cms< fo<" . |
| 37 | \ " | unlet! b:browsefilter" |
| 38 | |
| 39 | let &cpo = s:cpo_save |
| 40 | unlet s:cpo_save |