Skip to content
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

add support for TeXShop on macOS (MacVim) #2387

Closed
wants to merge 0 commits into from

Conversation

michaelliebling
Copy link
Contributor

Add support for TeXShop on macOS. TeXShop offers:

  1. a TeX-aware text editor (irrelevant for vim users)
  2. a PDF viewer compatible with backward search
  3. a compiler front-end for various TeX-related software (pdfTeX, LuaTeX, etc.).

The proposed features are related to 2. (backward search from PDF to MacVim) and 3. (backward search from compiler console to MacVim). The latter might stand out compared to other tools (viewers) vimtex usually interacts with (alternative to quickfix).

The following files are affected (or added) by this pull request:

  • README.md: mention TeXShop in the list of supported viewers.
  • autoload/health/vimtex.vim: add a command to check whether TeXShop exists
  • autoload/vimtex/options.vim: add the two options 'vimtex_view_texshop_activate' and 'vimtex_view_texshop_sync'.
  • autoload/vimtex/view/texshop.vim: viewer interaction with TeXShop (forward search) based on the latest viewer for Skim.
  • doc/vimtex.txt: add documentation on a. how to use vimtex with TeXShop (succinct, since it will just work like for other viewers on the vim side) and b. on how to set up TeXShop to play with MacVim (a bit longer, in the FAQ, since that's more unique).

Copy link
Owner

@lervag lervag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is really close, I only have a few more minor comments - I hope you don't mind.

One more important question, though: In December/January I added an improved method for doing inverse search. Perhaps you could check if this is possible to integrate also for TeXShop? Please read :help vimtex-synctex-inverse-search once in detail, I believe it may already be more or less fully relevant. Perhaps also relevant to read the :help vimtex-view-skim sections for an example on how I document the inverse search for Skim.

I am not surprised if we keep the faq section in general, but perhaps it is possible to simplify things more?

autoload/vimtex/view/texshop.vim Outdated Show resolved Hide resolved
autoload/vimtex/view/texshop.vim Outdated Show resolved Hide resolved
autoload/vimtex/view/texshop.vim Outdated Show resolved Hide resolved
doc/vimtex.txt Outdated Show resolved Hide resolved
doc/vimtex.txt Outdated Show resolved Hide resolved
@lervag
Copy link
Owner

lervag commented Nov 10, 2022

@michaelliebling I'm curious, do you want me to close this PR, or should I expect a reply to my comments?

@michaelliebling
Copy link
Contributor Author

Thanks for the comments and checks. I've shortened the docs to match those for other viewers (in particular, skim) only kept extra text for the extra features that TeXshop provides (i.e. when using its compiler front-end, one can Inverse Search the error during interactive compilation) and its expectations regarding the existence of an external bash script that calls the external editor.

As you suggested, the generic VimtexInverseSearch approach does indeed work well for TeXshop as well. One thing that took me a while to figure out: somehow I had missed the -v option in the call to mvim. This turns out to be essential to avoid having MacVim reload the window with an annoying opening animation at each Inverse Search.

I've moved the explicit script example to the vimtex-faq-texshopviewer section to keep the main documentation lean (again, matching skim's). In the faq, I describe using VimtexInverseSearch first, but nevertheless kept the mention to the --remote-silent alternative as it appears to be the only way to force-open a hidden buffer in MacVim (or even have the file opened by MacVim if it isn't open yet).

@lervag
Copy link
Owner

lervag commented Mar 20, 2023

Thank you! I think this is very good and I will be glad to merge it. However, I don't want the messy merge commits here. Can you please make a new fork of VimTeX and commit the changes on top of that as a single commit, then open a new PR? I'll merge it asap after that.

Alternatively, I can do this myself on my end. That means less work for you, but I may end up loosing your git signatures - that is, then it may seem like I authored the work. I would therefore prefer that you update on your end so that the authorship is correctly preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants