我的系统:xp+gvim。
我已经打开了gvim来编辑一句JavaScript语句,文件还没有命名。
print(sum(range(1, 10)));
我希望将
<F7>
映射到javascript,在_vimrc
中如何编写映射语句? 配置完成后,输入F7
时如何获得55
?我遵循
elclanrs
的建议,但出现错误输出。C:\WINDOWS\system32\cmd.exe /c ( node ^<C:\DOCUME~1\sanya\LOCALS~1\Temp\VIi8C.tmp)
[stdin]:1
print(sum(range(1, 10)));
^
ReferenceError: range is not defined
at [stdin]:1:11
at Object.<anonymous> ([stdin]-wrapper:6:22)
at Module._compile (module.js:456:26)
at evalScript (node.js:532:25)
at ReadStream.<anonymous> (node.js:154:11)
at ReadStream.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)
shell returned 8
Hit any key to close this window...