{"id":13600877,"url":"https://github.com/weirongxu/coc-calc","last_synced_at":"2025-04-05T06:03:54.499Z","repository":{"id":47420496,"uuid":"186567602","full_name":"weirongxu/coc-calc","owner":"weirongxu","description":"Calculate extension for coc.nvim","archived":false,"fork":false,"pushed_at":"2025-02-10T22:38:01.000Z","size":441,"stargazers_count":82,"open_issues_count":5,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T05:05:14.420Z","etag":null,"topics":["calc","calculate","coc","coc-nvim","mathematics","neovim","nvim","vim"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weirongxu.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-14T07:25:01.000Z","updated_at":"2025-02-26T23:03:41.000Z","dependencies_parsed_at":"2024-01-16T23:26:20.590Z","dependency_job_id":"d66242e2-bb0a-4400-bc81-f055fec71d50","html_url":"https://github.com/weirongxu/coc-calc","commit_stats":{"total_commits":118,"total_committers":4,"mean_commits":29.5,"dds":"0.15254237288135597","last_synced_commit":"5b2ae4a29398c43c9f12b2ae9f208896b6b6fc12"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weirongxu%2Fcoc-calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weirongxu%2Fcoc-calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weirongxu%2Fcoc-calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weirongxu%2Fcoc-calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weirongxu","download_url":"https://codeload.github.com/weirongxu/coc-calc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294516,"owners_count":20915340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calc","calculate","coc","coc-nvim","mathematics","neovim","nvim","vim"],"created_at":"2024-08-01T18:00:50.327Z","updated_at":"2025-04-05T06:03:54.480Z","avatar_url":"https://github.com/weirongxu.png","language":"TypeScript","funding_links":[],"categories":["Completion Enhanced","TypeScript"],"sub_categories":[],"readme":"# coc-calc\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./logo/calc-logo.svg\" alt=\"coc-calc\" width=\"200\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/weirongxu/coc-calc/actions?query=workflow%3Aci\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/workflow/status/weirongxu/coc-calc/ci\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  Calculate extension for coc.nvim\n\u003c/p\u003e\n\n## Features\n\n- Support underscores in numbers `10_000_000`\n- Support bignumber, use [decimal.js](https://github.com/MikeMcl/decimal.js)\n- Support [Mathematics functions](http://mikemcl.github.io/decimal.js/#methods)\n\n![screenshot](https://user-images.githubusercontent.com/1709861/65944119-9ab59f00-e463-11e9-886f-11513a8e01c9.gif)\n\n## Usage\n\n1. Install by coc.nvim command:\n   ```\n   :CocInstall coc-calc\n   ```\n2. Input calculate expression in any buffer\n   ```\n   sin(PI / 2) =\n   ```\n\n## Commands\n\n- `calc.appendWithCursor` Calculate and append in front of cursor\n- `calc.append` Calculate and append\n- `calc.replaceWithCursor` Calculate and replace in front of cursor\n- `calc.replace` Calculate and replace\n- `calc.calculate` see Vim API\n\n## Keymaps\n\nCreate keymappings like:\n\n```vim\n\" append result on current expression\nnmap \u003cLeader\u003eca \u003cPlug\u003e(coc-calc-result-append)\n\" replace result on current expression\nnmap \u003cLeader\u003ecr \u003cPlug\u003e(coc-calc-result-replace)\n```\n\n## Configurations\n\n- `calc.priority`, calc priority, default: `1000`\n- `calc.highlight`, enable calc highlight, default: `true`\n\n## Vim API\n\n### calc.calculate\n\n```vim\nlet result = CocAction('runCommand', 'calc.calculate', '1.5 * PI')\n```\n\n## Operators\n\nPrecedence is from highest to lowest.\n\n| Operator                              | Example                                     |\n| ------------------------------------- | ------------------------------------------- |\n| exponentiation `**`                   | `4 ** 3 ** 2` equivalent to `4 ** (3 ** 2)` |\n| unary `+ -`                           | `-2` `+2`                                   |\n| multiply / divide / remainder `* / %` | `4 % 3` `4 * 3`                             |\n| addition / subtraction                | `.2 - .1` `.1 + .2`                         |\n\n## Mathematics Constant\n\n- `E`\n- `PI`\n\n## Mathematics Functions\n\n```\nabs, acos, acosh, add, asin,\nasinh, atan, atanh, atan2, cbrt\nceil, cos, cosh, div, exp,\nfloor, hypot, ln, log, log2,\nlog10, max, min, mod, mul,\npow, random, round, sign, sin,\nsinh, sqrt, sub, tan, tanh, trunc\n```\n\nDetails: http://mikemcl.github.io/decimal.js/#methods\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweirongxu%2Fcoc-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweirongxu%2Fcoc-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweirongxu%2Fcoc-calc/lists"}