-
Notifications
You must be signed in to change notification settings - Fork 715
Adria Arrufat edited this page Dec 6, 2022
·
10 revisions
bc stands for "basic calculator"
https://en.wikipedia.org/wiki/Bc_(programming_language)
define-command -hidden -params 2 inc %{ try %{
evaluate-commands %sh{
[ "$1" = 0 ] && count=1 || count="$1"
printf '%s%s' 'exec h"_/\d<ret><a-i>na' "$2($count)<esc>|{<space>cat<semicolon>echo<semicolon>}|bc<ret>"
}
} catch %{
execute-keys l
}}
map global normal <c-a> ': inc %val{count} +<ret>'
map global normal <c-x> ': inc %val{count} -<ret>'
See plugin https://gitlab.com/Screwtapello/kakoune-inc-dec
map global normal = ': prompt math: %{exec "a%val{text}<lt>esc>|{ cat; echo; }|bc<lt>ret>"}<ret>'
See plugin https://github.com/alexherbo2/bc.kak
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV