इस विम विकिया प्रविष्टि के अनुसार आप नई बफर स्क्रिप्ट के लिए एक शेल निष्पादन बना सकते हैं और फिर नोड का उपयोग करके अपने कोड को चलाने के लिए इसे बढ़ा सकते हैं।
command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
function! s:RunShellCommand(cmdline)
let isfirst = 1
let words = []
for word in split(a:cmdline)
if isfirst
let isfirst = 0 " don't change first word (shell command)
else
if word[0] =~ '\v[%#<]'
let word = expand(word)
endif
let word = shellescape(word, 1)
endif
call add(words, word)
endfor
let expanded_cmdline = join(words)
botright new
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
call setline(1, 'You entered: ' . a:cmdline)
call setline(2, 'Expanded to: ' . expanded_cmdline)
call append(line('$'), substitute(getline(2), '.', '=', 'g'))
silent execute '$read !'. expanded_cmdline
1
endfunction
command! -complete=file -nargs=* RunJS call s:RunShellCommand('node '.<q-args>)
फिर यदि आप चलाते :RunJS %हैं तो आपको अपने नोड.जेएस निष्पादन के आउटपुट के साथ एक नया बफर मिलना चाहिए। वैकल्पिक रूप से आप चीजों को सीधे इस्तेमाल कर सकते हैं:Shell <cmd>
:!node %। यह बाहरीnodeप्रोग्राम को खोल देगा , वर्तमान फाइलनाम को एक तर्क के रूप में पारित करेगा। आउटपुट स्क्रीन पर प्रदर्शित किया जाएगा, और आप इसे खारिज करने के लिए Enter दबा सकते हैं।