2012-02-15 50 views
0

好吧,我刚刚得到了适用于emacs的F#扩展。我现在需要弄清楚如何让我写的脚本实际执行。在Visual Studio中,要运行它们,只需突出显示,右键单击并选择“发送到交互式”。我不指望emacs有这样的或类似的东西,但我不知道如何让f#脚本与fsi交互。所以,实质上,如何在使用emacs或终端编写脚本后运行脚本?在emacs中使用F#Interactive?

编辑:为了澄清,我在mac上运行emacs。

编辑2:因为我在Mac上运行,emacs没有办法执行该脚本,因为fsi不存在作为mac可用的东西。显然。多么悲伤。我只会选择最正确的答案。

+0

我觉得键盘绑定(至少是Ctrl键绑定)在Mac上是一样的。 – 2012-02-15 03:02:14

回答

4

我自己并不是Emacs用户,但Laurent Le Brun在F# mode for Emacs上做了一些工作,这可能是Emacs中使用F#最舒服的方式。他的博客文章讨论了Alt + Enter,所以我想F#模式会增加对这个键盘快捷键的处理。

如果你不想安装这个,那么我想你只需要运行fsi.exe在另一个缓冲区正常的控制台应用程序,并复制您的F#intput有(附加;;到最后,发送命令到fsi.exe)。

4

根据this page该软件包附带的自述文件应记录可用的击键。并根据该自述,这些是有问题的击键:

3) Bindings 

If you are new to Emacs, you might want to use the menu (call 
menu-bar-mode if you don't see it). However, it's usually faster to learn 
a few useful bindings: 

- C-c C-r  Evaluate region 
- C-c C-e  Evaluate current toplevel phrase 
- C-M-x   Evaluate current toplevel phrase 
- C-M-h   Mark current toplevel phrase 
- C-c C-s  Show interactive buffer 
- C-c C-c  Compile with fsc 
- C-c x   Run the executable 
- C-c C-a  Open alternate file (.fsi or .fs) 
- C-c l   Shift region to left 
- C-c r   Shift region to right 
- C-c <up>  Move cursor to the beginning of the block 

所以我猜你想要Ctrl-c Ctrl-r组合。

相关问题