~ecc/vim-qalc

Simple integration with qalc for vim
d404d2b3 — Tim Clifford 3 years ago
Move to sourcehut
16fd2498 — Tim Clifford 3 years ago
Cleanup mappings
89e078ab — Tim Clifford 3 years ago
Add keymap to evaluate the current word and put it in the " register

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~ecc/vim-qalc
read/write
git@git.sr.ht:~ecc/vim-qalc

You can also use your local clone with git send-email.

#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>
Do not follow this link