nvim: improve typst experience

This commit is contained in:
dogeystamp 2023-07-18 16:39:18 -04:00
parent 7313653341
commit ae32f8199e
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 6 additions and 3 deletions

View File

@ -85,5 +85,6 @@ function prob_cpp; echo $EDITOR src/(basename (xsel -b)).cpp; end
abbr -a cpp --function prob_cpp abbr -a cpp --function prob_cpp
function prob_py; echo $EDITOR src/(basename (xsel -b)).py; end function prob_py; echo $EDITOR src/(basename (xsel -b)).py; end
abbr -a py --function prob_py abbr -a py --function prob_py
function prob_pdf; echo zathura (basename (xsel -b)).pdf; end # in .config/nvim/typst.vim there is a bind that copies the path
function prob_pdf; echo zathura (xsel -b); end
abbr -a pdf --function prob_pdf abbr -a pdf --function prob_pdf

View File

@ -23,10 +23,12 @@ nnoremap <silent><leader>fs :call ScreenshotFig()<cr>
" compile typst doc on write " compile typst doc on write
function TypstWatch() function TypstWatch()
vsp vsp
vertical resize 50 vertical resize 20
exec 'terminal ' .. 'typst watch ' .. expand("%:t") exec 'terminal ' .. 'typst watch ' .. 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 :call setreg("+", expand("%:p:r") . ".pdf")<cr>:echo "Copied path."<cr>
au Filetype typst let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '$':'$', "```" : "```", "`": "`"} au Filetype typst let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"', '$':'$', "```" : "```", "`": "`"}