Use Neovim as a BQN repl.
Use your favourite plugin manager (or install manually). My plugin manager of choice is vim-plug.
call plug#begin('~/.config/nvim/plugged') Plug 'email@example.com:~detegr/nvim-bqn' call plug#end
For now, the plugin expects CBQN as the interpreter to run. The inner workings of the plugin
call CBQN with
By default, the plugin expects to find CBQN from path with a executable called
BQN. This can be changed by
pointing a global variable
g:nvim_bqn to a different executable.
By default, enter evaluates a the file from the beginning to the line that the cursor is on. A selection (range) can be evaluated with enter too, and the range evaluation will only contain the lines that are in the range.
<leader>bfwill evaluate every line of the file.
<leader>bcwill remove the inline results from the cursor to the end of the file
<leader>bcwith a range will remove the inline results within that range
<leader>bCwill remove the inline results from the whole file
<leader>bewill run expression explainer for a line. Note that the explainer has only the context of the single line and variables may be uninitialized because of it.
Due to Neovim's bug, the last line of the buffer is problematic. The plugin works around this by moving the last line to the center of the window when that is evaluated. However, it is possible to navigate the editor so that the last line of the buffer has an evaluation result below it and the last line of the buffer is on the last line of the window. In this case, due to the bug, the line is not rendered properly.
Reading an evaluation result that spans below the bottom of the window can be tricky. The Vim scrolling movements
<C-Y> are helpful in such situation.