ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Eval

by ViktorQvarfordt ST2/ST3

Execute selection, replace or show output in panel, any language.

Details

Installs

  • Total 218
  • Win 82
  • OS X 74
  • Linux 62
Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7
Windows 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 2 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0
OS X 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 2
Linux 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 1

Readme

Source
raw.​githubusercontent.​com

Sublime-Eval

  • Supports any language via easy and flexible config.
  • Threaded non-blocking code execution.
  • Output to panel or inline replace.
  • Simultaneous execution in multiple selections.

Usage

Open the Command Palette and type “Eval” to see the available commands. For example “Eval: Python” evaluates selection (or entire buffer) as python code and shows the output in panel.

“Eval: Terminate” stops execution.

There are two types of invocations:

  • Replace: Execute selection and replace with output. Empty selection = current line. Supports multiple selections simultaneously.

Demo inline

  • Panel output: Execute selection and show output in panel. Empty selection = entire file. Runs non-blocking in a thread.

Demo inline

Config

  • Open the Command Palette and select “Eval: Settings”. In the config you can add new methods (languages) and change timeout time.
  • New methods will automatically be available in the Command Palette.
  • Keybinds: There are no default keybinds, as to not interfere with your settings. To add a keybind for a method, put the following in you keybind config.

    { "keys":      ["super+p"], "command": "eval", "args": { "method": "Python Replace" } },
    { "keys": ["ctrl+super+p"], "command": "eval", "args": { "method": "Python"   } },
    

Issues, pull requests and suggestions for improvement are always welcome!