aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/ps1.vim
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-19 22:57:13 +0000
commit9be89f131f87608f224f0ee06d199fcd09d32176 (patch)
tree11022dcfa9e08cb4ac5581b16734196128688d48 /runtime/ftplugin/ps1.vim
parentff7ed8f586589d620a806c3758fac4a47a8e7e15 (diff)
parent88085c2e80a7e3ac29aabb6b5420377eed99b8b6 (diff)
downloadrneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.gz
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.tar.bz2
rneovim-9be89f131f87608f224f0ee06d199fcd09d32176.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/ftplugin/ps1.vim')
-rw-r--r--runtime/ftplugin/ps1.vim21
1 files changed, 10 insertions, 11 deletions
diff --git a/runtime/ftplugin/ps1.vim b/runtime/ftplugin/ps1.vim
index d6ab01016b..e09bbf86dc 100644
--- a/runtime/ftplugin/ps1.vim
+++ b/runtime/ftplugin/ps1.vim
@@ -3,6 +3,8 @@
" URL: https://github.com/PProvost/vim-ps1
" Last Change: 2021 Apr 02
" 2024 Jan 14 by Vim Project (browsefilter)
+" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
+" 2024 Sep 19 by Konfekt (simplify keywordprg #15696)
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin") | finish | endif
@@ -14,7 +16,7 @@ let s:cpo_save = &cpo
set cpo&vim
setlocal tw=0
-setlocal commentstring=#%s
+setlocal commentstring=#\ %s
setlocal formatoptions=tcqro
" Enable autocompletion of hyphenated PowerShell commands,
" e.g. Get-Content or Get-ADUser
@@ -34,6 +36,10 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
endif
endif
+" Undo the stuff we changed
+let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword<" .
+ \ " | unlet! b:browsefilter"
+
" Look up keywords by Get-Help:
" check for PowerShell Core in Windows, Linux or MacOS
if executable('pwsh') | let s:pwsh_cmd = 'pwsh'
@@ -44,21 +50,14 @@ elseif executable('powershell.exe') | let s:pwsh_cmd = 'powershell.exe'
endif
if exists('s:pwsh_cmd')
- if !has('gui_running') && executable('less') &&
- \ !(exists('$ConEmuBuild') && &term =~? '^xterm')
- " For exclusion of ConEmu, see https://github.com/Maximus5/ConEmu/issues/2048
- command! -buffer -nargs=1 GetHelp silent exe '!' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>" | ' . (has('unix') ? 'LESS= less' : 'less') | redraw!
- elseif has('terminal')
+ if exists(':terminal') == 2
command! -buffer -nargs=1 GetHelp silent exe 'term ' . s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full "<args>"' . (executable('less') ? ' | less' : '')
else
command! -buffer -nargs=1 GetHelp echo system(s:pwsh_cmd . ' -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -Command Get-Help -Full <args>')
endif
+ setlocal keywordprg=:GetHelp
+ let b:undo_ftplugin ..= " | setl kp< | sil! delc -buffer GetHelp"
endif
-setlocal keywordprg=:GetHelp
-
-" Undo the stuff we changed
-let b:undo_ftplugin = "setlocal tw< cms< fo< iskeyword< keywordprg<" .
- \ " | unlet! b:browsefilter"
let &cpo = s:cpo_save
unlet s:cpo_save