Skip to content

Quick start: Lua (neovim)

glyh edited this page Jan 22, 2022 · 5 revisions

Prerequisites

  1. Install the latest Neovim.

  2. Install the Conjure plugin.

  3. Install the nvim-treesitter plugin.

  4. Run :TSInstall lua to install parser for Lua.

  5. (Optional) Install the nvim-treesitter-textobjects plugin. With this plugin, you can use shortcut keys to select, e.g. a function, and the send it to Conjure for evaluation.

Configuration

You just need to configure Conjure to enable tree-sitter support:

vim.g['conjure#extract#tree_sitter#enabled'] = true

After that, update your config, open a Lua buffer and you’re good to go.

Constraint

  • Local variables won’t be preserved from evaluation to evalutation. This behavior is the same as Lua’s REPL. To overcome this, just use global variables when interacting with Conjure.

  • Right now the code evaluation is blocking. Later there might be other clients implemented as a standalone REPL that provide non-blocking evaluation.