gerw / vim-latex-suite

71 stars 16 forks source link

opening .sty files by default #32

Closed petergthatsme closed 7 years ago

petergthatsme commented 7 years ago

I often have some .sty files in the home folders the documents I'm editing.

It seems, as part of the update to package info, vim-latex-suite will automatically open these files in new buffers as I open the document. So doing:

vim mydocument.tex

will open vim with mydocument.tex, but also all the .sty files in their separate buffers.

I was wondering why this is the default. Seems it happens in vim-latex-suite/ftplugin/latex-suite/packages.vim, around line 144 (the 'exe' call):

    if expand('%:p') != fname
        call Tex_Debug(':Tex_pack_updateall: sview '.fnameescape(fname), 'pack')
        exe 'sview '.fnameescape(fname)
    else
        call Tex_Debug(':Tex_pack_updateall: split', 'pack')
        split
    endif

I can of course comment this out... but was wondering your thoughts on maybe having this not done by default, and/or perhaps having a variable that would dictate if these files should also be opened.

gerw commented 7 years ago

This code resides there since ages. I am not sure about the intentions, see also the comment at https://github.com/gerw/vim-latex-suite/blob/master/ftplugin/latex-suite/packages.vim#L232.

I do not agree with that comment. For a long time, I had replaced the q on line 235 by bwipe. Now, I disabled the scanning for packages altogether by let g:Tex_PackagesMenu = 0 in my ftplugin/tex.vim (in my opinion, it is slow, unreliable and not useful).

petergthatsme commented 7 years ago

gotcha. I guess I'll try setting Tex_PackagesMenu to 0 as well... maybe won't be missing anything anyway. Thanks for the quick follow up.