eleanor-clifford / vim-qalc

Simple integration with qalc for vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a mirror of 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

Installation

Use your favourite plugin manager. For example with Vundle.vim:

Plugin 'tim-clifford/vim-qalc'

Dependencies

  • libqalculate

Optional:

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.

" Run into a quickfix window (requires AsyncRun)
vnoremap <leader>xq    :call qalc#ToQuickfix()<CR>
nnoremap <leader>xq viW:call qalc#ToQuickfix()<CR>

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

" Evaluate and overwrite
vnoremap <leader>x<leader>    :call qalc#Substitute()<CR>
nnoremap <leader>x<leader> viW:call qalc#Substitute()<CR>

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

" Open qalc in a terminal window
noremap <leader>xt :term ++close qalc<CR>

About

Simple integration with qalc for vim

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Vim Script 100.0%