[Vim-latex-cvs] vimfiles/ftplugin/latex-suite wizardfuncs.vim,1.3,1.4
Brought to you by:
srinathava,
tmaas
From: <mi...@us...> - 2002-11-14 09:39:04
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory usw-pr-cvs1:/tmp/cvs-serv25281 Modified Files: wizardfuncs.vim Log Message: moving envs part to envmacros.vim Index: wizardfuncs.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/wizardfuncs.vim,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wizardfuncs.vim 27 Oct 2002 09:18:04 -0000 1.3 --- wizardfuncs.vim 14 Nov 2002 09:39:01 -0000 1.4 *************** *** 1,5 **** ! " File: texwizards.vim " Author: Mikolaj Machowski <mi...@wp...> ! " Last Change: Sun Oct 27 01:00 AM 2002 PST " Description: " --- 1,5 ---- ! " File: wizardfuncs.vim " Author: Mikolaj Machowski <mi...@wp...> ! " Last change: wto lis 12 09:00 2002 C " Description: " *************** *** 14,236 **** endif let s:doneOnce = 1 - - " Tex_MenuWizard: the king of the wizards {{{ - " - function! Tex_MenuWizard(submenu, env) - if (a:env=="figure" || a:env=="figure*" ) - return Tex_figure(a:env) - elseif (a:env=="table" || a:env=="table*") - return Tex_table(a:env) - elseif (a:env=="tabular" || a:env=="tabular*" || - \a:env=="array" || a:env=="array*") - return Tex_tabular(a:env) - elseif (a:env=="eqnarray" || a:env=="equation*") - return Tex_eqnarray(a:env) - elseif (a:env=="list") - return Tex_list(a:env) - elseif (a:env=="itemize" || a:env=="theindex" || - \a:env=="trivlist" || a:env=="enumerate") - return Tex_itemize(a:env) - elseif (a:env=="description") - return Tex_description(a:env) - elseif (a:env=="document") - return Tex_document(a:env) - elseif (a:env=="minipage") - return Tex_minipage(a:env) - elseif (a:env=="thebibliography") - return Tex_thebibliography(a:env) - else - return IMAP_PutTextWithMovement("\\begin{".a:env."}\<cr>«»\<cr>\\end{".a:env."}«»") - endif - endfunction - - " }}} - " ============================================================================== ! " Specialized functions for various environments " ============================================================================== - " Tex_itemize: {{{ - function! Tex_itemize(env) - return "\\begin{".a:env."}\<cr>\\item \<cr>\\end{".a:env."}«»\<Up>" - endfunction - - " }}} - " Tex_description: {{{ - function! Tex_description(env) - let itlabel = input("(Optional) Item label? ") - if (itlabel != "") - let itlabel = '['.itlabel.']' - endif - return IMAP_PutTextWithMovement("\\begin{description}\<cr>\\item".itlabel." \<cr>\\end{description}«»\<Up>") - endfunction - - " }}} - " Tex_figure: {{{ - function! Tex_figure(env) - let flto = input("Float to (htbp)? ") - let caption = input("Caption? ") - let center = input("Center ([y]/n)? ") - let label = input('Label (for use with \ref)? ') - " additional to AUC Tex since my pics are usually external files - let pic = input("Name of Pic-File? ") - if (flto != "") - let flto = "[".flto."]\<cr>" - else - let flto = "\<cr>" - endif - if (pic != "") - let pic = "\\input{".pic."}\<cr>" - else - let pic = "ä\<cr>" - endif - if (caption != "") - let caption = "\\caption{".caption."}\<cr>" - endif - if (label != "") - let label = "\\label{fig:".label."}\<cr>" - endif - if (center == "y" || center == "") - let centr = "\\begin{center}\<cr>" - let centr = centr . pic - let centr = centr . caption - let centr = centr . label - let centr = centr . "\\end{center}\<cr>" - else - let centr = pic - let centr = centr . caption - let centr = centr . label - endif - let figure = "\\begin{".a:env."}".flto - let figure = figure . centr - let figure = figure . "\\end{".a:env."}«»" - return IMAP_PutTextWithMovement(figure) - endfunction - - " }}} - " Tex_table: {{{ - function! Tex_table(env) - let flto = input("Float to (htbp)? ") - let caption = input("Caption? ") - let center = input("Center (y/n)? ") - let label = input('Label (for use with \ref)? ') - if (flto != "") - let flto ="[".flto."]\<cr>" - else - let flto = "" - endif - let ret="\\begin{table}".flto - if (center == "y") - let ret=ret."\<cr>\\begin{center}" - endif - let foo = "\<cr>\\begin{tabular}" - let pos = input("(Optional) Position (t b)? ") - if (pos!="") - let foo = foo.'['.pos.']' - endif - let format = input("Format ( l r c p{width} | @{text} )? ") - if format == '' - let format = '«»' - endif - let ret = ret.foo.'{'.format."}\<cr>«»\<cr>\\end{tabular}«»\<cr>" - if (center == "y") - let ret=ret."\\end{center}\<cr>" - endif - if (caption != "") - let ret=ret."\\caption{".caption."}\<cr>" - endif - if (label != "") - let ret=ret."\\label{tab:".label."}\<cr>" - endif - let ret=ret."\\end{table}«»" - return IMAP_PutTextWithMovement(ret) - endfunction - - " }}} - " Tex_tabular: {{{ - function! Tex_tabular(env) - let pos = input("(Optional) Position (t b)? ") - if (pos!="") - let pos = '['.pos.']' - endif - let format = input("Format ( l r c p{width} | @{text} )? ") - if format != "" - let format = '{'.format.'}' - endif - return IMAP_PutTextWithMovement("\\begin{".a:env."}".pos.format."\<cr> \<cr>\\end{".a:env."}«»\<Up>\<Left>") - endfunction - - " }}} - " Tex_eqnarray: {{{ - function! Tex_eqnarray(env) - let label = input("Label (for use with \ref)? ") - if (label != "") - let arrlabel = "\\label{eqn:".label."}\<cr> " - else - let arrlabel = " " - endif - return IMAP_PutTextWithMovement("\\begin{".a:env."}\<cr>".arrlabel."\<cr>\\end{".a:env."}«»\<Up>\<Left>") - endfunction - - " }}} - " Tex_list: {{{ - function! Tex_list(env) - let label = input("Label (for \item)? ") - if (label != "") - let label = "{".label."}" - let addcmd = input("Additional commands? ") - if (addcmd != "") - let label = label . "{".addcmd."}" - endif - else - let label = "" - endif - return IMAP_PutTextWithMovement("\\begin{list}".label."\<cr>\\item \<cr>\\end{list}«»\<Up>") - endfunction - - " }}} - " Tex_document: {{{ - function! Tex_document(env) - let dstyle = input("Document style? ") - let opts = input("(Optional) Options? ") - let foo = '\documentclass' - if (opts=="") - let foo = foo.'{'.dstyle.'}' - else - let foo = foo.'['.opts.']'.'{'.dstyle.'}' - endif - return IMAP_PutTextWithMovement(foo . "\<cr>\<cr>\\begin{document}\<cr>\<cr>\\end{document}\<Up>") - endfunction - - " }}} - " Tex_minipage: {{{ - function! Tex_minipage(env) - let foo = '\begin{minipage}' - let pos = input("(Optional) Position (t b)? ") - let width = input("Width? ") - if (pos=="") - let foo = foo.'{'.width.'}' - else - let foo = foo.'['.pos.']{'.width.'}' - endif - return IMAP_PutTextWithMovement(foo . "\<cr> \<cr>\\end{minipage}\<Up>\<Left>") - endfunction ! " }}} ! " Tex_thebibliography: {{{ ! function! Tex_thebibliography() ! " AUC Tex: "Label for BibItem: 99" ! let indent = input("Indent for BibItem? ") ! let foo = "{".indent."}" ! let biblabel = input("(Optional) Bibitem label? ") ! let key = input("Add key? ") ! let bar = "\\bibitem" ! if (biblabel != "") ! let bar = bar.'['.biblabel.']' ! endif ! let bar = bar.'{'.key.'}' ! return IMAP_PutTextWithMovement("\\begin{thebibliography}".foo."\<cr>".bar." \<cr>\\end{thebibliography}\<Up>\<Left>") ! endfunction - " }}} " Tex_VisSecAdv: handles visual selection for sections {{{ function! Tex_VisSecAdv(section) --- 14,24 ---- endif let s:doneOnce = 1 " ============================================================================== ! " Specialized functions for handling sections from command line " ============================================================================== ! com! -nargs=? TSection call Tex_section(<f-args>) ! com! -nargs=? TSectionAdvanced call Tex_section_adv(<f-args>) " Tex_VisSecAdv: handles visual selection for sections {{{ function! Tex_VisSecAdv(section) *************** *** 246,250 **** let shorttitle = '['.shorttitle.']' endif ! exe IMAP_PutTextWithMovement("normal `>a}\<cr>\<esc>`<i".sstructure.toc.shorttitle."{") endfunction --- 34,38 ---- let shorttitle = '['.shorttitle.']' endif ! exe "normal `>a}\<cr>\<esc>`<i".sstructure.toc.shorttitle."{" endfunction *************** *** 275,286 **** " }}} - - " ============================================================================== - " Specialized functions for handling sections from command line - " ============================================================================== - - com! -nargs=? TSection call Tex_section(<f-args>) - com! -nargs=? TSectionAdvanced call Tex_section_adv(<f-args>) - function! Tex_section(...) "{{{ silent let pos = line('.').' | normal! '.virtcol('.').'|' --- 63,66 ---- |