2012-02-15 95 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組合。

相關問題