Skip to content

sevehub/typstpowershell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vim9Script Plugin Typst & PowerShell

This Vim9Script plugin is designed to streamline the process of compiling Typst source code into PDF files.

Prerequisites:

Install TypstPowerShell:

  • Use your preferred Vim plugin manager (e.g., vim-plug).
  • Add the following line to your ~/.vimrc or vimrc:
    Plug 'sevehub/typstpowershell'
    
    and then run :PlugInstall to initialize the plugin. Set PDFViewer's path (optional, required when different from default application):
    let g:typst_pdf_viewer = 'SumatraPDF.exe' ""legacy
    g:typst_pdf_viewer = 'SumatraPDF.exe' #vim9script
    
    Set Typst's path (optional, when not included in the PATH variable):
    let g:typst_exe = 'typst.exe' ""legacy
    g:typst_exe = 'typst.exe' #vim9script
    
    Set the PowerShell's version if > 5:
    let g:powershell_version = 7 ""legacy
    g:powershell_version = 7 #vim9script
    
    Set Lsp binary path, if filename different form typst-lsp.exe and not in the PATH:
    let g:typst_lsp_exe = 'typst-lsp.exe' ""legacy
    g:typst_lsp_exe = 'typst-lsp.exe' #vim9script
    
    Creating PDFs:
  • Open your Typst source code in Vim.
  • Execute the TypstCompile command (e.g., :TypstCompile) or save it.
  • Your PDF will be generated using Typst and previewed in your PDFViewer.

Display Fonts:

  • Execute TypstFonts command (:TypstFonts)

View Errors in a quikfix list:

  • :TypstQFList

Open PDFViewer:

  • :PDFViewer

You can pin the PDFViwer with the keyboard shortcut CTRL-SHIFT-SPACE (Windows only).

TODO:

[] Documentation [] Complete Vim-Doc

PRs welcomed

Credits