Back to Extensions Directory
Read the complete README
coc-calc
Raidoucalculate extension for coc.nvim
Installation CommandVim prompt
:CocInstall coc-calc
npm latest published 2022-12-01Registry checked 2026-08-23Registry summary
Published Package Summary
coc-calc
Calculate extension for coc.nvim
Features
- Support underscores in numbers
10_000_000 - Support bignumber, use decimal.js
- Support Mathematics functions

Usage
- Install by coc.nvim command:
:CocInstall coc-calc - Input calculate expression in any buffer
sin(PI / 2) =
Keymaps
Create keymappings like:
" append result on current expression
nmap <Leader>ca <Plug>(coc-calc-result-append)
" replace result on current expression
nmap <Leader>cr <Plug>(coc-calc-result-replace)
Configurations
calc.priority, calc priority, default:1000calc.highlight, enable calc highlight, default:true
Vim API
calc.calculate
let result = CocAction('runCommand', 'calc.calculate', '1.5 * PI')
Operators
Precedence is from highest to lowest.
| Operator | Example |
|---|---|
exponentiation ** | 4 ** 3 ** 2 equivalent to 4 ** (3 ** 2) |
unary + - | -2 +2 |
multiply / divide / remainder * / % | 4 % 3 4 * 3 |
| addition / subtraction | .2 - .1 .1 + .2 |
Mathematics Constant
EPI
Mathematics Functions
abs, acos, acosh, add, asin,
asinh, atan, atanh, atan2, cbrt
ceil, cos, cosh, div, exp,
floor, hypot, ln, log, log2,
log10, max, min, mod, mul,
pow, random, round, sign, sin,
sinh, sqrt, sub, tan, tanh, trunc
Details: http://mikemcl.github.io/decimal.js/#methods
License
MIT
- calculate extension for coc.nvim
Activation Events
- *
Developer Resources
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-calc@3.1.0.
This package does not declare any contributed commands.
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
calc.debugboolean
Default: false
Raw JSON Schema
{
"type": "boolean",
"default": false
}calc.priorityinteger
Calc priority
Default: 1000
Raw JSON Schema
{
"type": "integer",
"default": 1000,
"description": "Calc priority"
}calc.highlightboolean
Enable calc highlight
Default: true
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable calc highlight"
}