Skip to content

Commit

Permalink
Support powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
janlazo committed Aug 3, 2019
1 parent 9382063 commit 35cfe4b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1980,11 +1980,18 @@ function! s:shellesc_cmd(arg)
return '^"'.substitute(escaped, '\(\\\+\)$', '\1\1', '').'^"'
endfunction

function! s:shellesc_ps1(arg)
return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'"
endfunction

function! s:shellesc(arg, ...)
let shell = get(a:000, 0, s:is_win ? 'cmd.exe' : 'sh')
if shell =~# 'cmd.exe$'
if shell =~# 'cmd\.exe$'
return s:shellesc_cmd(a:arg)
endif
if shell =~# 'powershell\.exe$'
return s:shellesc_ps1(a:arg)
endif
return shellescape(a:arg)
endfunction

Expand Down

0 comments on commit 35cfe4b

Please sign in to comment.