-
Notifications
You must be signed in to change notification settings - Fork 389
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backward search doesn't work on neovim + Skim #2157
Comments
Your config is not minimal ;) What happens when you remove the autocommand (and the |
It is still not working (and my current workaround also stops working, of course) |
Weird. How did you install neovim? |
brew install neovim --HEAD |
Notice that you are not on the latest VimTeX. It may not be crucial here, but it's best practise to ensure you're on the latest commits. |
Thanks for advice! Updated VimTex, but still the same problem) |
Can you simplify even more, that is, use the following minimal set nocompatible
let &rtp = '~/.vim/plugged/vimtex,' . &rtp
let &rtp .= ',~/.vim/plugged/vimtex/after'
filetype plugin indent on
syntax enable
let g:vimtex_view_method = 'skim' Also, could you for now remove the With that, you can open your TeX file with Also, please: Can you be very specific/verbose in exactly the steps you use to reproduce? Your current description is not specific. This would be an example (but it may not be exactly what you are doing):
Expect: Backward search Observe: Nothing |
I have done exactly the same you have written. (created test.vim, deleted .latexmkrc, and reproduce the steps you wrote) And still the same. Mystery..... |
Now that we are grasping at straws (and since you didn't specify it): you did set the |
I think we can wait if anyone else have this problem. If I am the only one it wouldn't matter) Thanks for your time!) |
Well, this is all very strange. As I don't use and don't know MacOS in any depth, it is hard to be of any more help; sorry. Of course, if you have a method for getting around this issue (as indicated in the original post), then that's very good. If it turns out that this is a problem for more people, then it might be useful/necessary to update the docs here. |
@AlexFreik I can confirm that the method posted by jdhao and posted here works while the one that I tried via the vimtex documentation does not. @lervag What is the best way to test the nvr command without using Skim? I don't really understand how
is supposed to find the server name initiated by the nvim host? Does it matter which terminal we use or how we launch nvim? In any case I have tested jdhao's solution using iTerm and Alacritty. |
@ThSGM I now realize that the docs are confusing in this sense, or perhaps even plain wrong. I've updated the docs now. I removed the faq entry and merged it with the |
@clason I'm curios, what do you use for the backward search config in Skim? Do you use the simple |
Yes, specifically
Works like a charm, as long as Skim is started by VimTeX. |
Do I further understand correctly, then, that you only have a single instance of neovim open at most times you work with LaTeX? I would claim that this configuration would only work when there are not multiple neovim instances. |
Yes, that's right. That's what splits were invented for, after all :) |
I partly agree; I usually avoid having multiple things going on at the same time. But I'm not at all surprised that some people are very different, and I would want VimTeX to work as expected in most cases. I believe the current docs more or less explain things well (see |
I agree that it's good to be explicit about this! But is this really specific to Skim? Wouldn't all other viewers have the same problem? (Which would point towards including this in VimTeX itself -- not that you have to do this, but encouraging @AlexFreik to make a PR ;)) |
Yes, that's a very good point. I would very much appreciate a PR, both for adding a more fullborne solution and for improving the docs on the matter. |
I've pushed a large doc update now. I would be very happy if someone could read the updated texts, and these in particular:
|
Thanks, great update) I don't know that much about vimtex ecosystem, but I checked your update for inverse search, and added a few comments to the commit c3fd5fe |
Glad you like it!
Thank you for the good suggestions/comments! Regarding this comment, i.e.:
I don't quite get what you mean. Can you be more specific? I.e., what does not work with these? Please notice that the "simple" solutions require either that one only has a single instance of neovim (i.e. servername is "trivial"), or that one uses the @clason I remember someone saying it may be better to use a different option than |
I am using only one instance, but probably I don't understand how to make them work. The @jdhao 's dynamic solution automatically creates a file But with those solutions, like |
I'm glad to hear that this solution works as expected.
Ok, and in this case you:
I believed this would work, because I thought
|
For some reason mine does not.
The only difference is python version. Double-checked that I have only one nvr instance.
|
I don't think so :)
Inverse search only works from the Skim instance started by Vimtex (for me) -- try closing Skim and starting via |
Perhaps this is the key, then. If Skim is started by neovim, then it should know the |
Hahaha =) Indeed, Skim, when started via \ll begins to work with inverse search. But, after nvim closed, and reopened the search stops working. |
Inverse search is indeed tricky to get it right. The more automatic, the better, so that users do not have to fight with various issues like this. |
Ah, yes, there it is, then. And the point is still valid - care must be taken to keep the servername in sync between Skim (or any viewer) and the corresponding neovim/Vim instance. |
I agree, but I'm not sure exactly how to help much more than by writing good docs. Suggestions are welcome, both on possible improvements/features and to improving the docs. Btw, @jdhao, thanks for your very nice blog posts on this topic. They were very helpful in understanding and improving the VimTeX docs! |
Maybe it is better to make Jdhao's solution the main one for Mac/Linux (don't know about the Windows' situation)? It is not that complex to add a few lines in your |
@lervag I think you may need to add a warning to the doc that skim needs to be closed before starting vimtex for LaTeX preview, if they choose to use the more manual way. |
Hmm, yes. Setting the servername explicitly for Neovim is reasonable (although I'd write it to |
It is a good idea! Now we do not need two code paths for server location. How come I hadn't thought about |
I've pushed another improvement to the docs; again I'm happy for feedback. I believe this is getting quite good now. |
Do you need this dance for vim, which has |
Yes. Vim has the exact same problem, because it also needs to know the correct servername. |
Ah, OK, I've only ever seen the issue raised in the context of Then a neovism is of course less than ideal. |
Yes, I also made the same conclusion first. But when I was rewriting all of this, I realized that we have the same exact challenges. I believe it may be somewhat more robust from Vim in that |
Description
My
~/.latexmkrc'
:My
~/.config/nvim/init.vim
(checked that the shortened version below still reproduces the problem):How I fixed the problem
However, backward search works when using the solution from this article.
TL;DR:
Add the following setting to nvim config.
In the Skim Preferences menu, select "Sync > Custom" and set
Args: --servername `cat /tmp/curnvimserver.txt` +"%line" "%file"
(instead of
Args: --remote +"%line" "%file"
)Steps to reproduce
:help vimtex-faq-skimviewer
Expected behavior
Backward search
Actual behavior
nothing
Do you use a latexmkrc file?
Yes
VimtexInfo
The text was updated successfully, but these errors were encountered: