vim-latex-cvs Mailing List for Vim-Latex (Page 20)
Brought to you by:
srinathava,
tmaas
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(82) |
Dec
(124) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(104) |
Feb
(3) |
Mar
(6) |
Apr
(48) |
May
(34) |
Jun
(62) |
Jul
(33) |
Aug
(24) |
Sep
(32) |
Oct
(16) |
Nov
(36) |
Dec
(39) |
2004 |
Jan
|
Feb
(3) |
Mar
(8) |
Apr
|
May
(29) |
Jun
(13) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(6) |
Dec
(9) |
2006 |
Jan
(9) |
Feb
(2) |
Mar
(16) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(17) |
Sep
(3) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2010 |
Jan
(25) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(8) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
(10) |
Oct
(1) |
Nov
|
Dec
(1) |
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(15) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1:/tmp/cvs-serv24712 Modified Files: latex-suite.txt Added Files: Makefile.in latex-suite-chunk.xsl latex-suite-common.xsl latex-suite.css latex-suite.xml latex-suite.xsl Log Message: New documentation files in the doc directory contain all the xml and xsl stuff needed to build the help files in various formats. From now on, only latex-suite.xml will be directly modified. latex-suite.txt, latex-suite.html and latex-suite/*.html will all be automatically generated from the master .xml file. The new method of making a release: 1. From the vimfiles/ directory issue a :make command. 2. From this directory issue a :make ls-txt command. 3. From the vimfiles/ directory issue a :make upload command. These three steps will be gathered into a single :make release target for the future. --- NEW FILE: Makefile.in --- ls-flat: java com.icl.saxon.StyleSheet latex-suite.xml latex-suite.xsl > latex-suite.html ls-chunk: ( \ cd latex-suite && \ java com.icl.saxon.StyleSheet ../latex-suite.xml ../latex-suite-chunk.xsl \ ) ls-txt: db2vim latex-suite.xml > latex-suite.txt # vim:nowrap --- NEW FILE: latex-suite-chunk.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <!-- $Id: latex-suite-chunk.xsl,v 1.1 2003/06/18 05:12:38 srinathava Exp $ --> <xsl:import href="file:///c:/users/srinath/testing/docbook/xhtml/chunk.xsl"/> <!-- import common customizations --> <xsl:import href="latex-suite-common.xsl"/> <!-- insert customization here --> <xsl:param name="default.encoding" select="'ISO-8859-1'"/> <xsl:param name="use.id.as.filename" select="'1'"/> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="html.stylesheet" select="'../latex-suite.css'"/> <!-- Chunk the first top-level section? --> <xsl:param name="chunk.first.sections" select="1"/> <!-- Depth to which sections should be chunked --> <xsl:param name="chunk.section.depth" select="2"/> <!-- How deep should recursive sections appear in the TOC? --> <xsl:param name="toc.section.depth">2</xsl:param> <!-- Control depth of TOC generation in sections --> <xsl:param name="generate.section.toc.level" select="3"/> <xsl:param name="chunker.output.method" select="'html'"/> <xsl:param name="chunker.output.doctype-public" select="'-//W3C//DTD HTML 4.01 Transitional//EN'"/> <xsl:param name="chunker.output.doctype-system" select="'http://www.w3.org/TR/html4/loose.dtd'"/> <!-- this enables generation of TOC in appendix --> <xsl:param name="generate.toc"> appendix toc article/appendix toc article toc sect1 toc sect2 toc sect3 toc sect4 toc sect5 toc section toc </xsl:param> </xsl:stylesheet> --- NEW FILE: latex-suite-common.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <!-- $Id: latex-suite-common.xsl,v 1.1 2003/06/18 05:12:38 srinathava Exp $ --> <!-- Common customizations for all stylesheets --> <!-- this omits the trailing '.' in numbered sections --> <xsl:param name="autotoc.label.separator" select="' '"/> <xsl:param name="local.l10n.xml" select="document('')"/> <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> <l:l10n language="en"> <l:context name="title-numbered"> <l:template name="section" text="%n %t"/> </l:context> </l:l10n> </l:i18n> <!-- override template for revhistory table --> <xsl:template match="revhistory" mode="titlepage.mode"> <xsl:variable name="numcols"> <xsl:choose> <xsl:when test="//authorinitials">3</xsl:when> <xsl:otherwise>2</xsl:otherwise> </xsl:choose> </xsl:variable> <div xmlns="http://www.w3.org/1999/xhtml" class="{name(.)}"> <table border="2" cellspacing="4" width="100%" summary="Revision history"> <tr> <th align="left" valign="top" colspan="{$numcols}"> <b> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'RevHistory'"/> </xsl:call-template> </b> </th> </tr> <xsl:apply-templates mode="titlepage.mode"> <xsl:with-param name="numcols" select="$numcols"/> </xsl:apply-templates> </table> </div> </xsl:template> <!-- <xsl:template name="user.header.content"> <div id="customheader"> <span class="logo">TeX Refs</span> </div> </xsl:template> <xsl:template name="user.footer.content"> <div id="customfooter"> Copyright © 2002 P. Karp, M. Wiedmann </div> </xsl:template> --> </xsl:stylesheet> --- NEW FILE: latex-suite.css --- /* * Authors: Srinath Avadhanula and Mikolaj Machowski * This style file borrows some elements from main.css, the style file used * in cream.sf.net * * */ P { font-size : 12pt ; font-family : helvetica, arial, verdana, sans-serif ; vertical-align : top; } DT { font-size : 11pt ; font-family : helvetica, arial, verdana, sans-serif ; vertical-align : top; } LI { font-size : 12pt ; font-family : helvetica, arial, verdana, sans-serif ; vertical-align : top; } DIV.header { margin : 0.5cm ; width : 800px ; height : 100 } .note { } TD { font-size : 11pt ; font-family : helvetica, arial, verdana, sans-serif ; vertical-align : top; } TD.menu { text-align : center ; font-family : verdana, helvetica, sans-serif } TD.footright { text-align : right ; font-size : 10pt ; font-family : verdana, helvetica, sans-serif } TD.leftpanel { font-size: 14px ; font-family: verdana, helvetica, sans-serif ; vertical-align: top ; width: 150px; padding: 15px; background-color: #88aaaa; } TD.mainpanel { font-size : 12pt ; font-family : helvetica, arial, verdana, sans-serif ; vertical-align : top; padding: 15px; } TD.footpanel { font-size: 12px ; font-family: verdana, helvetica, sans-serif ; vertical-align: top ; text-align: right; padding: 5px; background-color: #88aaaa; } .navigation { vertical-align: top; width: 150px; padding: 15px; background-color: #445555; color: #fffcfc; } .navheader { margin-top: -0.5em; margin-bottom: 0.5em; text-align: right; color: #446644; font-size: 14px; font-weight: bold; } SPAN.menu { text-align : center ; font-size : 12pt ; font-family : verdana, helvetica, sans-serif } DIV.merit { margin : 0.5cm ; width : 800px } TABLE.meritum { margin : 0.5cm ; border : 0 } .foot { margin : 0.5cm ; width : 800px } .head { margin : 0.5cm ; } CODE { font-family: "Andale Mono", "Courier New", "Courier", monospace; background-color: #eef0f3; white-space: nowrap; } .singlesmall { font-size: 14px; } .doublesmall { font-size: 12px; } DIV.footer { margin : 0.5cm ; width : 800px } .qa { margin : 0.5cm ; font-size : 16px; font-weight : bold; } .ans { margin : 0.5cm ; font-weight : normal; } H2.hline { text-align : center ; font-family : verdana, helvetica, sans-serif } A.extlinks { font-size : 11pt ; font-family : verdana, helvetica, sans-serif ; font-weight : bold } TT { font-family: courier,sans-serif; font-size: 11pt; } PRE.programlisting { font-family: courier,sans-serif; font-size: 10pt; background-color:#eef0f3; border-color: #000000; border-width: 1px; border-style: solid; } SPAN.conflict { font-size : small ; font-family: courier,sans-serif; color : #DD4444; } HR.navig { color: #446644; height: 1px; margin-top: 1em; border-top: 0px; /* Mozilla work-around to eliminate "groove" */ } A.question { color: #000000; height: 1px; margin-top: 1em; border-top: 0px; /* Mozilla work-around to eliminate "groove" */ } A.question:hover { color: #000000; background-color: #eef0f3; height: 1px; margin-top: 1em; border-top: 0px; /* Mozilla work-around to eliminate "groove" */ } --- NEW FILE: latex-suite.xml --- <?xml version='1.0' encoding='ISO-8859-1'?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "file:///c:/users/srinath/testing/docbook/docbookx.dtd" [<!ENTITY dummy "dummy"> <!ENTITY date "$Date: 2003/06/18 05:12:38 $"> <!ENTITY ls "Latex-Suite"> <!ENTITY latex "LaTeX"> <!ENTITY vim "Vim"> <!ENTITY ph "<++>"> ]> <article lang="en"> <articleinfo id="articleinfo"> <title id="articleinfo-title">&ls; Reference</title> <author> <firstname>Srinath</firstname> <surname>Avadhanula</surname> [...2882 lines suppressed...] A large number of functions in latex-suite come from various other people. Some of those people might have been missed here. Each function should however have the author's name/e-mail above it. Thats the more authoritative place to check out who has done what. </para> <anchor id="latex-suite-maintainer"></anchor> <para> The current maintainer(s) of latex-suite is(are) </para> <simplelist> <member>Srinath Avadhanula <sr...@fa...></member> <member>Mikolaj Machowski <mi...@wp...></member> <member>Benji Fisher <be...@me...></member> </simplelist> </section> </article> <!-- vim: fdm=syntax:et:sw=1:sts=4 --> --- NEW FILE: latex-suite.xsl --- <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <!-- $Id: latex-suite.xsl,v 1.1 2003/06/18 05:12:38 srinathava Exp $ --> <xsl:import href="file:///c:/users/srinath/testing/docbook/xhtml/docbook.xsl"/> <!-- import common customizations --> <xsl:import href="latex-suite-common.xsl"/> <xsl:output method="html" encoding="ISO-8859-1" indent="no"/> <!-- insert customization here --> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="html.stylesheet" select="'latex-suite.css'"/> </xsl:stylesheet> Index: latex-suite.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** latex-suite.txt 24 May 2003 22:20:10 -0000 1.24 --- latex-suite.txt 18 Jun 2003 05:12:38 -0000 1.25 *************** *** 1,1267 **** ! *latex-suite* Tools for an enhanced LaTeX environment in Vim ! For Vim version 6.0 and above. ! Last Change: Sat Apr 16 06:00 PM 2003 ! ! By Srinath Avadhanula <sr...@fa...>, ! Mikolaj Machowski <mi...@wp...>, ! Benji Fisher <be...@me...> ! et. al (|latex-suite-credits|) ! ! [...3552 lines suppressed...] ! *latex-suite-maintainer* ! The current maintainer(s) of latex-suite is(are) ! ! ! Srinath Avadhanula <sr...@fa...> ! ! Mikolaj Machowski <mi...@wp...> ! ! Benji Fisher <be...@me...> ! ! ================================================================================ ! Vim folding ! ! The following modelines should nicely fold up the help manual. ! ! vim:ft=help:fdm=expr ! vim:foldexpr=getline(v\:lnum-1)=~"=\\\\{80,}"?"a1"\:(getline(v\:lnum+1)=~"=\\\\{80,}"?"s1"\:"=") ! vim:foldtext=v\:folddashes.substitute(getline(v\:foldstart),"\\\\s*\\\\*.*","","") ! ================================================================================ ! |
From: <sri...@us...> - 2003-06-18 04:49:51
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1:/tmp/cvs-serv22750 Removed Files: newlatex-suite.txt Log Message: --- newlatex-suite.txt DELETED --- |
From: <sri...@us...> - 2003-06-18 01:09:33
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv22609 Modified Files: packages.vim Log Message: Bug: Use Tex_GetMainFileName(':p:r') to find the complete path-name of the master file, not Tex_GetMainFileName(':p'). Change: Do not use the v:errmsg mechanism for finding out if an error occured in opening a custom package. Sometimes, other errors could occur _after_ the file is opened, causing v:errmsg to be corrupted. Instead check to see using bufnr(), which should be more robust. Change: Use silent! while opening and closing folds, otherwise we get errors on terminal. Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** packages.vim 17 Jun 2003 02:07:47 -0000 1.35 --- packages.vim 18 Jun 2003 01:09:30 -0000 1.36 *************** *** 83,87 **** " Find out which file we need to scan. if Tex_GetMainFileName() != '' ! let fname = Tex_GetMainFileName(':p') else let fname = expand('%:p') --- 83,87 ---- " Find out which file we need to scan. if Tex_GetMainFileName() != '' ! let fname = Tex_GetMainFileName(':p:r') else let fname = expand('%:p') *************** *** 147,154 **** endif - let v:errmsg = '' - " write down the name of this package in the fake buffer. - call Tex_Debug('silent! find '.packname.'.sty', 'pack') split exec 'silent! find '.packname.'.sty' call Tex_Debug('present file = '.bufname('%'), 'pack') --- 147,154 ---- endif split + + call Tex_Debug('silent! find '.packname.'.sty', 'pack') + let thisbufnum = bufnr('%') exec 'silent! find '.packname.'.sty' call Tex_Debug('present file = '.bufname('%'), 'pack') *************** *** 156,160 **** " If this file was not found, assume that it means its not a " custom package and mark it "scanned". ! if v:errmsg =~ '^E345' let scannedPackages = scannedPackages.','.packname q --- 156,162 ---- " If this file was not found, assume that it means its not a " custom package and mark it "scanned". ! " A package is not found if we stay in the same buffer as before and ! " its not the one where we want to go. ! if bufnr('%') == thisbufnum && bufnr('%') != bufnr(packname.'.sty') let scannedPackages = scannedPackages.','.packname q *************** *** 162,166 **** call Tex_Debug(packname.' not found anywhere', 'pack') let i = i + 1 ! let packname = Tex_Strntok(g:Tex_package_detected) continue endif --- 164,168 ---- call Tex_Debug(packname.' not found anywhere', 'pack') let i = i + 1 ! let packname = Tex_Strntok(g:Tex_package_detected, ',', i) continue endif *************** *** 297,301 **** " /somepattern " issued in a closed fold _always_ goes to the first match. ! normal! ggVGzO " The wrap trick enables us to match \usepackage on the first line as --- 299,305 ---- " /somepattern " issued in a closed fold _always_ goes to the first match. ! let erm = v:errmsg ! silent! normal! ggVGzO ! let v:errmsg = erm " The wrap trick enables us to match \usepackage on the first line as *************** *** 365,369 **** " functionality to remember the fold-state before opening up all the folds " and then re-creating them. Use mkview.vim. ! normal! ggVGzC " Because creating list of detected packages gives string --- 369,375 ---- " functionality to remember the fold-state before opening up all the folds " and then re-creating them. Use mkview.vim. ! let erm = v:errmsg ! silent! normal! ggVGzC ! let v:errmsg = erm " Because creating list of detected packages gives string |
From: <sri...@us...> - 2003-06-18 01:03:45
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv22000 Modified Files: texrc Log Message: In the viewer rules for windows, do not use full paths. Ask the user to set the $PATH variable to include the directories containing the programs. This is more portable than before. Set default value for g:Tex_RememberCiteSearch, Tex_BIBINPUTS and Tex_TEXINPUTS Index: texrc =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texrc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** texrc 15 Jun 2003 08:42:11 -0000 1.28 --- texrc 18 Jun 2003 01:03:42 -0000 1.29 *************** *** 106,116 **** " when calling them. The viewer therefore cannot accept arguments after " the filename. ! " Important for Windows users: ! " you should adapt the absolute path for gsview32 and AcroRd32 calls; ! " below you can find some standard locations of those programs. ! " Tex_ViewRule_dvi value can be set to 'yap -1' or 'windvi'. if has('win32') ! TexLet g:Tex_ViewRule_ps = 'C:\Ghostgum\gsview\gsview32' ! TexLet g:Tex_ViewRule_pdf = 'C:\Progra~1\Adobe\Acroba~1.0\Reader\AcroRd32' TexLet g:Tex_ViewRule_dvi = 'yap -1' elseif has('macunix') --- 106,114 ---- " when calling them. The viewer therefore cannot accept arguments after " the filename. ! " NOTE: Windows users: ! " Set your $PATH variable to include the full path to these programs. if has('win32') ! TexLet g:Tex_ViewRule_ps = 'gsview32' ! TexLet g:Tex_ViewRule_pdf = 'AcroRd32' TexLet g:Tex_ViewRule_dvi = 'yap -1' elseif has('macunix') *************** *** 416,419 **** --- 414,420 ---- " }}} + + " }}} + " ============================================================================== " TeX Completion: {{{ " *************** *** 435,439 **** TexLet g:Tex_ImageDir = '' ! " }}} " }}} --- 436,444 ---- TexLet g:Tex_ImageDir = '' ! " whether or not searches for \cite's are cached. ! TexLet g:Tex_RememberCiteSearch = 1 ! " Paths to the bibliography files and custom packages. ! TexLet g:Tex_BIBINPUTS = '' ! TexLet g:Tex_TEXINPUTS = '' " }}} *************** *** 506,519 **** " by g:Tex_Folding), so you can do <F6> or \rf to refresh/create folds. TexLet g:Tex_AutoFolding = 1 - - " }}} - " ============================================================================== - " TEXINPUTS: check this directories for user packages {{{ - " Search some directories for user packages. They can contain, \usepackage, - " \newcommand etc. commands. LaTeX uses $TEXINPUTS variable. Because relations - " between Vim and shell aren't straightforward copy it here. Use exact syntax. - " Example g:Tex_TEXINPUTS = '.:~/texmf//:'. More in |latex-package-scanning|. - " Default: '' - TexLet g:Tex_TEXINPUTS = '' " }}} --- 511,514 ---- |
From: <sri...@us...> - 2003-06-18 00:57:28
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv21304 Modified Files: compiler.vim Log Message: Bug: If we used :TTarget ps, then the compiler would be called as: dvips -o file.tex.ps file.tex.dvi instead of dvips -o file.ps file.dvi Why: In a recent change, we made RunLaTeX() use filenames with extension. However, some compilation rules might require filenames w/o extensions (such as Tex_CompileRule_ps which is 'dvips -o $*.ps $*.dvi') Fix: Try to guess if the &makeprg requires files w/o extensions by seeing if it matches '\$\*\.\w\+'. If so, use file-name w/o extension. Otherwise, retain extension in 'make '.fname Index: compiler.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/compiler.vim,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** compiler.vim 15 Jun 2003 08:44:54 -0000 1.39 --- compiler.vim 18 Jun 2003 00:57:24 -0000 1.40 *************** *** 119,123 **** " " if mainfname exists, then it means it was supplied to RunLaTeX(). ! let mainfname = Tex_GetMainFileName() if exists('b:fragmentFile') || mainfname == '' let mainfname = expand('%:t') --- 119,124 ---- " " if mainfname exists, then it means it was supplied to RunLaTeX(). ! " Extract the complete file name including the extension. ! let mainfname = Tex_GetMainFileName(':r') if exists('b:fragmentFile') || mainfname == '' let mainfname = expand('%:t') *************** *** 137,140 **** --- 138,146 ---- let &l:makeprg = _makeprg else + " If &makeprg has something like "$*.ps", it means that it wants the + " file-name without the extension... Therefore remove it. + if &makeprg =~ '\$\*\.\w\+' + let mainfname = fnamemodify(mainfname, ':r') + endif exec 'make '.mainfname endif |
From: <sri...@us...> - 2003-06-17 17:26:49
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv8259 Modified Files: texviewer.vim Log Message: More bug fixes! Bug: Pressing <F9> at the end of a line like This is a \ref{eqn:something} and this is a comp would cause errors. Why: The substitute() command returns the original string if the pattern does not match causing us to wrongly infer a match. Fix: Therefore first check if there is a match. Bug: Once we complete an equation, we can never complete a word. Why: s:type is never unlet Fix: unlet! s:type if there is no match on current line to any known command. Bug: Pressing <CR> during word completion does not take us to the location of the match, as claimed. Why: <CR> does "cc <num> | pclose! | cclose!". Because the preview window with the match is open, therefore cc will take us to the match in the preview window, after which pclose closes it up! Fix: Do 'pclose! cc <num> | cclose' instead... Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** texviewer.vim 17 Jun 2003 16:22:57 -0000 1.24 --- texviewer.vim 17 Jun 2003 17:26:46 -0000 1.25 *************** *** 81,87 **** " s:typeoption = '[option=value]' let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{\(\a\+=\)\?$' ! let s:type = substitute(s:curline, pattern, '\1', 'e') ! let s:typeoption = substitute(s:curline, pattern, '\2', 'e') ! call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption, 'view') if exists("s:type") && s:type =~ 'ref' --- 81,92 ---- " s:typeoption = '[option=value]' let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{\(\a\+=\)\?$' ! if s:curline =~ pattern ! let s:type = substitute(s:curline, pattern, '\1', 'e') ! let s:typeoption = substitute(s:curline, pattern, '\2', 'e') ! call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption, 'view') ! else ! unlet! s:type ! unlet! s:typeoption ! endif if exists("s:type") && s:type =~ 'ref' *************** *** 152,156 **** endif endif ! exe "silent! grep! '\<".s:word."' ".s:search_directory.'*.tex' call <SID>Tex_c_window_setup() --- 157,162 ---- endif endif ! call Tex_Debug("silent! grep! '\\<".s:word."' ".s:search_directory.'*.tex', 'view') ! exe "silent! grep! '\\<".s:word."' ".s:search_directory.'*.tex' call <SID>Tex_c_window_setup() *************** *** 191,194 **** --- 197,206 ---- $ d _ endif + setlocal nonumber + setlocal nowrap + + let s:scrollOffVal = &scrolloff + call <SID>UpdateViewerWindow() + " If everything went well, then we should be situated in the quickfix " window. If there were problems, (no matches etc), then we will not be. *************** *** 199,208 **** endif - setlocal nonumber - setlocal nowrap - - let s:scrollOffVal = &scrolloff - call <SID>UpdateViewerWindow() - nnoremap <buffer> <silent> j j:call <SID>UpdateViewerWindow()<CR> nnoremap <buffer> <silent> k k:call <SID>UpdateViewerWindow()<CR> --- 211,214 ---- *************** *** 407,412 **** function! s:GoToLocation() - exe 'cc ' . line('.') pclose! cclose --- 413,418 ---- function! s:GoToLocation() pclose! + exe 'cc ' . line('.') cclose *************** *** 533,540 **** exec 0 let wrap = 'w' ! while search('^\s*\\input', wrap) let wrap = 'W' ! let filename = matchstr(getline('.'), '\\input{\zs.\{-}\ze}') let v:errmsg = '' exec 'silent! find '.filename --- 539,546 ---- exec 0 let wrap = 'w' ! while search('^\s*\\\(input\|include\)', wrap) let wrap = 'W' ! let filename = matchstr(getline('.'), '\\\(input\|include\){\zs.\{-}\ze}') let v:errmsg = '' exec 'silent! find '.filename |
From: <sri...@us...> - 2003-06-17 16:23:00
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv31378 Modified Files: texviewer.vim Log Message: New: Also support '\psfig{figure=' for completion. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** texviewer.vim 17 Jun 2003 09:35:25 -0000 1.23 --- texviewer.vim 17 Jun 2003 16:22:57 -0000 1.24 *************** *** 6,9 **** --- 6,10 ---- " License: Vim Charityware License " Part of vim-latexSuite: http://vim-latex.sourceforge.net + " CVS: $Id$ " ============================================================================ *************** *** 72,83 **** let s:prefix = matchstr(s:curline, '.*{\zs.\{-}$') " a command is of the type ! " \includegraphics[0.8\columnwidth]{} " Thus ! " s:curline = '\includegraphics[0.8\columnwidth]{' " (with possibly some junk before \includegraphics) " from which we need to extract ! " s:type = 'includegraphics' ! " s:typeoption = '[0.8\columnwidth]' ! let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{$' let s:type = substitute(s:curline, pattern, '\1', 'e') let s:typeoption = substitute(s:curline, pattern, '\2', 'e') --- 73,84 ---- let s:prefix = matchstr(s:curline, '.*{\zs.\{-}$') " a command is of the type ! " \psfig[option=value]{figure=} " Thus ! " s:curline = '\psfig[option=value]{figure=' " (with possibly some junk before \includegraphics) " from which we need to extract ! " s:type = 'psfig' ! " s:typeoption = '[option=value]' ! let pattern = '.*\\\(\w\{-}\)\(\[.\{-}\]\)\?{\(\a\+=\)\?$' let s:type = substitute(s:curline, pattern, '\1', 'e') let s:typeoption = substitute(s:curline, pattern, '\2', 'e') *************** *** 87,91 **** call Tex_Debug("silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex', 'view') exe "silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex' ! elseif exists("s:type") && s:type =~ 'cite' --- 88,92 ---- call Tex_Debug("silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex', 'view') exe "silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex' ! call <SID>Tex_c_window_setup() elseif exists("s:type") && s:type =~ 'cite' *************** *** 110,114 **** endif ! elseif exists("s:type") && s:type =~ 'includegraphics' let s:storehidefiles = g:explHideFiles let g:explHideFiles = '^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$' --- 111,115 ---- endif ! elseif exists("s:type") && (s:type =~ 'includegraphics' || s:type == 'psfig') let s:storehidefiles = g:explHideFiles let g:explHideFiles = '^\.,\.tex$,\.bib$,\.bbl$,\.zip$,\.gz$' *************** *** 179,183 **** " function! s:Tex_c_window_setup(...) ! cclose exe 'copen '. g:Tex_ViewerCwindowHeight --- 180,184 ---- " function! s:Tex_c_window_setup(...) ! call Tex_Debug('+Tex_c_window_setup', 'view') cclose exe 'copen '. g:Tex_ViewerCwindowHeight *************** *** 259,262 **** --- 260,264 ---- " function! s:UpdateViewerWindow() + call Tex_Debug('+UpdateViewerWindow', 'view') let viewfile = matchstr(getline('.'), '^\f*\ze|\d') |
From: <sri...@us...> - 2003-06-17 09:35:28
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv30256 Modified Files: texviewer.vim Log Message: New: Bibliography searching was pretty delicate before where only a few select situations succeeded in producing a match. Make this much more robust using :find. This has the advantage of letting us use vim's native file-searching capability to find out bibliography file etc. New: Capability to retain the \cite search in memory so we do not have to make searches with every <F9> pressed. This is useful because quite often the bibliography is a _huge_ file which is not changed very seldom and we might want add a lot of \cite's between changes to the bibliography file. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** texviewer.vim 15 Jun 2003 05:23:31 -0000 1.22 --- texviewer.vim 17 Jun 2003 09:35:25 -0000 1.23 *************** *** 87,106 **** call Tex_Debug("silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex', 'view') exe "silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex' ! call <SID>Tex_c_window_setup() elseif exists("s:type") && s:type =~ 'cite' ! silent! grep! nothing % ! let bibfiles = <SID>Tex_FindBibFiles() ! let bblfiles = <SID>Tex_FindBblFiles() ! if bibfiles != '' ! call Tex_Debug("silent! grepadd! '@.*{".s:prefix."' ".bibfiles, 'view') ! exec "silent! grepadd! '@.*{".s:prefix."' ".bibfiles endif ! if bblfiles != '' ! call Tex_Debug("silent! grepadd! 'bibitem{".s:prefix."' ".bblfiles, 'view') ! exec "silent! grepadd! 'bibitem{".s:prefix."' ".bblfiles endif - call Tex_Debug('returning', 'view') - call <SID>Tex_c_window_setup() elseif exists("s:type") && s:type =~ 'includegraphics' --- 87,112 ---- call Tex_Debug("silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex', 'view') exe "silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex' ! elseif exists("s:type") && s:type =~ 'cite' ! " grep! nothing % ! " does _not_ clear the search history contrary to what the ! " help-docs say. This was expected. So use something improbable. ! " TODO: Is there a way to clear the search-history w/o making a ! " useless, inefficient search? ! silent! grep! ____HIGHLY_IMPROBABLE___ % ! if g:Tex_RememberCiteSearch && exists('s:citeSearchHistory') ! call <SID>Tex_c_window_setup(s:citeSearchHistory) ! else ! call Tex_Debug('calling Tex_GrepForBibItems', 'bib') ! call Tex_GrepForBibItems(s:prefix) ! call <SID>Tex_c_window_setup() endif ! if g:Tex_RememberCiteSearch && &ft == 'qf' ! let _a = @a ! silent! normal! ggVG"ay ! let s:citeSearchHistory = @a ! let @a = _a endif elseif exists("s:type") && s:type =~ 'includegraphics' *************** *** 172,185 **** " settings " ! function! s:Tex_c_window_setup() cclose exe 'copen '. g:Tex_ViewerCwindowHeight ! ! setlocal nonumber ! setlocal nowrap ! ! let s:scrollOffVal = &scrolloff ! call <SID>UpdateViewerWindow() " If everything went well, then we should be situated in the quickfix " window. If there were problems, (no matches etc), then we will not be. --- 178,193 ---- " settings " ! function! s:Tex_c_window_setup(...) cclose exe 'copen '. g:Tex_ViewerCwindowHeight ! " If called with an argument, it means we want to re-use some search ! " history from last time. Therefore, just paste it here and proceed. ! if a:0 == 1 ! set modifiable ! % d _ ! silent! 0put!=a:1 ! $ d _ ! endif " If everything went well, then we should be situated in the quickfix " window. If there were problems, (no matches etc), then we will not be. *************** *** 190,193 **** --- 198,206 ---- endif + setlocal nonumber + setlocal nowrap + + let s:scrollOffVal = &scrolloff + call <SID>UpdateViewerWindow() nnoremap <buffer> <silent> j j:call <SID>UpdateViewerWindow()<CR> *************** *** 397,530 **** endfunction " }}} - " Tex_FindBibFiles: find *.bib files {{{ - " Description: scan files looking for \bibliography entries - " - function! s:Tex_FindBibFiles() - - let position = line('.').' | normal! '.virtcol('.').'|' - if g:projFiles != '' - let bibfiles = '' - let i = 1 - while Tex_Strntok(g:projFiles, ',', i) != '' - let curfile = Tex_Strntok(g:projFiles, ',', i) - if curfile =~ '\.bib' - let curfile = substitute(curfile, '.*', s:search_directory.'\0', '') - let bibfiles = bibfiles.'"'.curfile.'" ' - endif - let i = i + 1 - endwhile - - let g:bibf = bibfiles - exec position - return bibfiles - - else - let bibnames = '' - let bibfiles = '' - let bibfiles2 = '' - - if search('\\bibliography{', 'w') - let bibnames = matchstr(getline('.'), '\\bibliography{\zs.\{-}\ze}') - let bibnames = substitute(bibnames, '\(,\|$\)', '.bib ', 'ge') - endif ! if has('win32') ! let sep = "\n" ! else ! let sep = ":" ! endif ! let dirs = expand("%:p:h") . sep . expand("$BIBINPUTS") ! let dirs = substitute(dirs, sep.'\+', sep, 'g') ! let i = 1 ! while Tex_Strntok(dirs, sep, i) != '' ! let curdir = Tex_Strntok(dirs, sep, i) ! let curdir = substitute(curdir, ' ', "\\", 'ge') ! let tmp = '' ! if bibnames != '' ! let j = 1 ! while Tex_Strntok(bibnames, ' ', j) != '' ! let fname = curdir.'/'.Tex_Strntok(bibnames, ' ', j) ! if filereadable(fname) ! let tmp = tmp . ' ' . fname ! endif ! let j = j + 1 ! endwhile ! else ! let tmp = glob(curdir.'/*.bib') ! let tmp = substitute(tmp, "\n", ' ', 'ge') ! endif ! let bibfiles = bibfiles . ' ' . tmp ! let i = i + 1 ! endwhile ! if Tex_GetMainFileName() != '' && expand('%:p') != Tex_GetMainFileName(':p:r') ! let mainfname = Tex_GetMainFileName(':p:r') ! let mainfdir = fnamemodify(mainfname, ":p:h") ! let curdir = expand("%:p:h") ! let curdir = substitute(curdir, ' ', "\\", 'ge') ! exe 'bot 1 split '.mainfname ! if search('\\bibliography{', 'w') ! let bibfiles2 = matchstr(getline('.'), '\\bibliography{\zs.\{-}\ze}') ! let bibfiles2 = substitute(bibfiles2, '\(,\|$\)', '.bib ', 'ge') ! let bibfiles2 = substitute(bibfiles2, '\(^\| \)', ' '.curdir.'/', 'ge') ! elseif mainfdir != curdir ! let bibfiles2 = glob(mainfdir.'/*.bib') ! let bibfiles2 = substitute(bibfiles2, "\n", ' ', 'ge') ! endif ! wincmd q endif ! ! exec position ! return bibfiles.' '.bibfiles2 endif - endfunction " }}} ! " Tex_FindBblFiles: find bibitem entries in tex files {{{ ! " Description: scan files looking for \bibitem entries " ! function! s:Tex_FindBblFiles() ! if g:projFiles != '' ! let bblfiles = '' let i = 1 ! while Tex_Strntok(g:projFiles, ',', i) != '' ! let curfile = Tex_Strntok(g:projFiles, ',', i) ! if curfile =~ '\.tex' ! let curfile = substitute(curfile, '.*', s:search_directory.'\0', '') ! let bblfiles = bblfiles.'"'.curfile.'" ' endif let i = i + 1 endwhile ! return bblfiles ! ! else ! let bblfiles = '' ! let bblfiles2 = '' ! let curdir = expand("%:p:h") ! ! let bblfiles = glob(curdir.'/*.tex') ! let bblfiles = substitute(bblfiles, "\n", ' ', 'ge') ! call Tex_Debug('getting bblfiles = '.bblfiles) ! if Tex_GetMainFileName() != '' ! let mainfname = Tex_GetMainFileName() ! let mainfdir = fnamemodify(mainfname, ":p:h") ! if mainfdir != curdir ! let bblfiles = glob(mainfdir.'/*.tex') ! let bblfiles = substitute(bblfiles, "\n", ' ', 'ge') ! endif endif ! return bblfiles.' '.bblfiles2 ! endif endfunction " }}} --- 410,552 ---- endfunction " }}} ! " Bibliography specific functions ! " Tex_GrepForBibItems: grep main filename for bib items {{{ ! " Description: ! function! Tex_GrepForBibItems(prefix) ! let mainfname = Tex_GetMainFileName(':p:r') ! let toquit = 0 ! if bufnr('%') != bufnr(mainfname) ! exec 'split '.mainfname ! let toquit = 1 ! endif ! let _path = &path ! let _suffixesadd = &suffixesadd ! let &path = '.,'.g:Tex_BIBINPUTS ! let &suffixesadd = '.tex' ! let pos = line('.').'| normal! '.virtcol('.').'|' ! let foundCiteFile = Tex_ScanFileForCite(a:prefix) ! exec pos ! let &path = _path ! let &suffixesadd = _suffixesadd ! if foundCiteFile ! if toquit ! q endif ! return endif endfunction " }}} ! " Tex_ScanFileForCite: search for \bibitem's in .bib or .bbl or tex files {{{ ! " Description: ! " Search for bibliographic entries in the presently edited file in the ! " following manner: ! " 1. First see if the file has a \bibliography command. ! " If YES: ! " 1. If a .bib file corresponding to the \bibliography command can be ! " found, then search for '@.*'.a:prefix inside it. ! " 2. Otherwise, if a .bbl file corresponding to the \bibliography command ! " can be found, then search for '\bibitem'.a:prefix inside it. ! " 2. Next see if the file has a \thebibliography environment ! " If YES: ! " 1. Search for '\bibitem'.a:prefix in this file. " ! " If neither a \bibliography or \begin{thebibliography} are found, then repeat ! " steps 1 and 2 for every file \input'ed into this file. Abort any searching ! " as soon as the first \bibliography or \begin{thebibliography} is found. ! function! Tex_ScanFileForCite(prefix) ! call Tex_Debug('searching for bibkeys in '.bufname('%').' (buffer #'.bufnr('%').')', 'bib') ! let presBufNum = bufnr('%') ! let foundCiteFile = 0 ! " First find out if this file has a \bibliography command in it. If so, ! " assume that this is the only file in the project which defines a ! " bibliography. ! if search('\\bibliography{', 'w') ! call Tex_Debug('found bibliography command in '.bufname('%'), 'bib') ! " convey that we have found a bibliography command. we do not need to ! " proceed any further. ! let foundCiteFile = 1 ! ! " extract the bibliography filenames from the command. ! let bibnames = matchstr(getline('.'), '\\bibliography{\zs.\{-}\ze}') ! let bibnames = substitute(bibnames, '\s', '', 'g') ! ! call Tex_Debug('trying to search through ['.bibnames.']', 'bib') ! let i = 1 ! while Tex_Strntok(bibnames, ',', i) != '' ! " first try to find if a .bib file exists. If so do not search in ! " the corresponding .bbl file. (because the .bbl file will most ! " probly be generated automatically from the .bib file with ! " bibtex). ! ! " split a new window so we do not screw with the current buffer. ! split ! let thisbufnum = bufnr('%') ! exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bib' ! if bufnr('%') != thisbufnum ! " use the appropriate syntax for the .bib file. ! exec 'silent! grepadd @.*{'.a:prefix.' %' ! else ! let thisbufnum = bufnr('%') ! call Tex_Debug('silent! find '.Tex_Strntok(bibnames, ',', i).'.bbl from '.thisbufnum, 'bib') ! exec 'silent! find '.Tex_Strntok(bibnames, ',', i).'.bbl' ! call Tex_Debug('now in bufnum#'.bufnr('%'), 'bib') ! if bufnr('%') != thisbufnum ! exec 'silent! grepadd \\bibitem{'.a:prefix.' %' ! endif endif + " close the newly opened window + q + let i = i + 1 endwhile ! if foundCiteFile ! return 1 ! endif ! endif ! " If we have a thebibliography environment, then again assume that this is ! " the only file which defines the bib-keys. Aand convey this information ! " upwards by returning 1. ! if search('^\s*\\begin{thebibliography}', 'w') ! call Tex_Debug('got a thebibliography environment in '.bufname('%'), 'bib') ! ! let foundCiteFile = 1 ! exec 'silent! grepadd \\bibitem{'.a:prefix.' %' ! ! return 1 ! endif ! " If we have not found any \bibliography or \thebibliography environment ! " in this file, search for these environments in all the files which this ! " file includes. ! exec 0 ! let wrap = 'w' ! while search('^\s*\\input', wrap) ! let wrap = 'W' + let filename = matchstr(getline('.'), '\\input{\zs.\{-}\ze}') + let v:errmsg = '' + exec 'silent! find '.filename + if v:errmsg == '' + " DANGER! recursive call. + let foundCiteFile = Tex_ScanFileForCite(a:prefix) + exec 'e #'.presBufNum endif ! if foundCiteFile ! return 1 ! endif ! endwhile + return 0 endfunction " }}} *************** *** 593,596 **** --- 615,620 ---- return relpath endfunction " }}} + + com! -nargs=0 TClearCiteHist unlet! s:citeSearchHistory " this statement has to be at the end. |
From: <sri...@us...> - 2003-06-17 02:12:32
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv10499 Modified Files: main.vim Log Message: A small change to include every debug statement in the default string. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** main.vim 15 Jun 2003 08:43:17 -0000 1.39 --- main.vim 17 Jun 2003 02:12:29 -0000 1.40 *************** *** 3,6 **** --- 3,7 ---- " Maintainer: Srinath Avadhanula " Email: sr...@fa... + " CVS: $Id$ " URL: *************** *** 491,494 **** --- 492,496 ---- endif let s:debugString_{pattern} = s:debugString_{pattern}.a:str."\n" + let s:debugString_ = s:debugString_.pattern.' : '.a:str."\n" endfunction " }}} " Tex_PrintDebug: prings s:debugString {{{ |
From: <sri...@us...> - 2003-06-17 02:07:50
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv9769 Modified Files: packages.vim Log Message: Change: Instead of using very complicated logic to find out the locations of package files, just use vim's native :find command. This easily avoids problems of not being able to search more than 1 level deep etc. Ofcourse, this means that the users have to specify g:Tex_TEXINPUTS in the format given in :help file-searching, but that seems a very acceptable thing to do. Why was globpath() and all that used previously? Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** packages.vim 16 Jun 2003 06:40:00 -0000 1.34 --- packages.vim 17 Jun 2003 02:07:47 -0000 1.35 *************** *** 3,6 **** --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST + " CVS: $Id$ " " Description: handling packages from within vim *************** *** 78,86 **** " in such a way as to not repeat work. function! Tex_pack_updateall(force) ! call Tex_Debug('+Tex_pack_updateall') " Find out which file we need to scan. if Tex_GetMainFileName() != '' ! let fname = Tex_GetMainFileName(':p:r') else let fname = expand('%:p') --- 79,87 ---- " in such a way as to not repeat work. function! Tex_pack_updateall(force) ! call Tex_Debug('+Tex_pack_updateall', 'pack') " Find out which file we need to scan. if Tex_GetMainFileName() != '' ! let fname = Tex_GetMainFileName(':p') else let fname = expand('%:p') *************** *** 103,108 **** " This sets up a global variable of all detected packages. let g:Tex_package_detected = '' ! call Tex_pack_all(fname) ! call Tex_Debug('updateall: detected = '.g:Tex_package_detected) " Now only support packages we didn't last time. --- 104,190 ---- " This sets up a global variable of all detected packages. let g:Tex_package_detected = '' ! " reset the environments and commands. ! let g:Tex_PromptedEnvironments = g:Tex_PromptedEnvironmentsDefault ! let g:Tex_PromptedCommands = g:Tex_PromptedCommandsDefault ! ! call Tex_ScanForPackages(fname) ! call Tex_Debug('updateall: detected ['.g:Tex_package_detected.'] in first run', 'pack') ! ! " Now for each package find out if this is a custom package and if so, ! " scan that as well. We will use the ':wincmd f' command in vim to let vim ! " search for the file paths for us. We open up a new file, write down the ! " name of each package and ask vim to open it for us using the 'gf' ! " command. ! " ! " NOTE: This while loop will also take into account packages included ! " within packages to any level of recursion as long as ! " g:Tex_package_detected is always padded with new package names ! " from the end. ! " ! " First set the &path setting to the user's TEXINPUTS setting. ! let _path = &path ! let _suffixesadd = &suffixesadd ! ! let &path = '.,'.g:Tex_TEXINPUTS ! let &suffixesadd = '.sty,.tex' ! ! let scannedPackages = '' ! ! let i = 1 ! let packname = Tex_Strntok(g:Tex_package_detected, ',', i) ! while packname != '' ! ! call Tex_Debug('scanning package '.packname, 'pack') ! ! " Scan this package only if we have not scanned it before in this ! " run. ! if scannedPackages =~ '\<'.packname.'\>' ! let i = i + 1 ! ! call Tex_Debug(packname.' already scanned', 'pack') ! let packname = Tex_Strntok(g:Tex_package_detected, ',', i) ! continue ! endif ! ! let v:errmsg = '' ! " write down the name of this package in the fake buffer. ! call Tex_Debug('silent! find '.packname.'.sty', 'pack') ! split ! exec 'silent! find '.packname.'.sty' ! call Tex_Debug('present file = '.bufname('%'), 'pack') ! ! " If this file was not found, assume that it means its not a ! " custom package and mark it "scanned". ! if v:errmsg =~ '^E345' ! let scannedPackages = scannedPackages.','.packname ! q ! ! call Tex_Debug(packname.' not found anywhere', 'pack') ! let i = i + 1 ! let packname = Tex_Strntok(g:Tex_package_detected) ! continue ! endif ! ! " otherwise we are presently editing a custom package, scan it for ! " more \usepackage lines from the first line to the last. ! let packpath = expand('%:p') ! let &complete = &complete.'s'.packpath ! ! call Tex_Debug('found custom package '.packpath, 'pack') ! call Tex_ScanForPackages(packpath, line('$'), line('$')) ! call Tex_Debug('After scanning, g:Tex_package_detected = '.g:Tex_package_detected, 'pack') ! ! let scannedPackages = scannedPackages.','.packname ! " Do not use bwipe, but that leads to excessive buffer number ! " consumption. Besides, its intuitive for a custom package to remain ! " on the buffer list. ! q ! ! let i = i + 1 ! let packname = Tex_Strntok(g:Tex_package_detected, ',', i) ! endwhile ! ! let &path = _path ! let &suffixesadd = _suffixesadd " Now only support packages we didn't last time. *************** *** 179,204 **** endfunction " }}} ! " Tex_pack_all: scans the current file for \usepackage{} lines {{{ " and if supported, loads the options and commands found in the " corresponding package file. Also scans for \newenvironment and " \newcommand lines and adds names to g:Tex_Prompted variables, they can be " easy available through <F5> and <F7> shortcuts ! function! Tex_pack_all(fname) ! ! let g:lastname = a:fname let pos = line('.').' | normal! '.virtcol('.').'|' let currfile = expand('%:p') let toquit = 0 if a:fname != currfile exe 'split '.a:fname let toquit = 1 endif ! 0 ! let beginline = search('\\begin{document}', 'W') ! let endline = search('\\end{document}', 'W') ! 0 " Scan the file. First open up all the folds, because the command --- 261,296 ---- endfunction " }}} ! " Tex_ScanForPackages: scans the current file for \usepackage{} lines {{{ " and if supported, loads the options and commands found in the " corresponding package file. Also scans for \newenvironment and " \newcommand lines and adds names to g:Tex_Prompted variables, they can be " easy available through <F5> and <F7> shortcuts ! function! Tex_ScanForPackages(fname, ...) let pos = line('.').' | normal! '.virtcol('.').'|' let currfile = expand('%:p') + call Tex_Debug('currfile = '.currfile.', a:fname = '.a:fname, 'pack') let toquit = 0 if a:fname != currfile + + call Tex_Debug('splitting file', 'pack') exe 'split '.a:fname let toquit = 1 endif ! " For package files without \begin and \end{document}, we might be told to ! " search from beginning to end. ! if a:0 < 2 ! 0 ! let beginline = search('\\begin{document}', 'W') ! let endline = search('\\end{document}', 'W') ! 0 ! else ! let beginline = a:1 ! let endline = a:2 ! endif ! call Tex_Debug('beginline = '.beginline.', endline = '.endline, 'pack') ! " Scan the file. First open up all the folds, because the command *************** *** 207,216 **** normal! ggVGzO ! while search('^\s*\\usepackage\_.\{-}{\_.\+}', 'W') ! if !exists("s:Tex_up_check") ! if line('.') > beginline ! break ! endif endif --- 299,311 ---- normal! ggVGzO ! " The wrap trick enables us to match \usepackage on the first line as ! " well. ! let wrap = 'w' ! while search('^\s*\\usepackage\_.\{-}{\_.\+}', wrap) ! let wrap = 'W' ! call Tex_Debug('finding package on '.line('.'), 'pack') ! if line('.') > beginline ! break endif *************** *** 280,297 **** " through <F7> 0 - let s:Tex_LookForCommand = g:Tex_PromptedCommandsDefault while search('^\s*\\newcommand\*\?{.\{-}}', 'W') ! if !exists("s:Tex_up_check") ! if line('.') > endline ! break ! endif endif let newcommand = matchstr(getline('.'), '\\newcommand\*\?{\\\zs.\{-}\ze}') ! let s:Tex_LookForCommand = s:Tex_LookForCommand . ',' . newcommand endwhile - let g:Tex_PromptedCommands = s:Tex_LookForCommand " Scans whole file (up to \end{document}) for \newenvironment and adds this --- 375,388 ---- " through <F7> 0 while search('^\s*\\newcommand\*\?{.\{-}}', 'W') ! if line('.') > endline ! break endif let newcommand = matchstr(getline('.'), '\\newcommand\*\?{\\\zs.\{-}\ze}') ! let g:Tex_PromptedCommands = g:Tex_PromptedCommands . ',' . newcommand endwhile " Scans whole file (up to \end{document}) for \newenvironment and adds this *************** *** 299,437 **** " through <F5> 0 ! let s:Tex_LookForEnvironment = g:Tex_PromptedEnvironmentsDefault while search('^\s*\\newenvironment\*\?{.\{-}}', 'W') ! if !exists("s:Tex_up_check") ! if line('.') > endline ! break ! endif endif let newenvironment = matchstr(getline('.'), '\\newenvironment\*\?{\zs.\{-}\ze}') ! let s:Tex_LookForEnvironment = s:Tex_LookForEnvironment . ',' . newenvironment endwhile - let g:Tex_PromptedEnvironments = s:Tex_LookForEnvironment if toquit q - endif - - " Check if one of declared packages isn't user package in current - " Basing on TEXINPUTS. - if !exists("s:Tex_up_check") - " Prevents endless loop - let s:Tex_up_check = 1 - - " Operate on list of packages from current/main file, - " g:Tex_package_detected will be changing - let tpd_orig = g:Tex_package_detected - - " Iterate through original list - let fn = 1 - while Tex_Strntok(tpd_orig, ',', fn) != '' - let userpackage = Tex_Strntok(tpd_orig, ',', fn) - let stypath = expand("%:p:h").'/'.userpackage.'.sty' - call Tex_Debug('userpackage = '.userpackage.', stypath = '.stypath, 'pack') - - " If package with given name exists in current dir - " check if there are usepackage commands, newcommand etc. - if filereadable(stypath) - call Tex_pack_all(stypath) - " Remove this file from list of buffers - exe 'bwipe '.stypath - " But add word completion - if such file exists probably there - " is huge collection of commands, <F7> doesn't solve - " everything - exe 'setlocal complete+=s'.stypath - endif - - " Check list of locations from $TEXINPUTS variable. But before simple - " trick - add current directory to make everything in one loop - if g:Tex_TEXINPUTS != '' - let inputdirs = g:Tex_TEXINPUTS - - let id = 1 - while Tex_Strntok(inputdirs, ':', id) != '' - let cur_input_dir = Tex_Strntok(inputdirs, ':', id) - - " Skip current directory, we checked it already - if cur_input_dir == "\\." || cur_input_dir == "\\./" - let g:cid1 = cur_input_dir - let id = id + 1 - continue - - " Deal with ./ entries - elseif cur_input_dir =~ "^\\./" - let g:cid2 = cur_input_dir - - let cur_dir = expand("%:p:h") - - if cur_input_dir == './/' - let stypath = globpath(cur_dir.'/*', userpackage.'.sty') - if filereadable(stypath) - call Tex_pack_all(stypath) - exe 'bwipe '.stypath - exe 'setlocal complete+=s'.stypath - endif - - else - let cur_input_dir = substitute(cur_input_dir,'./','','e') - let stypath = cur_dir.'/'.cur_input_dir.'/'.userpackage.'.sty' - if filereadable(stypath) - call Tex_pack_all(stypath) - exe 'bwipe '.stypath - exe 'setlocal complete+=s'.stypath - endif - - endif - - " Check one-level directory item variable. - elseif cur_input_dir !~ '//$' - let cur_input_dir = substitute(cur_input_dir,'/*$','','ge') - let stypath = cur_input_dir.'/'.userpackage.'.sty' - let stypath = fnamemodify(stypath, ':p') - if filereadable(stypath) - call Tex_pack_all(stypath) - exe 'bwipe '.stypath - exe 'setlocal complete+=s'.stypath - endif - - " Check the rest. Now this is fake because currently Vim - " doesn't accept ** in globpath(). Solution with '/*' - " provides only one level depth but ** in globpath() is on - " TODO list. In future versions of Vim we will only need - " to add one * in globpath. - else - let cur_input_dir = substitute(cur_input_dir,'/*$','','ge') - let stypath = fnamemodify(cur_input_dir, ':p:h') - - let stypath2 = stypath.'/'.userpackage.'.sty' - if filereadable(stypath2) - call Tex_pack_all(stypath2) - exe 'bwipe '.stypath2 - exe 'setlocal complete+=s'.stypath2 - endif - - let stypathglob = globpath(stypath.'/*', userpackage.'.sty') - if filereadable(stypathglob) - call Tex_pack_all(stypathglob) - exe 'bwipe '.stypathglob - exe 'setlocal complete+=s'.stypathglob - endif - - endif - - let id = id + 1 - - endwhile - - endif - - - let fn = fn + 1 - - endwhile - endif --- 390,409 ---- " through <F5> 0 ! call Tex_Debug('looking for newenvironments in '.bufname('%'), 'pack') ! while search('^\s*\\newenvironment\*\?{.\{-}}', 'W') + call Tex_Debug('found newenvironment on '.line('.'), 'pack') ! if line('.') > endline ! break endif let newenvironment = matchstr(getline('.'), '\\newenvironment\*\?{\zs.\{-}\ze}') ! let g:Tex_PromptedEnvironments = g:Tex_PromptedEnvironments . ',' . newenvironment endwhile if toquit q endif |
From: <sri...@us...> - 2003-06-17 02:00:16
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv7963 Modified Files: envmacros.vim Log Message: Bug: <F5> does not work if we type in the name of a package latex-suite doesn't recognize. a 0 is inserted. Cause: In the recent feature where Tex_PutEnvironment also tried to scan environments added by packages, there is no fail-safe at the end of all the if statements. Solution: if all else fails remember to at least insert a bare-bones environment. Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** envmacros.vim 8 Jun 2003 20:25:50 -0000 1.32 --- envmacros.vim 17 Jun 2003 02:00:13 -0000 1.33 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 08:00 PM 2002 PST ! " CVS Header: " Description: mappings/menus for environments. "============================================================================= --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 08:00 PM 2002 PST ! " CVS Header: $Id$ " Description: mappings/menus for environments. "============================================================================= *************** *** 508,527 **** " Description: function! PromptForEnvironment(ask) ! ! if !exists('s:common_env_prompt') ! let s:common_env_prompt = ! \ "\n" . ! \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ',') . ! \ "Enter number or name of environment: " ! endif ! ! let inp = input(a:ask.s:common_env_prompt) ! if inp =~ '^[0-9]\+$' ! let env = Tex_Strntok(g:Tex_PromptedEnvironments, ',', inp) ! else ! let env = inp ! endif ! ! return env endfunction " }}} " Tex_DoEnvironment: fast insertion of environments {{{ --- 508,516 ---- " Description: function! PromptForEnvironment(ask) ! return Tex_ChooseFromPrompt( ! \ a:ask."\n" . ! \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ",") . ! \ "\nEnter nae or number of environment :", ! \ g:Tex_PromptedEnvironments, ",") endfunction " }}} " Tex_DoEnvironment: fast insertion of environments {{{ *************** *** 598,605 **** let i = i + 1 endwhile - else - return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>\\end{".a:env."}<++>") - endif endif endif endfunction " }}} --- 587,594 ---- let i = i + 1 endwhile endif + " If nothing before us managed to create an environment, then just + " create a bare-bones environment from the name. + return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>\\end{".a:env."}<++>") endif endfunction " }}} |
From: <sri...@us...> - 2003-06-16 06:40:07
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv3710 Modified Files: packages.vim Log Message: Bug: When a \usepackage{} line is inside a fold, then we go into an infinite loop. (Lin-bo Zhang) Cause: Due to an apparent vim bug, when if we issue the command /somepattern in a closed fold, then we always goto the first match in the fold. Solution: A temporary hack of first opening up all folds before scanning and then closing them. This needs to be robustified in the future using mkview.vim Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** packages.vim 13 Jun 2003 21:41:27 -0000 1.33 --- packages.vim 16 Jun 2003 06:40:00 -0000 1.34 *************** *** 202,206 **** 0 ! " Scan while search('^\s*\\usepackage\_.\{-}{\_.\+}', 'W') --- 202,210 ---- 0 ! " Scan the file. First open up all the folds, because the command ! " /somepattern ! " issued in a closed fold _always_ goes to the first match. ! normal! ggVGzO ! while search('^\s*\\usepackage\_.\{-}{\_.\+}', 'W') *************** *** 228,232 **** " \usepackage{stuff,foo} into @a. Do not use matchstr() and the like " because we can have things split across lines and such. ! exec "normal! /{\<CR>\"ayi}" " now remove all whitespace from @a. We need to remove \n and \r --- 232,236 ---- " \usepackage{stuff,foo} into @a. Do not use matchstr() and the like " because we can have things split across lines and such. ! exec "normal! /{\<CR>\"ay/}\<CR>" " now remove all whitespace from @a. We need to remove \n and \r *************** *** 261,267 **** " restore @a let @a = saveA - endwhile " Because creating list of detected packages gives string " ',pack1,pack2,pack3' remove leading , --- 265,275 ---- " restore @a let @a = saveA endwhile + " TODO: This needs to be changed. In the future, we might have + " functionality to remember the fold-state before opening up all the folds + " and then re-creating them. Use mkview.vim. + normal! ggVGzC + " Because creating list of detected packages gives string " ',pack1,pack2,pack3' remove leading , *************** *** 325,328 **** --- 333,337 ---- let userpackage = Tex_Strntok(tpd_orig, ',', fn) let stypath = expand("%:p:h").'/'.userpackage.'.sty' + call Tex_Debug('userpackage = '.userpackage.', stypath = '.stypath, 'pack') " If package with given name exists in current dir |
From: <sri...@us...> - 2003-06-15 08:44:56
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv30552 Modified Files: compiler.vim Log Message: Change: ViewLaTeX() no longer uses a:size input argument. instead using the b:fragmentFile buffer variable. Index: compiler.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/compiler.vim,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** compiler.vim 8 Jun 2003 22:14:55 -0000 1.38 --- compiler.vim 15 Jun 2003 08:44:54 -0000 1.39 *************** *** 215,224 **** if s:target == 'dvi' if exists('g:Tex_UseEditorSettingInDVIViewer') && ! \ g:Tex_UseEditorSettingInDVIViewer == 1 && a:size == "all" && \ exists('v:servername') && \ (s:viewer == "xdvi" || s:viewer == "xdvik") exec '!'.s:viewer.' -editor "gvim --servername '.v:servername.' --remote-silent +\%l \%f" '.mainfname.'.dvi &' elseif exists('g:Tex_UseEditorSettingInDVIViewer') && ! \ g:Tex_UseEditorSettingInDVIViewer == 1 && a:size == "all" && \ s:viewer == "kdvi" exec '!kdvi --unique '.mainfname.'.dvi &' --- 215,224 ---- if s:target == 'dvi' if exists('g:Tex_UseEditorSettingInDVIViewer') && ! \ g:Tex_UseEditorSettingInDVIViewer == 1 && \ exists('v:servername') && \ (s:viewer == "xdvi" || s:viewer == "xdvik") exec '!'.s:viewer.' -editor "gvim --servername '.v:servername.' --remote-silent +\%l \%f" '.mainfname.'.dvi &' elseif exists('g:Tex_UseEditorSettingInDVIViewer') && ! \ g:Tex_UseEditorSettingInDVIViewer == 1 && \ s:viewer == "kdvi" exec '!kdvi --unique '.mainfname.'.dvi &' |
From: <sri...@us...> - 2003-06-15 08:43:21
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv30418 Modified Files: main.vim Log Message: issue a debug call when catching the latexSuite autocommand. Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** main.vim 24 May 2003 22:20:31 -0000 1.38 --- main.vim 15 Jun 2003 08:43:17 -0000 1.39 *************** *** 578,582 **** augroup LatexSuite ! au LatexSuite User LatexSuiteFileType call <SID>SetTeXOptions() augroup END --- 578,584 ---- augroup LatexSuite ! au LatexSuite User LatexSuiteFileType ! \ call Tex_Debug('main.vim: Catching LatexSuiteFileType event') | ! \ call <SID>SetTeXOptions() augroup END |
From: <sri...@us...> - 2003-06-15 08:42:15
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv30312 Modified Files: texrc Log Message: Use the more standard TexLet way to set default options instead of exists() and stuff. Index: texrc =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texrc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** texrc 2 Jun 2003 13:39:35 -0000 1.27 --- texrc 15 Jun 2003 08:42:11 -0000 1.28 *************** *** 482,486 **** " remember them. You can display them with utf-8. Your system/GUI interface " have to support utf-8. This addition is necessary for resetting 'encoding'. ! if exists("g:Tex_UseUtfMenus") && g:Tex_UseUtfMenus != 0 && has("gui_running") set encoding=utf-8 endif --- 482,488 ---- " remember them. You can display them with utf-8. Your system/GUI interface " have to support utf-8. This addition is necessary for resetting 'encoding'. ! TexLet g:Tex_UseUtfMenus = 0 ! ! if g:Tex_UseUtfMenus != 0 && has("gui_running") set encoding=utf-8 endif |
From: <sri...@us...> - 2003-06-15 08:23:18
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv28548 Modified Files: bibtex.vim Log Message: Changed structure of bibtex.vim to look more ``modular''. Still don't know if this is a good idea. Might revert to older revision in the future. Feature: added way to customize the fields which are applied via the mappings. Index: bibtex.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/bibtex.vim,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bibtex.vim 12 Jan 2003 22:02:36 -0000 1.4 --- bibtex.vim 15 Jun 2003 08:23:14 -0000 1.5 *************** *** 3,8 **** --- 3,125 ---- " Function: BibT " Author: Alan G Isaac <ai...@am...> + " modified by Srinath Avadhanula <srinath AT fastmail DOT fm> + " for latex-suite. + " License: Vim Charityware license. + " CVS: $Id$ "============================================================================= + " Fields: + " Define what field type each letter denotes {{{ + " + let s:w_standsfor = 'address' + let s:a_standsfor = 'author' + let s:b_standsfor = 'booktitle' + let s:c_standsfor = 'chapter' + let s:d_standsfor = 'edition' + let s:e_standsfor = 'editor' + let s:h_standsfor = 'howpublished' + let s:i_standsfor = 'institution' + let s:k_standsfor = 'isbn' + let s:j_standsfor = 'journal' + let s:m_standsfor = 'month' + let s:n_standsfor = 'number' + let s:o_standsfor = 'organization' + let s:p_standsfor = 'pages' + let s:q_standsfor = 'publisher' + let s:r_standsfor = 'school' + let s:s_standsfor = 'series' + let s:t_standsfor = 'title' + let s:u_standsfor = 'type' + let s:v_standsfor = 'volume' + let s:y_standsfor = 'year' + let s:z_standsfor = 'note' + + " }}} + " Define the fields required for the various entry types {{{ + " + " s:{type}_required defines the required fields + " s:{type}_optional1 defines common optional fields + " s:{type}_optional2 defines uncommmon optional fields + " s:{type}_retval defines the first line of the formatted bib entry. + " + let s:key='<+key+>' + + let s:{'article'}_required="atjy" + let s:{'article'}_optional1="vnpm" + let s:{'article'}_optional2="z" " z is note + let s:{'article'}_retval = '@ARTICLE{' . s:key . ','."\n" + + let s:{'book'}_required="aetqy" " requires author *or* editor + let s:{'book'}_optional1="wd" + let s:{'book'}_optional2="vnsmz" " w is address, d is edition + let s:{'book'}_extras="k" " isbn + let s:{'book'}_retval = '@BOOK{' . s:key . ','."\n" + + let s:{'booklet'}_required="t" + let s:{'booklet'}_optional1="ahy" + let s:{'booklet'}_optional2="wmz" " w is address + let s:{'booklet'}_retval = '@BOOKLET{' . s:key . ','."\n" + + let s:{'inbook'}_required="aetcpqy" + let s:{'inbook'}_optional1="w" " w is address + let s:{'inbook'}_optional2="vnsudmz" " d is edition + let s:{'inbook'}_extras="k" " isbn + let s:{'inbook'}_retval = '@INBOOK{' . s:key . ','."\n" + + let s:{'incollection'}_required="atbqy" " b is booktitle + let s:{'incollection'}_optional1="cpw" " w is address, c is chapter + let s:{'incollection'}_optional2="evnsudmz" " d is edition + let s:{'incollection'}_extras="k" " isbn + let s:{'incollection'}_retval = '@INCOLLECTION{' . s:key . ','."\n" + + let s:{'inproceedings'}_required="atby" " b is booktitle + let s:{'inproceedings'}_optional1="epwoq" " w is address, q is publisher + let s:{'inproceedings'}_optional2="vnsmz" + let s:{'inproceedings'}_extras="k" " isbn + let s:{'inproceedings'}_retval = '@INPROCEEDINGS{' . s:key . ','."\n" + + let s:{'conference'}_required="atby" " b is booktitle + let s:{'conference'}_optional1="epwoq" " w is address, q is publisher + let s:{'conference'}_optional2="vnsmz" + let s:{'conference'}_extras="k" " isbn + let s:{'conference'}_retval = '@CONFERENCE{' . s:key . ','."\n" + + let s:{'manual'}_required="t" + let s:{'manual'}_optional1="ow" + let s:{'manual'}_optional2="admyz" " w is address + let s:{'manual'}_retval = '@MANUAL{' . s:key . ','."\n" + + let s:{'msthesis'}_required="atry" " r is school + let s:{'msthesis'}_optional1="w" " w is address + let s:{'msthesis'}_optional2="umz" " u is type, w is address + let s:{'msthesis'}_retval = '@MASTERSTHESIS{' . s:key . ','."\n" + + let s:{'misc'}_required="" + let s:{'misc'}_optional1="ath" + let s:{'misc'}_optional2="myz" + let s:{'misc'}_retval = '@MISC{' . s:key . ','."\n" + + let s:{'phdthesis'}_required="atry" " r is school + let s:{'phdthesis'}_optional1="w" " w is address + let s:{'phdthesis'}_optional2="umz" " u is type + let s:{'phdthesis'}_retval = '@PHDTHESIS{' . s:key . ','."\n" + + let s:{'proceedings'}_required="ty" + let s:{'proceedings'}_optional1="ewo" " w is address + let s:{'proceedings'}_optional2="vnsmqz" " q is publisher + let s:{'proceedings'}_retval = '@PROCEEDINGS{' . s:key . ','."\n" + + let s:{'techreport'}_required="atiy" + let s:{'techreport'}_optional1="unw" " u is type, w is address + let s:{'techreport'}_optional2="mz" + let s:{'techreport'}_retval = '@TECHREPORT{' . s:key . ','."\n" + + let s:{'unpublished'}_required="atz" + let s:{'unpublished'}_optional1="y" + let s:{'unpublished'}_optional2="m" + let s:{'unpublished'}_retval = '@UNPUBLISHED{' . s:key . ','."\n" + + " }}} + if exists('s:done') finish *************** *** 10,16 **** let s:done = 1 ! call IMAP ('BBA', "\<C-r>=BibT('article', '', 0)\<CR>", 'bib') ! call IMAP ('BBB', "\<C-r>=BibT('inproceedings', '', 0)\<CR>", 'bib') ! call IMAP ('BAS', "\<C-r>=BibT('', '', 0)\<CR>", 'bib') " BibT: function to generate a formatted bibtex entry {{{ --- 127,134 ---- let s:done = 1 ! call IMAP ('BBB', "\<C-r>=BibT('', '', 0)\<CR>", 'bib') ! call IMAP ('BBL', "\<C-r>=BibT('', 'o', 0)\<CR>", 'bib') ! call IMAP ('BBH', "\<C-r>=BibT('', 'O', 0)\<CR>", 'bib') ! call IMAP ('BBX', "\<C-r>=BibT('', 'Ox', 0)\<CR>", 'bib') " BibT: function to generate a formatted bibtex entry {{{ *************** *** 20,36 **** " :call BibT("article","ox") more optional fields (o) and extras (x) " function BibT(type, options, prompt) if a:type != '' let choosetype = a:type else ! let choosetype=input("Enter type (type in whole word!):\n". ! \" article\tbooklet\t\tbook\t\tconference\n". ! \" inbook\t\tincollection\tinproceedings\tmanual\n". ! \" msthesis\tmisc\t\tphdthesis\tproceedings\n". ! \" techreport\tunpublished\n\n:" ! \) if choosetype == '' let choosetype = 'article' endif endif if a:options != '' --- 138,186 ---- " :call BibT("article","ox") more optional fields (o) and extras (x) " + " Input Arguments: + " type: is one of the types listed above. (this should be a complete name, not + " the acronym). + " options: a string containing 0 or more of the letters 'oOx' + " where + " o: include a bib entry with first set of options + " O: include a bib entry with extended options + " x: incude bib entry with extra options + " prompt: whether the fields are asked to be filled on the command prompt or + " whether place-holders are used. when prompt == 1, then comman line + " questions are used. + " + " Returns: + " a string containing a formatted bib entry function BibT(type, options, prompt) if a:type != '' let choosetype = a:type else ! let types = ! \ 'article'."\n". ! \ 'booklet'."\n". ! \ 'book'."\n". ! \ 'conference'."\n". ! \ 'inbook'."\n". ! \ 'incollection'."\n". ! \ 'inproceedings'."\n". ! \ 'manual'."\n". ! \ 'msthesis'."\n". ! \ 'misc'."\n". ! \ 'phdthesis'."\n". ! \ 'proceedings'."\n". ! \ 'techreport'."\n". ! \ 'unpublished' ! let choosetype = Tex_ChooseFromPrompt( ! \ "Choose the type of bibliographic entry: \n" . ! \ Tex_CreatePrompt(types, 3, "\n") . ! \ "\nEnter number or filename :", ! \ types, "\n") if choosetype == '' let choosetype = 'article' endif + if types !~ '^\|\n'.choosetype.'$\|\n' + echomsg 'Please choose only one of the given types' + return + endif endif if a:options != '' *************** *** 43,250 **** let extras="" let retval = "" - let key='<+key+>' - - " characterize entry types - if choosetype ==? "article" - let required="atjy" - let optional1="vnpm" - let optional2="z" " z is note - let retval = retval.'@ARTICLE{' . key . ','."\n" - endif - if choosetype ==? "book" - let required="ætqy" " requires author *or* editor - let optional1="wd" - let optional2="vnsmz" " w is address, d is edition - let extras="k" " isbn - let retval = retval.'@BOOK{' . key . ','."\n" - endif - if choosetype ==? "booklet" - let required="t" - let optional1="ahy" - let optional2="wmz" " w is address - let retval = retval.'@BOOKLET{' . key . ','."\n" - endif - if choosetype ==? "inbook" - let required="ætcpqy" - let optional1="w" " w is address - let optional2="vnsudmz" " d is edition - let extras="k" " isbn - let retval = retval.'@INBOOK{' . key . ','."\n" - endif - if choosetype ==? "incollection" - let required="atbqy" " b is booktitle - let optional1="cpw" " w is address, c is chapter - let optional2="evnsudmz" " d is edition - let extras="k" " isbn - let retval = retval.'@INCOLLECTION{' . key . ','."\n" - endif - if choosetype ==? "inproceedings" - let required="atby" " b is booktitle - let optional1="epwoq" " w is address, q is publisher - let optional2="vnsmz" - let extras="k" " isbn - let retval = retval.'@INPROCEEDINGS{' . key . ','."\n" - endif - if choosetype ==? "manual" - let required="t" - let optional1="ow" - let optional2="admyz" " w is address - let retval = retval.'@MANUAL{' . key . ','."\n" - endif - if choosetype ==? "msthesis" - let required="atry" " r is school - let optional1="w" " w is address - let optional2="umz" " u is type, w is address - let retval = retval.'@MASTERSTHESIS{' . key . ','."\n" - endif - if choosetype ==? "misc" - let required="" - let optional1="ath" - let optional2="myz" - let retval = retval.'@MISC{' . key . ','."\n" - endif - if choosetype ==? "phdthesis" - let required="atry" " r is school - let optional1="w" " w is address - let optional2="umz" " u is type - let retval = retval.'@PHDTHESIS{' . key . ','."\n" - endif - if choosetype ==? "proceedings" - let required="ty" - let optional1="ewo" " w is address - let optional2="vnsmqz" " q is publisher - let retval = retval.'@PROCEEDINGS{' . key . ','."\n" - endif - if choosetype ==? "techreport" - let required="atiy" - let optional1="unw" " u is type, w is address - let optional2="mz" - let retval = retval.'@TECHREPORT{' . key . ','."\n" - endif - if choosetype ==? "unpublished" - let required="atz" - let optional1="y" - let optional2="m" - let retval = retval.'@UNPUBLISHED{' . key . ','."\n" - endif " define fields ! let fields = required ! if options =~ 'o' ! let fields = fields . optional1 endif ! if options =~ "O" ! if options !~ 'o' ! let fields = fields . optional1 endif ! let fields = fields . optional2 endif ! if options =~ "x" let fields = fields . extras endif ! ! " implement fields ! if fields =~ "[aæ]" ! let author=s:Input("Author(s)? ", a:prompt) ! if author!="" || required =~ "a" ! let retval = retval.'author = {' . author . '},'."\n" ! endif ! endif ! if fields =~ "[eæ]" ! let editor=s:Input("Editor(s)? ", a:prompt) ! if editor!="" || required =~ "e" ! let retval = retval.'editor = {' . editor . '},'."\n" ! endif ! endif ! if fields =~ "y" ! let year=s:Input("Year? ", a:prompt) ! let retval = retval.'year = ' . year . ','."\n" ! endif ! if fields =~ "t" ! let title=s:Input("title? ", a:prompt) ! let retval = retval.'title = {' . title . '},'."\n" ! endif ! if fields =~ "b" " booktitle ! let booktitle=s:Input("booktitle? ", a:prompt) ! let retval = retval.'booktitle = {' . booktitle . '},'."\n" ! endif ! if fields =~ "d" " edition ! let edition=s:Input("edition? (E.g., 2nd) ", a:prompt) ! let retval = retval.'edition = {' . edition . '},'."\n" ! endif ! if fields =~ "c" " chapter ! let chapter=s:Input("chapter? ", a:prompt) ! if chapter !="" ! let retval = retval.'chapter = {' . chapter . '},'."\n" ! endif ! endif ! if fields =~ "j" " journal ! let jrnlkey=s:Input("{Journal Name} (in braces) or journal key? ", a:prompt) ! if jrnlkey != "" ! let retval = retval.'journal = ' . jrnlkey . ','."\n" ! else ! let retval = retval.'journal = {},'."\n" ! endif ! endif ! if fields =~ "v" ! let volume=s:Input("volume? ", a:prompt) ! if volume !="" ! let retval = retval.'volume = ' . volume . ','."\n" ! endif ! endif ! if fields =~ "n" ! let number=s:Input("number? ", a:prompt) ! if number !="" ! let retval = retval.'number = ' . number . ','."\n" ! endif ! endif ! if fields =~ "m" ! let month=s:Input("month? ", a:prompt) ! if month !="" ! let retval = retval.'month = ' . month . ','."\n" ! endif ! endif ! if fields =~ "p" ! let pages=s:Input("pages? ", a:prompt) ! let retval = retval.'pages = {' . pages . '},'."\n" ! endif ! if fields =~ "q" ! let publisher=s:Input("publisher? ", a:prompt) ! let retval = retval.'publisher = {' . publisher . '},'."\n" ! endif ! if fields =~ "w" ! let address=s:Input("address? ", a:prompt) ! let retval = retval.'address = {' . address . '},'."\n" ! endif ! if fields =~ "h" ! let howpublished=s:Input("howpublished? ", a:prompt) ! let retval = retval.'howpublished = {' . howpublished . '},'."\n" ! endif ! if fields =~ "i" ! let institution=s:Input("institution? ", a:prompt) ! let retval = retval.'institution = {' . institution . '},'."\n" ! endif ! if fields =~ "o" ! let organization=s:Input("organization? ", a:prompt) ! let retval = retval.'organization = {' . organization . '},'."\n" ! endif ! if fields =~ "r" ! let school=s:Input("school? ", a:prompt) ! let retval = retval.'school = {' . school . '},'."\n" ! endif ! if fields =~ "s" ! let series=s:Input("series? ", a:prompt) ! let retval = retval.'series = {' . series . '},'."\n" ! endif ! if fields =~ "u" ! let type=s:Input("type? (E.g., Working Paper)", a:prompt) ! let retval = retval.'type = {' . type . '},'."\n" endif ! if fields =~ "k" ! let isbn=s:Input("isbn? ", a:prompt) ! if isbn !="" ! let retval = retval.'isbn = {' . isbn . '},'."\n" endif ! endif let retval = retval.'otherinfo = {<++>}'."\n" let retval = retval."}<++>"."\n" --- 193,227 ---- let extras="" let retval = "" " define fields ! let fields = s:{choosetype}_required ! if options =~ 'o' && exists('s:'.choosetype.'_optional1') ! let fields = fields . s:{choosetype}_optional1 endif ! if options =~ "O" && exists('s:'.choosetype.'_optional2') ! if options !~ 'o'&& exists('s:'.choosetype.'_optional1') ! let fields = fields . s:{choosetype}_optional1 endif ! let fields = fields . s:{choosetype}_optional2 endif ! if options =~ "x" && exists('s:'.choosetype.'_extras') let fields = fields . extras endif ! if exists('g:Bib_'.choosetype.'_options') ! let fields = fields . g:Bib_{choosetype}_options endif ! ! let retval = s:{choosetype}_retval ! ! let i = 0 ! while i < strlen(fields) ! let field = strpart(fields, i, 1) ! if exists('s:'.field.'_standsfor') ! let field_name = s:{field}_standsfor ! let retval = retval.field_name." = {<++>},\n" endif ! ! let i = i + 1 ! endwhile let retval = retval.'otherinfo = {<++>}'."\n" let retval = retval."}<++>"."\n" |
From: <sri...@us...> - 2003-06-15 08:09:31
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin In directory sc8-pr-cvs1:/tmp/cvs-serv27182 Added Files: bib_latexSuite.vim Log Message: create a bib_latexSuite.vim file to be able to also support bib files. This file basically sources bibtex.vim, which contains maps to insert bibliographic entries easily. --- NEW FILE: bib_latexSuite.vim --- " File: bib_latexSuite.vim " Author: Srinath Avadhanula " License: Vim Charityware License " Description: " This file sources the bibtex.vim file distributed as part of latex-suite. " That file sets up 3 maps BBB, BAS, and BBA which are easy wasy to type in " bibliographic entries. " " CVS: $Id: bib_latexSuite.vim,v 1.1 2003/06/15 08:09:28 srinathava Exp $ " source main.vim because we need a few functions from it. runtime ftplugin/latex-suite/main.vim " Disable smart-quotes because we need to enter real quotes in bib files. runtime ftplugin/latex-suite/bibtex.vim " vim:fdm=marker:ff=unix:noet:ts=4:sw=4:nowrap |
From: <sri...@us...> - 2003-06-15 05:23:33
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv12064 Modified Files: texviewer.vim Log Message: Bug: Sometimes Tex_FindBblFiles() would return a bunch of files with new-lines in them. Cause: substitue(text, '\n', ' ', 'ge') doesn't remove newlines (at least in vanilla vim 6.1). Solution: Use substitute(text, "\n", ' ', 'ge') instead. NOTE: use double quotes when using special characters in replacement string in substitute(). Bug: Sometimes the latex file would get the maps from Tex_c_window_setup(). Cause: The maps would be created even when s:UpdateViewerWindow() closed off the quickfix and preview window because of error E32 and focus returned to the latex window. Solution: Check if &ft == 'qf' before setting maps. Bug: If the tex file used a '\bibliography' command to include a .bib file, it would not be found. (on windows) Cause: Used ':' as a path seperator. which crashes on windows, because a path is of the form c:/path/to/something (i.e ':' is a character in every path!!) Solution: Use "\n" as a path seperator on windows. TODO: Should we be using "\n" for other OSs too? Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** texviewer.vim 12 Jun 2003 08:16:25 -0000 1.21 --- texviewer.vim 15 Jun 2003 05:23:31 -0000 1.22 *************** *** 82,86 **** let s:type = substitute(s:curline, pattern, '\1', 'e') let s:typeoption = substitute(s:curline, pattern, '\2', 'e') ! call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption) if exists("s:type") && s:type =~ 'ref' --- 82,86 ---- let s:type = substitute(s:curline, pattern, '\1', 'e') let s:typeoption = substitute(s:curline, pattern, '\2', 'e') ! call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption, 'view') if exists("s:type") && s:type =~ 'ref' *************** *** 94,103 **** let bblfiles = <SID>Tex_FindBblFiles() if bibfiles != '' ! exe "silent! grepadd! '@.*{".s:prefix."' ".bibfiles ! let g:bbb = "silent! grepadd! '@.*{".s:prefix."' ".bibfiles endif if bblfiles != '' ! exe "silent! grepadd! 'bibitem{".s:prefix."' ".bblfiles endif call <SID>Tex_c_window_setup() --- 94,105 ---- let bblfiles = <SID>Tex_FindBblFiles() if bibfiles != '' ! call Tex_Debug("silent! grepadd! '@.*{".s:prefix."' ".bibfiles, 'view') ! exec "silent! grepadd! '@.*{".s:prefix."' ".bibfiles endif if bblfiles != '' ! call Tex_Debug("silent! grepadd! 'bibitem{".s:prefix."' ".bblfiles, 'view') ! exec "silent! grepadd! 'bibitem{".s:prefix."' ".bblfiles endif + call Tex_Debug('returning', 'view') call <SID>Tex_c_window_setup() *************** *** 174,177 **** --- 176,180 ---- cclose exe 'copen '. g:Tex_ViewerCwindowHeight + setlocal nonumber setlocal nowrap *************** *** 179,182 **** --- 182,193 ---- let s:scrollOffVal = &scrolloff call <SID>UpdateViewerWindow() + " If everything went well, then we should be situated in the quickfix + " window. If there were problems, (no matches etc), then we will not be. + " Therefore return. + if &ft != 'qf' + call Tex_Debug('not in quickfix window, quitting', 'view') + return + endif + nnoremap <buffer> <silent> j j:call <SID>UpdateViewerWindow()<CR> *************** *** 272,275 **** --- 283,287 ---- endif let v:errmsg = '' + call Tex_Debug('UpdateViewerWindow: got error E32, no matches found, quitting', 'view') return 0 endif *************** *** 390,393 **** --- 402,406 ---- function! s:Tex_FindBibFiles() + let position = line('.').' | normal! '.virtcol('.').'|' if g:projFiles != '' let bibfiles = '' *************** *** 403,406 **** --- 416,420 ---- let g:bibf = bibfiles + exec position return bibfiles *************** *** 415,424 **** endif ! let dirs = expand("%:p:h") . ":" . expand("$BIBINPUTS") ! let dirs = substitute(dirs, ':\+', ':', 'g') let i = 1 ! while Tex_Strntok(dirs, ':', i) != '' ! let curdir = Tex_Strntok(dirs, ':', i) let curdir = substitute(curdir, ' ', "\\", 'ge') let tmp = '' --- 429,444 ---- endif ! if has('win32') ! let sep = "\n" ! else ! let sep = ":" ! endif ! ! let dirs = expand("%:p:h") . sep . expand("$BIBINPUTS") ! let dirs = substitute(dirs, sep.'\+', sep, 'g') let i = 1 ! while Tex_Strntok(dirs, sep, i) != '' ! let curdir = Tex_Strntok(dirs, sep, i) let curdir = substitute(curdir, ' ', "\\", 'ge') let tmp = '' *************** *** 442,450 **** endwhile ! if Tex_GetMainFileName() != '' ! let mainfname = Tex_GetMainFileName() let mainfdir = fnamemodify(mainfname, ":p:h") ! let curdir = expand("%:p:h") ! let curdir = substitute(curdir, ' ', "\\", 'ge') exe 'bot 1 split '.mainfname if search('\\bibliography{', 'w') --- 462,471 ---- endwhile ! if Tex_GetMainFileName() != '' && expand('%:p') != Tex_GetMainFileName(':p:r') ! let mainfname = Tex_GetMainFileName(':p:r') let mainfdir = fnamemodify(mainfname, ":p:h") ! let curdir = expand("%:p:h") ! let curdir = substitute(curdir, ' ', "\\", 'ge') ! exe 'bot 1 split '.mainfname if search('\\bibliography{', 'w') *************** *** 454,462 **** elseif mainfdir != curdir let bibfiles2 = glob(mainfdir.'/*.bib') ! let bibfiles2 = substitute(bibfiles2, '\n', ' ', 'ge') endif wincmd q endif return bibfiles.' '.bibfiles2 endif --- 475,484 ---- elseif mainfdir != curdir let bibfiles2 = glob(mainfdir.'/*.bib') ! let bibfiles2 = substitute(bibfiles2, "\n", ' ', 'ge') endif wincmd q endif + exec position return bibfiles.' '.bibfiles2 endif *************** *** 488,492 **** let bblfiles = glob(curdir.'/*.tex') ! let bblfiles = substitute(bblfiles, '\n', ' ', 'ge') if Tex_GetMainFileName() != '' --- 510,515 ---- let bblfiles = glob(curdir.'/*.tex') ! let bblfiles = substitute(bblfiles, "\n", ' ', 'ge') ! call Tex_Debug('getting bblfiles = '.bblfiles) if Tex_GetMainFileName() != '' *************** *** 496,500 **** if mainfdir != curdir let bblfiles = glob(mainfdir.'/*.tex') ! let bblfiles = substitute(bblfiles, '\n', ' ', 'ge') endif --- 519,523 ---- if mainfdir != curdir let bblfiles = glob(mainfdir.'/*.tex') ! let bblfiles = substitute(bblfiles, "\n", ' ', 'ge') endif |
From: <sri...@us...> - 2003-06-14 05:09:14
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv15932 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ChangeLog 2 Jun 2003 13:39:26 -0000 1.6 --- ChangeLog 14 Jun 2003 05:09:10 -0000 1.7 *************** *** 1,2 **** --- 1,46 ---- + 13 Jun 2003 + Features + * remoteOpen.vim: + Add a command :RemoteOpen which is to be used in applications such as + YAP to make vim use the same session to open files. (SA) + + Bugfixes + * texviewer.vim: + Problem: <F9> did not work in standard vim + cygwin combination. + Solution: Use single quotes instead of double-quotes when issuing + shell commands. (SA) + * texviewer.vim: + Problem: <F9> did not work for \includegraphics[0.8\columnwidth]{} + because it would confuse \columnwidth for a command instead + of an option. + Solution: improve regexp for extracting command from a line. (SA) + * envmacros.vim: + Problem: the maps in envmacros.vim got applied only to the first file + which latex-suite sees. + Solution: fix a typo in the autocommand line. (SA) + * compiler.vim,wizardfuncs.vim: + Problem: the log preview window did not appear during part + compilation. + Solution: rearranged code in the files so the main filename was + defined even for part compilation. (SA) + * texviewer.vim: + Problem: <F9> only works for the first file. + Solution: call the function to set the maps every time. (SA) + * compiler.vim: + Problem: sometimes, <F9> would try to search for completions in /*.tex + and would therefore fail. + Solution: use expand('%:p:h') instead of expand('%;h') to calculate + directory because the latter can sometimes evaluate to ''. (SA) + * texviewer.vim: + Problem: 'scrolloff' remains at 1000 even after <F9> returns (Jakub + Turski) + Solution: reset 'scrolloff' before quitting any of the windows created + during searching. + * packages.vim: + Problem: A spurious '{' is sometimes inserted into the search history. + ... (A. S. Budden, Mpiktas) + Solution: call histdel once at the end of Tex_pack_all. + + After 8 May 2003 |
From: <sri...@us...> - 2003-06-14 04:43:11
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv13376 Modified Files: remoteOpen.vim Log Message: Change: Previously, if a file was not opened in any other session, then it would open it in a new session. But for projects with lots of files, this can become painful. Therefore, instead of opening in new sessions each time, open files in the same session we used the first time we had to create a session. Index: remoteOpen.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/remoteOpen.vim,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** remoteOpen.vim 8 Jun 2003 23:42:44 -0000 1.1 --- remoteOpen.vim 14 Jun 2003 04:43:07 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- " anywhere and if so, opens it there instead of in this session. function! RemoteOpen(arglist) + " First construct line number and filename from argument. a:arglist is of " the form: *************** *** 55,58 **** --- 56,60 ---- exec "e ".filename exec linenum + normal! zv return endif *************** *** 60,74 **** " Otherwise, loop through all available servers let servers = serverlist() let i = 1 let server = s:Strntok(servers, "\n", i) while server != '' " Ask each server if that file is being edited by them. let bufnum = remote_expr(server, "bufnr('".filename."')") ! " If it isnt... if bufnum != -1 ! " ask the server to edit that file and come to the background. ! call remote_send(server, "\<C-\>\<C-n>:drop ".filename."\<CR>:".linenum."\<CR>") call remote_foreground(server) " quit this vim session --- 62,95 ---- " Otherwise, loop through all available servers let servers = serverlist() + " If there are no servers, open file locally. + if servers == '' + exec "e ".filename + exec linenum + let g:Remote_Server = 1 + normal! zv + return + endif let i = 1 let server = s:Strntok(servers, "\n", i) + let firstServer = v:servername while server != '' + " Find out if there was any server which was used by remoteOpen before + " this. If a new gvim session was ever started via remoteOpen, then + " g:Remote_Server will be set. + if remote_expr(server, 'exists("g:Remote_Server")') + let firstServer = server + endif + " Ask each server if that file is being edited by them. let bufnum = remote_expr(server, "bufnr('".filename."')") ! " If it is... if bufnum != -1 ! " ask the server to edit that file and come to the foreground. ! " set a variable g:Remote_Server to indicate that this server ! " session has at least one file opened via RemoteOpen ! call remote_send(server, "\<C-\>\<C-n>:drop ".filename."\<CR>:".linenum."\<CR>:normal! zv\<CR>") ! call remote_send(server, ":let g:Remote_Server = 1\<CR>") call remote_foreground(server) " quit this vim session *************** *** 82,88 **** endwhile ! " If there is no server which was editing this file, then open it up here. ! exec "e ".filename ! exec linenum endfunction " }}} " Strntok: extract the n^th token from a list {{{ --- 103,117 ---- endwhile ! " If none of the servers have the file open, then open this file in the ! " first server. This has the advantage if yap tries to make vim open ! " multiple vims, then at least they will all be opened by the same gvim ! " server. ! call remote_send(firstServer, "\<C-\>\<C-n>:drop ".filename."\<CR>:".linenum."\<CR>:normal! zv\<CR>") ! call remote_send(firstServer, ":let g:Remote_Server = 1\<CR>") ! call remote_foreground(firstServer) ! " quit this vim session ! if v:servername != firstServer ! q ! endif endfunction " }}} " Strntok: extract the n^th token from a list {{{ |
From: <sri...@us...> - 2003-06-13 21:41:30
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv28775 Modified Files: packages.vim Log Message: Bug: When a \usepackage line is found, then a spurious { is inserted into the search history. (A. S. Budden, Mpiktas) Cause: a "normal! /{\<CR>" command is executed. Solution: call histdel at the end of the function. Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** packages.vim 8 Apr 2003 08:45:01 -0000 1.32 --- packages.vim 13 Jun 2003 21:41:27 -0000 1.33 *************** *** 428,431 **** --- 428,438 ---- exe pos + " first make a random search so that we push at least one item onto the + " search history. Since vim puts only one item in the history per function + " call, this way we make sure that one and only item is put into the + " search history. + normal! /^<CR> + " now delete it... + call histdel('/', -1) endfunction |
From: <sri...@us...> - 2003-06-12 08:16:30
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv9349 Modified Files: texviewer.vim Log Message: Bug: 'scrolloff' remains at 100 even after we complete the reference (Jakub Turski) Cause: 'scrolloff' is a global setting, not local Solution: Preserve the value of &scrolloff and reset it just before quitting any of the windows. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** texviewer.vim 9 Jun 2003 03:34:26 -0000 1.20 --- texviewer.vim 12 Jun 2003 08:16:25 -0000 1.21 *************** *** 177,180 **** --- 177,181 ---- setlocal nowrap + let s:scrollOffVal = &scrolloff call <SID>UpdateViewerWindow() *************** *** 186,198 **** " Change behaviour of <cr> only for 'ref' and 'cite' context. if exists("s:type") && s:type =~ 'ref' ! nnoremap <buffer> <silent> <cr> :silent! call <SID>CompleteName("ref")<CR> elseif exists("s:type") && s:type =~ 'cite' ! nnoremap <buffer> <silent> <cr> :silent! call <SID>CompleteName("cite")<CR> else " In other contexts jump to place described in cwindow and close small " windows ! nnoremap <buffer> <silent> <cr> :call <SID>GoToLocation()<cr> endif --- 187,199 ---- " Change behaviour of <cr> only for 'ref' and 'cite' context. if exists("s:type") && s:type =~ 'ref' ! exec 'nnoremap <buffer> <silent> <cr> :set scrolloff='.s:scrollOffVal.'<CR>:silent! call <SID>CompleteName("ref")<CR>' elseif exists("s:type") && s:type =~ 'cite' ! exec 'nnoremap <buffer> <silent> <cr> :set scrolloff='.s:scrollOffVal.'<CR>:silent! call <SID>CompleteName("cite")<CR>' else " In other contexts jump to place described in cwindow and close small " windows ! exec 'nnoremap <buffer> <silent> <cr> :set scrolloff='.s:scrollOffVal.'<CR>:call <SID>GoToLocation()<cr>' endif *************** *** 201,205 **** nnoremap <buffer> <silent> K :wincmd j<cr><c-y>:wincmd k<cr> ! exe 'nnoremap <buffer> <silent> q :call Tex_CloseSmallWindows()<cr>' endfunction " }}} --- 202,206 ---- nnoremap <buffer> <silent> K :wincmd j<cr><c-y>:wincmd k<cr> ! exe 'nnoremap <buffer> <silent> q :set scrolloff='.s:scrollOffVal.'<CR>:call Tex_CloseSmallWindows()<cr>' endfunction " }}} |
From: <sri...@us...> - 2003-06-09 03:34:29
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv16577 Modified Files: texviewer.vim Log Message: Bug: More stupid windows issues. Sometimes, getcwd() = 'c:\path\to\file' and expand('%:p:h') = 'c:/path/to/file' which causes s:searchdirectory to become '' causing Tex_completion to search as fgrep \label /*.tex Solution: s:searchdirectory = expand('%:p:h') instead of expand('%:h') Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** texviewer.vim 8 Jun 2003 22:30:39 -0000 1.19 --- texviewer.vim 9 Jun 2003 03:34:26 -0000 1.20 *************** *** 43,47 **** if getcwd() != expand("%:p:h") ! let s:search_directory = expand("%:h") . '/' else let s:search_directory = '' --- 43,47 ---- if getcwd() != expand("%:p:h") ! let s:search_directory = expand("%:p:h") . '/' else let s:search_directory = '' *************** *** 82,87 **** --- 82,89 ---- let s:type = substitute(s:curline, pattern, '\1', 'e') let s:typeoption = substitute(s:curline, pattern, '\2', 'e') + call Tex_Debug('s:type = '.s:type.', typeoption = '.s:typeoption) if exists("s:type") && s:type =~ 'ref' + call Tex_Debug("silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex', 'view') exe "silent! grep! '\\label{".s:prefix."' ".s:search_directory.'*.tex' call <SID>Tex_c_window_setup() |
From: <sri...@us...> - 2003-06-08 23:42:47
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv14650 Added Files: remoteOpen.vim Log Message: This script provides a command :RemoteOpen which is supposed to be used from the command line as follows: gvim -c ":RemoteOpen +<lnum> <filename>" where <lnum> is the line-number you wish <filename> to open to. What will happen is that a new gvim will start up and enquire from all previous sessions if <filename> is already open in any of them. If it is, then it will edit the file in that session and bring it to the foreground and itself quit. Otherwise, it will not quit and instead open up the file for editing at <lnum>. This was mainly created to be used with Yap (the dvi previewer in miktex), so you can specify the program for "inverse search" as specified above. This ensures that the inverse search uses the correct gvim each time. --- NEW FILE: remoteOpen.vim --- " File: remoteOpen.vim " Author: Srinath Avadhanula <srinath AT fastmail DOT fm> " $Id: remoteOpen.vim,v 1.1 2003/06/08 23:42:44 srinathava Exp $ " " Description: " Often times, an external program needs to open a file in gvim from the " command line. However, it will not know if the file is already opened in a " previous vim session. It is not sufficient to simply specify " " gvim --remote-silent <filename> " " because this simply opens up <filename> in the first remote gvim session it " sees. This script provides a command RemoteOpen which is meant to be used " from the command line as follows: " " gvim -c ":RemoteOpen +<lnum> <filename>" " " where <lnum> is the line-number you wish <filename> to open to. What will " happen is that a new gvim will start up and enquire from all previous " sessions if <filename> is already open in any of them. If it is, then it " will edit the file in that session and bring it to the foreground and itself " quit. Otherwise, it will not quit and instead open up the file for editing " at <lnum>. " " This was mainly created to be used with Yap (the dvi previewer in miktex), " so you can specify the program for "inverse search" as specified above. " This ensures that the inverse search uses the correct gvim each time. " " Ofcourse, this requires vim with +clientserver. If not, then RemoteOpen just " opens in the present session. " Enclose <args> in single quotes so it can be passed as a function argument. com -nargs=1 RemoteOpen :call RemoteOpen('<args>') " RemoteOpen: open a file remotely (if possible) {{{ " Description: checks all open vim windows to see if this file has been opened " anywhere and if so, opens it there instead of in this session. function! RemoteOpen(arglist) " First construct line number and filename from argument. a:arglist is of " the form: " +10 c:\path\to\file " or just " c:\path\to\file if a:arglist =~ '^\s*+\d\+' let linenum = matchstr(a:arglist, '^\s*+\zs\d\+\ze') let filename = matchstr(a:arglist, '^\s*+\d\+\s*\zs.*\ze') else let linenum = 1 let filename = matchstr(a:arglist, '^\s*\zs.*\ze') endif " If there is no clientserver functionality, then just open in the present " session and return if !has('clientserver') exec "e ".filename exec linenum return endif " Otherwise, loop through all available servers let servers = serverlist() let i = 1 let server = s:Strntok(servers, "\n", i) while server != '' " Ask each server if that file is being edited by them. let bufnum = remote_expr(server, "bufnr('".filename."')") " If it isnt... if bufnum != -1 " ask the server to edit that file and come to the background. call remote_send(server, "\<C-\>\<C-n>:drop ".filename."\<CR>:".linenum."\<CR>") call remote_foreground(server) " quit this vim session q " Is this necessary? :) return end let i = i + 1 let server = s:Strntok(servers, "\n", i) endwhile " If there is no server which was editing this file, then open it up here. exec "e ".filename exec linenum endfunction " }}} " Strntok: extract the n^th token from a list {{{ " example: Strntok('1,23,3', ',', 2) = 23 fun! <SID>Strntok(s, tok, n) return matchstr( a:s.a:tok[0], '\v(\zs([^'.a:tok.']*)\ze['.a:tok.']){'.a:n.'}') endfun " }}} " vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap |
From: <sri...@us...> - 2003-06-08 22:30:43
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv26878 Modified Files: texviewer.vim Log Message: Bug: <F9> only worked the first time. Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** texviewer.vim 7 Jun 2003 21:02:23 -0000 1.18 --- texviewer.vim 8 Jun 2003 22:30:39 -0000 1.19 *************** *** 9,20 **** if exists("g:Tex_Completion") finish endif ! inoremap <silent> <Plug>Tex_Completion <Esc>:call Tex_completion("default","text")<CR> ! if !hasmapto('<Plug>Tex_Completion', 'i') ! imap <buffer> <silent> <F9> <Plug>Tex_Completion ! endif command -nargs=1 TLook call <SID>Tex_look(<q-args>) --- 9,28 ---- if exists("g:Tex_Completion") + call Tex_SetTexViewerMaps() finish endif + let g:Tex_Completion = 1 ! " Tex_SetTexViewerMaps: sets maps for this ftplugin {{{ ! function! Tex_SetTexViewerMaps() ! inoremap <silent> <Plug>Tex_Completion <Esc>:call Tex_completion("default","text")<CR> ! if !hasmapto('<Plug>Tex_Completion', 'i') ! imap <buffer> <silent> <F9> <Plug>Tex_Completion ! endif ! endfunction ! " call this function the first time ! call Tex_SetTexViewerMaps() ! " }}} command -nargs=1 TLook call <SID>Tex_look(<q-args>) *************** *** 560,564 **** endfunction " }}} - let g:Tex_Completion = 1 " this statement has to be at the end. let s:doneOnce = 1 --- 568,571 ---- |