Skip to content

m1foley/vim-expresso

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

expresso.vim

Evaluate text as a math expression and replace it with the result.

screenshot

Installation

Using vim-plug:

Plug 'm1foley/vim-expresso'

Usage

Visual mode

  • g= after selecting text replaces it with the result.

Normal mode

  • g= with a motion. For example, g=$ evaluates text from the cursor to the end of the line.
  • g== evaluates the current line.

Command mode

  • With a range like :1,7Expresso

Limitations

Expresso uses Vim expressions, so it has the same limitations of @=, the expression register. If none of the numbers have a decimal, it evaluates to a whole number: 3/2 = 1. To force a Float conversion, add a decimal to one of the numbers: 3/2.0 = 1.5

Similar Projects

  • crunch is a more powerful & expressive math plugin, and gets around the Float conversion issue.

License

MIT

About

Easily perform math calculations from text

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published