https://github.com/fvictorio/vim-eval-expression
Evaluate a selection or text object and replace it with its result.
https://github.com/fvictorio/vim-eval-expression
Last synced: 2 months ago
JSON representation
Evaluate a selection or text object and replace it with its result.
- Host: GitHub
- URL: https://github.com/fvictorio/vim-eval-expression
- Owner: fvictorio
- Created: 2023-04-29T10:51:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-29T10:51:59.000Z (about 2 years ago)
- Last Synced: 2025-03-14T15:56:46.894Z (3 months ago)
- Language: Vim Script
- Homepage:
- Size: 977 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-eval-expression
Evaluate a selection or text object and replace it with its result.
## Usage
- `=` in visual mode will evaluate the current selection
- `=` followed by a text object will evaluate the text object
- `==` will evaluate the current line## Why?
This is particularly useful to evaluate mathematical expressions:

But you can use it to evaluate anything that can be evaluated by vim. You can think of it as a shortcut to the expression (`=`) register.
## Installation
If you are using [`vim-plug`](https://github.com/junegunn/vim-plug):
```
Plug 'fvictorio/vim-eval-expression'
```## Acknowledgements
I used the implementation of [`vim-exchange`](https://github.com/tommcdo/vim-exchange) as the basis of this plugin, and took some functions verbatim from it.