在emacs中使用F#Interactive?

Mir*_*ate 1 emacs f# fsi

好的,所以我刚刚为emacs提供了F#扩展.我现在需要弄清楚如何使我编写的脚本实际执行.在Visual Studio中,要运行它们,只需突出显示,右键单击,然后选择"发送到交互式".我不认为emacs有那种或类似的东西,但我不知道如何使f#脚本与fsi交互.所以,从本质上讲,如何使用emacs或终端编写脚本后运行脚本?

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

EDIT2:因为我在mac上运行,所以emacs无法执行脚本,因为fsi不存在作为mac的可用东西.显然.多么悲伤.我只会选择投票最多的答案为正确.

Tom*_*cek 5

我自己不是Emacs的用户,但Laurent Le Brun已经为Emacs做了一些F#模式的工作,这可能是从Emacs使用F#最舒服的方式.他的博客文章讨论了Alt + Enter,所以我认为F#模式增加了对这个键盘快捷键的处理.

如果你不想安装它,那么我猜你只需要fsi.exe在另一个缓冲区中作为普通的控制台应用程序运行并在那里复制你的F#intput(附加;;到最后,发送命令fsi.exe).


Ono*_*cci 5

根据此页面,包中包含的自述文件应记录可用的击键.而且,根据该自述文件,这些是有问题的击键:

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
Run Code Online (Sandbox Code Playgroud)

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