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

Eval

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

Details

Installs

  • Total 609
  • Win 253
  • Mac 197
  • Linux 159
Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 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
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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!