CSharpRepl emacs integration?

I know that mono CSharpRepl , is there an emacs csharp mode that uses this to run REPL in one window and compile / run C # code in another window, like python mode?

+4
source share
2 answers

You can simply create a lisp function to call CSharpRepl and assign a key to the call when you are working on C # code. For example, you can put the following in your Emacs initialization file (assuming the CSharpRepl executable is β€œcsharp” in your 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) 

So, if you are editing a program in C # (using whatever mode you prefer), now you can press F11 and CSharpRepl will open in a new window so you can interactively evaluate C # code.

+2
source

A small addition to the accepted answer. Returns an existing buffer, if one exists.

 (defun csharp-repl () "Switch to the CSharpRepl buffer, creating it if necessary." (interactive) (let ((buf (get-buffer "*csharp*"))) (if buf (pop-to-buffer buf) (progn (split-window) (other-window 1) (comint-run "csharp"))))) (define-key csharp-mode-map (kbd "Cc Cz") 'csharp-repl) 
+2
source

All Articles