{"id":22646493,"url":"https://github.com/arecarn/vim-crunch","last_synced_at":"2025-07-27T01:04:57.273Z","repository":{"id":9114432,"uuid":"10898151","full_name":"arecarn/vim-crunch","owner":"arecarn","description":"A calculator inside Vim","archived":false,"fork":false,"pushed_at":"2023-12-05T18:08:11.000Z","size":340,"stargazers_count":135,"open_issues_count":4,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-05T16:47:04.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arecarn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-06-24T03:51:52.000Z","updated_at":"2025-04-27T01:46:29.000Z","dependencies_parsed_at":"2023-12-05T19:26:29.398Z","dependency_job_id":null,"html_url":"https://github.com/arecarn/vim-crunch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/arecarn/vim-crunch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arecarn%2Fvim-crunch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arecarn%2Fvim-crunch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arecarn%2Fvim-crunch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arecarn%2Fvim-crunch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arecarn","download_url":"https://codeload.github.com/arecarn/vim-crunch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arecarn%2Fvim-crunch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267278631,"owners_count":24063252,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-12-09T06:12:10.731Z","updated_at":"2025-07-27T01:04:57.253Z","avatar_url":"https://github.com/arecarn.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"crunch\n======\n\ncrunch makes calculations in Vim more accessible by providing an operator to\nevaluate mathematical expressions, loosening Vim's math syntax, and forcing\nintegers into floating point numbers.\n\nUsage\n-----\n\n| Mode   | Key Mapping | Description                                |\n|--------|-------------|--------------------------------------------|\n| normal | g={motion}  | Evaluate the text that {motion} moves over |\n| normal | g==         | Evaluate the current line                  |\n| visual | g=          | Evaluate the highlighted expressions       |\n\n* `:[range]Crunch[!]`\n    * Evaluates the current visual selection or provided range and adds result\n      to the end of the line(s) With the [!] crunch does not append the result\n      but replaces the provided range or visual selection with the result this\n      behavior can be reversed  by setting  `g:crunch_result_type_append` = 0\n\n* `:Crunch`\n    * Provides a prompt in the command for you to enter your mathematical\n      expression. The result is then available to be pasted from the default\n      register.\n\n* `:Crunch {expression}`\n    * Where {expression} is some mathematical expression to be evaluated. The\n      result is then available to be pasted from the default register.\n\nRequirements\n------------\n* [selection.vim](https://github.com/arecarn/selection.vim)\n* Vim compiled with `+float` feature\n\n------------------------------------------------------------------------------\n\nMath With Looser Syntax\n-----------------------\nThe following chart shows the looser math syntax provided with crunch, compared\nto the default math syntax.\n\n| Feature                     | With crunch         | Without crunch      |\n|-----------------------------|---------------------|---------------------|\n| Implied Multiplication      |                     |                     |\n|                             | cos(0)cos(0) = 1    | cos(0)*cos(0) = 1.0 |\n|                             | 2sin(1) = 1.682942  | 2*sin(1) = 1.682942 |\n|                             | sin(1)2 = 1.682942  | sin(1)*2 = 1.682942 |\n|                             | (2\\*3)(3\\*2) = 36   | (2\\*3)*(3\\*2) = 36  |\n|                             | 2(3*2) = 12         | 2*(3\\*2) = 12       |\n| Integer to Float Conversion |                     |                     |\n|                             | 1/2 = 0.5           | 1.0/2.0 = 0.5       |\n|                             | .25*4 = 1           | 0.25*4 = 1.0        |\n| Decimals w/o Leading Zeros  |                     |                     |\n|                             | .5/2 = 0.25         | 0.5/2 = 0.25        |\n|                             | .25*4 = 1           | 0.25*4 = 1.0        |\n| Removed Zeros In Result     |                     |                     |\n|                             | 0.25*4 = 1          | 0.25*4 = 1.0        |\n|                             | pow(2,8) = 256      | pow(2,8)= 256.0     |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farecarn%2Fvim-crunch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farecarn%2Fvim-crunch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farecarn%2Fvim-crunch/lists"}