Activity: May, 2024 - Nov, 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”
For simplicity, you can use the supplied Makefile
, which
does all of this in one command:
make install
For updating helix-term, simply pull the newest version from git (or use the tarball) and run:
make update
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:
helix-term R
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
- Adding an alias for helix-term to your bash configuration. For example:
echo "alias hxt=helix-term" >> ~/.bashrc
echo "alias hxtr=helix-term R" >> ~/.bashrc
GNU R
- 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:
echo "options(help_type='html')" >> ~/.Rprofile
Clone this repository via:
git clone https://https://src.jayvii.de/pub/helix-term.git