Giter Club home page Giter Club logo

plutojl-mode.el's Introduction

Pluto.jl edit mode for Emacs

This Emacs minor mode allows provides you with some minor convenience functionality when editing .jl files compatible with Pluto.jl.

Note that this is an independent piece of work and is in no way connected to the Pluto.jl project.

Warning!!! This project is still in early development, and so any use is at your own risk.

Installation

Prerequisites

Before installing the Pluto.jl mode, please make sure you have the following dependencies installed:

  • Emacs (version 26 or higher)
  • Julia (version 1.0 or higher)
  • Pluto.jl (version 0.15.0 or higher)

Using straight.el

To install the Pluto.jl Notebook Mode using straight.el, follow these steps:

  1. Open your Emacs configuration file (usually ~/.emacs.d/init.el or ~/.emacs) and add the following code:

    (use-package plutojl-mode
      :straight (plutojl-mode :type git :host github :repo "torfjelde/plutojl-mode.el"))

    It's recommended to activate auto-revert-mode whenever plutojl-mode is activated, since Pluto.jl might make changes to the notebook upon saving the .jl file, such as rearranging cells the to respect the depdencies between cells. To activate auto-revert-mode whenever plutojl-mode is activated,

    (use-package plutojl-mode
      :straight (plutojl-mode :type git :host github :repo "torfjelde/plutojl-mode.el")
      :hook (plutojl-mode . auto-revert-mode))

    (Note that plutojl-mode always tries to preserve the cursor position when the notebook is updated even in scenarios where Pluto.jl rearranges the ordering.)

  2. Restart Emacs or evaluate the configuration by running M-x eval-buffer.

Usage

Once you have installed the plutojl-mode, you can start editing Pluto.jl notebooks using Emacs.

Enabling the Mode

To enable the Pluto.jl mode, you can just call

(plutojl-mode)

Alternatively, you can conditionally enable plutojs-mode upon activation of, say, julia-mode, using the provided convenience method plutojl-maybe-enable-plutojl-mode:

(add-hook 'julia-mode-hook #'plutojl-maybe-enable-plutojl-mode)

Keybindings

  • plutojl-insert-cell-at-point (C-c C-c): Insert a new Pluto.jl notebook cell at the current point.
  • plutojl-delete-cell-at-point (C-c C-d): Delete the Pluto.jl notebook cell at the current point.
  • plutojl-goto-previous-cell (C-c C-p): Move to the previous Pluto.jl notebook cell.
  • plutojl-goto-next-cell (C-c C-n): Move to the next Pluto.jl notebook cell.
  • plutojl-toggle-fold-cell (C-c C-f): Toggle folding of the Pluto.jl notebook cell at the current point.

Interacting with Pluto.jl

If you are going to be editing Pluto notebooks in Emacs, then it's generally a good idea to start the Pluto.jl server with auto_reload_from_file=true, for example starting server using the following

Pluto.run(Pluto.Configuration.from_flat_kwargs(auto_reload_from_file=true))

Then the notebook will update whenever you save changes in the .jl file.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

Please make sure to follow the contribution guidelines when submitting pull requests.

License

This project is licensed under the MIT License.

plutojl-mode.el's People

Contributors

torfjelde avatar

Stargazers

 avatar Ehsan Irani avatar Marcelo Maciel avatar  avatar

Watchers

 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.