Closed Nora-n closed 1 year ago
This works for me
{
"lervag/vimtex",
lazy = false,
ft = { "tex" },
config = function()
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_compiler_method = "latexmk"
vim.g.vimtex_toc_config = {
split_width = 20
}
end,
}
:h g:vimtex_toc_config
First, thanks for giving a very nice and detailed issue description!
Thus in my
vimtex.lua
file I have: …
There are a few things that I would change here:
ft = "tex"
. If it does not work without it, then there is something else that is seriously wrong, and you should instead open a new issue on that. ft = "tex"
implies lazy loading, and you don't want that. VimTeX is already lazy.init
instead of config
to ensure that the options are defined before VimTeX is loaded. Also, you don't need to call vimtex#init
yourself! And, by the way, if you want to run vimscript functions in lua, it is better to write vim.fn["vimtex#init"]()
:)split_width
key of g:vimtex_toc_config
.I've compiled those tips and a few other minor improvements (e.g. remove options that you do not change form default values, and remove unnecessary g.tex_*
options) in the following suggested config:
return {
{
"lervag/vimtex",
lazy = false,
init = function()
vim.g.vimtex_quickfix_mode = 0
vim.g.vimtex_view_method = "zathura"
vim.g.vimtex_toc_config = {
split_width = 20
}
end,
},
}
I would think that things should work if you use the above suggested config. If not, then please open a new issue. Preferably try and create a reproducible example.
@julio-b Please also note that you should NOT have ft = "tex"
in your config!
Thank you! Works like a charm, as always.
Glad to hear it :)
Description
I want the table of content to be smaller than its default value.
:help vimtex_toc
indicates I should change the parameterg.vimtex_split_width
. Thus in myvimtex.lua
file I haveHowever, ToC size is the same.
Steps to reproduce
nvim minimal.tex
:VimtexTocToggle
:q
nvim $HOME/.config/nvim/lua/plugins/vimtex.lua
split_width
to 20Expected behavior
I expect the ToC to change width.
Actual behavior
It doesn't.
Do you use a latexmkrc file?
No
VimtexInfo