blob: 17bb181f372d71d68ed028889ce4bc00e948076a [file] [log] [blame]
Bram Moolenaar130cbfc2021-04-07 21:07:20 +02001" Vim filetype plugin file
2" Language: Windows PowerShell
3" URL: https://github.com/PProvost/vim-ps1
4" Last Change: 2021 Apr 02
Doug Kearns93197fd2024-01-14 20:59:02 +01005" 2024 Jan 14 by Vim Project (browsefilter)
Bram Moolenaar130cbfc2021-04-07 21:07:20 +02006
7" Only do this when not done yet for this buffer
8if exists("b:did_ftplugin") | finish | endif
9
10" Don't load another plug-in for this buffer
11let b:did_ftplugin = 1
12
13let s:cpo_save = &cpo
14set cpo&vim
15
16setlocal tw=0
17setlocal commentstring=#%s
18setlocal formatoptions=tcqro
19
Doug Kearns93197fd2024-01-14 20:59:02 +010020" Change the browse dialog on Win32 and GTK to show mainly PowerShell-related files
21if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Bram Moolenaar130cbfc2021-04-07 21:07:20 +020022 let b:browsefilter =
23 \ "All PowerShell Files (*.ps1, *.psd1, *.psm1, *.ps1xml)\t*.ps1;*.psd1;*.psm1;*.ps1xml\n" .
24 \ "PowerShell Script Files (*.ps1)\t*.ps1\n" .
25 \ "PowerShell Module Files (*.psd1, *.psm1)\t*.psd1;*.psm1\n" .
Doug Kearns93197fd2024-01-14 20:59:02 +010026 \ "PowerShell XML Files (*.ps1xml)\t*.ps1xml\n"
27 if has("win32")
28 let b:browsefilter .= "All Files (*.*)\t*\n"
29 else
30 let b:browsefilter .= "All Files (*)\t*\n"
31 endif
Bram Moolenaar130cbfc2021-04-07 21:07:20 +020032endif
33
34" Undo the stuff we changed
35let b:undo_ftplugin = "setlocal tw< cms< fo<" .
36 \ " | unlet! b:browsefilter"
37
38let &cpo = s:cpo_save
39unlet s:cpo_save