Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/max397574/Vmath.nvim
https://github.com/max397574/Vmath.nvim
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/max397574/Vmath.nvim
- Owner: max397574
- Created: 2021-07-25T12:27:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-13T15:42:07.000Z (about 3 years ago)
- Last Synced: 2024-05-11T00:36:06.980Z (6 months ago)
- Language: Lua
- Size: 295 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🧮Vmath.nvim
A lua version of Damian Conway's [vmath](https://www.youtube.com/watch?v=aHm36-na4-4&t=1740s).
✨Features
--------* Calculate mathematical figures of visual selection
* Amount of numbers
* Sum
* Average
* Highest
* Lowest
* Range
* Median
* Automatic recognition of numbers
* Option to set registers to number
* FastSpeed Reference
213,123,42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125,3,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125213,123,
42152,324.234,2352.123,234.2123,523,235.4684.345,745.36,1247.45,25.213,422352613,1352.125* Sum: 4646425087.0446
* Count: 144
* Average: 32266840.882254
* Smallest: 3
* Biggest: 422352613
* Range: 422352610takes 0.000806s to calculate
📦Installation
------------
Use your favourite package manager and call setup function.
```vim
" Vimscript with vim-plug
Plug 'max397574/vmath.nvim'
lua require("vmath_nvim").init()
```
```
-- lua with packer.nvim
use {"max397574/vmath.nvim",
config = function()
require("vmath_nvim").init()
end
}```
âś…Usage
-----
Remap the command in visual mode.
`vnoremap :Vmath`Example:
`vnoremap vm :Vmath`⚙️Customization
-------------
You can customize with the following lines in a vim configuration. These are the default settings.
```lua
lua << EOF
require('vmath_nvim').setup{
-- show these numbers
show_sum = true,
show_average = true,
show_count = true,
show_lowest = true,
show_highest = true,
show_range = true,
show_median = true,
-- show debug info (execution time and values)
debug = false,
-- save values in registers surrounded with ''
-- example: 'A'verage gets saved in register a
registers = true,
}
EOF
```
And this in a lua configuration:
```lua
require('vmath_nvim').setup{
-- show these numbers
show_sum = true,
show_average = true,
show_count = true,
show_lowest = true,
show_highest = true,
show_range = true,
show_median = true,
-- show debug info (execution time and values)
debug = false,
-- save values in registers surrounded with ''
-- example: 'A'verage gets saved in register a
registers = true,
}
```đźš«Limitations
-----------
* Currently can't ignore dates
* Only works with full lines (visual-line mode)đź’ˇFuture Plans/Ideas
------------------
* Ignore dates
* More mathematical figuresđź‘€Examples
--------Extract out of list with text and $-signs
![example image](https://github.com/max397574/Vmath.nvim/blob/master/resources/month_list.png)