如何在vim上设置REPL? [英] How do I setup REPL on vim?

查看:177
本文介绍了如何在vim上设置REPL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装vimclojure,使其更容易开始学习clojure。但是,我没有能够在vim中设置REPL。这基本上是因为我不能在vim(?)中写一个maplocalleader



根据vimclojure / doc / clojure.txt中的文档,我把以下内容放在我的.vimrc启动REPL -

 :map< LocalLeader> sr * sr * * StartRepl * 



但是输入sr不会启动REPL。



提前感谢。

解决方案

很可能在VimClojure映射完全定义之前,插件中发生错误。



当Clojure源文件加载到Vim缓冲区时出现语法错误时,我可能会遇到一种情况。



在加载源文件(语法高亮或某些东西)期间,插件中存在某些错误,并阻止映射被定义。



这可能只是VimClojure的一个不幸的问题,应该报告,但我没有时间挖足够和记录一个智能的错误报告/补丁。 p>

要解决此问题,在当前缓冲区中打开一个Clojure源文件,请尝试执行以下操作:

 :call vimclojure#Repl.New()

这会调用插件中的函数映射到\sr。这不是一个推荐的方式启动Repl,但由于我们只是故障排除您的配置,希望它会揭示一些有意义的你。



此外,请检查是否有任何有用的讯息记录。

 :messages 


I have installed vimclojure to make it easier to start learning clojure. But, I haven't been able to setup REPL inside vim. This is essentially because I was not able to write a maplocalleader in vim(?)

Based on the documentation in vimclojure/doc/clojure.txt I put the following in my .vimrc to start the REPL -

:map <LocalLeader>sr *sr* *StartRepl*

But typing "sr" doesn't start the REPL.

Thanks in advance.

解决方案

Most likely there is an error occurring in the plugin before the VimClojure mappings are fully defined.

One likely scenario that I have run into several times occurs when the Clojure source file has syntax errors when it's loaded into the Vim buffer.

There's something going on in the plugin during the load of the source file (syntax highlighting or something) that errors out and prevents the mappings from getting defined.

This is probably just an unfortunate issue with VimClojure and should be reported, but I haven't had time to dig enough and log an intelligent bug report/patch.

To troubleshoot, with a Clojure source file open in current buffer, try doing this:

:call vimclojure#Repl.New()

This invokes the function inside the plugin that is mapped to \sr. It's not a recommended way of launching the Repl, but since we're just troubleshooting your configuration, hopefully it will reveal something meaningful to you.

Also, do this to see if there happen to be any helpful messages getting logged.

:messages

这篇关于如何在vim上设置REPL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆