Skip to content

Instantly share code, notes, and snippets.

@krobelus
Last active September 24, 2022 19:44
Show Gist options
  • Save krobelus/b064c3cfae55b635908a59ac9255ace1 to your computer and use it in GitHub Desktop.
Save krobelus/b064c3cfae55b635908a59ac9255ace1 to your computer and use it in GitHub Desktop.
rudimentary synctex support for Kakoune
define-command -override zathura-open %{
nop %sh{
pdf=${kak_buffile%.tex}.pdf
zathura \
-x "sh -c 'echo evaluate-commands -verbatim -client ${kak_client} -- edit -- %{input} %{line} | kak -p ${kak_session}'" \
"$pdf" </dev/null >/dev/null 2>&1 &
}
}
define-command -override zathura-jump %{
nop %sh{
pdf=${kak_buffile%.tex}.pdf
zathura --synctex-forward ${kak_cursor_line}:${kak_cursor_column}:${kak_buffile} "$pdf" \
</dev/null >/dev/null 2>&1 &
}
}
map global user z ': zathura-open<ret>'
map global user <ret> ': zathura-jump<ret>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment