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