nvim: typst auto root finding
This commit is contained in:
parent
692bbb8e56
commit
fc2f333223
@ -17,13 +17,18 @@ function ScreenshotFig()
|
||||
endf
|
||||
nnoremap <silent><leader>fs :call ScreenshotFig()<cr>
|
||||
|
||||
function GitRoot()
|
||||
return fnamemodify(finddir('.git', ";"), ":h")
|
||||
endfunc
|
||||
|
||||
" compile typst doc on write
|
||||
function TypstWatch()
|
||||
vsp
|
||||
vertical resize 20
|
||||
exec 'terminal ' .. 'typst watch ' .. expand("%:")
|
||||
exec 'terminal ' .. 'typst watch --root ' .. GitRoot() .. " " .. expand("%:")
|
||||
exec "norm \<c-w>h"
|
||||
endfunc
|
||||
|
||||
nnoremap <silent><leader>fc :call TypstWatch()<cr>
|
||||
|
||||
nnoremap <silent><leader>fr :silent exec "!zathura --fork " . expand("%:p:r") . ".pdf &"<cr>
|
||||
|
Loading…
Reference in New Issue
Block a user