Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philippotto/Sublime-EvalPrinter
Transpiles, evaluates and prints code. Provides immediate feedback for code execution within Sublime Text.
https://github.com/philippotto/Sublime-EvalPrinter
Last synced: about 2 months ago
JSON representation
Transpiles, evaluates and prints code. Provides immediate feedback for code execution within Sublime Text.
- Host: GitHub
- URL: https://github.com/philippotto/Sublime-EvalPrinter
- Owner: philippotto
- License: mit
- Created: 2014-07-17T22:30:26.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-04T21:56:23.000Z (almost 9 years ago)
- Last Synced: 2024-08-02T05:11:47.143Z (5 months ago)
- Language: Python
- Homepage:
- Size: 1.75 MB
- Stars: 20
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Sublime-EvalPrinter [![Build Status](https://travis-ci.org/philippotto/Sublime-EvalPrinter.svg?branch=master)](https://travis-ci.org/philippotto/Sublime-EvalPrinter)
===================EvalPrinter is a Sublime Text 2/3 Plugin which transpiles, evaluates and prints code.
This allows rapid testing of code snippets without leaving your code editor.
To see which languages are supported, see the appropriate section.## Motivation
You are writing some code and you are unsure if it does what you want?
Is JavaScript's second parameter for ```String.prototype.slice``` the index of the last character?
Or is it the amount of characters to slice? Does Python's ```reverse```-method for lists return a reversed copy or does it modify the instance?
Do you need these braces in your CoffeeScript code or are they optional?Don't look this up in the documention!
Don't open a shell, in which you replicate the code you already wrote! Stay in Sublime and just evaluate/transpile your code.
With EvalPrinter.Unlike a REPL, EvalPrinter does not only work with simple expressions but with entire blocks of code. Because you don't have to switch to another program, context switches are reduced und Sublime's usual text editing capabilities can be used, as well.
Additionally, the live session mode provides true immediate feedback which is completely missing in a REPL. The same applies for showing the results of transpilation processes.
## Features
You can trigger the ```eval_print``` command to transpile/evaluate the current selection (or the current line if nothing is selected).
The default keybinding is Shift + Alt + Enter.
By default, the output will yield the result of the last expression.
Additional output can be achieved via the standard logging methods of the current programming language (e.g. ```console.log``` in JavaScript and ```print``` in Python).![](http://philippotto.github.io/Sublime-EvalPrinter/screens/javascript.gif)
Another possibility is to enter a "live session", in which the code will be transpiled/evaluated after each keystroke. The immediate feedback makes it especially useful for tweaking code until it's perfect.
The command is called ```eval_print_enter_live_session``` and the default keybinding is Ctrl/Cmd + Shift + Alt + Enter. Invoke it again to exit the mode.![](http://philippotto.github.io/Sublime-EvalPrinter/screens/javascript-live-session.gif)
For languages which will be transpiled (e.g. CoffeeScript), the output will also include the result of the transpilation process:
![](http://philippotto.github.io/Sublime-EvalPrinter/screens/coffeescript.gif)
## Supported languages
Currently, the following languages are supported:
- JavaScript
- CoffeeScript
- PythonFeel free to open issues or submit pull requests to add support for other languages.
## Installation
Either use [Package Control](https://sublime.wbond.net/installation) and search for `EvalPrinter` or clone this repository into Sublime Text "Packages" directory.
## License
MIT © Philipp Otto 2014