Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liborw/equals
Equals!
https://github.com/liborw/equals
Last synced: 3 days ago
JSON representation
Equals!
- Host: GitHub
- URL: https://github.com/liborw/equals
- Owner: liborw
- Created: 2021-09-17T21:15:33.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-23T14:48:17.000Z (almost 2 years ago)
- Last Synced: 2024-08-02T13:34:37.477Z (3 months ago)
- Language: Python
- Size: 326 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Equals (#=)
Equals is a result of a search for a simple text editor based calculator, the idea came from [Calca](http://calca.io/) 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 `#=`.
## Installation
As neovim plugin using [vim-plug](https://github.com/junegunn/vim-plug):
```vim
Plug 'liborw/equals', { 'do': 'pip install --user .'}
```As neovim plugin using [vim-jetpack](https://github.com/tani/vim-jetpack):
```lua
use {'liborw/equals', run = 'pip install --user .'}
```As standalone tool using pip:
```shell
pip install git+https://github.com/liborw/equals.git
```## Usage
Command line:
```sh
# equals --help
usage: equals [-h] [-i | -o OUTPUT | -u] [-d] [-l LANG] inputpositional 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 languageKnown languages: python, py, markdown, md
```Neovim configuration:
```lua
require("equals").setup({
set_keys = true,
})-- or
vim.api.nvim_set_keymap('n', 'ee', 'lua require("equals").buffer()', {noremap = true})
```## Similar tools
- [Calca](http://calca.io/) great, but closed source, unmantained and lacking linux support.
- [codi.vim](https://github.com/metakirby5/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.
- ...## What works and what is missing
- [ ] Multiline results
- [x] Support for assignments i.e. `a = 1 + 2 #= 3`
- [x] Vim integration
- [x] Move to click and setup tools
- [x] Improved error handling
- [x] Markdown support
- [x] Basic support for code blocks
- [x] Support for inline code in `a #=`
- [ ] Add more languages
- [ ] Highlighting## References
- [Vim Loop Question on Reddit](https://www.reddit.com/r/neovim/comments/mw4oe7/lua_cleaning_up_vimloopspawn_properly/)