back

pub / helix-term

Interactive console for the Helix-Editor using TMUX
git clone https://src.jayvii.de/pub/helix-term.git
Log | Files | Exports | Refs | README | RSS

Activity: May, 2024 - Jun, 2024

Less More

helix-term

Please send patches or remarks to jayvii[AT]posteo[DOT]de

Interactive console for the Helix editor using the terminal multiplexer TMUX.

This script is primarily written for working with R but should work with any other script language and REPL.

Installation

The scripts in “bin/” are intended to go into your “~/.local/bin/” folder, or any other directory within your “$PATH”.

The snippets in “helix_config.toml” belong into your helix configuration (typically located in “~/.config/helix/config.toml”).

You need “tmux” to be installed on your system. An example configuration is provided in “tmux.conf”, which you can copy to “~/.tmux.conf”

Usage

Working on some script in helix, execute the “helix-term” command in another terminal window or by splitting the terminal window helix is running in (ctrl+h or ctrl+v). For example, if you want to run the R-REPL, issue following command:

This creates a temporary file in the current working directory “./.helix_session” containing the current session’s ID (base64 encoded path). Any helix session opened with the same root path is bound to that helix-term session. Upon exiting the REPL, the session file is removed.

From helix, you can now send commands to the REPL via Ctrl+C, Ctrl+C. In normal mode, this send the current code paragraph the pointer is located within. If in insert mode, the shortcut enters normal mode and goes on from there. If in selection mode, the current selection is send to the REPL.

Advanced Usage

Here are some tips which may make usage a little easier or may workaround issues I stumbled upon while using this setup.

General

  1. Adding an alias for helix-term to your bash configuration. For example:

GNU R

  1. Opening help-files in your web-browser rather than a “less” window in the terminal. this leads to unblocking the R-session, while looking up a function’s manual:

Clone this repository via:
git clone https://src.jayvii.de/pub/helix-term.git