Working NeoVim-Configuration, this should be the base for further

enhancements
This commit is contained in:
Thomas Naderer
2024-12-18 16:45:53 +01:00
commit e870d7408b
5 changed files with 322 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
-- 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
-- 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 }
)
-- Keybindings for TeX Workflow
vim.keymap.set('n', '<leader>ll', ':LuaTeX<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lx', ':XeTeX<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lp', ':PdfLaTeX<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>lv', ':ViewPDF<CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>le', ':CheckErrors<CR>', { noremap = true, silent = true })