-- File: ~/.config/nvim/lua/plugins/vimtex.lua -- VimTeX Configuration vim.g.vimtex_view_method = 'skim' -- Use Skim as the PDF viewer vim.g.vimtex_view_skim_sync = 1 -- Enable forward search with Skim vim.g.vimtex_view_skim_activate = 1 -- Activate Skim on compilation vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for LaTeX compilation vim.g.vimtex_quickfix_mode = 0 -- Disable automatic quickfix window vim.g.vimtex_syntax_enabled = 1 -- Enable VimTeX syntax highlighting vim.g.vimtex_fold_enabled = 1 -- Enable VimTeX syntax highlighting vim.g.vimtex_format_enabled = 1 -- Enable VimTeX syntax highlighting -- Custom TeX Engine Commands vim.api.nvim_create_user_command( 'LuaTeX', '!lualatex %', { nargs = 0 } ) vim.api.nvim_create_user_command( 'XeTeX', '!xelatex %', { nargs = 0 } ) vim.api.nvim_create_user_command( 'PdfLaTeX', '!pdflatex %', { nargs = 0 } ) -- View PDF Command vim.api.nvim_create_user_command( 'ViewPDF', '!open -a Skim ' .. vim.fn.expand('%:r') .. '.pdf', { nargs = 0 } ) -- Check for Errors in Log File vim.api.nvim_create_user_command( 'CheckErrors', '!grep -i error %.log || echo "No errors found!"', { nargs = 0 } ) vim.api.nvim_create_user_command( 'CleanAuxFiles', '!rm -f *.aux *.log *.out *.toc *.bbl *.blg *.synctex.gz *.fls *.fdb_latexmk', { nargs = 0 } ) -- Keybindings for TeX Workflow vim.keymap.set('n', 'll', ':LuaTeX', { noremap = true, silent = true }) vim.keymap.set('n', 'lx', ':XeTeX', { noremap = true, silent = true }) vim.keymap.set('n', 'lp', ':PdfLaTeX', { noremap = true, silent = true }) vim.keymap.set('n', 'lv', ':ViewPDF', { noremap = true, silent = true }) vim.keymap.set('n', 'le', ':CheckErrors', { noremap = true, silent = true }) vim.keymap.set('n', 'lc', ':CleanAuxFiles', { noremap = true, silent = true })