nix-home/home/kakoune/kaktex

29 lines
686 B
Plaintext
Raw Normal View History

#!/usr/bin/env fish
function usage
echo "Usage: "
echo " kaktex set [client] [session]"
2024-06-23 15:40:07 +00:00
echo " kaktex jump [file] [line] [column]"
exit 1
end
2024-06-23 15:40:07 +00:00
if test (count $argv) -lt 3
usage
end
switch $argv[1]
case "set"
set -U _kaktex_client $argv[2]
set -U _kaktex_session $argv[3]
case "jump"
echo "
evaluate-commands -client $_kaktex_client %{
evaluate-commands -try-client $_kaktex_client %{
2024-06-23 15:40:07 +00:00
edit -existing -- $argv[2] $(math $argv[3] + 1) $(math $argv[4] + 1)
}
}
" | kak -p $_kaktex_session
case '*'
usage
end