Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eval.hx

Evaluates Steel code against the live editor engine (via the eval-string builtin) and routes results to a dedicated *hx-eval* scratch buffer, in the style of nrepl.hx.

Evaluation is synchronous and runs on the editor’s own engine, so evaluated code can call any helix/* function and see prior definitions.

Note that evaluated code shares the global namespace and can shadow bindings.

Demo

An asciinema recording of evaluating code with the results in the eval.hx buffer

Commands

  • :hx-eval-selection - Evaluate the primary selection.
  • :hx-eval-buffer - Evaluate the entire buffer.
  • :hx-eval-multiple-selections - Evaluate every selection in sequence.
  • :hx-eval-prompt - Prompt for an expression and evaluate it.

Results are appended to the *hx-eval* buffer in REPL format: a repl:N:> prompt, the value, or a commented error block.

Install

forge pkg install --git https://github.com/waddie/eval.hx

Then, in ~/.config/helix/init.scm:

(require "eval.hx/eval.scm")

See keybindings-example.scm for a sample keymap (bound under space E).

Licence

GNU AGPL v3 or later. See LICENSE.md.

About

Helix REPL scratch buffer for eval-string output

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages