是否可以将vim.fireplace连接到浏览器repl?我有一个使用奥斯汀的设置,但如果我尝试评估内部的东西我得到:
org.mozilla.javascript.EcmaError: ReferenceError: "setTimeout" is not defined.
这似乎是未使用浏览器repl的指示。
答案 0 :(得分:4)
我发现Reddit上的this discussion很有帮助。
具体来说,我已将这些命令(如帖子中所示)添加到我的vimrc作为快捷方式,具体取决于我要连接的环境:
command! Piggie :Piggieback (cemerick.austin/exec-env)
command! Biggie :Piggieback (cemerick.austin/exec-env :exec-cmds ["open" "-ga" "/Applications/Google Chrome.app"])
command! Wiggie :Piggieback (weasel.repl.websocket/repl-env :ip "0.0.0.0" :port 9001)
现在,我可以
lein repl
或:Console
)(run)
):Wiggie
)答案 1 :(得分:3)
是的,这是可能的。浏览器repl,noderepl,rhino repl ...
查看文档并阅读有关piggieback的信息。这就是它处理envs的方式
https://github.com/tpope/vim-fireplace/blob/master/doc/fireplace.txt https://github.com/cemerick/piggieback
Piggieback也包含在奥斯汀中,所以它应该可以工作:连接到奥斯汀然后:Piggieback与你想要的环境
编辑:示例
阅读https://github.com/cemerick/austin/blob/master/README.md#usage并查看与您启动repl的方式相对应的环境。例如:Piggieback (cemerick.austin/repl-env)
。查看文档以查看可以尝试的不同repl-env。
编辑2:示例项目Vim nRepl和节点repl
查看此项目以及自述文件中有关nodejs类似内容的说明
https://github.com/joakin/cljs-node-repl/blob/master/README.md