I would like vimwiki to open .tex files in vim (in the same way it open wiki files in vim).
I'm running cygwin, and I finally succeeded in making vimwiki open links the way it "should" by replacing 'xdg-open ' with 'cygstart ' in the vim#wiki#base#system_open_link function, and so now pdfs open in a pdf viewer, urls open in a browser, etc, which is great. But when cygstart is applied to .tex files, it opens the windows copy of gvim in another window.
Is there any way of configuring vimwiki to not use cygstart when the local file has a .tex extension, but rather treat it exactly the same way it treats .wiki files?
I found the answer in the vimwiki help file. There is an example of the VimWikiLinkHandler function that opens
vlocal
files in vim. I just copied this function into plugin/vimwiki.vim: