Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eleanor-clifford/vim-qalc

Simple integration with qalc for vim
https://github.com/eleanor-clifford/vim-qalc

Last synced: 5 days ago
JSON representation

Simple integration with qalc for vim

Awesome Lists containing this project

README

        

| :exclamation: | This is a mirror of [https://git.sr.ht/~tim-clifford/vim-qalc](https://git.sr.ht/~tim-clifford/vim-qalc). Please refrain from using GitHub's issue and PR system. |
|----------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------|

# vim-qalc

Simple integration with `qalc` for vim, to make calculations easier

![Demo](demo.gif)

## Installation

Use your favourite plugin manager. For example with
[Vundle.vim](https://github.com/VundleVim/Vundle.vim):
```vimscript
Plugin 'tim-clifford/vim-qalc'
```
# Dependencies

- libqalculate

Optional:

- [skywind3000/asyncrun.vim](https://github.com/skywind3000/asyncrun.vim) to
enable evaluating an expression into a quickfix window

# Usage

You can evaluate expressions in a few ways. Here are the default mappings
(disabled with `let g:qalc_mappings = 0`). Note that the terminal and quickfix
options only work with vim (not neovim) at the moment.

```vimscript
" Run into a quickfix window (requires AsyncRun)
vnoremap xq :call qalc#ToQuickfix()
nnoremap xq viW:call qalc#ToQuickfix()

" Evaluate and put it in the active register
vnoremap xr :call qalc#ToRegister(v:register)
nnoremap xr viW:call qalc#ToRegister(v:register)

" Evaluate and overwrite
vnoremap x :call qalc#Substitute()
nnoremap x viW:call qalc#Substitute()

" Evaluate and put it in the " register
vnoremap xx :call qalc#ToRegister(v:register)
nnoremap xx viW"":call qalc#ToRegister(v:register)

" Open qalc in a terminal window
noremap xt :term ++close qalc
```