AutoYADM commit: 2025-04-22 18:15:06
This commit is contained in:
parent
5bb20dda7c
commit
7cfc5f8797
2 changed files with 9 additions and 3 deletions
|
@ -68,6 +68,7 @@ diagnostics = ["warning", "error"]
|
||||||
workspace-diagnostics = ["warning", "error"]
|
workspace-diagnostics = ["warning", "error"]
|
||||||
|
|
||||||
[editor.lsp]
|
[editor.lsp]
|
||||||
|
# enable = false
|
||||||
display-inlay-hints = true
|
display-inlay-hints = true
|
||||||
display-messages = true
|
display-messages = true
|
||||||
display-progress-messages = true
|
display-progress-messages = true
|
||||||
|
@ -101,6 +102,10 @@ s = "select_mode"
|
||||||
|
|
||||||
# reload lsp
|
# reload lsp
|
||||||
C-r = ":lsp-restart"
|
C-r = ":lsp-restart"
|
||||||
|
# toggle lsp
|
||||||
|
# C-r = '@:toggle lsp.enable<ret>:echo %sh{sleep 0.1}<ret>:lsp-restart<ret>'
|
||||||
|
|
||||||
|
|
||||||
C-A-r = ":lsp-stop"
|
C-A-r = ":lsp-stop"
|
||||||
# config file stuff
|
# config file stuff
|
||||||
A-r = ":config-reload"
|
A-r = ":config-reload"
|
||||||
|
|
|
@ -100,16 +100,17 @@ if not string match -q '*.typ' $src
|
||||||
qecho "$(path basename $src) is not a Typst file!"
|
qecho "$(path basename $src) is not a Typst file!"
|
||||||
return $ret
|
return $ret
|
||||||
end
|
end
|
||||||
# change to pdf extension
|
# change abs path to pdf extension
|
||||||
set -l targ (string replace '.typ' '.pdf' $src)
|
set -l targ (string replace '.typ' '.pdf' $src)
|
||||||
|
# get pdf target's base name
|
||||||
set -l base (path basename --no-extension $src).pdf
|
set -l base (path basename --no-extension $src).pdf
|
||||||
|
|
||||||
|
# if a suitable pdf exists in the same dir, open it
|
||||||
if test -f "$targ"
|
if test -f "$targ"
|
||||||
# zathura "$targ" &>/dev/null &
|
|
||||||
zopen "$targ"
|
zopen "$targ"
|
||||||
else
|
else
|
||||||
# no such file in current dir, time to search!
|
# no such file in current dir, time to search!
|
||||||
# if we're in a git repo, search from root
|
# if we're in a git repo, search from its root
|
||||||
# if we're not, search from cwd
|
# if we're not, search from cwd
|
||||||
if git rev-parse --is-inside-work-tree &>/dev/null
|
if git rev-parse --is-inside-work-tree &>/dev/null
|
||||||
set root (git rev-parse --show-toplevel)
|
set root (git rev-parse --show-toplevel)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue