Re: [Vim-latex-devel] envmacros.vim
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@ee...> - 2002-11-17 18:23:04
|
Hey Mikolaj! On Sun, 17 Nov 2002, Mikolaj Machowski wrote: > > I am redirecting to devel list. > > On Sat, Nov 16, 2002 at 04:54:27PM -0800, Srinath Avadhanula wrote: > > Hello! > > I did most of this myself because I couldn't resist ;) > > So the TODO which remains for envmacros.vim: > > 1. EFI in menu and EFI in maps insert different things. > > 2. Introduce a new setting g:Tex_UseMenuWizard in texrc to see if user > > wants wizard behavior or not. > > 3. Change s:Tex_change_environments to also use the > > s:PromptForEnvironment function. > > 4. Put a "Choose Environment" in the environments main menu (which > > should shortcut to Tex_FastEnvironmentInsert()). > > 5. Documentation!!! All these features are presently hidden from user. > > Eeee, what exactly is left to do? :) Plenty. See the TODO list above. none of these are implemented yet. The _most important_ thing still unimplemented imo is number 2 above. This according to me is really really important. This setting will have to be used by each of the Tex_itemize() and such functions. For example, pressing <F5> now and choosing 'figure' asks many many questions. I would prefer just inserting a template with placeholders. > I'd like to introduce one more feature: more intelligent F5 key. It will > act: > x - cursor > I. Empty file > 1. Empty line > ---------- > > x > > --------- > Asks for environment. > 2. One word in line > ---------- > > asdfx > > --------- > Treats "asdf" as name of the environment > This is already the behavior. When there is a word, it constructs an environment from that, otherwise it prompts. Try it out... As of now, it doesn't care about whether there is stuff in the file or not. 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. > 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? > 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} > 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. > 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! Also, another idea. As of now, Carl's suggestion of having <S-F1> through <S-F4> map to commonly used environments is not implemented. A good way to do this will be to have a setting: g:Tex_CommonEnvironments in texrc and map <S-F1> through <S-F4> (note that its <S-F1>, not <F1>), to the environments in those. This way, we will have customization and if someone decides that he doesn't want these shortcuts, he can leave g:Tex_CommonEnvironments = '' So thats another TODO item... Plenty of things to choose from :) Srinath -- Srinath Avadhanula Nov 17 10:02am "I used to think that the brain was the most wonderful organ in my body. Then I realized who was telling me this." -- Emo Phillips |