Inspired by (vim-calc)[https://github.com/theniceboy/vim-calc].
Uses (asteval)[https://newville.github.io/asteval/] to perform safe-ish expression evaluations and replaces the expression right in your buffer!
vimcalc
is a fully functional calculator that will replace expressions in your buffer
with their result!
To bind to a key, add this to your nvim
configuration:
vim.keymap.set("v", "<C-c>", "<cmd>Calculate<cr>", {})
Now, you can press Control
and c
to calculate!
Install vimcalc
with Lazy:
require("lazy").setup({
"lcford2/vimcalc",
})
MIT