Comments (10)
Do not lazy-load VimTeX (at all); this will prevent it from working and is not necessary (it lazy-loads itself, as plugins should).
from vimtex.
Lunarvim uses folke/lazy.nvim.
Is there any setting I could use, so vimtex it not lazy loaded?
from vimtex.
I cannot give advice on Lunarvim (except don't use it). If you use lazy.nvim itself, you should consult the docs.
from vimtex.
So, I'm currently trying to set up vimtex forwardsearch and inversesearch with Zathura. Forwardsearch works like a charm, while inversesearch does not.
The common reason for this is that people lazy load VimTeX. It is quite easy to check this. If you open Neovim from a terminal with nvim
, it should show an empty buffer (or a start buffer). Can you do :VimtexInverseSearch
now? If not, then you are lazy loading VimTeX.
Another way to check: Run :scriptnames
after starting neovim. If you don't find any vimtex scripts, you are lazy loading.
this is my current config: …
You should NOT use vim.cmd("call vimtex#init()")
!!!!!!
Try this:
lvim.plugins = {
{
"lervag/vimtex",
lazy = false,
init = function()
vim.g.vimtex_view_method = 'zathura'
end,
},
}
Notice that we specify to not lazy load and that configuration is added in the init
function. Also, you don't need to set vimtex_view_general_viewer
.
Error detected while processing command line: E492: Not an editor command: VimtexInverseSearch 23 '/home/max/LaTeX/./hello_world.tex'
That indicates that you are lazy loading stuff.
So there seems to be an issue with
VimtexInverseSearch
. When I open the.tex
file usinglvim hello_world.tex
and then run:VimtexInverseSearch 10 hello_world.tex
LunarVim instantly shuts down.
That is expected. You should not use :VimtexInverseSearch
yourself unless you know what you are doing. :)
from vimtex.
Thank you for the detailed answer.
I have adjusted my config as you suggested
lvim.plugins = { { "lervag/vimtex", lazy = false, init = function() vim.g.vimtex_view_method = 'zathura' end, }, }
Unfortunately, the behavior is still the same. Forwardsearch works just fine, inversesearch not.
Also, when I run :scriptnames
after starting neovim I get this:
There are some vimtex scripts, but probably not all?
It looks to me as if the lazy=false
option is not working. Maybe this is a specific Lunarvim problem. I also have an issue open here Issue #4455/LunarVim but have not yet received any feedback.
from vimtex.
What happens if you run /usr/bin/nvim/bin/nvim
in a terminal? Do you get your expected lunarvim version of neovim running with your config?
from vimtex.
What happens if you run /usr/bin/nvim/bin/nvim in a terminal? Do you get your expected lunarvim version of neovim running with your config?
No, this will open vanilla neovim. To run LunarVim I have to use the lvim command.
I was able to fix my issue by switching to LazyVim and using the vimtex settings that you recommended.
Thank you for your help, I really appreciate it!
from vimtex.
What happens if you run /usr/bin/nvim/bin/nvim in a terminal? Do you get your expected lunarvim version of neovim running with your config?
No, this will open vanilla neovim. To run LunarVim I have to use the lvim command.
Ok! In this case, you have to set the g:vimtex_callback_progpath
variable to lvim
or to the full path (found e.g. by which lvim
in a terminal).
I was able to fix my issue by switching to LazyVim and using the vimtex settings that you recommended. Thank you for your help, I really appreciate it!
Glad to hear it!
from vimtex.
Thank you so much @lervag! I had exactly the same problem in LunarVim and setting vim.g:vimtex_callback_progpath
to the full path to lvim
solved my issue.
I'll note that lazy loading was not the problem (using the "standard" way to load plugins worked fine in LunarVim).
Finally, I'll add that I'm running Wayland, so I also needed to set vim.g.vimtex_view_method = "zathura_simple"
from vimtex.
Thank you so much @lervag! I had exactly the same problem in LunarVim and setting
vim.g:vimtex_callback_progpath
to the full path tolvim
solved my issue.
Great, glad to hear it! If there's a LunarVim wiki or something similar where people share things related to configuring plugins in LunarVim, perhaps this is relevant stuff to add there?
I'll note that lazy loading was not the problem (using the "standard" way to load plugins worked fine in LunarVim).
Lazy loading will break inverse search. And lazy loading of VimTeX does not really bring any significant benefit, so please, just don't do that.
Finally, I'll add that I'm running Wayland, so I also needed to set
vim.g.vimtex_view_method = "zathura_simple"
👍🏻
from vimtex.
Related Issues (20)
- Show which float shows a warning message HOT 4
- Zathura fails for symbolic links (physical vs. absolute logical paths) HOT 3
- pdf outfile should be updated to match the argument to compile command HOT 3
- Arabic text is concealed when indented HOT 4
- Partial concealment of symbols HOT 6
- `which-key.nvim` support HOT 5
- Difficulty getting Okular inverse search to work HOT 7
- Automatically source syntax highlight changes for vimtex highlight groups HOT 2
- Changes in Treesitter parser broke vimtex syntax highlighting HOT 1
- [Question] Combine default markdown syntax and vimtex syntax? HOT 4
- cite command syntax highlighting including various variants introduced by biblatex-chicago HOT 23
- Neovim and Zathura: no inverse search HOT 4
- about slow syntax highlighting HOT 12
- citekey autofill not working with \Volcite and \volcite when using correct biblatex syntax HOT 4
- zathura_simple on wayland not outputting pdf HOT 7
- Contents on Zathura are not recoganizable when doing forward search if the cursor stays on an equation environment HOT 1
- Disregard contents of "comment" environment HOT 6
- Errors E716 E116 when running :VimtexTocOpen in a file containing a \label HOT 3
- Item Option highlight group and concealing HOT 3
- How to replace deprecated option 'vimtex_view_general_options_latexmk'? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vimtex.