Created
August 15, 2017 13:50
-
-
Save dalum/bd82611a7767ef078d10f9c912640a7b to your computer and use it in GitHub Desktop.
My Emacs Julia REPL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun julia-repl () | |
"Runs Julia in a screen session in a `term' buffer." | |
(interactive) | |
(require 'term) | |
(let ((termbuf (apply 'make-term "Julia REPL" (split-string-and-unquote "julia")))) | |
(set-buffer termbuf) | |
(term-mode) | |
(term-char-mode) | |
(switch-to-buffer termbuf))) | |
(defun send-region-to-julia-repl () | |
"If region active, send it to julia-repl buffer." | |
(interactive) | |
(if (region-active-p) | |
(send-region "*Julia REPL*" (region-beginning) (region-end)))) | |
(defun my-julia-mode-hooks () | |
(define-key julia-mode-map (kbd "C-c C-r") 'julia-repl) | |
(define-key julia-mode-map (kbd "C-c C-c") 'send-region-to-julia-repl)) | |
(add-hook 'julia-mode-hook 'my-julia-mode-hooks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment