Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

navicore/bc.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

This repository has moved to https://git.navicore.tech/navicore/bc.nvim.

The GitHub copy is archived and no longer maintained.

bc.nvim

A simple Neovim plugin to evaluate mathematical expressions using bc in markdown and telekasten files.

Installation

lazy.nvim

Add to your lazy.nvim plugin specification:

"navicore/bc.nvim"

Or in your full lazy setup:

require("lazy").setup({
  -- your other plugins...
  "navicore/bc.nvim",
  -- more plugins...
})

Other plugin managers

packer.nvim

use 'navicore/bc.nvim'

vim-plug

Plug 'navicore/bc.nvim'

Usage

  1. Open a markdown or telekasten file
  2. Visually select a mathematical expression (e.g., 2 * (33 - 1))
  3. Run :Bc or :'<,'>Bc
  4. The selection will be replaced with the expression and its result (e.g., 2 * (33 - 1) = 64)

Financial Formatting

The plugin supports currency and comma formatting:

  • $ symbols are preserved and the result uses 2 decimal places
  • Comma separators in numbers (e.g., 10,000) are preserved in the result

Examples:

  • 2 * $52 * $5 = $10.00
  • $100 / 3$100 / 3 = $33.33
  • 2 * 10,0002 * 10,000 = 20,000
  • $1,000 + $500$1,000 + $500 = $1,500.00

Decimal Handling

The output type is inferred from the input:

  • Integers only → integer result (e.g., 10 / 3 = 3)
  • Any float in input → float result matching max decimal places (e.g., 10.0 / 3 = 3.3)
  • Currency ($) → always 2 decimal places (e.g., $10 / 3 = $3.33)

To get decimal results from integer division, use a float in the input: 10.0 / 3 instead of 10 / 3.

Requirements

  • Neovim 0.7+
  • bc command-line calculator (usually pre-installed on Unix-like systems)

Limitations

  • Only works in markdown or telekasten files (filetype must be markdown or telekasten)
  • Uses bc syntax, so expressions must be valid bc input

About

bc math processor neovim plugin for markdown files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages