我碰巧知道 mono 的 CSharpRepl , 是否有 emacs csharp 模式使用它在一个窗口中运行 REPL,并像 python 模式一样在另一个窗口中编译/运行 C# 代码?
最佳答案
您可以只创建一个 lisp 函数来调用 CSharpRepl 并分配一个键来在您处理 C# 代码时调用它。例如,您可以将以下内容放入您的 Emacs 初始化文件中(假设 CSharpRepl 可执行文件“csharp”在您的 PATH 中):
(defun csharp-repl ()
"Open a new side-by-side window and start CSharpRepl in it."
(interactive)
(split-window-side-by-side)
(other-window 1)
(comint-run "csharp"))
(global-set-key [f11] 'csharp-repl)
因此,如果您正在编辑 C# 程序(使用您喜欢的任何模式),您现在可以按 F11,CSharpRepl 将在新窗口中打开,以便您可以交互式地评估 C# 代码。
关于c# - CSharpRepl emacs 集成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6207068/