Hi, Gerd,

 I second Laszlo's point of view; for me, using labels with well chosen
names is clearly the best choice, and I think that the latex-suite should
keep this behavior by default. To me, the <F9>-completion works quite well
and it would maybe need some improvements (it does not work for me with
\includegraphics, and if the vim-window is split when invoking <F9> in
\cite, it oftentimes fails...) but not a complete change of logic.

 Your idea to scan the .aux files could be useful for someone, though. I
don't know if it is feasible, but I would suggest an implementation via a
command, something like

 let g:Tex_completion_scanfile = tex / aux

whereby everyone would have the choice.

This would does not imply less code nor less maintenance, though.

        Best regards,
                Filip

On Thu, 26 Jan 2017, N Laszlo Frazer wrote:

Date: Thu, 26 Jan 2017 21:33:44
From: N Laszlo Frazer <perso...@cesdep.org>
To: "vim-latex-devel@lists.sourceforge.net"
   <vim-latex-devel@lists.sourceforge.net>
Subject: Re: [Vim-latex-devel] Aux completion

Please do not remove the current functionality.  I think it would be very
annoying to rely on the aux file being up-to-date.

Well-chosen keys are much easier to remember than numbers, and they do not
change when you expand the document.

On Fri, 27 Jan 2017 00:52:25 +1100, Gerd Wachsmuth
<gerd.wachsm...@mathematik.tu-chemnitz.de> wrote:

Hi,

in my version of latex-suite (https://github.com/gerw/vim-latex-suite),
I have changed the mechanism of \ref-completions. The current version of
latex-suite greps through the tex-file for \labels. My version greps
through the aux-file. This has the advantage, that one does not have to
memorize the keys within the \labels for completion, but can use the
actual labels in the compiled document.

Hence, you get the following expansions (given that the tex-file has the
corresponding labels):

        theorem.1.3<F9>   =>   \autoref{thm:bar}
        section.2<F9>     =>   \autoref{sec:foo}
        (1.9<F9>          =>   \eqref{eq:baz}
        (1.9)<F9>         =>   \eqref{eq:baz}

(You can also reconfigure an option to use \cref (or anything else)
instead of \autoref)

This is quite convenient, because you can look in the pdf to get the
appropriate number of the thing you want to refer to and use this for
the completion. No need for packages like showkeys.

The only disadvantage is that you get the labels from the aux-file.
Hence, if the aux-file is not up-to-date or you use the numbers from a
print-out (and the aux-file is more recent), you might get unexpected
results.

My question is: Can I replace the current style of the completion with
this aux-based completion in the official repository? This would result
in less code (less maintenance) and is therefore desirable. However, I
can understand if someone would like to stay with the current behavior.

The stage is open for discussion, see also
https://github.com/vim-latex/vim-latex/issues/55


Best regards,
Gerd


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Upozornění / Disclaimer <http://www.fzu.cz/e-mail-upozorneni-disclaimer>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to