Code Monkey home page Code Monkey logo

julia-shell-mode's Introduction

julia-shell-mode

MELPA

Emacs major mode for an interactive Julia shell

Screenshot

Introduction

julia-shell-mode provides a comfortable Julia REPL in an interactive Emacs buffer. Some of the features include TAB completion through the Emacs completion system and easy interaction between a julia-mode editing buffer and a live julia-shell REPL.

Features/Usage

Julia-shell

To start a julia-shell, simply do

M-x run-julia

Completions

To query Julia for completions of the current command on the prompt, simply hit TAB. This supports LaTeX substitutions, just like the native Julia shell. For example, hitting TAB after

julia> y + \Delta

Completes to

julia> y + ฮ”

just like in the native Julia REPL.

When not substituting LaTeX letters, julia-shell will open a buffer with suggestions on how to complete the current command using Emacs' completion system. Simply press TAB to get a list of suggestions. For example, pressing TAB after

julia> his

First completes to

julia> hist

And pressing TAB again opens up a new *Completions* buffer with the following suggestions:

Click on a completion to select it.
In this buffer, type RET to select the completion near point.

Possible completions are:
hist 	hist2D
hist2d 	histrange

Shell interaction from julia-mode

You can use the function julia-shell-run-region-or-line to send the current region to the Julia interpreter. If the region is not active, this function will send the current line.

Another handy function is julia-shell-save-and-go: Save the current buffer and evaluate it in the Julia shell using evalfile().

Installation

Put the following code in your .emacs, init.el, or equivalent:

(add-to-list 'load-path "path-to-julia-shell-mode")
(require 'julia-shell)

where "path-to-julia-shell-mode" should be the location of this archive. Since the alias to run-julia overrides julia-mode's command, make sure to include these line after requiring julia-mode.

To interact with julia-shell from julia-mode, add the following code to your init.el:

(defun my-julia-mode-hooks ()
  (require 'julia-shell-mode))
(add-hook 'julia-mode-hook 'my-julia-mode-hooks)
(define-key julia-mode-map (kbd "C-c C-c") 'julia-shell-run-region-or-line)
(define-key julia-mode-map (kbd "C-c C-s") 'julia-shell-save-and-go)

Acknowledgments

This mode borrows heavily from MATLAB-emacs and hopes to replicate the comfortable MATLAB shell experience using Julia. Thanks!

Furthermore, thanks to the devs of the original julia.el for laying the foundation of this, especially the neat LaTeX substitutions.

License

GPL v2

julia-shell-mode's People

Contributors

syohex avatar tarsius avatar jagot avatar stardiviner avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.