Home

Awesome

🧮Vmath.nvim

A lua version of Damian Conway's vmath.

✨Features

<details> <summary>Speed Reference</summary> 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: 422352610

takes 0.000806s to calculate
</details>

📦Installation

Use your favourite package manager and call setup function.

" 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 <your mapping> <ESC>:Vmath<CR>

Example: vnoremap <leader>vm <ESC>:Vmath<CR>

⚙️Customization

You can customize with the following lines in a vim configuration. These are the default settings.

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:

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

💡Future Plans/Ideas

👀Examples

Extract out of list with text and $-signs

example image