Fix vimtex backward search

This commit is contained in:
Andreas Tsouchlos 2025-11-13 23:47:56 +01:00
parent 2bf187255a
commit dcb4e6e71d

View File

@ -1,9 +1,6 @@
return { return {
"lervag/vimtex", "lervag/vimtex",
ft = { lazy = false, -- For backward search to work, :VimtexInverseSearch must always be available
"tex",
"bib"
},
config = function() config = function()
-- General configuration -- General configuration
@ -20,8 +17,7 @@ return {
} }
} }
-- TODO: Fix `VimTex: Viewer cannot find Zathura window ID` vim.g.vimtex_view_method = 'zathura_simple'
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_quickfix_mode = 0 vim.g.vimtex_quickfix_mode = 0
-- Concealment -- Concealment
@ -49,15 +45,5 @@ return {
\ {'name': 'bm', 'mathmode': 1, 'argstyle': 'bold', 'conceal': 1}, \ {'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 end
} }