Re: [Vim-latex-devel] envmacros.vim
Brought to you by:
srinathava,
tmaas
From: Mikolaj M. <mi...@wp...> - 2002-11-19 17:51:18
|
On Sun, Nov 17, 2002 at 10:23:32AM -0800, Srinath Avadhanula wrote: > However, if we do begin caring about file content, we should look out > for whether this is the main file or not. For example, if there is a > main.tex.latexmain in the current directory and we are not editing > main.tex, then only use behavior I, irrespective of file content. Simpler is just checking if in current file is \documentclass declaration. > > 3. More than one word in line > > ---------- > > > > asdf asdfx > > > > --------- > > Looks for environment and try to change it. > I dont understand this... What would be an example? a. ---------- \begin{quote} asdf asdfx \end{quote} --------- After <F5> you will get: You are inside quote environment. Do you want to change it to: b. ---------- \begin{quote} asdfx \end{quote} --------- After <F5> ---------- \begin{quote} \begin{asdf} x \end{asdf} \end{quote} --------- > > II. Non empty file (only \documentclass declaration) > Shouldn't this be: If in the preamble of the main file? We could check > for being in the preamble by whether we are after \documentclass but > before \begin{document} Yes. But what if there is no \begin{document} line? > > 1. Empty line > > ---------- > > \documentclass{article} > > x > > > > --------- > > Asks for package > > 2. One word in line > > ---------- > > \documentclass{article} > > asdfx > > > > --------- > > Treats "asdf" as name of the package (and checks if supported) > > 2. If line contains \usepackage > > ---------- > > \documentclass{article} > > \usepackage{asdf}x > > > > --------- > > Change package. Useful when changing supported packages. > Okay. This does sound useful, but use the Tex_GetMainFileName() if you > implement something like this. OK. > > III. Template > > ---------- > > \documentclass{article} > > > > \begin{document} > > > > \end{document} > > --------- > > If cursor is above \begin{document} behaviour as in II, if below as in > > I. > Hmmm... The template is created only once during the entire editing > cycle. I dont think we need to have shortcuts for it since its highly > improbable that a user will keep changing templates! But sometimes you want to change package, add one. m. |