dotfiles/.config/nvim/lua/plugins/vimtex.lua

64 lines
1.9 KiB
Lua

return {
{
"lervag/vimtex",
ft = {
"tex",
"bib"
},
config = function()
-- General configuration
vim.cmd("syntax enable")
vim.g.vimtex_compiler_latexmk = {
out_dir = 'build',
options = {
'-shell-escape',
'-verbose',
'-file-line-error',
'-interaction=nonstopmode',
'-synctex=1'
}
}
vim.g.vimtex_view_general_viewer = 'sioyek'
vim.g.vimtex_quickfix_mode = 0
-- Concealment
vim.cmd([[set conceallevel=1]])
vim.cmd([[
let g:vimtex_syntax_conceal = {
\ 'accents': 1,
\ 'ligatures': 1,
\ 'cites': 1,
\ 'fancy': 1,
\ 'spacing': 0,
\ 'greek': 1,
\ 'math_bounds': 1,
\ 'math_delimiters': 1,
\ 'math_fracs': 1,
\ 'math_super_sub': 0,
\ 'math_symbols': 1,
\ 'sections': 0,
\ 'styles': 0,
\}
let g:vimtex_syntax_custom_cmds = [
\ {'name': 'bm', 'mathmode': 1, 'argstyle': 'bold', 'conceal': 1},
\]
]])
-- Synctex configuration
vim.g.vimtex_compiler_progname = 'nvr'
local options = string.format(
'--reuse-window --inverse-search="nvr --servername %s +%%2 %%1" --forward-search-file @tex --forward-search-line @line @pdf',
vim.v.servername)
local command = string.format("let g:vimtex_view_general_options='%s'", options)
vim.cmd(command)
end
}
}