使用 VIM 编程方案(Racket) - 如何开始
最近,我开始在DrRacket中编写Racket(以前的Scheme)。 我很快就开始想念 DrRacket 中 VIM 的所有功能,所以我想 使用 VIM 进行我的方案(球拍)编程。
我知道 Emacs 可能是密集 Lisp 编程的最佳选择,但所有 我想要的是编写一个方案(球拍)文件检查语法,然后运行它。
不幸的是,我不知道如何在命令行中调用“racket” 在文件上使其执行与 DrRacket 相同的操作。
我正在运行 Ubuntu 10.10 Maverick Meerkat,VIM 7.3,我下载并 从官方网站安装 Racket。
帮助入门将非常感激。
recently, I started programming Racket (formerly Scheme) in DrRacket.
I quite fast I began to miss all the features of VIM in DrRacket, so I would like
to use VIM for my scheme(racket) programming.
I know that Emacs might be the best choice for intense lisp programming, but all
I want is write a scheme(racket) file check syntax and then run it.
Unfortunately, I could not figure out, how to invoke "racket" in the commandline
on a file to get it doing the same as DrRacket.
I am running Ubuntu 10.10 Maverick Meerkat, VIM 7.3 and I downloaded and
installed Racket from the official website.
Help to get started would be very appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只想在命令行上将文件加载到 Racket 中并运行它,我认为这应该可行:
-i
选项将使您在 REPL 中测试您的代码文件.scm
。但是,您可能想看看这篇博客文章:
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/
您可以设置运行命令行 Racket 的 GNU 屏幕会话,并向其发送 s-表达式来自维姆。有一个指向 Vimscript 的链接,可以使此操作自动进行。我在 mit-scheme 中使用了一段时间,它相当有效。但它并不像 SLIME 或 DrRacket 那么强大。我刚刚在 OS X 上测试了描述的步骤,它适用于命令行球拍,它应该适用于 Ubuntu,这就是我第一次使用此方法时所使用的。
您可能还想看看这个:
http://evalwhen.com/scmindent/index.html< /a>
... 其中有一些有关 Vim 中 Lisp 和 Scheme 代码更好缩进的信息。
我最终改用了 Emacs,但不要让 Vim 的讨厌者让你失望。 Paul Graham 据说使用 vi,他一定是最杰出的 5 位 Lisp 程序员之一。
http://paul.graham.usesthis.com/
If you just want to load a file into Racket on the command-line and run it, I think that this should work:
The
-i
option would leave you at the REPL to test your code infile.scm
.However, you might want to take a look at this blog post:
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/
You can set up a GNU screen session running the command-line Racket, and send s-expressions to it from Vim. There's a link to a bit of Vimscript which will make this automatic. I used this for a while with mit-scheme, and it was reasonably effective. It's not quite the as powerful as SLIME or DrRacket though. I just tested the steps described on OS X and it works with the command-line racket, it should work on Ubuntu, that's what I was using when I first used this method.
You might also want to take a look at this:
http://evalwhen.com/scmindent/index.html
... which has some information on better indentation in Vim for Lisp and Scheme code.
I eventually switched to Emacs, but don't let the Vim haters get you down. Paul Graham supposedly uses vi and he's gotta be one of the top 5 most prominent Lisp programmers.
http://paul.graham.usesthis.com/
有几个附加组件可以使 Vim 中的 Racket 编码更加令人满意。
set lisp
) - 改进了缩进和w
/e
/b
单词的一些基础知识 -跳跃。makeprg
使其工作)K
的 Vim 文档,以及自动完成 Racket 功能我更喜欢 slime 而不是 slimv 因为它的简单性。
Vundle,这里有一种安装大多数提到的附加组件的方法:
如果您使用 将它们放入您的
~/.vimrc
中,然后调用进行安装:这是显示其中大部分内容的屏幕截图:
(* 披露:我编写了 VROD 和 REPTL ,而且它们还不成熟)
另外,这里是描述 Vim/SICP 设置的相关博客文章。
Several add-ons are available to make coding in Racket more satisfying with Vim.
set lisp
) -- improves some basics for indenting andw
/e
/b
word-hopping.makeprg
for this to work)K
-based Vim documenation, and auto-completion of Racket functionsI prefer slime over slimv for its simplicity.
If you are using Vundle, here is a way to install most of the add-ons mentioned:
Put those into your
~/.vimrc
, and then invoke to install:Here is a screenshot showing off most of these:
(* disclosure: I wrote VROD and REPTL, and they are immature)
Also, here is a related blog post describing a Vim/SICP setup.
大约一周前,SLIMV(SLIME for Vim)支持 Racket。 SLIMV 通常被认为是目前 Vim 最成熟的 Lisp 环境。
As of about a week ago, SLIMV (SLIME for Vim) supports Racket. SLIMV is generally regarded as the most mature Lisp environment for Vim at the moment.