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 243
  • Win 93
  • OS X 81
  • Linux 69
Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 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
Windows 0 0 0 1 0 1 1 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
OS X 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 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!