【问题标题】:Using F# Interactive in emacs?在 emacs 中使用 F# Interactive?
【发布时间】:2012-06-12 10:26:26
【问题描述】:

好的,所以我刚刚获得了适用于 emacs 的 F# 扩展。我现在需要弄清楚如何让我编写的脚本真正执行。在 Visual Studio 中,要运行它们,只需突出显示、右键单击并选择“Send to Interactive”。我不希望 emacs 有这个或类似的东西,但我不知道如何让 f# 脚本与 fsi 交互。那么,从本质上讲,如何在编写脚本后使用 emacs 或终端运行脚本?

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

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

【问题讨论】:

  • 我认为键绑定(至少 Ctrl 键绑定)在 Mac 上是相同的。

标签: emacs f# fsi


【解决方案1】:

我自己不是 Emacs 用户,但 Laurent Le Brun 对 F# mode for Emacs 做了一些工作,这可能是从 Emacs 使用 F# 最舒适的方式。他的博客文章谈到了 Alt+Enter,所以我想 F# 模式添加了对这个键盘快捷键的处理。

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

【讨论】:

    【解决方案2】:

    根据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 组合。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多