File: neovim.vim

package info (click to toggle)
vim-link-vim 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 524 kB
  • sloc: python: 66; makefile: 30
file content (20 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function! linkvim#jobs#neovim#run(cmd) abort
  call s:neovim_{s:os}_run(a:cmd)
endfunction

let s:os = has('win32') ? 'win' : 'unix'

" vint: next-line -ProhibitUnusedVariable
function! s:neovim_unix_run(cmd) abort
  call system(['sh', '-c', a:cmd])
endfunction

" vint: next-line -ProhibitUnusedVariable
function! s:neovim_win_run(cmd) abort
  let s:saveshell = [&shell, &shellcmdflag, &shellslash]
  set shell& shellcmdflag& shellslash&

  call system('cmd /s /c "' . a:cmd . '"')

  let [&shell, &shellcmdflag, &shellslash] = s:saveshell
endfunction