-
Notifications
You must be signed in to change notification settings - Fork 715
Qalculate
Qalculate! is a multipurpose cross-platform desktop calculator. It is simple to use but provides power and versatility normally reserved for complicated math packages, as well as useful tools for everyday needs (such as currency conversion and percent calculation). Features include a large library of customizable functions, unit calculations and conversion, physical constants, symbolic calculations (including integrals and equations), arbitrary precision, uncertainty propagation, interval arithmetic, plotting, and a user-friendly interface (GTK, Qt and CLI).
It can be integrated into Kakoune as a drop-in replacement of bc for a math prompt:
map global normal = ': prompt math: %{exec "a%val{text}<lt>esc>|qalc -t +u8 -f -<lt>ret>"}<ret>'
We can also define a command that will perform computations and display the results on the status bar like this:
define-command qalc -docstring "compute equation with Qalculate!" -params .. %{echo %sh{qalc ${@}}}
Qalculate has many built-in functions and variables, we can improve the qalc
command by generating autocomplete suggestions:
complete-command qalc shell-script-candidates %{
{ echo $(qalc +u8 --list-functions | head -n -3); echo $(qalc +u8 --list-variables | head -n -3); } | tr ' ' '\n' | sort -u
}
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV