AutoYADM commit: 2025-04-22 18:30:06
This commit is contained in:
parent
7cfc5f8797
commit
ad49367f90
2 changed files with 25 additions and 11 deletions
|
@ -184,11 +184,8 @@ C-u = ["page_cursor_half_up", "align_view_center"]
|
|||
|
||||
# language specific commands
|
||||
[keys.normal.space.l]
|
||||
|
||||
# typst
|
||||
[keys.normal.space.l.t]
|
||||
# open pdf preview
|
||||
p = ':sh ~/.config/helix/scripts/typst-zathura.fish -k %{buffer_name}'
|
||||
# open pdf preview for typst
|
||||
p = ':sh ~/.config/helix/scripts/hx-typ-zathura.fish -k %{buffer_name}'
|
||||
|
||||
# git stuff
|
||||
[keys.normal.space.g]
|
||||
|
|
|
@ -1,14 +1,30 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
# hx-typ-zathura: easily preview your typst documents from Helix!
|
||||
# This script will automatically find a pdf that matches your
|
||||
# current Typst document and attempt to open it with Zathura.
|
||||
# Optionally, it will quit Zathura when you close Helix.
|
||||
# Run this script with --help for usage info!
|
||||
|
||||
# Author: Daniel Fichtinger <daniel@ficd.ca
|
||||
# License: MIT
|
||||
|
||||
argparse q/quiet k/kill-on-exit h/help -- $argv
|
||||
|
||||
if test (count $argv) -eq 0; or set -q _flag_h
|
||||
echo "Helper script for opening Typst files from Helix in Zathura."
|
||||
echo "Helper script for opening Typst files from Helix in Zathura."\n
|
||||
echo "Usage: (bind the following to a key)"
|
||||
echo ':sh typst-zathura [opts] %{buffer_name}'
|
||||
echo ':sh hx-typ-zathura.fish [opts] %{buffer_name}'\n
|
||||
echo 'Example for config.toml:'
|
||||
echo '[keys.normal.space.t]'
|
||||
echo 'p = \':sh /path/to/hx-typ-zathura.fish -k %\{buffer_name\}\''\n
|
||||
echo "Options:"
|
||||
echo "-q/--quiet: Don't `echo` on caught errors, return 1 instead."
|
||||
echo "-k/--kill-on-exit: Kill Zathura when parent Helix exits."
|
||||
echo "-h/--help: print this screen"
|
||||
echo "-q/--quiet: Don't \`echo\` on caught errors, return 1 instead."
|
||||
echo "-k/--kill-on-exit: Kill Zathura when parent Helix process exits."
|
||||
echo "-h/--help: print this screen"\n
|
||||
echo 'Author: Daniel Fichtinger <daniel@ficd.ca>'
|
||||
echo 'License: MIT'
|
||||
return 0
|
||||
end
|
||||
|
||||
# only return status 1 if -q not set
|
||||
|
@ -79,9 +95,10 @@ function zopen --wraps zathura
|
|||
# user didn't ask for watch, so open normally
|
||||
zathura "$argv[1]" &>/dev/null &
|
||||
end
|
||||
true
|
||||
end
|
||||
|
||||
# try to find the target pdf file
|
||||
# try to find the target pdf file searching from root
|
||||
function find_pdf
|
||||
set -l root $argv[1]
|
||||
set -l base $argv[2]
|
Loading…
Add table
Add a link
Reference in a new issue