Equals is a result of a search for a simple text editor based calculator, the idea came from Calca which is great but lacking linux support and is not maintained very much. Equals takes python code or markdown with python code blocks and append intermediate results to expressions followed by #=
.
As neovim plugin using vim-plug:
Plug 'liborw/equals', { 'do': 'pip install --user .'}
As neovim plugin using vim-jetpack:
use {'liborw/equals', run = 'pip install --user .'}
As standalone tool using pip:
pip install git+https://github.com/liborw/equals.git
Command line:
# equals --help
usage: equals [-h] [-i | -o OUTPUT | -u] [-d] [-l LANG] input
positional arguments:
input Input file, for input from stdin use '-' as in input.
options:
-h, --help show this help message and exit
-i, --in-place Update the input file in place.
-o OUTPUT, --output OUTPUT
Output file
-u, --updates-only Print out only updateted values in json format.
-d, --debug Run in debug mode.
-l LANG, --lang LANG Input language
Known languages: python, py, markdown, md
Neovim configuration:
require("equals").setup({
set_keys = true,
})
-- or
vim.api.nvim_set_keymap('n', 'ee', '<cmd>lua require("equals").buffer()<cr>', {noremap = true})
- Calca great, but closed source, unmantained and lacking linux support.
- codi.vim was close but the results are not persistent, does not support
a = 1 + b #=
, and used has no control what result are included. - ...
- Multiline results
- Support for assignments i.e.
a = 1 + 2 #= 3
- Vim integration
- Move to click and setup tools
- Improved error handling
- Markdown support
- Basic support for code blocks
- Support for inline code in
a #=
- Add more languages
- Highlighting