vim-latex-cvs Mailing List for Vim-Latex (Page 33)
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
|
From: <sri...@us...> - 2002-12-14 10:59:24
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates In directory sc8-pr-cvs1:/tmp/cvs-serv21869/ftplugin/latex-suite/templates Modified Files: Tag: b-newimaps article.tex report.tex report_two_column.tex Log Message: Changed ä to <++> changed « to <+ changed » to +> No other change. I will not be posting the actual diff of this commit to the group. Just the log. Check the web cvs if you want the diff. Index: article.tex =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/article.tex,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** article.tex 30 Apr 2002 00:03:25 -0000 1.1.1.1 --- article.tex 14 Dec 2002 10:59:20 -0000 1.1.1.1.4.1 *************** *** 1,8 **** % File: ¡expand("%:p:t")¡ % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ ! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ % \documentclass[a4paper]{article} \begin{document} ! «» \end{document} --- 1,8 ---- % File: ¡expand("%:p:t")¡ % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ ! % Last Change: Sat Dec 14 02:00 AM 2002 PST % \documentclass[a4paper]{article} \begin{document} ! <++> \end{document} Index: report.tex =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report.tex,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** report.tex 30 Apr 2002 00:03:25 -0000 1.1.1.1 --- report.tex 14 Dec 2002 10:59:21 -0000 1.1.1.1.4.1 *************** *** 1,8 **** % File: ¡expand("%")¡ % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ ! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ % \documentclass[a4paper]{report} \begin{document} ! «» \end{document} --- 1,8 ---- % File: ¡expand("%")¡ % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ ! % Last Change: Sat Dec 14 02:00 AM 2002 PST % \documentclass[a4paper]{report} \begin{document} ! <++> \end{document} Index: report_two_column.tex =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/templates/report_two_column.tex,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.4.1 *** report_two_column.tex 30 Apr 2002 00:03:25 -0000 1.1.1.1 --- report_two_column.tex 14 Dec 2002 10:59:21 -0000 1.1.1.1.4.1 *************** *** 1,8 **** % File: ¡expand("%:p:t")¡ % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ ! % Last Change: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ % \documentclass[a4paper,twocolumn]{report} \begin{document} ! «» \end{document} --- 1,8 ---- % File: ¡expand("%:p:t")¡ % Created: ¡strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')¡ ! % Last Change: Sat Dec 14 02:00 AM 2002 PST % \documentclass[a4paper,twocolumn]{report} \begin{document} ! <++> \end{document} |
From: <sri...@us...> - 2002-12-14 10:48:27
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv19126 Modified Files: Tag: b-newimaps imaps.vim Log Message: . modified the older version (Tex_IMAP) to use the new IMAP() function. . changed Tex_PutTextWithMovement() to just a hack. It substitutes '<+' and '+>' with the s:PlaceHolder*() variables and then calls the new Imap_PutText... sorry for the short cvs log. I am running really late. NOTE: This is a work in progress. the changed version of Tex_IMAP() is not yet working quite robustly enought. It is sometimes generating more arguments than are needed. This commmit will be followed by another huge commit which is essentially replacing all ä characters with <++>, « with <+ and so on.... Therefore... FROM HENCEFORTH: Use <+ and +> instead of « and » Better still, dont use any placeholders at all and use the new IMAP() function. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** imaps.vim 14 Dec 2002 06:49:17 -0000 1.9.2.1 --- imaps.vim 14 Dec 2002 10:48:24 -0000 1.9.2.2 *************** *** 8,12 **** " while preserving filetype indentation. " ! " Last Change: Fri Dec 13 10:00 PM 2002 PST " " Documentation: {{{ --- 8,12 ---- " while preserving filetype indentation. " ! " Last Change: Sat Dec 14 02:00 AM 2002 PST " " Documentation: {{{ *************** *** 56,60 **** " Example One: " ! " call Tex_IMAP ("bit`", "\\begin{itemize}\<cr>\\item «»\<cr>\\end{itemize}«»", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. --- 56,60 ---- " Example One: " ! " call Tex_IMAP ("bit`", "\\begin{itemize}\<cr>\\item <++>\<cr>\\end{itemize}<++>", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. *************** *** 63,74 **** " \begin{itemize} " \item * ! " \end{itemize}«» " " where * shows the cursor position. The cursor position after inserting the " text is decided by the position of the first "place-holder". Place holders " are special characters which decide cursor placement and movement. In the ! " example above, the place holder characters are « and ». After you have typed ! " in the item, press <C-j> and you will be taken to the next set of «»'s. ! " Therefore by placing the «» characters appropriately, you can minimize the " use of movement keys. " --- 63,74 ---- " \begin{itemize} " \item * ! " \end{itemize}<++> " " where * shows the cursor position. The cursor position after inserting the " text is decided by the position of the first "place-holder". Place holders " are special characters which decide cursor placement and movement. In the ! " example above, the place holder characters are <+ and +>. After you have typed ! " in the item, press <C-j> and you will be taken to the next set of <++>'s. ! " Therefore by placing the <++> characters appropriately, you can minimize the " use of movement keys. " *************** *** 94,103 **** " }}} - " Prevent resourcing this file. - if exists('s:doneImaps') - finish - endif - let s:doneImaps = 1 - " ============================================================================== " Script variables --- 94,97 ---- *************** *** 177,242 **** \ '")<CR>' endfunction - " Old version: - function! Tex_IMAP(lhs, rhs, ft) - let lastLHSChar = a:lhs[strlen(a:lhs)-1] - " s:charLens_<ft>_<char> contains the lengths of the left hand sides of - " the various mappings for filetype <ft> which end in <char>. its a comma - " seperated list of numbers. - " for example if we want to create 2 mappings - " ab --> cd - " lbb --> haha - " for tex type files, then the variable will be: - " s:charLens_tex_b = '2,3,' - let charLenHash = 's:charLens_'.a:ft.'_'.char2nr(lastLHSChar) ! " if this variable doesnt exist before, initialize... ! if !exists(charLenHash) ! exe 'let '.charLenHash.' = ""' ! end ! " get the value of the variable. ! exe "let charLens = ".charLenHash ! " check to see if this length is already there... ! if matchstr(charLens, '\(^\|,\)'.strlen(a:lhs).',') == '' ! " ... if not append. ! " but carefully. sort the charLens array in decreasing order. this way ! " the longest lhs is checked first. i.e if the user has 2 maps ! " ab --> rhs1 ! " csdfb --> rhs2 ! " i.e 2 mappings ending in b, then check to see if the longer mapping ! " is satisfied first. ! " TODO: possible bug. what if the user has a mapping with lhs more ! " than 9 chars? (highly improbable). ! " largest element which is just smaller than the present length ! let idx = match(charLens, '[1-'.strlen(a:lhs).'],') ! if idx == -1 ! let new = charLens.strlen(a:lhs).',' ! else ! let left = strpart(charLens, 0, idx) ! let right = strpart(charLens, idx, 1000) ! let new = left.strlen(a:lhs).','.right ! end ! let charLens = new ! exe "let ".charLenHash." = charLens" ! end ! ! " create a variable corresponding to the lhs. convert all non-word ! " characters into their ascii codes so that a vim variable with that name ! " can be created. this is a way to create hashes in vim. ! let lhsHash = 's:Map_'.a:ft.'_'.substitute(a:lhs, '\(\W\)', '\="_".char2nr(submatch(1))."_"', 'g') ! " store the value of the right-hand side of the mapping in this newly ! " created variable. ! exe "let ".lhsHash." = a:rhs" ! ! " store a token string of this length. this is helpful later for erasing ! " the left-hand side before inserting the right-hand side. ! let tokenLenHash = 's:LenStr_'.strlen(a:lhs) ! exe "let ".tokenLenHash." = a:lhs" ! " map only the last character of the left-hand side. ! if lastLHSChar == ' ' ! let lastLHSChar = '<space>' ! end ! exe 'inoremap <silent> '.escape(lastLHSChar, '|').' <C-r>=<SID>LookupCharacter("'.escape(lastLHSChar, '\|').'")<CR>' endfunction --- 171,248 ---- \ '")<CR>' endfunction ! " }}} ! " Tex_IMAP: This is the old version of IMAP which used to take 3 arguments. {{{ ! " It has been changed in order to retain backwards compatibility (of ! " sorts) while still using the new IMAP ! " It could also be used for convinience in places where specifying multiple ! " arguments might be tedious. ! " ! " Ex: ! " ! " call Tex_IMAP('foo', 'ba<++>bar', '', '<+', '+>') ! " ! " The last 2 optional arguments specify the placeholder characters in the rhs. ! " See s:PlaceHolderStart() and s:PlaceHolderEnd for how they are chosen if the ! " the optional arguments are unspecified. ! function! Tex_IMAP(lhs, rhs, ft, ...) ! if a:0 > 0 ! let phs = a:1 ! let phe = a:2 ! else ! " Tex_IMAP is only concerned with mappings which latex-suite itself ! " generates. This means that we do not use the g:Imap_PlaceHolder* ! " settings. ! let phs = '<+' ! let phe = '+>' ! endif ! " break up the rhs into multiple chunks ! let remainingString = a:rhs ! let callString = 'call IMAP(a:ft, a:lhs, arg_1' ! ! let i = 1 ! while remainingString != '' ! let firstPart = matchstr(remainingString, '^.\{-}\ze\('.phs.'\|$\)') ! let secondPart = matchstr(remainingString, ! \ phs.'\zs.\{-}\ze'.phe, ! \ strlen(firstPart)) ! let arg_{i} = firstPart ! " we have already appended one argument. Do this only from next time ! " on. ! if i > 1 ! let callString = callString.', arg_'.i ! endif ! ! " if firstPart is smaller than the total string, then there is a ! " placeholder. Therefore append the placeholder as an argument ! if strlen(firstPart) < strlen(remainingString) ! let i = i + 1 ! ! let arg_{i} = secondPart ! let callString = callString.', arg_'.i ! endif ! ! " find out the part remaining. ! let remainingString = strpart(remainingString, ! \ strlen(firstPart) + ! \ strlen(secondPart) + ! \ strlen(phs) + strlen(phe)) ! ! if i >= 20 ! echomsg 'getting more than 20 placeholders!' ! echomsg 'input rhs = '.a:rhs ! endif ! ! let i = i + 1 ! endwhile ! ! " Finally, we end up with a string like: ! " 'call IMAP(a:ft, a:lhs, arg_1, arg_2, arg_3)' ! let callString = callString.')' ! ! echomsg callString ! exec callString endfunction *************** *** 262,265 **** --- 268,273 ---- " escaped when building up s:LHS_{ft}_{charHash} . let text = strpart(getline("."), 0, col(".")-1) . a:char + " matchstr() returns the longest match. This automatically ensures that + " the longest LHS is used for the mapping. let lhs = matchstr(text, '\V\(' . s:LHS_{ft}_{charHash} . '\)\$') if strlen(lhs) == 0 *************** *** 273,276 **** --- 281,285 ---- return bs . IMAP_PutTextWithMovement(s:Map_{ft}_{s:Hash(lhs)}, mark) endfunction + " Old version: function! <SID>LookupCharacter(char) *************** *** 365,370 **** let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, endpat, '') " ... delete all the others ... ! let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, '', '') ! " ... and replace phe with phs.phe . let text = substitute(text, '\V'.endpat, startpat.endpat, '') endif --- 374,379 ---- let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, endpat, '') " ... delete all the others ... ! let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, '', 'g') ! " ... and replace the first phe with phs.phe . let text = substitute(text, '\V'.endpat, startpat.endpat, '') endif *************** *** 374,377 **** --- 383,387 ---- " If there are no place holders, just return the text. if strlen(template) == 0 + echomsg 'searching for \V' . startpat . '\.\{-}' . endpat . ' in ' . text return text endif *************** *** 385,391 **** let text = text . ":call search('\\V" . startpat . "', 'W')\<CR>" " Finally, append commands to Select <+template+> or replace <++> . ! " Enter Visual mode and move to the end. Note that <space> can cross line ! " boundaries if 'ww' has its default value. ! let text = text . "v" . (strlen(template)-1) . "\<space>" if template == phs . phe " template looks like <++> so Change it: --- 395,403 ---- let text = text . ":call search('\\V" . startpat . "', 'W')\<CR>" " Finally, append commands to Select <+template+> or replace <++> . ! " Enter Visual mode and move to the end. Use a search strategy instead of ! " computing the length of the template because strlen() returns different ! " things depending on the encoding. ! let text = text . "v/\\V" . endpat . "/e\<CR>\<ESC>" ! \ . s:RemoveLastHistoryItem . "\<CR>gv" if template == phs . phe " template looks like <++> so Change it: *************** *** 398,536 **** return text endfunction ! " Old version: function! Tex_PutTextWithMovement(text) ! let s:oldenc = &encoding ! if &encoding != 'latin1' ! let &encoding='latin1' ! endif ! ! let text = a:text ! ! " if the user doesnt want to use place-holders, then remove them. ! if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders ! " a heavy-handed way to just use the first placeholder or ä and remove ! " the rest. ! " substitute the placeholders with ä ! let text = substitute(text, '«[^»]*»', 'ä', 'g') ! " substitute the first ä with ë ... ! let text = substitute(text, 'ä', 'ë', '') ! " ... now remove all the ä's. ! let text = substitute(text, 'ä', '', 'g') ! " ... and substitute back the first ë with ä ! let text = substitute(text, 'ë', 'ä', '') ! endif ! ! " change the default values of the place-holder variables. ! let phs = '«' ! if exists('b:Imap_PlaceHolderStart') ! let phs = b:Imap_PlaceHolderStart ! elseif exists('g:Imap_PlaceHolderStart') ! let phs = g:Imap_PlaceHolderStart ! endif ! let text = substitute(text, '«', phs, 'g') ! let phe = '»' ! if exists('b:Imap_PlaceHolderEnd') ! let phe = b:Imap_PlaceHolderEnd ! elseif exists('g:Imap_PlaceHolderEnd') ! let phe = g:Imap_PlaceHolderEnd ! endif ! let text = substitute(text, '»', phe, 'g') ! ! let fc = match(text, 'ä\|'.phs.'[^'.phe.']*'.phe) ! if fc < 0 ! let initial = "" ! let movement = "" ! " if the place to go to is at the very beginning, then a simple back ! " search will do... ! elseif fc == 0 ! let initial = "" ! let movement = "\<C-\>\<C-N>?ä\<cr>" . s:RemoveLastHistoryItem . "\<cr>s" ! ! " however, if its somewhere in the middle, then we need to go back to the ! " beginning of the pattern and then do a forward lookup from that point. ! else ! ! " hopefully ¡¡IMAPS_Start!! is rare enough. prepend that to the text. ! let initial = "¡¡IMAPS_Start!!" ! " and then do a backwards lookup. this takes us to the beginning. then ! " delete that dummy part. we are left at the very beginning. ! let movement = "\<C-\>\<C-N>?¡¡IMAPS_Start!!\<cr>v".(strlen(initial)-1)."l\"_x" ! ! " now proceed with the forward search for cursor placement ! let movement = movement."/ä\\|".phs."[^".phe."]*".phe."\<cr>" ! ! " we needed 2 searches to get here. remove them from the search ! " history. ! let movement = movement . s:RemoveLastHistoryItem . "\<cr>" ! ! " if its a ä or «», then just delete it ! if text[fc] == 'ä' ! let movement = movement."\"_s" ! elseif strpart(text, fc, 2) == phs.phe ! let movement = movement."\"_2s" ! ! " otherwise enter select mode... ! else ! let movement = movement."v/".iconv(phe, 'latin1', s:oldenc)."\<CR>\<C-g>" ! end ! ! end ! if s:oldenc != 'latin1' ! let &encoding = s:oldenc ! endif ! return initial.text.movement endfunction " }}} ! " IMAP_Jumpfunc: takes user to next «place-holder» {{{ ! " Author: Gergely Kontra ! " taken from mu-template.vim by him This idea is originally ! " from Stephen Riehm's bracketing system. ! " modified by SA to use optional place holder characters. function! IMAP_Jumpfunc() - let s:oldenc = &encoding - if s:oldenc != 'latin1' - setglobal encoding=latin1 - endif - ! let phs = '«' ! let phe = '»' ! ! if exists('b:Imap_PlaceHolderStart') ! let phs = b:Imap_PlaceHolderStart ! elseif exists('g:Imap_PlaceHolderStart') ! let phs = g:Imap_PlaceHolderStart ! endif ! ! if exists('b:Imap_PlaceHolderEnd') ! let phe = b:Imap_PlaceHolderEnd ! elseif exists('g:Imap_PlaceHolderEnd') ! let phe = g:Imap_PlaceHolderEnd ! endif ! ! let phsc = iconv(phs, 'latin1', s:oldenc) ! let phec = iconv(phe, 'latin1', s:oldenc) ! if !search(phsc.'.\{-}'.phec,'W') "no more marks ! echomsg "no marks found\n" ! return "\<CR>" else ! if strpart ( ! \ getline('.'), ! \ col('.') + strlen(phsc) - 1, ! \ strlen(phec) ! \ ! \ ) == phec ! return substitute(phsc.phec, '.', "\<Del>", 'g')."\<C-r>=RestoreEncoding()\<CR>" else if col('.') > 1 ! return "\<Esc>lv/".phec."\<CR>\<Esc>:call RestoreEncoding()\<CR>gv\<C-g>" else ! return "\<C-\>\<C-n>v/".phe."\<CR>\<Esc>:call RestoreEncoding()\<CR>gv\<C-g>" endif endif --- 410,449 ---- return text endfunction ! " Tex_PutTextWithMovement: old version of IMAP_PutTextWithMovement ! " Description: ! " This function is supplied to maintain backward compatibility. ! " This function is only for use in latex-suite. function! Tex_PutTextWithMovement(text) ! let phs = s:PlaceHolderStart() ! let phe = s:PlaceHolderEnd() ! let newText = substitute(a:text, '<+', phs, 'g') ! let newText = substitute(newText, '+>', phe, 'g') ! return IMAP_PutTextWithMovement(newText) endfunction " }}} ! " IMAP_Jumpfunc: takes user to next <+place-holder+> {{{ ! " Author: Luc Hermitte ! " function! IMAP_Jumpfunc() ! let phs = escape(s:PlaceHolderStart(), '\') ! let phe = escape(s:PlaceHolderEnd(), '\') ! if !search(phs.'.\{-}' . phe, 'W') "no more marks ! return "" else ! if strpart(getline('.'), col('.') + strlen(phs) - 1) ! \ =~ '^' . phe ! return substitute(phs . phe, '.', "\<Del>", 'g') else if col('.') > 1 ! return "\<Esc>lv/\\V" . phe . "/e\<CR>\<C-g>" else ! return "\<C-\>\<C-n>v/\\V" . phe . "/e\<CR>\<C-g>" endif endif *************** *** 553,557 **** endfunction " }}} ! nmap <silent> <script> <plug>«SelectRegion» `<v`> " ============================================================================== --- 466,470 ---- endfunction " }}} ! nmap <silent> <script> <plug><+SelectRegion+> `<v`> " ============================================================================== *************** *** 670,674 **** " `<v`> to avoid problems caused by some of the characters in " '`<v`>' being mapped. ! let gotoc = "\<plug>«SelectRegion»" else let gotoc = '' --- 583,587 ---- " `<v`> to avoid problems caused by some of the characters in " '`<v`>' being mapped. ! let gotoc = "\<plug><+SelectRegion+>" else let gotoc = '' |
From: <sri...@us...> - 2002-12-14 06:49:21
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv5135 Modified Files: Tag: b-newimaps imaps.vim Log Message: . adding in Benji's new version of imaps.vim . changed the author from SA to SA + BF. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** imaps.vim 13 Dec 2002 17:24:36 -0000 1.9 --- imaps.vim 14 Dec 2002 06:49:17 -0000 1.9.2.1 *************** *** 1,9 **** " File: imaps.vim ! " Author: Srinath Avadhanula ! " ( sr...@fa... ) ! " WWW: http://robotics.eecs.berkeley.edu/~srinath/vim/.vim/imaps.vim " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Documentation: {{{ --- 1,12 ---- " File: imaps.vim ! " Authors: Srinath Avadhanula <srinath AT fastmail.fm> ! " Benji Fisher <benji AT member.AMS.org> ! " ! " WWW: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/vim-latex/vimfiles/plugin/imaps.vim?only_with_tag=MAIN ! " " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " ! " Last Change: Fri Dec 13 10:00 PM 2002 PST " " Documentation: {{{ *************** *** 98,101 **** --- 101,118 ---- " ============================================================================== + " Script variables + " ============================================================================== + " {{{ + " A lot of back-spaces, to be used by IMAP(). If needed, more will be added + " automatically. + let s:backsp = substitute("0123456789", '\d', "\<bs>", 'g') + " s:LHS_{ft}_{char} will be generated automatically. It will look like + " s:LHS_tex_o = 'fo\|foo\|boo' and contain all mapped sequences ending in "o". + " s:Map_{ft}_{lhs} will be generated automatically. It will look like + " s:Map_c_foo = 'for(<++>; <++>; <++>)', the mapping for "foo". + " + " }}} + + " ============================================================================== " functions for easy insert mode mappings. " ============================================================================== *************** *** 122,125 **** --- 139,181 ---- " the previously typed characters and erased and the right hand side is " inserted + function! IMAP(ft, lhs, ...) + let lastLHSChar = a:lhs[strlen(a:lhs)-1] + " Make sure that s:backsp is long enough: + while strlen(s:backsp) < strlen(a:lhs) + let s:backsp = s:backsp . s:backsp + endwhile + " Add a:lhs to the list of left-hand sides that end with lastLHSChar: + if !exists("s:LHS_" . a:ft . "_" . s:Hash(lastLHSChar)) + let s:LHS_{a:ft}_{s:Hash(lastLHSChar)} = escape(a:lhs, '\') + else + let s:LHS_{a:ft}_{s:Hash(lastLHSChar)} = escape(a:lhs, "\\") . '\|' . + \ s:LHS_{a:ft}_{s:Hash(lastLHSChar)} + endif + " Build up the right-hand side: + let rhs = "" + let phs = s:PlaceHolderStart() + let phe = s:PlaceHolderEnd() + let i = 1 " counter for arguments + let template = 0 " flag: is the current argument a <+template+> ? + while i <= a:0 + if template + let rhs = rhs . phs . a:{i} . phe + else + let rhs = rhs . a:{i} + endif + let i = i+1 + let template = !template + endwhile + let s:Map_{a:ft}_{s:Hash(a:lhs)} = rhs + + " map only the last character of the left-hand side. + if lastLHSChar == ' ' + let lastLHSChar = '<space>' + end + exe 'inoremap <silent>' escape(lastLHSChar, '|') + \ '<C-r>=<SID>NewLookupCharacter("' . escape(lastLHSChar, '\|') . + \ '")<CR>' + endfunction + " Old version: function! Tex_IMAP(lhs, rhs, ft) let lastLHSChar = a:lhs[strlen(a:lhs)-1] *************** *** 192,195 **** --- 248,277 ---- " character and then if a possible match exists, erases the left-hand side " and inserts the right-hand side instead. + function! s:NewLookupCharacter(char) + let charHash = s:Hash(a:char) + + if exists("s:LHS_" . &ft . "_" . charHash) + let ft = &ft + elseif exists("s:LHS__" . charHash) + let ft = "" + else + return a:char + endif + " Find the longest left-hand side that matches the line so far. + " Use '\V' (very no-magic) so that only '\' is special, and it was already + " escaped when building up s:LHS_{ft}_{charHash} . + let text = strpart(getline("."), 0, col(".")-1) . a:char + let lhs = matchstr(text, '\V\(' . s:LHS_{ft}_{charHash} . '\)\$') + if strlen(lhs) == 0 + return a:char + endif + " enough back-spaces to erase the left-hand side; -1 for the last + " character typed: + let bs = substitute(strpart(lhs, 1), ".", "\<bs>", "g") + " Execute this string to get to the start of the replacement text: + let mark = line(".") . "norm!" . (virtcol(".") - strlen(lhs) + 1) . "|" + return bs . IMAP_PutTextWithMovement(s:Map_{ft}_{s:Hash(lhs)}, mark) + endfunction + " Old version: function! <SID>LookupCharacter(char) let charHash = char2nr(a:char) *************** *** 269,272 **** --- 351,402 ---- " IMAP_PutTextWithMovement: appends movement commands to a text {{{ " This enables which cursor placement. + function! IMAP_PutTextWithMovement(text, mark) + + let text = a:text + let phs = s:PlaceHolderStart() + let phe = s:PlaceHolderEnd() + let startpat = escape(phs, '\') + let endpat = escape(phe, '\') + + " If the user does not want to use place-holders, then remove them. + if exists('g:Imap_UsePlaceHolders') && !g:Imap_UsePlaceHolders + " a heavy-handed way to just use the first placeholder and remove the + " rest. Replace the first template with phe ... + let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, endpat, '') + " ... delete all the others ... + let text = substitute(text, '\V'.startpat.'\.\{-}'.endpat, '', '') + " ... and replace phe with phs.phe . + let text = substitute(text, '\V'.endpat, startpat.endpat, '') + endif + + " template = first <+{...}+> in text, where {...} may be empty. + let template = matchstr(text, '\V' . startpat . '\.\{-}' . endpat) + " If there are no place holders, just return the text. + if strlen(template) == 0 + return text + endif + + " Now, start building the return value. + " Return to Normal mode: this works even if 'insertmode' is set: + let text = text . "\<C-\>\<C-N>" + " Start at the position given by mark: + let text = text . ":" . a:mark . "\<CR>" + " Look for the first place holder: + let text = text . ":call search('\\V" . startpat . "', 'W')\<CR>" + " Finally, append commands to Select <+template+> or replace <++> . + " Enter Visual mode and move to the end. Note that <space> can cross line + " boundaries if 'ww' has its default value. + let text = text . "v" . (strlen(template)-1) . "\<space>" + if template == phs . phe + " template looks like <++> so Change it: + let text = text . "c" + else + " Enter Select mode. + let text = text . "\<C-G>" + endif + + return text + endfunction + " Old version: function! Tex_PutTextWithMovement(text) *************** *** 566,569 **** --- 696,725 ---- " }}} + " Hash: Return a version of a string that can be used as part of a variable" {{{ + " name. + fun! s:Hash(text) + return substitute(a:text, '\([^[:alnum:]]\)', + \ '\="_".char2nr(submatch(1))."_"', 'g') + endfun + "" }}} + " PlaceHolderStart and PlaceHolderEnd: return the buffer-local " {{{ + " variable, or the global one, or the default. + fun! s:PlaceHolderStart() + if exists("b:Imap_PlaceHolderStart") + return b:Imap_PlaceHolderStart + elseif exists("g:Imap_PlaceHolderStart") + return g:Imap_PlaceHolderStart + else + return "<+" + endfun + fun! s:PlaceHolderEnd() + if exists("b:Imap_PlaceHolderEnd") + return b:Imap_PlaceHolderEnd + elseif exists("g:Imap_PlaceHolderEnd") + return g:Imap_PlaceHolderEnd + else + return "+>" + endfun + " }}} " ============================================================================== *************** *** 602,604 **** " }}} ! " vim6:fdm=marker:nowrap --- 758,760 ---- " }}} ! " vim:ft=vim:ts=4:sw=4:noet:fdm=marker:commentstring=\"\ %s:nowrap |
From: <mi...@us...> - 2002-12-13 17:58:39
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv9230 Modified Files: newalg schedule Log Message: fixed package files Index: newalg =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/newalg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newalg 23 Nov 2002 17:18:00 -0000 1.1 --- newalg 13 Dec 2002 17:58:31 -0000 1.2 *************** *** 2,9 **** let g:TeX_package_newalg = ! \ 'ens:algorithm{«name»}{«»},' ! \.'ens:IF{«cond»},' ! \.'ens:FOR{«loop»},' ! \.'ens:WHILE{«cond»},' \.'bra:ERROR,' \.'nor:ELSE,' --- 2,9 ---- let g:TeX_package_newalg = ! \ 'ens:algorithm:{«name»}{«»},' ! \.'ens:IF:{«cond»},' ! \.'ens:FOR:{«loop»},' ! \.'ens:WHILE:{«cond»},' \.'bra:ERROR,' \.'nor:ELSE,' Index: schedule =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/schedule,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** schedule 23 Nov 2002 17:18:00 -0000 1.1 --- schedule 13 Dec 2002 17:58:32 -0000 1.2 *************** *** 2,6 **** let g:TeX_package_schedule = ! \ 'ens:schedule[«title»],' \.'bra:CellHeight,' \.'bra:CellWidth,' --- 2,6 ---- let g:TeX_package_schedule = ! \ 'ens:schedule:[«title»],' \.'bra:CellHeight,' \.'bra:CellWidth,' *************** *** 12,13 **** --- 12,15 ---- \.'nor:SevenDay,' \.'brs:NewAppointment{«name»}{«bg»}{«fg»}' + + " vim:ft=vim:ff=unix |
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv9130 Added Files: accents footmisc graphicx caption2 color float ifthen moreverbatim Log Message: new package files --- NEW FILE: accents --- let g:TeX_package_option_accents = \ 'nonscript,' \.'single' let g:TeX_package_accents = \ 'bra:grave,' \.'bra:acute,' \.'bra:check,' \.'bra:breve,' \.'bra:bar,' \.'bra:ring,' \.'bra:hat,' \.'bra:dot,' \.'bra:tilde,' \.'bra:undertilde,' \.'bra:ddot,' \.'bra:dddot,' \.'bra:ddddot,' \.'bra:vec,' \.'brd:accentset,' \.'brd:underaccent,' " vim:ft=vim:ff=unix --- NEW FILE: footmisc --- let g:TeX_package_option_footmisc = \ 'bottom,' \.'flushmargin,' \.'marginal,' \.'multiple,' \.'norule,' \.'para,' \.'perpage,' \.'splitrule,' \.'stable,' \.'symbol,' \.'symbol+' let g:TeX_package_footmisc = '' " vim:ft=vim:ff=unix --- NEW FILE: graphicx --- let g:TeX_package_option_graphicx = \ 'sbr:Drivers,' \.'xdvi,' \.'dvipdf,' \.'dvipdfm,' \.'pdftex,' \.'dvipsone,' \.'dviwindo,' \.'emtex,' \.'dviwin,' \.'oztex,' \.'textures,' \.'pctexps,' \.'pctexwin,' \.'pctexhp,' \.'pctex32,' \.'truetex,' \.'tcidvi,' \.'vtex,' \.'sbr:Rest,' \.'debugshow,' \.'draft,' \.'final,' \.'hiderotate,' \.'hiresbb,' \.'hidescale,' \.'unknownkeysallowed,' \.'unknownkeyserror' let g:TeX_package_graphicx = \ 'sbr:Includegraphics,' \.'nob:includegraphics,' \.'spe:height=,' \.'spe:width=,' \.'spe:keepaspectratio=,' \.'spe:totalheight=,' \.'spe:angle=,' \.'spe:scale=,' \.'spe:origin=,' \.'spe:clip,' \.'spe:bb=,' \.'spe:viewport=,' \.'spe:trim=,' \.'spe:draft,' \.'spe:hiresbb,' \.'spe:type=,' \.'spe:ext=,' \.'spe:read=,' \.'spe:command=,' \.'sbr:Rotatebox,' \.'brs:rotatebox[«»]{«»}{«»},' \.'spe:origin=,' \.'spe:x=,' \.'spe:y=,' \.'spe:units=,' \.'sbr:Rest,' \.'brs:scalebox{«»}[«»]{«»},' \.'brs:resizebox{«»}{«»}{«»},' \.'brs:resizebox*{«»}{«»}{«»},' \.'bra:DeclareGraphicsExtensions,' \.'brs:DeclareGraphicsRule{«»}{«»}{«»}{«»},' \.'bra:graphicspath' " vim:ft=vim:ff=unix --- NEW FILE: caption2 --- let g:TeX_package_option_caption2 = \ 'scriptsize,' \.'footnotesize,' \.'small,' \.'normalsize,' \.'large,' \.'Large,' \.'up,' \.'it,' \.'sl,' \.'sc,' \.'md,' \.'bf,' \.'rm,' \.'sf,' \.'tt,' \.'ruled,' \.'boxed,' \.'centerlast,' \.'anne,' \.'center,' \.'flushleft,' \.'flushright,' \.'oneline,' \.'nooneline,' \.'hang,' \.'isu,' \.'indent,' \.'longtable' let g:TeX_package_caption2 = \ 'bra:captionsize,' \.'bra:captionfont,' \.'bra:captionlabelfont,' \.'bra:setcaptionmargin,' \.'bra:setcaptionwidth' " vim:ft=vim:ff=unix --- NEW FILE: color --- let g:TeX_package_option_color = \ 'monochrome,' \.'debugshow,' \.'dvips,' \.'xdvi,' \.'dvipdf,' \.'pdftex,' \.'dvipsone,' \.'dviwindo,' \.'emtex,' \.'dviwin,' \.'oztex,' \.'textures,' \.'pctexps,' \.'pctexwin,' \.'pctexhp,' \.'pctex32,' \.'truetex,' \.'tcidvi,' \.'dvipsnames,' \.'nodvipsnames,' \.'usenames' let g:TeX_package_color = \ 'brs:definecolor{«»}{«»}{«»},' \.'brs:DefineNamedColor{«»}{«»}{«»}{«»},' \.'bra:color,' \.'nob:color,' \.'brd:textcolor,' \.'brs:textcolor[«»]{«»}{«»},' \.'brd:colorbox,' \.'brs:colorbox[«»]{«»}{«»},' \.'brs:fcolorbox{«»}{«»}{«»},' \.'brs:fcolorbox[«»]{«»}{«»}{«»},' \.'brd:pagecolor,' \.'nob:pagecolor' " vim:ft=vim:ff=unix --- NEW FILE: float --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ifthen --- (This appears to be a binary file; contents omitted.) --- NEW FILE: moreverbatim --- (This appears to be a binary file; contents omitted.) |
From: <ma...@us...> - 2002-12-13 17:25:44
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv987/ftplugin/latex-suite Modified Files: bibtex.vim custommacros.vim diacritics.vim elementmacros.vim envmacros.vim main.vim mathmacros.vim packages.vim wizardfuncs.vim Log Message: I replaced IMAP() with Tex_IMAP() and IMAP_PutTextWithMovement() with Tex_PutTextWithMovement() This is a preliminary step before rewriting these two functions. Index: bibtex.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/bibtex.vim,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** bibtex.vim 30 Apr 2002 00:03:14 -0000 1.1.1.1 --- bibtex.vim 13 Dec 2002 17:23:43 -0000 1.2 *************** *** 3,7 **** " Function: BibT " Author: Alan G Isaac <ai...@am...> ! " Last Change: Fri Apr 26 10:00 PM 2002 PDT "============================================================================= --- 3,7 ---- " Function: BibT " Author: Alan G Isaac <ai...@am...> ! " Last Change: Fri Dec 13 12:00 PM 2002 EST "============================================================================= *************** *** 11,17 **** 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 {{{ --- 11,17 ---- let s:done = 1 ! call Tex_IMAP ('BBA', "\<C-r>=BibT('article', '', 0)\<CR>", 'bib') ! call Tex_IMAP ('BBB', "\<C-r>=BibT('inproceedings', '', 0)\<CR>", 'bib') ! call Tex_IMAP ('BAS', "\<C-r>=BibT('', '', 0)\<CR>", 'bib') " BibT: function to generate a formatted bibtex entry {{{ *************** *** 251,255 **** let retval = retval."}«»"."\n" ! return IMAP_PutTextWithMovement(retval) endfunction --- 251,255 ---- let retval = retval."}«»"."\n" ! return Tex_PutTextWithMovement(retval) endfunction Index: custommacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/custommacros.vim,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** custommacros.vim 6 Dec 2002 06:36:00 -0000 1.7 --- custommacros.vim 13 Dec 2002 17:23:46 -0000 1.8 *************** *** 4,8 **** " Version: 1.0 " Created: Tue Apr 23 05:00 PM 2002 PST ! " Last Change: Thu Dec 05 10:00 PM 2002 PST " " Description: functions for processing custom macros in the --- 4,8 ---- " Version: 1.0 " Created: Tue Apr 23 05:00 PM 2002 PST ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Description: functions for processing custom macros in the *************** *** 109,113 **** call Tex_CleanSearchHistory() ! silent! exec "normal! i\<C-r>='¡!¡Start here¡!¡'.IMAP_PutTextWithMovement(@a)\<CR>" let pos = line('.').'| normal! '.virtcol('.').'|' --- 109,113 ---- call Tex_CleanSearchHistory() ! silent! exec "normal! i\<C-r>='¡!¡Start here¡!¡'.Tex_PutTextWithMovement(@a)\<CR>" let pos = line('.').'| normal! '.virtcol('.').'|' Index: diacritics.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/diacritics.vim,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** diacritics.vim 30 Apr 2002 00:03:15 -0000 1.1.1.1 --- diacritics.vim 13 Dec 2002 17:23:51 -0000 1.2 *************** *** 3,7 **** " Author: Lubomir Host " Created: Tue Apr 23 07:00 PM 2002 PST ! " Last Change: Fri Apr 26 03:00 PM 2002 PDT " " Description: shortcuts for all diacritics. --- 3,7 ---- " Author: Lubomir Host " Created: Tue Apr 23 07:00 PM 2002 PST ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Description: shortcuts for all diacritics. *************** *** 13,125 **** " \'{a} {{{ ! call IMAP ('=a', "\\\'{a}", 'tex') ! call IMAP ('=b', "\\'{b}", 'tex') ! call IMAP ('=c', "\\'{c}", 'tex') ! call IMAP ('=d', "\\'{d}", 'tex') ! call IMAP ('=e', "\\'{e}", 'tex') ! call IMAP ('=f', "\\'{f}", 'tex') ! call IMAP ('=g', "\\'{g}", 'tex') ! call IMAP ('=h', "\\'{h}", 'tex') ! call IMAP ('=i', "\\'{\i}", 'tex') ! call IMAP ('=j', "\\'{j}", 'tex') ! call IMAP ('=k', "\\'{k}", 'tex') ! call IMAP ('=l', "\\'{l}", 'tex') ! call IMAP ('=m', "\\'{m}", 'tex') ! call IMAP ('=n', "\\'{n}", 'tex') ! call IMAP ('=o', "\\'{o}", 'tex') ! call IMAP ('=p', "\\'{p}", 'tex') ! call IMAP ('=q', "\\'{q}", 'tex') ! call IMAP ('=r', "\\'{r}", 'tex') ! call IMAP ('=s', "\\'{s}", 'tex') ! call IMAP ('=t', "\\'{t}", 'tex') ! call IMAP ('=u', "\\'{u}", 'tex') ! call IMAP ('=v', "\\'{v}", 'tex') ! call IMAP ('=w', "\\'{w}", 'tex') ! call IMAP ('=x', "\\'{x}", 'tex') ! call IMAP ('=y', "\\'{y}", 'tex') ! call IMAP ('=z', "\\'{z}", 'tex') ! call IMAP ('=A', "\\'{A}", 'tex') ! call IMAP ('=B', "\\'{B}", 'tex') ! call IMAP ('=C', "\\'{C}", 'tex') ! call IMAP ('=D', "\\'{D}", 'tex') ! call IMAP ('=E', "\\'{E}", 'tex') ! call IMAP ('=F', "\\'{F}", 'tex') ! call IMAP ('=G', "\\'{G}", 'tex') ! call IMAP ('=H', "\\'{H}", 'tex') ! call IMAP ('=I', "\\'{\I}", 'tex') ! call IMAP ('=J', "\\'{J}", 'tex') ! call IMAP ('=K', "\\'{K}", 'tex') ! call IMAP ('=L', "\\'{L}", 'tex') ! call IMAP ('=M', "\\'{M}", 'tex') ! call IMAP ('=N', "\\'{N}", 'tex') ! call IMAP ('=O', "\\'{O}", 'tex') ! call IMAP ('=P', "\\'{P}", 'tex') ! call IMAP ('=Q', "\\'{Q}", 'tex') ! call IMAP ('=R', "\\'{R}", 'tex') ! call IMAP ('=S', "\\'{S}", 'tex') ! call IMAP ('=T', "\\'{T}", 'tex') ! call IMAP ('=U', "\\'{U}", 'tex') ! call IMAP ('=V', "\\'{V}", 'tex') ! call IMAP ('=W', "\\'{W}", 'tex') ! call IMAP ('=X', "\\'{X}", 'tex') ! call IMAP ('=Y', "\\'{Y}", 'tex') ! call IMAP ('=Z', "\\'{Z}", 'tex') " }}} " \v{a} {{{ ! call IMAP ('+a', "\\v{a}", 'tex') ! call IMAP ('+b', "\\v{b}", 'tex') ! call IMAP ('+c', "\\v{c}", 'tex') ! call IMAP ('+d', "\\v{d}", 'tex') ! call IMAP ('+e', "\\v{e}", 'tex') ! call IMAP ('+f', "\\v{f}", 'tex') ! call IMAP ('+g', "\\v{g}", 'tex') ! call IMAP ('+h', "\\v{h}", 'tex') ! call IMAP ('+i', "\\v{\i}", 'tex') ! call IMAP ('+j', "\\v{j}", 'tex') ! call IMAP ('+k', "\\v{k}", 'tex') ! call IMAP ('+l', "\\q l", 'tex') ! call IMAP ('+m', "\\v{m}", 'tex') ! call IMAP ('+n', "\\v{n}", 'tex') ! call IMAP ('+o', "\\v{o}", 'tex') ! call IMAP ('+p', "\\v{p}", 'tex') ! call IMAP ('+q', "\\v{q}", 'tex') ! call IMAP ('+r', "\\v{r}", 'tex') ! call IMAP ('+s', "\\v{s}", 'tex') ! call IMAP ('+t', "\\q t", 'tex') ! call IMAP ('+u', "\\v{u}", 'tex') ! call IMAP ('+v', "\\v{v}", 'tex') ! call IMAP ('+w', "\\v{w}", 'tex') ! call IMAP ('+x', "\\v{x}", 'tex') ! call IMAP ('+y', "\\v{y}", 'tex') ! call IMAP ('+z', "\\v{z}", 'tex') ! call IMAP ('+A', "\\v{A}", 'tex') ! call IMAP ('+B', "\\v{B}", 'tex') ! call IMAP ('+C', "\\v{C}", 'tex') ! call IMAP ('+D', "\\v{D}", 'tex') ! call IMAP ('+E', "\\v{E}", 'tex') ! call IMAP ('+F', "\\v{F}", 'tex') ! call IMAP ('+G', "\\v{G}", 'tex') ! call IMAP ('+H', "\\v{H}", 'tex') ! call IMAP ('+I', "\\v{\I}", 'tex') ! call IMAP ('+J', "\\v{J}", 'tex') ! call IMAP ('+K', "\\v{K}", 'tex') ! call IMAP ('+L', "\\v{L}", 'tex') ! call IMAP ('+M', "\\v{M}", 'tex') ! call IMAP ('+N', "\\v{N}", 'tex') ! call IMAP ('+O', "\\v{O}", 'tex') ! call IMAP ('+P', "\\v{P}", 'tex') ! call IMAP ('+Q', "\\v{Q}", 'tex') ! call IMAP ('+R', "\\v{R}", 'tex') ! call IMAP ('+S', "\\v{S}", 'tex') ! call IMAP ('+T', "\\v{T}", 'tex') ! call IMAP ('+U', "\\v{U}", 'tex') ! call IMAP ('+V', "\\v{V}", 'tex') ! call IMAP ('+W', "\\v{W}", 'tex') ! call IMAP ('+X', "\\v{X}", 'tex') ! call IMAP ('+Y', "\\v{Y}", 'tex') ! call IMAP ('+Z', "\\v{Z}", 'tex') " }}} ! call IMAP ('+}', "\\\"{a}", 'tex') ! call IMAP ('+:', "\\^{o}", 'tex') " vim:fdm=marker:ts=4:sw=4:noet --- 13,125 ---- " \'{a} {{{ ! call Tex_IMAP ('=a', "\\\'{a}", 'tex') ! call Tex_IMAP ('=b', "\\'{b}", 'tex') ! call Tex_IMAP ('=c', "\\'{c}", 'tex') ! call Tex_IMAP ('=d', "\\'{d}", 'tex') ! call Tex_IMAP ('=e', "\\'{e}", 'tex') ! call Tex_IMAP ('=f', "\\'{f}", 'tex') ! call Tex_IMAP ('=g', "\\'{g}", 'tex') ! call Tex_IMAP ('=h', "\\'{h}", 'tex') ! call Tex_IMAP ('=i', "\\'{\i}", 'tex') ! call Tex_IMAP ('=j', "\\'{j}", 'tex') ! call Tex_IMAP ('=k', "\\'{k}", 'tex') ! call Tex_IMAP ('=l', "\\'{l}", 'tex') ! call Tex_IMAP ('=m', "\\'{m}", 'tex') ! call Tex_IMAP ('=n', "\\'{n}", 'tex') ! call Tex_IMAP ('=o', "\\'{o}", 'tex') ! call Tex_IMAP ('=p', "\\'{p}", 'tex') ! call Tex_IMAP ('=q', "\\'{q}", 'tex') ! call Tex_IMAP ('=r', "\\'{r}", 'tex') ! call Tex_IMAP ('=s', "\\'{s}", 'tex') ! call Tex_IMAP ('=t', "\\'{t}", 'tex') ! call Tex_IMAP ('=u', "\\'{u}", 'tex') ! call Tex_IMAP ('=v', "\\'{v}", 'tex') ! call Tex_IMAP ('=w', "\\'{w}", 'tex') ! call Tex_IMAP ('=x', "\\'{x}", 'tex') ! call Tex_IMAP ('=y', "\\'{y}", 'tex') ! call Tex_IMAP ('=z', "\\'{z}", 'tex') ! call Tex_IMAP ('=A', "\\'{A}", 'tex') ! call Tex_IMAP ('=B', "\\'{B}", 'tex') ! call Tex_IMAP ('=C', "\\'{C}", 'tex') ! call Tex_IMAP ('=D', "\\'{D}", 'tex') ! call Tex_IMAP ('=E', "\\'{E}", 'tex') ! call Tex_IMAP ('=F', "\\'{F}", 'tex') ! call Tex_IMAP ('=G', "\\'{G}", 'tex') ! call Tex_IMAP ('=H', "\\'{H}", 'tex') ! call Tex_IMAP ('=I', "\\'{\I}", 'tex') ! call Tex_IMAP ('=J', "\\'{J}", 'tex') ! call Tex_IMAP ('=K', "\\'{K}", 'tex') ! call Tex_IMAP ('=L', "\\'{L}", 'tex') ! call Tex_IMAP ('=M', "\\'{M}", 'tex') ! call Tex_IMAP ('=N', "\\'{N}", 'tex') ! call Tex_IMAP ('=O', "\\'{O}", 'tex') ! call Tex_IMAP ('=P', "\\'{P}", 'tex') ! call Tex_IMAP ('=Q', "\\'{Q}", 'tex') ! call Tex_IMAP ('=R', "\\'{R}", 'tex') ! call Tex_IMAP ('=S', "\\'{S}", 'tex') ! call Tex_IMAP ('=T', "\\'{T}", 'tex') ! call Tex_IMAP ('=U', "\\'{U}", 'tex') ! call Tex_IMAP ('=V', "\\'{V}", 'tex') ! call Tex_IMAP ('=W', "\\'{W}", 'tex') ! call Tex_IMAP ('=X', "\\'{X}", 'tex') ! call Tex_IMAP ('=Y', "\\'{Y}", 'tex') ! call Tex_IMAP ('=Z', "\\'{Z}", 'tex') " }}} " \v{a} {{{ ! call Tex_IMAP ('+a', "\\v{a}", 'tex') ! call Tex_IMAP ('+b', "\\v{b}", 'tex') ! call Tex_IMAP ('+c', "\\v{c}", 'tex') ! call Tex_IMAP ('+d', "\\v{d}", 'tex') ! call Tex_IMAP ('+e', "\\v{e}", 'tex') ! call Tex_IMAP ('+f', "\\v{f}", 'tex') ! call Tex_IMAP ('+g', "\\v{g}", 'tex') ! call Tex_IMAP ('+h', "\\v{h}", 'tex') ! call Tex_IMAP ('+i', "\\v{\i}", 'tex') ! call Tex_IMAP ('+j', "\\v{j}", 'tex') ! call Tex_IMAP ('+k', "\\v{k}", 'tex') ! call Tex_IMAP ('+l', "\\q l", 'tex') ! call Tex_IMAP ('+m', "\\v{m}", 'tex') ! call Tex_IMAP ('+n', "\\v{n}", 'tex') ! call Tex_IMAP ('+o', "\\v{o}", 'tex') ! call Tex_IMAP ('+p', "\\v{p}", 'tex') ! call Tex_IMAP ('+q', "\\v{q}", 'tex') ! call Tex_IMAP ('+r', "\\v{r}", 'tex') ! call Tex_IMAP ('+s', "\\v{s}", 'tex') ! call Tex_IMAP ('+t', "\\q t", 'tex') ! call Tex_IMAP ('+u', "\\v{u}", 'tex') ! call Tex_IMAP ('+v', "\\v{v}", 'tex') ! call Tex_IMAP ('+w', "\\v{w}", 'tex') ! call Tex_IMAP ('+x', "\\v{x}", 'tex') ! call Tex_IMAP ('+y', "\\v{y}", 'tex') ! call Tex_IMAP ('+z', "\\v{z}", 'tex') ! call Tex_IMAP ('+A', "\\v{A}", 'tex') ! call Tex_IMAP ('+B', "\\v{B}", 'tex') ! call Tex_IMAP ('+C', "\\v{C}", 'tex') ! call Tex_IMAP ('+D', "\\v{D}", 'tex') ! call Tex_IMAP ('+E', "\\v{E}", 'tex') ! call Tex_IMAP ('+F', "\\v{F}", 'tex') ! call Tex_IMAP ('+G', "\\v{G}", 'tex') ! call Tex_IMAP ('+H', "\\v{H}", 'tex') ! call Tex_IMAP ('+I', "\\v{\I}", 'tex') ! call Tex_IMAP ('+J', "\\v{J}", 'tex') ! call Tex_IMAP ('+K', "\\v{K}", 'tex') ! call Tex_IMAP ('+L', "\\v{L}", 'tex') ! call Tex_IMAP ('+M', "\\v{M}", 'tex') ! call Tex_IMAP ('+N', "\\v{N}", 'tex') ! call Tex_IMAP ('+O', "\\v{O}", 'tex') ! call Tex_IMAP ('+P', "\\v{P}", 'tex') ! call Tex_IMAP ('+Q', "\\v{Q}", 'tex') ! call Tex_IMAP ('+R', "\\v{R}", 'tex') ! call Tex_IMAP ('+S', "\\v{S}", 'tex') ! call Tex_IMAP ('+T', "\\v{T}", 'tex') ! call Tex_IMAP ('+U', "\\v{U}", 'tex') ! call Tex_IMAP ('+V', "\\v{V}", 'tex') ! call Tex_IMAP ('+W', "\\v{W}", 'tex') ! call Tex_IMAP ('+X', "\\v{X}", 'tex') ! call Tex_IMAP ('+Y', "\\v{Y}", 'tex') ! call Tex_IMAP ('+Z', "\\v{Z}", 'tex') " }}} ! call Tex_IMAP ('+}', "\\\"{a}", 'tex') ! call Tex_IMAP ('+:', "\\^{o}", 'tex') " vim:fdm=marker:ts=4:sw=4:noet Index: elementmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/elementmacros.vim,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** elementmacros.vim 10 Nov 2002 22:11:48 -0000 1.4 --- elementmacros.vim 13 Dec 2002 17:23:55 -0000 1.5 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: nie lis 10 11:00 2002 C " " Description: macros for dimensions/fonts/counters. --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Description: macros for dimensions/fonts/counters. *************** *** 55,59 **** exe "vnoremap <silent> ".g:Tex_Leader.vislhs. \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" ! exe 'call IMAP ("'.a:font.'", "\\text'.vislhs.'{ä}«»", "tex")' endif --- 55,59 ---- exe "vnoremap <silent> ".g:Tex_Leader.vislhs. \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" ! exe 'call Tex_IMAP ("'.a:font.'", "\\text'.vislhs.'{ä}«»", "tex")' endif *************** *** 62,66 **** let location = s:fontMenuLoc.substitute(a:fam, '^.', '\u&', '').'.'.vislhs.a:fam.'<tab>'.a:font.'\ ('.g:Tex_Leader.vislhs.')' exe "amenu ".location. ! \" <plug><C-r>=IMAP_PutTextWithMovement('\\text".vislhs."{ä}«»')<CR>" exe "vmenu ".location. \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" --- 62,66 ---- let location = s:fontMenuLoc.substitute(a:fam, '^.', '\u&', '').'.'.vislhs.a:fam.'<tab>'.a:font.'\ ('.g:Tex_Leader.vislhs.')' exe "amenu ".location. ! \" <plug><C-r>=Tex_PutTextWithMovement('\\text".vislhs."{ä}«»')<CR>" exe "vmenu ".location. \" \<C-\\>\<C-N>:call VEnclose('\\text".vislhs."{', '}', '{\\".vislhs.a:fam." ', '}')<CR>" *************** *** 75,79 **** let location = s:fontMenuLoc.'&Diacritics.'.a:name.'<tab>' exe 'amenu '.location. ! \" <plug><C-r>=IMAP_PutTextWithMovement('\\".a:rhs."{«»}«»')<CR>" exe 'vmenu '.location. \" \<C-\\>\<C-n>:call VEnclose('\\".a:rhs."{', '}', '', '')<CR>" --- 75,79 ---- let location = s:fontMenuLoc.'&Diacritics.'.a:name.'<tab>' exe 'amenu '.location. ! \" <plug><C-r>=Tex_PutTextWithMovement('\\".a:rhs."{«»}«»')<CR>" exe 'vmenu '.location. \" \<C-\\>\<C-n>:call VEnclose('\\".a:rhs."{', '}', '', '')<CR>" *************** *** 90,94 **** function! <SID>Tex_Fontfont(desc, lhs) let location = s:fontMenuLoc.'&font.'.a:desc.'<tab>' ! exe "amenu ".location." <plug><C-r>=IMAP_PutTextWithMovement('".a:lhs."')<CR>" exe "vunmenu ".location endfunction " }}} --- 90,94 ---- function! <SID>Tex_Fontfont(desc, lhs) let location = s:fontMenuLoc.'&font.'.a:desc.'<tab>' ! exe "amenu ".location." <plug><C-r>=Tex_PutTextWithMovement('".a:lhs."')<CR>" exe "vunmenu ".location endfunction " }}} *************** *** 108,112 **** function! <SID>Tex_VariousMenus(desc, lhs) let location = s:variousMenuLoc.a:desc.'<tab>' ! exe "amenu ".location." <plug><C-r>=IMAP_PutTextWithMovement('".a:lhs."')<CR>" exe "vunmenu ".location endfunction " }}} --- 108,112 ---- function! <SID>Tex_VariousMenus(desc, lhs) let location = s:variousMenuLoc.a:desc.'<tab>' ! exe "amenu ".location." <plug><C-r>=Tex_PutTextWithMovement('".a:lhs."')<CR>" exe "vunmenu ".location endfunction " }}} *************** *** 132,136 **** " the \emph is special. if g:Tex_FontMaps | exe "vnoremap <silent> ".g:Tex_Leader."em \<C-\\>\<C-N>:call VEnclose('\\emph{', '}', '{\\em', '\\/}')<CR>" | endif ! if g:Tex_FontMaps | exe 'call IMAP ("FEM", "\\emph{ä}«»", "tex")' | endif " }}} --- 132,136 ---- " the \emph is special. if g:Tex_FontMaps | exe "vnoremap <silent> ".g:Tex_Leader."em \<C-\\>\<C-N>:call VEnclose('\\emph{', '}', '{\\em', '\\/}')<CR>" | endif ! if g:Tex_FontMaps | exe 'call Tex_IMAP ("FEM", "\\emph{ä}«»", "tex")' | endif " }}} Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** envmacros.vim 6 Dec 2002 09:44:06 -0000 1.11 --- envmacros.vim 13 Dec 2002 17:23:59 -0000 1.12 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 08:00 PM 2002 PST ! " Last Change: Fri Dec 06 12:00 AM 2002 PST " " Description: mappings/menus for environments. --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 08:00 PM 2002 PST ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Description: mappings/menus for environments. *************** *** 74,78 **** if g:Tex_EnvironmentMaps && !exists('s:doneOnce') ! call IMAP (a:lhs, '\begin{'.a:name."}\<CR>".extra."«»\<CR>\\end{".a:name."}«»", 'tex') exec 'vnoremap <silent> '.vlhs.' '.vrhs endif --- 74,78 ---- if g:Tex_EnvironmentMaps && !exists('s:doneOnce') ! call Tex_IMAP (a:lhs, '\begin{'.a:name."}\<CR>".extra."«»\<CR>\\end{".a:name."}«»", 'tex') exec 'vnoremap <silent> '.vlhs.' '.vrhs endif *************** *** 113,117 **** if g:Tex_EnvironmentMaps && !exists('s:doneOnce') ! call IMAP(a:lhs, a:irhs, 'tex') exec 'vnoremap '.vlhs.' '.vrhs endif --- 113,117 ---- if g:Tex_EnvironmentMaps && !exists('s:doneOnce') ! call Tex_IMAP(a:lhs, a:irhs, 'tex') exec 'vnoremap '.vlhs.' '.vrhs endif *************** *** 123,127 **** exe 'amenu '.location.' <plug><C-r>=Tex_DoEnvironment("'.a:name.'")<CR>' else ! exe 'amenu '.location." <plug><C-r>=IMAP_PutTextWithMovement('".a:irhs."')<CR>" endif exe 'vmenu '.location.' '.vrhs --- 123,127 ---- exe 'amenu '.location.' <plug><C-r>=Tex_DoEnvironment("'.a:name.'")<CR>' else ! exe 'amenu '.location." <plug><C-r>=Tex_PutTextWithMovement('".a:irhs."')<CR>" endif exe 'vmenu '.location.' '.vrhs *************** *** 138,142 **** if g:Tex_SectionMaps && !exists('s:doneOnce') exe 'vnoremap '.vlhs.' '.vrhs ! call IMAP (a:lhs, "\\".a:name.'{«»}«»', 'tex') endif --- 138,142 ---- if g:Tex_SectionMaps && !exists('s:doneOnce') exe 'vnoremap '.vlhs.' '.vrhs ! call Tex_IMAP (a:lhs, "\\".a:name.'{«»}«»', 'tex') endif *************** *** 145,149 **** let advlocation = g:Tex_EnvMenuLocation.'Sections.Advanced.'.a:name ! let irhs = "\<C-r>=IMAP_PutTextWithMovement('\\".a:name."{«»}«»')\<CR>" let advirhs = "\<C-r>=Tex_InsSecAdv('".a:name."')\<CR>" --- 145,149 ---- let advlocation = g:Tex_EnvMenuLocation.'Sections.Advanced.'.a:name ! let irhs = "\<C-r>=Tex_PutTextWithMovement('\\".a:name."{«»}«»')\<CR>" let advirhs = "\<C-r>=Tex_InsSecAdv('".a:name."')\<CR>" *************** *** 286,290 **** " Tex_itemize: {{{ function! Tex_itemize(env) ! return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr>\\item «»\<cr>\\end{".a:env."}«»") endfunction " }}} --- 286,290 ---- " Tex_itemize: {{{ function! Tex_itemize(env) ! return Tex_PutTextWithMovement('\begin{'.a:env."}\<cr>\\item «»\<cr>\\end{".a:env."}«»") endfunction " }}} *************** *** 296,302 **** let itlabel = '['.itlabel.']' endif ! return IMAP_PutTextWithMovement("\\begin{description}\<cr>\\item".itlabel." «»\<cr>\\end{description}«»") else ! return IMAP_PutTextWithMovement(s:description) endif endfunction --- 296,302 ---- let itlabel = '['.itlabel.']' endif ! return Tex_PutTextWithMovement("\\begin{description}\<cr>\\item".itlabel." «»\<cr>\\end{description}«»") else ! return Tex_PutTextWithMovement(s:description) endif endfunction *************** *** 341,347 **** let figure = figure . centr let figure = figure . '\end{'.a:env.'}' ! return IMAP_PutTextWithMovement(figure) else ! return IMAP_PutTextWithMovement(s:figure) endif endfunction --- 341,347 ---- let figure = figure . centr let figure = figure . '\end{'.a:env.'}' ! return Tex_PutTextWithMovement(figure) else ! return Tex_PutTextWithMovement(s:figure) endif endfunction *************** *** 385,391 **** endif let ret=ret.'\end{table}«»' ! return IMAP_PutTextWithMovement(ret) else ! return IMAP_PutTextWithMovement(s:table) endif endfunction --- 385,391 ---- endif let ret=ret.'\end{table}«»' ! return Tex_PutTextWithMovement(ret) else ! return Tex_PutTextWithMovement(s:table) endif endfunction *************** *** 402,408 **** let format = '{'.format.'}' endif ! return IMAP_PutTextWithMovement('\begin{'.a:env.'}'.pos.format."\<cr> \<cr>\\end{".a:env.'}«»') else ! return IMAP_PutTextWithMovement('\begin{'.a:env.'}[«position»]{«format»}'."\<cr>«»\<cr>\\end{".a:env.'}«»') endif endfunction --- 402,408 ---- let format = '{'.format.'}' endif ! return Tex_PutTextWithMovement('\begin{'.a:env.'}'.pos.format."\<cr> \<cr>\\end{".a:env.'}«»') else ! return Tex_PutTextWithMovement('\begin{'.a:env.'}[«position»]{«format»}'."\<cr>«»\<cr>\\end{".a:env.'}«»') endif endfunction *************** *** 421,425 **** let arrlabel = '' endif ! return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr>".arrlabel."«»\<cr>\\end{".a:env."}«»") else if a:env !~ '\*' --- 421,425 ---- let arrlabel = '' endif ! return Tex_PutTextWithMovement('\begin{'.a:env."}\<cr>".arrlabel."«»\<cr>\\end{".a:env."}«»") else if a:env !~ '\*' *************** *** 428,432 **** let arrlabel = '«»' endif ! return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr>".arrlabel."\<cr>".'\end{'.a:env.'}«»') endif endfunction --- 428,432 ---- let arrlabel = '«»' endif ! return Tex_PutTextWithMovement('\begin{'.a:env."}\<cr>".arrlabel."\<cr>".'\end{'.a:env.'}«»') endif endfunction *************** *** 445,451 **** let label = '' endif ! return IMAP_PutTextWithMovement('\begin{list}'.label."\<cr>\\item \<cr>\\end{list}«»") else ! return IMAP_PutTextWithMovement(s:list) endif endfunction --- 445,451 ---- let label = '' endif ! return Tex_PutTextWithMovement('\begin{list}'.label."\<cr>\\item \<cr>\\end{list}«»") else ! return Tex_PutTextWithMovement(s:list) endif endfunction *************** *** 462,468 **** let foo = foo.'['.opts.']'.'{'.dstyle.'}' endif ! return IMAP_PutTextWithMovement(foo."\<cr>\<cr>\\begin{document}\<cr>«»\<cr>\\end{document}") else ! return IMAP_PutTextWithMovement(s:document) endif endfunction --- 462,468 ---- let foo = foo.'['.opts.']'.'{'.dstyle.'}' endif ! return Tex_PutTextWithMovement(foo."\<cr>\<cr>\\begin{document}\<cr>«»\<cr>\\end{document}") else ! return Tex_PutTextWithMovement(s:document) endif endfunction *************** *** 479,485 **** let foo = foo.'['.pos.']{'.width.'}' endif ! return IMAP_PutTextWithMovement(foo."\<cr>«»\<cr>\\end{minipage}«»") else ! return IMAP_PutTextWithMovement(s:minipage) endif endfunction --- 479,485 ---- let foo = foo.'['.pos.']{'.width.'}' endif ! return Tex_PutTextWithMovement(foo."\<cr>«»\<cr>\\end{minipage}«»") else ! return Tex_PutTextWithMovement(s:minipage) endif endfunction *************** *** 497,501 **** endif let bar = bar.'{'.key.'}' ! return IMAP_PutTextWithMovement('\begin{thebibliography}'.foo."\<cr>".bar." \<cr>\\end{thebibliography}«»\<Up>") endfunction " }}} --- 497,501 ---- endif let bar = bar.'{'.key.'}' ! return Tex_PutTextWithMovement('\begin{thebibliography}'.foo."\<cr>".bar." \<cr>\\end{thebibliography}«»\<Up>") endfunction " }}} *************** *** 580,588 **** exe 'return Tex_'.a:env.'(a:env)' elseif a:env == '$$' ! return IMAP_PutTextWithMovement('$$«»$$') elseif a:env == '[' ! return IMAP_PutTextWithMovement("\\[\<CR>«»\<CR>\\]«»") else ! return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr>«»\<cr>\\end{".a:env."}«»") endif endfunction " }}} --- 580,588 ---- exe 'return Tex_'.a:env.'(a:env)' elseif a:env == '$$' ! return Tex_PutTextWithMovement('$$«»$$') elseif a:env == '[' ! return Tex_PutTextWithMovement("\\[\<CR>«»\<CR>\\]«»") else ! return Tex_PutTextWithMovement('\begin{'.a:env."}\<cr>«»\<cr>\\end{".a:env."}«»") endif endfunction " }}} Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** main.vim 6 Dec 2002 23:55:35 -0000 1.15 --- main.vim 13 Dec 2002 17:24:06 -0000 1.16 *************** *** 4,8 **** " Email: sr...@fa... " URL: ! " Last Change: sob gru 07 12:00 2002 C " " Help: --- 4,8 ---- " Email: sr...@fa... " URL: ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Help: *************** *** 75,137 **** " short forms for latex formatting and math elements. {{{ " taken from auctex.vim or miktexmacros.vim ! call IMAP ('__', '_{ä}«»', "tex") ! call IMAP ('()', '(ä)«»', "tex") ! call IMAP ('[]', '[ä]«»', "tex") ! call IMAP ('{}', '{ä}«»', "tex") ! call IMAP ('^^', '^{ä}«»', "tex") ! call IMAP ('$$', '$ä$«»', "tex") ! call IMAP ('==', '&=& ', "tex") ! call IMAP ('~~', '&\approx& ', "tex") ! call IMAP ('=~', '\approx', "tex") ! call IMAP ('::', '\dots', "tex") ! call IMAP ('((', '\left( ä \right)«»', "tex") ! call IMAP ('[[', '\left[ ä \right]«»', "tex") ! call IMAP ('{{', '\left\{ ä \right\}«»', "tex") ! call IMAP (g:Tex_Leader.'^', '\hat{ä}«»', "tex") ! call IMAP (g:Tex_Leader.'_', '\bar{ä}«»', "tex") ! call IMAP (g:Tex_Leader.'6', '\partial', "tex") ! call IMAP (g:Tex_Leader.'8', '\infty', "tex") ! call IMAP (g:Tex_Leader.'/', '\frac{ä}{«»}«»', "tex") ! call IMAP (g:Tex_Leader.'%', '\frac{ä}{«»}«»', "tex") ! call IMAP (g:Tex_Leader.'@', '\circ', "tex") ! call IMAP (g:Tex_Leader.'0', '^\circ', "tex") ! call IMAP (g:Tex_Leader.'=', '\equiv', "tex") ! call IMAP (g:Tex_Leader."\\",'\setminus', "tex") ! call IMAP (g:Tex_Leader.'.', '\cdot', "tex") ! call IMAP (g:Tex_Leader.'*', '\times', "tex") ! call IMAP (g:Tex_Leader.'&', '\wedge', "tex") ! call IMAP (g:Tex_Leader.'-', '\bigcap', "tex") ! call IMAP (g:Tex_Leader.'+', '\bigcup', "tex") ! call IMAP (g:Tex_Leader.'(', '\subset', "tex") ! call IMAP (g:Tex_Leader.')', '\supset', "tex") ! call IMAP (g:Tex_Leader.'<', '\le', "tex") ! call IMAP (g:Tex_Leader.'>', '\ge', "tex") ! call IMAP (g:Tex_Leader.',', '\nonumber', "tex") ! call IMAP (g:Tex_Leader.'~', '\tilde{ä}«»', "tex") ! call IMAP (g:Tex_Leader.';', '\dot{ä}«»', "tex") ! call IMAP (g:Tex_Leader.':', '\ddot{ä}«»', "tex") ! call IMAP (g:Tex_Leader.'2', '\sqrt{ä}«»', "tex") ! call IMAP (g:Tex_Leader.'|', '\Big|', "tex") ! call IMAP (g:Tex_Leader.'I', "\\int_{ä}^{«»}«»", 'tex') " }}} " other miscellaneous stuff taken from imaps.vim. {{{ ! call IMAP ("vb".s:ml, "\\verb|ä|«»", "tex") ! call IMAP ("bf".s:ml, "{\\bf ä}«»", "tex") ! call IMAP ("em".s:ml, "{\\em ä}«»", "tex") ! call IMAP ("it".s:ml, "{\\it ä}«»", "tex") ! call IMAP ("mb".s:ml, "\\mbox{ä}«»", "tex") ! call IMAP ("frac".s:ml, "\\frac{ä}{«»}«»", "tex") ! call IMAP ("sq".s:ml, "\\sqrt{ä}«»", "tex") ! call IMAP ("eps".s:ml, "\\psfig{figure=ä.eps}«»", "tex") ! call IMAP ("sum".s:ml, "\\sum{ä}{«»}«»", "tex") ! call IMAP ("suml".s:ml, "\\sum\\limits_{ä}^{«»}«»", "tex") ! call IMAP ("int".s:ml, "\\int_{ä}^{«»}«»", "tex") ! call IMAP ("intl".s:ml, "\\int\\limits_{ä}^{«»}«»", "tex") ! call IMAP ("bbr".s:ml, "\\left( ä \\right)«»", "tex") ! call IMAP ("bbc".s:ml, "\\left\\{ ä \\right\\}«»", "tex") ! call IMAP ("bbs".s:ml, "\\left[ ä \\right]«»", "tex") ! call IMAP ("rr".s:ml, "\\right", "tex") ! call IMAP ("ll".s:ml, "\\left", "tex") ! call IMAP ("part".s:ml, "\\partial", "tex") " }}} " Greek Letters {{{ --- 75,137 ---- " short forms for latex formatting and math elements. {{{ " taken from auctex.vim or miktexmacros.vim ! call Tex_IMAP ('__', '_{ä}«»', "tex") ! call Tex_IMAP ('()', '(ä)«»', "tex") ! call Tex_IMAP ('[]', '[ä]«»', "tex") ! call Tex_IMAP ('{}', '{ä}«»', "tex") ! call Tex_IMAP ('^^', '^{ä}«»', "tex") ! call Tex_IMAP ('$$', '$ä$«»', "tex") ! call Tex_IMAP ('==', '&=& ', "tex") ! call Tex_IMAP ('~~', '&\approx& ', "tex") ! call Tex_IMAP ('=~', '\approx', "tex") ! call Tex_IMAP ('::', '\dots', "tex") ! call Tex_IMAP ('((', '\left( ä \right)«»', "tex") ! call Tex_IMAP ('[[', '\left[ ä \right]«»', "tex") ! call Tex_IMAP ('{{', '\left\{ ä \right\}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'^', '\hat{ä}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'_', '\bar{ä}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'6', '\partial', "tex") ! call Tex_IMAP (g:Tex_Leader.'8', '\infty', "tex") ! call Tex_IMAP (g:Tex_Leader.'/', '\frac{ä}{«»}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'%', '\frac{ä}{«»}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'@', '\circ', "tex") ! call Tex_IMAP (g:Tex_Leader.'0', '^\circ', "tex") ! call Tex_IMAP (g:Tex_Leader.'=', '\equiv', "tex") ! call Tex_IMAP (g:Tex_Leader."\\",'\setminus', "tex") ! call Tex_IMAP (g:Tex_Leader.'.', '\cdot', "tex") ! call Tex_IMAP (g:Tex_Leader.'*', '\times', "tex") ! call Tex_IMAP (g:Tex_Leader.'&', '\wedge', "tex") ! call Tex_IMAP (g:Tex_Leader.'-', '\bigcap', "tex") ! call Tex_IMAP (g:Tex_Leader.'+', '\bigcup', "tex") ! call Tex_IMAP (g:Tex_Leader.'(', '\subset', "tex") ! call Tex_IMAP (g:Tex_Leader.')', '\supset', "tex") ! call Tex_IMAP (g:Tex_Leader.'<', '\le', "tex") ! call Tex_IMAP (g:Tex_Leader.'>', '\ge', "tex") ! call Tex_IMAP (g:Tex_Leader.',', '\nonumber', "tex") ! call Tex_IMAP (g:Tex_Leader.'~', '\tilde{ä}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.';', '\dot{ä}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.':', '\ddot{ä}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'2', '\sqrt{ä}«»', "tex") ! call Tex_IMAP (g:Tex_Leader.'|', '\Big|', "tex") ! call Tex_IMAP (g:Tex_Leader.'I', "\\int_{ä}^{«»}«»", 'tex') " }}} " other miscellaneous stuff taken from imaps.vim. {{{ ! call Tex_IMAP ("vb".s:ml, "\\verb|ä|«»", "tex") ! call Tex_IMAP ("bf".s:ml, "{\\bf ä}«»", "tex") ! call Tex_IMAP ("em".s:ml, "{\\em ä}«»", "tex") ! call Tex_IMAP ("it".s:ml, "{\\it ä}«»", "tex") ! call Tex_IMAP ("mb".s:ml, "\\mbox{ä}«»", "tex") ! call Tex_IMAP ("frac".s:ml, "\\frac{ä}{«»}«»", "tex") ! call Tex_IMAP ("sq".s:ml, "\\sqrt{ä}«»", "tex") ! call Tex_IMAP ("eps".s:ml, "\\psfig{figure=ä.eps}«»", "tex") ! call Tex_IMAP ("sum".s:ml, "\\sum{ä}{«»}«»", "tex") ! call Tex_IMAP ("suml".s:ml, "\\sum\\limits_{ä}^{«»}«»", "tex") ! call Tex_IMAP ("int".s:ml, "\\int_{ä}^{«»}«»", "tex") ! call Tex_IMAP ("intl".s:ml, "\\int\\limits_{ä}^{«»}«»", "tex") ! call Tex_IMAP ("bbr".s:ml, "\\left( ä \\right)«»", "tex") ! call Tex_IMAP ("bbc".s:ml, "\\left\\{ ä \\right\\}«»", "tex") ! call Tex_IMAP ("bbs".s:ml, "\\left[ ä \\right]«»", "tex") ! call Tex_IMAP ("rr".s:ml, "\\right", "tex") ! call Tex_IMAP ("ll".s:ml, "\\left", "tex") ! call Tex_IMAP ("part".s:ml, "\\partial", "tex") " }}} " Greek Letters {{{ *************** *** 193,199 **** let i = char2nr('a') while i <= char2nr('z') ! call IMAP(g:Tex_Leader.nr2char(i), "\<C-r>=TEX_InsertGreekLetter('".nr2char(i)."')\<CR>", 'tex') if exists('s:greek_'.nr2char(i-32)) ! call IMAP(g:Tex_Leader.nr2char(i-32), "\<C-r>=TEX_InsertGreekLetter('".nr2char(i-32)."')\<CR>", 'tex') endif let i = i + 1 --- 193,199 ---- let i = char2nr('a') while i <= char2nr('z') ! call Tex_IMAP(g:Tex_Leader.nr2char(i), "\<C-r>=TEX_InsertGreekLetter('".nr2char(i)."')\<CR>", 'tex') if exists('s:greek_'.nr2char(i-32)) ! call Tex_IMAP(g:Tex_Leader.nr2char(i-32), "\<C-r>=TEX_InsertGreekLetter('".nr2char(i-32)."')\<CR>", 'tex') endif let i = i + 1 Index: mathmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/mathmacros.vim,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mathmacros.vim 10 Nov 2002 13:39:48 -0000 1.2 --- mathmacros.vim 13 Dec 2002 17:24:13 -0000 1.3 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: sob lis 09 10:00 2002 C " " Description: macros for everything mathematical in latex. --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Description: macros for everything mathematical in latex. *************** *** 79,91 **** " MATH Fonts {{{ let s:pA2a = s:pA."&MathFonts." ! exe s:pA2a.'mathbf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbf{ä}«»")<cr>' ! exe s:pA2a.'mathrm{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathrm{ä}«»")<cr>' ! exe s:pA2a.'mathsf{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathsf{ä}«»")<cr>' ! exe s:pA2a.'mathtt{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathtt{ä}«»")<cr>' ! exe s:pA2a.'mathit{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathit{ä}«»")<cr>' ! exe s:pA2a.'mathfrak{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathfrak{ä}«»")<cr>' ! exe s:pA2a.'mathcal{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathcal{ä}«»")<cr>' ! exe s:pA2a.'mathscr{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathscr{ä}«»")<cr>' ! exe s:pA2a.'mathbb{} <plug><C-r>=IMAP_PutTextWithMovement("\\mathbb{ä}«»")<cr>' " }}} " Greek Letters small {{{ --- 79,91 ---- " MATH Fonts {{{ let s:pA2a = s:pA."&MathFonts." ! exe s:pA2a.'mathbf{} <plug><C-r>=Tex_PutTextWithMovement("\\mathbf{ä}«»")<cr>' ! exe s:pA2a.'mathrm{} <plug><C-r>=Tex_PutTextWithMovement("\\mathrm{ä}«»")<cr>' ! exe s:pA2a.'mathsf{} <plug><C-r>=Tex_PutTextWithMovement("\\mathsf{ä}«»")<cr>' ! exe s:pA2a.'mathtt{} <plug><C-r>=Tex_PutTextWithMovement("\\mathtt{ä}«»")<cr>' ! exe s:pA2a.'mathit{} <plug><C-r>=Tex_PutTextWithMovement("\\mathit{ä}«»")<cr>' ! exe s:pA2a.'mathfrak{} <plug><C-r>=Tex_PutTextWithMovement("\\mathfrak{ä}«»")<cr>' ! exe s:pA2a.'mathcal{} <plug><C-r>=Tex_PutTextWithMovement("\\mathcal{ä}«»")<cr>' ! exe s:pA2a.'mathscr{} <plug><C-r>=Tex_PutTextWithMovement("\\mathscr{ä}«»")<cr>' ! exe s:pA2a.'mathbb{} <plug><C-r>=Tex_PutTextWithMovement("\\mathbb{ä}«»")<cr>' " }}} " Greek Letters small {{{ *************** *** 472,498 **** " {{{ MathDiacritics let s:pA12 = s:pA."&MathDiacritics." ! exe s:pA12.'acute{} <plug><C-r>=IMAP_PutTextWithMovement("\\acute{ä}«»")<cr>' ! exe s:pA12.'bar{}<Tab>`_ <plug><C-r>=IMAP_PutTextWithMovement("\\bar{ä}«»")<cr>' ! exe s:pA12.'breve{} <plug><C-r>=IMAP_PutTextWithMovement("\\breve{ä}«»")<cr>' ! exe s:pA12.'check{} <plug><C-r>=IMAP_PutTextWithMovement("\\check{ä}«»")<cr>' ! exe s:pA12.'ddot{}<Tab>`: <plug><C-r>=IMAP_PutTextWithMovement("\\ddot{ä}«»")<cr>' ! exe s:pA12.'dot{}<Tab>`; <plug><C-r>=IMAP_PutTextWithMovement("\\dot{ä}«»")<cr>' ! exe s:pA12.'grave{} <plug><C-r>=IMAP_PutTextWithMovement("\\grave{ä}«»")<cr>' ! exe s:pA12.'hat{}<Tab>`^ <plug><C-r>=IMAP_PutTextWithMovement("\\hat{ä}«»")<cr>' ! exe s:pA12.'tilde{}<tab>`~ <plug><C-r>=IMAP_PutTextWithMovement("\\tilde{ä}«»")<cr>' ! exe s:pA12.'vec{} <plug><C-r>=IMAP_PutTextWithMovement("\\vec{ä}«»")<cr>' ! exe s:pA12.'widehat{} <plug><C-r>=IMAP_PutTextWithMovement("\\widehat{ä}«»")<cr>' ! exe s:pA12.'widetilde{} <plug><C-r>=IMAP_PutTextWithMovement("\\widetilde{ä}«»")<cr>' ! exe s:pA12.'imath <plug><C-r>=IMAP_PutTextWithMovement("\\imath")<cr>' ! exe s:pA12.'jmath <plug><C-r>=IMAP_PutTextWithMovement("\\jmath")<cr>' " }}} " {{{ OverlineAndCo let s:pA13 = s:pA."&OverlineAndCo." ! exe s:pA13.'overline{} <plug><C-r>=IMAP_PutTextWithMovement("\\overline{}")<cr>' ! exe s:pA13.'underline{} <plug><C-r>=IMAP_PutTextWithMovement("\\underline{}")<cr>' ! exe s:pA13.'overrightarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overrightarrow{}")<cr>' ! exe s:pA13.'overleftarrow{} <plug><C-r>=IMAP_PutTextWithMovement("\\overleftarrow{}")<cr>' ! exe s:pA13.'overbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\overbrace{}")<cr>' ! exe s:pA13.'underbrace{} <plug><C-r>=IMAP_PutTextWithMovement("\\underbrace{}")<cr>' " }}} " {{{ Symbols1 --- 472,498 ---- " {{{ MathDiacritics let s:pA12 = s:pA."&MathDiacritics." ! exe s:pA12.'acute{} <plug><C-r>=Tex_PutTextWithMovement("\\acute{ä}«»")<cr>' ! exe s:pA12.'bar{}<Tab>`_ <plug><C-r>=Tex_PutTextWithMovement("\\bar{ä}«»")<cr>' ! exe s:pA12.'breve{} <plug><C-r>=Tex_PutTextWithMovement("\\breve{ä}«»")<cr>' ! exe s:pA12.'check{} <plug><C-r>=Tex_PutTextWithMovement("\\check{ä}«»")<cr>' ! exe s:pA12.'ddot{}<Tab>`: <plug><C-r>=Tex_PutTextWithMovement("\\ddot{ä}«»")<cr>' ! exe s:pA12.'dot{}<Tab>`; <plug><C-r>=Tex_PutTextWithMovement("\\dot{ä}«»")<cr>' ! exe s:pA12.'grave{} <plug><C-r>=Tex_PutTextWithMovement("\\grave{ä}«»")<cr>' ! exe s:pA12.'hat{}<Tab>`^ <plug><C-r>=Tex_PutTextWithMovement("\\hat{ä}«»")<cr>' ! exe s:pA12.'tilde{}<tab>`~ <plug><C-r>=Tex_PutTextWithMovement("\\tilde{ä}«»")<cr>' ! exe s:pA12.'vec{} <plug><C-r>=Tex_PutTextWithMovement("\\vec{ä}«»")<cr>' ! exe s:pA12.'widehat{} <plug><C-r>=Tex_PutTextWithMovement("\\widehat{ä}«»")<cr>' ! exe s:pA12.'widetilde{} <plug><C-r>=Tex_PutTextWithMovement("\\widetilde{ä}«»")<cr>' ! exe s:pA12.'imath <plug><C-r>=Tex_PutTextWithMovement("\\imath")<cr>' ! exe s:pA12.'jmath <plug><C-r>=Tex_PutTextWithMovement("\\jmath")<cr>' " }}} " {{{ OverlineAndCo let s:pA13 = s:pA."&OverlineAndCo." ! exe s:pA13.'overline{} <plug><C-r>=Tex_PutTextWithMovement("\\overline{}")<cr>' ! exe s:pA13.'underline{} <plug><C-r>=Tex_PutTextWithMovement("\\underline{}")<cr>' ! exe s:pA13.'overrightarrow{} <plug><C-r>=Tex_PutTextWithMovement("\\overrightarrow{}")<cr>' ! exe s:pA13.'overleftarrow{} <plug><C-r>=Tex_PutTextWithMovement("\\overleftarrow{}")<cr>' ! exe s:pA13.'overbrace{} <plug><C-r>=Tex_PutTextWithMovement("\\overbrace{}")<cr>' ! exe s:pA13.'underbrace{} <plug><C-r>=Tex_PutTextWithMovement("\\underbrace{}")<cr>' " }}} " {{{ Symbols1 Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** packages.vim 8 Dec 2002 16:52:32 -0000 1.14 --- packages.vim 13 Dec 2002 17:24:19 -0000 1.15 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: nie gru 08 05:00 2002 C " " Description: handling packages from within vim --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Description: handling packages from within vim *************** *** 251,257 **** let p_o_end = p_o_item[strlen(p_o_item) - 1] if p_o_end !~ "[a-zA-Z}]" ! let r_m_p_o_item = "<plug><C-r>=IMAP_PutTextWithMovement('".p_o_item.'ä'.p_o_delimiter."«»')<cr>" elseif p_o_end == '}' ! let r_m_p_o_item = "<plug><C-r>=IMAP_PutTextWithMovement('".p_o_item.p_o_delimiter."«»')<cr>" else let r_m_p_o_item = '<plug>'.p_o_item.p_o_delimiter --- 251,257 ---- let p_o_end = p_o_item[strlen(p_o_item) - 1] if p_o_end !~ "[a-zA-Z}]" ! let r_m_p_o_item = "<plug><C-r>=Tex_PutTextWithMovement('".p_o_item.'ä'.p_o_delimiter."«»')<cr>" elseif p_o_end == '}' ! let r_m_p_o_item = "<plug><C-r>=Tex_PutTextWithMovement('".p_o_item.p_o_delimiter."«»')<cr>" else let r_m_p_o_item = '<plug>'.p_o_item.p_o_delimiter *************** *** 286,298 **** let com_type = '{}' let l_m_item = '\\&'.p_item_name.'{}' ! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."{ä}«»')<cr>" elseif p_item_def == 'brs' let com_type = '{}' let l_m_item = '\\&'.substitute(p_item_name, "[ä«»]", '', 'g') ! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."«»')<cr>" elseif p_item_def == 'brd' let com_type = '{}{}' let l_m_item = '\\&'.p_item_name.'{}{}' ! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."{ä}{«»}«»')<cr>" elseif p_item_def == 'sep' let com_type = '' --- 286,298 ---- let com_type = '{}' let l_m_item = '\\&'.p_item_name.'{}' ! let r_m_item = "<plug><C-r>=Tex_PutTextWithMovement('\\".p_item_name."{ä}«»')<cr>" elseif p_item_def == 'brs' let com_type = '{}' let l_m_item = '\\&'.substitute(p_item_name, "[ä«»]", '', 'g') ! let r_m_item = "<plug><C-r>=Tex_PutTextWithMovement('\\".p_item_name."«»')<cr>" elseif p_item_def == 'brd' let com_type = '{}{}' let l_m_item = '\\&'.p_item_name.'{}{}' ! let r_m_item = "<plug><C-r>=Tex_PutTextWithMovement('\\".p_item_name."{ä}{«»}«»')<cr>" elseif p_item_def == 'sep' let com_type = '' *************** *** 320,328 **** let com_type = '\\[]' let l_m_item = '\\&'.p_item_name.'[]' ! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."[ä]«»')<cr>" elseif p_item_def == 'nob' let com_type = '[]{}' let l_m_item = '\\&'.p_item_name.'[]{}' ! let r_m_item = "<plug><C-r>=IMAP_PutTextWithMovement('\\".p_item_name."[ä]{«»}«»')<cr>" elseif p_item_def == 'pla' let com_type = '(p)' --- 320,328 ---- let com_type = '\\[]' let l_m_item = '\\&'.p_item_name.'[]' ! let r_m_item = "<plug><C-r>=Tex_PutTextWithMovement('\\".p_item_name."[ä]«»')<cr>" elseif p_item_def == 'nob' let com_type = '[]{}' let l_m_item = '\\&'.p_item_name.'[]{}' ! let r_m_item = "<plug><C-r>=Tex_PutTextWithMovement('\\".p_item_name."[ä]{«»}«»')<cr>" elseif p_item_def == 'pla' let com_type = '(p)' Index: wizardfuncs.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/wizardfuncs.vim,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wizardfuncs.vim 14 Nov 2002 09:39:01 -0000 1.4 --- wizardfuncs.vim 13 Dec 2002 17:24:24 -0000 1.5 *************** *** 198,202 **** exe "normal! i\\".a:section_name."{«»}«»\<Esc>0\<C-j>" " let ret_section = "\\".a:section_name."{«»}«»" ! " exe "normal! i\<C-r>=IMAP_PutTextWithMovement(ret_section)\<CR>" " normal f}i endfunction "}}} --- 198,202 ---- exe "normal! i\\".a:section_name."{«»}«»\<Esc>0\<C-j>" " let ret_section = "\\".a:section_name."{«»}«»" ! " exe "normal! i\<C-r>=Tex_PutTextWithMovement(ret_section)\<CR>" " normal f}i endfunction "}}} |
From: <ma...@us...> - 2002-12-13 17:25:16
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv987/plugin Modified Files: imaps.vim Log Message: I replaced IMAP() with Tex_IMAP() and IMAP_PutTextWithMovement() with Tex_PutTextWithMovement() This is a preliminary step before rewriting these two functions. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** imaps.vim 7 Dec 2002 00:43:41 -0000 1.8 --- imaps.vim 13 Dec 2002 17:24:36 -0000 1.9 *************** *** 5,9 **** " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " Last Change: Fri Dec 06 04:00 PM 2002 PST " " Documentation: {{{ --- 5,9 ---- " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " " Documentation: {{{ *************** *** 46,50 **** " form: " ! " call IMAP (lhs, rhs, ft) " " Some characters in the RHS have special meaning which help in cursor --- 46,50 ---- " form: " ! " call Tex_IMAP (lhs, rhs, ft) " " Some characters in the RHS have special meaning which help in cursor *************** *** 53,57 **** " Example One: " ! " call IMAP ("bit`", "\\begin{itemize}\<cr>\\item «»\<cr>\\end{itemize}«»", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. --- 53,57 ---- " Example One: " ! " call Tex_IMAP ("bit`", "\\begin{itemize}\<cr>\\item «»\<cr>\\end{itemize}«»", "tex") " " This effectively sets up the map for "bit`" whenever you edit a latex file. *************** *** 80,84 **** " Example Two: " You can use the <C-r> command to insert dynamic elements such as dates. ! " call IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') " " sets up the map for date` to insert the current date. --- 80,84 ---- " Example Two: " You can use the <C-r> command to insert dynamic elements such as dates. ! " call Tex_IMAP ('date`', "\<c-r>=strftime('%b %d %Y')\<cr>", '') " " sets up the map for date` to insert the current date. *************** *** 102,106 **** " IMAP: Adds a "fake" insert mode mapping. {{{ " For example, doing ! " IMAP('abc', 'def' ft) " will mean that if the letters abc are pressed in insert mode, then " they will be replaced by def. If ft != '', then the "mapping" will be --- 102,106 ---- " IMAP: Adds a "fake" insert mode mapping. {{{ " For example, doing ! " Tex_IMAP('abc', 'def' ft) " will mean that if the letters abc are pressed in insert mode, then " they will be replaced by def. If ft != '', then the "mapping" will be *************** *** 122,126 **** " the previously typed characters and erased and the right hand side is " inserted ! function! IMAP(lhs, rhs, ft) let lastLHSChar = a:lhs[strlen(a:lhs)-1] " s:charLens_<ft>_<char> contains the lengths of the left hand sides of --- 122,126 ---- " the previously typed characters and erased and the right hand side is " inserted ! function! Tex_IMAP(lhs, rhs, ft) let lastLHSChar = a:lhs[strlen(a:lhs)-1] " s:charLens_<ft>_<char> contains the lengths of the left hand sides of *************** *** 256,260 **** exe "let ret = ".lhsHash ! return bkspc.IMAP_PutTextWithMovement(ret) endwhile --- 256,260 ---- exe "let ret = ".lhsHash ! return bkspc.Tex_PutTextWithMovement(ret) endwhile *************** *** 269,273 **** " IMAP_PutTextWithMovement: appends movement commands to a text {{{ " This enables which cursor placement. ! function! IMAP_PutTextWithMovement(text) let s:oldenc = &encoding --- 269,273 ---- " IMAP_PutTextWithMovement: appends movement commands to a text {{{ " This enables which cursor placement. ! function! Tex_PutTextWithMovement(text) let s:oldenc = &encoding |
From: <ma...@us...> - 2002-12-13 17:25:16
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv987/ftplugin/tex Modified Files: brackets.vim Log Message: I replaced IMAP() with Tex_IMAP() and IMAP_PutTextWithMovement() with Tex_PutTextWithMovement() This is a preliminary step before rewriting these two functions. Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** brackets.vim 9 Dec 2002 20:41:56 -0000 1.4 --- brackets.vim 13 Dec 2002 17:24:31 -0000 1.5 *************** *** 2,7 **** " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Mon Dec 09 12:00 PM 2002 PST ! " Desciption: " This ftplugin provides the following maps: " . <M-b> encloses the previous character in \mathbf{} --- 2,7 ---- " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Fri Dec 13 12:00 PM 2002 EST ! " Description: " This ftplugin provides the following maps: " . <M-b> encloses the previous character in \mathbf{} *************** *** 84,88 **** endfunction " }}} " Tex_MathCal: enclose the previous letter/number in \mathcal {{{ ! " Desciption: " if the last character is not a letter/number, then insert \cite{} function! Tex_MathCal() --- 84,88 ---- endfunction " }}} " Tex_MathCal: enclose the previous letter/number in \mathcal {{{ ! " Description: " if the last character is not a letter/number, then insert \cite{} function! Tex_MathCal() *************** *** 93,97 **** return "\<BS>".'\mathcal{'.toupper(char).'}' else ! return IMAP_PutTextWithMovement('\cite{«»}«»') endif endfunction --- 93,97 ---- return "\<BS>".'\mathcal{'.toupper(char).'}' else ! return Tex_PutTextWithMovement('\cite{«»}«»') endif endfunction *************** *** 121,129 **** endif let rhs = matchstr(matchedbrackets, char.'\zs.\ze') ! return "\<BS>".IMAP_PutTextWithMovement('\left'.add.char.'«»\right'.add.rhs.'«»') elseif char == '<' ! return "\<BS>".IMAP_PutTextWithMovement('langle«»\rangle«»') elseif char == 'q' ! return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{«»}«»') else return '\label{«»}«»' --- 121,129 ---- endif let rhs = matchstr(matchedbrackets, char.'\zs.\ze') ! return "\<BS>".Tex_PutTextWithMovement('\left'.add.char.'«»\right'.add.rhs.'«»') elseif char == '<' ! return "\<BS>".Tex_PutTextWithMovement('langle«»\rangle«»') elseif char == 'q' ! return "\<BS>".Tex_PutTextWithMovement('\lefteqn{«»}«»') else return '\label{«»}«»' |
From: <ma...@us...> - 2002-12-13 17:25:07
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv987/ftplugin/latex-suite/packages Modified Files: polski Log Message: I replaced IMAP() with Tex_IMAP() and IMAP_PutTextWithMovement() with Tex_PutTextWithMovement() This is a preliminary step before rewriting these two functions. Index: polski =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/polski,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** polski 12 Dec 2002 23:40:15 -0000 1.7 --- polski 13 Dec 2002 17:24:27 -0000 1.8 *************** *** 1,5 **** " Author: Mikolaj Machowski <mi...@wp...> " (c) Copyright by Mikolaj Machowski 2002 ! " Last Change: czw gru 12 11:00 2002 C " License: Vim Charityware " --- 1,5 ---- " Author: Mikolaj Machowski <mi...@wp...> " (c) Copyright by Mikolaj Machowski 2002 ! " Last Change: Fri Dec 13 12:00 PM 2002 EST " License: Vim Charityware " *************** *** 49,53 **** " u¿ywasz (albo go ¶ci±gnij z http://vim-latex.sf.net) function! TPackagePolskiTylda() ! call IMAP (" ---", "~---", "tex") endfunction call TPackagePolskiTylda() --- 49,53 ---- " u¿ywasz (albo go ¶ci±gnij z http://vim-latex.sf.net) function! TPackagePolskiTylda() ! call Tex_IMAP (" ---", "~---", "tex") endfunction call TPackagePolskiTylda() |
From: <ma...@us...> - 2002-12-13 14:47:33
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv22397 Modified Files: texrc Log Message: 1. I changed the installation instructions: the user's texrc file should be put in .../ftplugin/tex/ and it will be :source'd automatically. TODO: All this belongs in a help file, not in the comments. 2. I changed the default for s:CompileFlags back to '' for non-win32 systems. My brand-new RH 8.0 system, with the current (non-beta!) version of teTeX does not support --src-specials and this leads to a silent failure of \ll :-( Index: texrc =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texrc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** texrc 6 Dec 2002 09:36:54 -0000 1.14 --- texrc 13 Dec 2002 14:47:29 -0000 1.15 *************** *** 4,29 **** " Author: Srinath Avadhanula " Created: Mon Apr 01 11:00 AM 2002 PST ! " Last Change: Fri Dec 06 01:00 AM 2002 PST " " Description: This file contains resource configuration information for the " latex-suite package. " ! " NOTE: This file should NOT be edited directly. The recommended usage ! " is to make a copy somewhere, edit that copy and then source ! " that copy in your ftplugin/tex.vim file. ! " ! " This is because this file will be over-written each time you ! " install a new copy of latex-suite. " " Installation: This file should normally reside as: " $HOME/vimfiles/ftplugin/latex-suite/texrc (WINDOWS) " or ! " $HOME/.vim/ftplugin/tex/latex-suite/texrc (UNIX) ! " ! " Copy it over somewhere and then put " ! " source /path/to/copy/of/texrc " ! " in your ~/.vim/ftplugin/tex.vim file. " " NOTE: This file is best viewed with Vim-6.0+ with folding turned on. --- 4,31 ---- " Author: Srinath Avadhanula " Created: Mon Apr 01 11:00 AM 2002 PST ! " Last Change: Fri Dec 13 09:00 AM 2002 EST " " Description: This file contains resource configuration information for the " latex-suite package. " ! " NOTE: Do NOT be edit this file directly: ! " this file will be over-written each time you install a new copy ! " of latex-suite. " " Installation: This file should normally reside as: " $HOME/vimfiles/ftplugin/latex-suite/texrc (WINDOWS) " or ! " $HOME/.vim/ftplugin/latex-suite/texrc (UNIX) " ! " Make your local copy as: ! " $HOME/vimfiles/ftplugin/tex/texrc (WINDOWS) ! " or ! " $HOME/.vim/ftplugin/tex/texrc (UNIX) " ! " It will be :source'd automatically when you edit a LaTeX file. ! " You can edit your local copy with the command ! " :Ttexrc ! " or with the menu item ! " TeX-Suite/Edit texrc " " NOTE: This file is best viewed with Vim-6.0+ with folding turned on. *************** *** 83,87 **** TexLet g:Tex_EscapeChars = '' else ! let s:CompileFlags = '--src-specials' TexLet g:Tex_EscapeChars = '{}\' endif --- 85,89 ---- TexLet g:Tex_EscapeChars = '' else ! let s:CompileFlags = '' TexLet g:Tex_EscapeChars = '{}\' endif |
From: <mi...@us...> - 2002-12-12 23:40:18
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv685 Modified Files: polski Log Message: turning off magic space in verbatim type environments Index: polski =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/polski,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** polski 10 Dec 2002 21:13:32 -0000 1.6 --- polski 12 Dec 2002 23:40:15 -0000 1.7 *************** *** 1,5 **** " Author: Mikolaj Machowski <mi...@wp...> " (c) Copyright by Mikolaj Machowski 2002 ! " Last Change: wto gru 10 09:00 2002 C " License: Vim Charityware " --- 1,5 ---- " Author: Mikolaj Machowski <mi...@wp...> " (c) Copyright by Mikolaj Machowski 2002 ! " Last Change: czw gru 12 11:00 2002 C " License: Vim Charityware " *************** *** 87,91 **** function! s:Tex_polish_space() "Nic magicznego w matematyce ! if synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath' return ' ' else --- 87,91 ---- function! s:Tex_polish_space() "Nic magicznego w matematyce ! if synIDattr(synID(line('.'),col('.')-1,0),"name") =~ '^texMath\|^texZone' return ' ' else |
From: <mi...@us...> - 2002-12-10 21:13:37
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv14078 Modified Files: polski Log Message: Added switch between magic and normal space - F8 Index: polski =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/polski,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** polski 29 Nov 2002 22:03:10 -0000 1.5 --- polski 10 Dec 2002 21:13:32 -0000 1.6 *************** *** 1,5 **** " Author: Mikolaj Machowski <mi...@wp...> " (c) Copyright by Mikolaj Machowski 2002 ! " Last Change: czw lis 28 01:00 2002 C " License: Vim Charityware " --- 1,5 ---- " Author: Mikolaj Machowski <mi...@wp...> " (c) Copyright by Mikolaj Machowski 2002 ! " Last Change: wto gru 10 09:00 2002 C " License: Vim Charityware " *************** *** 66,69 **** --- 66,88 ---- " Wymuszenie zwyklej spacji inoremap <buffer> <silent> <C-Space> <Space> + + " Latwe przelaczanie sie miedzy magiczna spacja a zwykla + inoremap <buffer> <silent> <F8> <C-R>=<SID>TogglePolishSpace()<CR> + + function! s:TogglePolishSpace() + if !exists("b:polishspace") + iunmap <buffer> <Space> + iunmap <buffer> <CR> + let b:polishspace = 1 + return '' + else + inoremap <buffer> <silent> <Space> <C-R>=<SID>Tex_polish_space()<CR> + inoremap <buffer> <silent> <CR> <C-R>=<SID>Tex_polish_space()<CR><BS><CR> + unlet b:polishspace + return '' + endif + endfunction + + function! s:Tex_polish_space() "Nic magicznego w matematyce |
From: <sri...@us...> - 2002-12-09 20:42:00
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv18828 Modified Files: brackets.vim Log Message: . The solution in rev 1.2 was incomplete. Instead of using hasmapto('Tex_MathBF') to see whether map exists, use hasmapto('Tex_MathBF', 'i'). This is because hasmapto() uses 'nvo' as default for mode if unspecified. Also, the way the maps are supposed to be disabled/changed: " In order to completeley disable mappings of <M-b>, <M-c> and <M-l> inoremap <buffer> <plug>foo1 Tex_MathBF inoremap <buffer> <plug>foo2 Tex_MathCal inoremap <buffer> <plug>foo3 Tex_LeftRight " In order to map the functionality of Tex_MathBF, Tex_MathCal and " Tex_LeftRight into some other keys inoremap <buffer> <silent> <C-c>b <C-r>=Tex_MathBF()<CR> inoremap <buffer> <silent> <C-c>c <C-r>=Tex_MathCal()<CR> inoremap <buffer> <silent> <C-c>l <C-r>=Tex_LeftRight()<CR> Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** brackets.vim 7 Dec 2002 02:19:06 -0000 1.3 --- brackets.vim 9 Dec 2002 20:41:56 -0000 1.4 *************** *** 2,6 **** " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Fri Dec 06 06:00 PM 2002 PST " Desciption: " This ftplugin provides the following maps: --- 2,6 ---- " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Mon Dec 09 12:00 PM 2002 PST " Desciption: " This ftplugin provides the following maps: *************** *** 48,58 **** " {{{ ! if !hasmapto('Tex_MathBF') inoremap <buffer> <silent> <M-b> <C-r>=Tex_MathBF()<CR> endif ! if !hasmapto('Tex_MathCal') && mapcheck('<M-c>') == '' inoremap <buffer> <silent> <M-c> <C-R>=Tex_MathCal()<CR> endif ! if !hasmapto('Tex_LeftRight') inoremap <buffer> <silent> <M-l> <C-r>=Tex_LeftRight()<CR> endif --- 48,58 ---- " {{{ ! if !hasmapto('Tex_MathBF', 'i') && mapcheck('<M-b>', 'i') == '' inoremap <buffer> <silent> <M-b> <C-r>=Tex_MathBF()<CR> endif ! if !hasmapto('Tex_MathCal', 'i') && mapcheck('<M-c>', 'i') == '' inoremap <buffer> <silent> <M-c> <C-R>=Tex_MathCal()<CR> endif ! if !hasmapto('Tex_LeftRight', 'i') && mapcheck('<M-l>', 'i') == '' inoremap <buffer> <silent> <M-l> <C-r>=Tex_LeftRight()<CR> endif |
From: <sri...@us...> - 2002-12-09 20:17:18
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv19171 Added Files: smartspace.vim Log Message: Carl Muellers contribution: Maps the <space> key in insert mode so that mathematical formulaes are always kept on the same line. i.e, $$'s dont get broken across multiple lines. NOTE: Using this ftplugin sets 'tw' = 0. If you set tw != 0, after sourcing this ftplugin, unpredictable things might happen. If you really want &tw != 0, disable this plugin by setting g:Tex_SmartKeySpace = 0. --- NEW FILE: smartspace.vim --- "============================================================================= " File: smartspace.vim " Author: Carl Muller " Created: Fri Dec 06 12:00 AM 2002 PST " Last Change: Fri Dec 06 12:00 AM 2002 PST " " Description: " Maps the <space> key in insert mode so that mathematical formulaes are " always kept on the same line. i.e, $$'s dont get broken across multiple " lines. "============================================================================= " Avoid reinclusion or if the user doesn't want us. if exists('b:done_smartspace') \ || (exists('g:Tex_SmartKeySpace') && !g:Tex_SmartKeySpace) finish endif let b:done_smartspace = 1 " Smart space relies on taking over vim's insertion of carriage returns in " order to keep $$'s on the same line. The only way to get vim not to break " lines is to set tw=0. " " NOTE: setting tw != 0 will break smartspace " the user's 'tw' setting is still respected in the insert mode. " However, normal mode actions which rely on 'tw' such as gqap will be " broken because of the faulty 'tw' setting. if &l:tw > 0 let b:tw = &l:tw else let b:tw = 79 endif setlocal tw=0 inoremap <buffer> <silent> <Space> <Space><Esc>:call <SID>TexFill(b:tw)<CR>a " Do not redefine the function. if exists('*s:TexFill') finish endif " TexFormatLine: format line retaining $$'s on the same line. function! s:TexFill(width) " {{{ if col(".") > a:width exe "normal! a##\<Esc>" call <SID>TexFormatLine(a:width) exe "normal! ?##\<CR>2s\<Esc>" endif endfunction " }}} function! s:TexFormatLine(width) " {{{ let first = strpart(getline(line(".")),0,1) normal! $ let length = col(".") let go = 1 while length > a:width+2 && go let between = 0 let string = strpart(getline(line(".")),0,a:width) " Count the dollar signs let number_of_dollars = 0 let evendollars = 1 let counter = 0 while counter <= a:width-1 if string[counter] == '$' && string[counter-1] != '\' " Skip \$. let evendollars = 1 - evendollars let number_of_dollars = number_of_dollars + 1 endif let counter = counter + 1 endwhile " Get ready to split the line. exe "normal! " . (a:width + 1) . "|" if evendollars " Then you are not between dollars. exe "normal! ?\\$\\| \<CR>W" else " Then you are between dollars. normal! F$ if col(".") == 1 || strpart(getline(line(".")),col(".")-1,1) != "$" let go = 0 endif endif if first == '$' && number_of_dollars == 1 let go = 0 else exe "normal! i\<CR>\<Esc>$" let first = strpart(getline(line(".")),0,1) endif let length = col(".") endwhile endfunction " }}} " vim:fdm=marker:ts=4:sw=4:noet |
From: <mi...@us...> - 2002-12-08 16:52:36
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv7548 Modified Files: packages.vim Log Message: Modification of TPackage command, now it works: :TPackage<cr> use ChooseFile menu :TPackage package<cr> inserts \usepackage[]«»{package}«» depending if package has defined options :TPackage package1 package2 inserts \usepackage{package1} \usepackage{package2} Also added some foolproofness to this command Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** packages.vim 6 Dec 2002 23:55:42 -0000 1.13 --- packages.vim 8 Dec 2002 16:52:32 -0000 1.14 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: sob gru 07 12:00 2002 C " " Description: handling packages from within vim --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: nie gru 08 05:00 2002 C " " Description: handling packages from within vim *************** *** 80,83 **** --- 80,84 ---- " }}} " Tex_pack_one: {{{ + " Reads command-line and adds appropriate \usepackage lines function! Tex_pack_one(...) if a:0 == 0 *************** *** 87,90 **** --- 88,96 ---- exe 'cd '.pwd call Tex_pack_check(packname) + return Tex_pack_supp(packname) + elseif a:0 == 1 + if filereadable(s:path.'/packages/'.a:1) + return Tex_pack_supp(a:1) + endif else let i = a:0 *************** *** 92,100 **** while omega <= i exe 'let packname = a:'.omega ! call Tex_pack_check(packname) ! let omega = omega + 1 endwhile endif - return Tex_pack_supp(packname) endfunction " }}} --- 98,108 ---- while omega <= i exe 'let packname = a:'.omega ! if filereadable(s:path.'/packages/'.packname) ! call Tex_pack_check(packname) ! exe 'normal ko\usepackage{'.packname."}\<Esc>" ! let omega = omega + 1 ! endif endwhile endif endfunction " }}} |
From: <sri...@us...> - 2002-12-07 11:06:56
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1:/tmp/cvs-serv539 Modified Files: latex-suite.txt Log Message: . Changed the TOC to a more tree like structure. . Added a latex-smart-keys section... . moved some stuff around so as to be consistent with the TOC. Index: latex-suite.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** latex-suite.txt 6 Dec 2002 09:32:29 -0000 1.8 --- latex-suite.txt 7 Dec 2002 11:06:53 -0000 1.9 *************** *** 1,5 **** *latex-suite* Tools for an enhanced LaTeX environment in Vim For Vim version 6.0 and above. ! Last Change: Fri Dec 06 01:00 AM 2002 PST By Srinath Avadhanula <sr...@fa...>, --- 1,5 ---- *latex-suite* Tools for an enhanced LaTeX environment in Vim For Vim version 6.0 and above. ! Last Change: Sat Dec 07 03:00 AM 2002 PST By Srinath Avadhanula <sr...@fa...>, *************** *** 59,64 **** The tools which are included in LaTeX suite can be grouped together into the following. Almost every feature described here can be customized to some ! degree. Please see the included file latex-suite/texrc file for the complete ! list of variables which can be customized. }}} --- 59,64 ---- The tools which are included in LaTeX suite can be grouped together into the following. Almost every feature described here can be customized to some ! degree. Please see the included file ftplugin/latex-suite/|texrc| file for the ! complete list of variables which can be customized. }}} *************** *** 66,106 **** TABLE OF CONTENTS *latex-suite-toc* {{{ ! |latex-macros| Insert and visual mode mappings and menu items for ! commonly used LaTeX typesetting elements ! |latex-compiling| This version of latex-suite ships with a version of the ! compiler specification which produces slightly less ! verbose output. It can also be dynamically re-configured ! to change the verbosity level. ! |latex-viewing| This is a set of functions which open up the compiled ! .dvi document using the specified DVI viewer. ! |latex-searching| Xdvi (for UNIX) and Yap (for Windows) both provide ways ! for "forward searching" LaTeX documents. This section ! describes how to use these features and how to set up ! your dvi viewer to best use this feature. ! |latex-folding| manual folding based on LaTeX syntax elements. ! |latex-packages| This module provides a way to generate custom menus based ! on the packages used in the file being edited. ! |latex-templates| Custom templates ! |latex-custom-macros| Custom macros ! |latex-help| LaTeX's tex-info file translated into a vim help file. ! |latex-dictionary| A dictionary of standard LaTeX terms. ! |latex-tools| This version of latex-suite also ships with 2 external ! tools: ! 1. |vimlatex| an external utility which filters the output ! of the LaTeX compiler in order to ensure a more robust ! error-parsing. ! 2. |ltags| A script to generate a tags file. It recognizes ! files being \input'ed into a main file. ! (ltags is written by Dimitri Antoniou) }}} =========================================================================== --- 66,130 ---- TABLE OF CONTENTS *latex-suite-toc* {{{ ! Editing ! ======= ! |latex-macros| ! Insert mode and visual mode mappings and menu items for commonly used ! LaTeX typesetting elements ! |latex-smart-keys| ! mappings of some common keys like <BS> to make editing faster ! |latex-bracketing-macros| ! A streamlined way of entering all the \left's and \right's while ! typing latex ! |latex-templates| ! Latex-suite ships with a select number of templates which you can use ! when you start editing a tex file. Placing your own templates in the ! ftplugin/latex-suite/templates directory causes them to be available ! via the |TTemplate| command or the menu. ! |latex-custom-macros| ! By placing custom macros in the ftplugin/latex-suite/macros directory, ! they are available readily via the |TMacro| command. ! Compiling/Viewing/Searching ! =========================== ! |latex-compiling| ! A customizable compiler which can be dynamically reconfigured to ! change what kinds of warnings/errors to ignore. ! |latex-viewing| ! This is a set of functions which open up the compiled .dvi document ! using the specified DVI viewer. ! |latex-searching| ! Xdvi (for UNIX) and Yap (for Windows) both provide ways for "forward ! searching" LaTeX documents. This section describes how to use these ! features and how to set up your dvi viewer to best use this feature. ! Folding ! ======= ! |latex-folding| ! manual folding based on LaTeX syntax elements. ! Pacakge Support ! =============== ! |latex-packages| ! This module provides a way to generate custom menus based on the ! packages used in the file being edited. ! Miscelleneous Stuff ! =================== ! |latex-help| ! LaTeX's tex-info file translated into a vim help file. ! ! |latex-dictionary| ! A dictionary of standard LaTeX terms. ! ! |latex-tools| ! This version of latex-suite also ships with an external tools: ! 2. |ltags| A script to generate a tags file. It recognizes files being ! \input'ed into a main file. (ltags is written by Dimitri Antoniou) }}} =========================================================================== *************** *** 168,195 **** «» \end{center}«» ! with the cursor left at the first |placeholder|. ! (The environment above is generated by typing ECE in insert mode) ! Rule for remembering shortcuts: ! ------------------------------- ! 1. All environment mappings begin with 'E' ! 2. If the environment can be broken up into 2 distinct words, such as ! flushright (flush + right), then the next 2 letters are the first letters ! of the 2 words. ! Example: > ! flushleft (_f_lush + _l_eft) ---> EFL ! flushright (_f_lush + _r_ight) ---> EFR ! eqnarray (_e_qn + _a_rray) ---> EEA ! < If on the other hand, the environment name cannot be broken up into 2 ! distinct words, then the next 2 letters are the first 2 letters of the name ! of the environment. ! Example: > ! equation (_eq_uation) ---> EEQ ! Of course, not every last one of the environments can follow this rule because ! of ambiguities. In case of doubt, pull down the Tex-Environments menu. The ! menu item should give the hint for the map. Along with the insert mode mappings, a set of visual mode mappings is --- 192,241 ---- «» \end{center}«» ! with the cursor left at the first |placeholder|. There are various ways of ! inserting environments into the source file. If the environment is a standard ! latex environment, then latex suite might also include common fields ! associated with it. ! Method 1: ! If you press <F5> in the insert mode while on an empty line, latex-suite ! prompts you with a list of environments you might want to insert. You can ! either choose one from the list or type in a new environment name. This ! list can be customized. See the 'Macros' section of the |texrc| file for ! details. ! Method 2: ! If you press <F5> while on a line containing a single word, then ! latex-suite creates a environment of that name. ! Method 3: ! The shifted function keys, <S-F1> to <S-F4> can also be optionally mapped ! to some common environments which you insert most often. The environments ! mapped to each key can also be customized. See the |texrc| file for ! details. ! Method 4: ! Environments can also be inserted by pressing a 3 capital letter sequence ! starting with an E. The following subsection describes this in detail. The ! sequence of 3 letters generally tries to follow the following rules: ! ! 1. All environment mappings begin with 'E' ! ! 2. If the environment can be broken up into 2 distinct words, such as ! flushright (flush + right), then the next 2 letters are the first ! letters of the 2 words. ! Example: > ! flushleft (_f_lush + _l_eft) ---> EFL ! flushright (_f_lush + _r_ight) ---> EFR ! eqnarray (_e_qn + _a_rray) ---> EEA ! ! < If on the other hand, the environment name cannot be broken up into 2 ! distinct words, then the next 2 letters are the first 2 letters of the name ! of the environment. ! Example: > ! equation (_eq_uation) ---> EEQ ! ! < Of course, not every last one of the environments can follow this rule ! because of ambiguities. In case of doubt, pull down the ! Tex-Environments menu. The menu item should give the hint for the map. Along with the insert mode mappings, a set of visual mode mappings is *************** *** 361,364 **** --- 407,503 ---- }}} =========================================================================== + LATEX SMART KEYS *latex-smart-keys* {{{ + + Latex suite ships with the following smart keys: + + Smart Backspace + Pressing <BS> in insert mode checks to see whether we are just after + something like \'{a} and if so, deletes all of it. i.e, diacritics are + treated as single characters for backspacing. + + Smart Quotes + Pressing " (english double quote) will insert `` or '' by making an + intelligent guess about whether we intended to open or close a quote. + + Smart Space + Latex-suite maps the <space> key in such a way that $ characters are not + broken across lines. It does this by first setting tw=0 so that vim will + not automatically break lines and then maps the <space> key to insert + newlines keeping $$'s on the same line. + + Smart Dots + Pressing ... (3 dots) results in \ldots outside math mode and \cdots in + math mode. + + }}} + =========================================================================== + CUSTOM TEMPLATES *latex-templates* {{{ + + This functionality is available via the TeX-Suite.Templates menu. + + This module provides a way to insert custom templates at the beginning of the + current file. + + When latex-suite first starts up, it scans the latex-suite/templates/ directory + and creates menu items based on the files found there. When you select a + template from this menu, the file will be read in above the first line of the + current file. + + A template file can use |placeholders| for easy cursor movement. In addition, + you can use lines such as the following for inserting dates, names + dynamically: > + % File: ¡expand("%")¡ + + This will create a line of the form: > + % File: name.tex + + if the current file name is name.tex. + + NOTE: Templates are also accessible for non-gui users with the command + |:TexTemplate|. The argument should be name of the corresponding template + file. If the command is called without arguments (preferred usage), then a + list of avaiable templates is displayed and the user is asked to choose one of + them. + + You can ofcourse place your own templates in this directory. + + }}} + =========================================================================== + CUSTOM MACROS *latex-custom-macros* {{{ + + This functionality is available via the TeX-Suite.Macros menu. + + This module provides a way of inserting customized macros into the current + file. + + When latex-suite starts up, it scans the latex-suite/macros/ directory and + creates a menu from the files found there. Each file is considered as a single + macro. You can place your own macros in this directory, using |placeholders| + if wanted. + + When you choose a macro from the menu, the corresponding file is read into the + current buffer after the current cursor position. In non-gui mode, you can + use the |TexMacro| command instead of choosing from the menu. This command + takes the macro file name as an argument. When called without arguments + (preferred usage), then a list of avaiable macro files is displayed and the + user is prompted to choose one of them). + + There are some other tools provided in this menu, namely: + + {New} Creates a new (unnamed) buffer in the latex-suite/macros/ + directory. + Use the command :TexMacroNew in non-gui mode. + + {Edit} Opens up the corresponding macro file for editing. + Use :TexMacroEdit in non-gui mode. + + {Delete} Deletes the corresponding macro. + Use the prefixed numbers for fast navigation of menus. + Use :TexMacroDelete in non-gui mode. + + {Redraw} Rescans the macros/ directory and refreshes the macros list. + + }}} + =========================================================================== LATEX COMPILING *latex-compiling* {{{ *************** *** 373,379 **** and displays the errors in a |quickfix-window|. You can then scroll through the errors and press <enter> to be taken to the location of the corresponding ! error. Along with the errors being listed in the quickfix window, the log file ! corresponding is also opened in |preview| mode. It is scrolled automatically ! to keep in sync with the error being viewed in the quickfix window. |latex-compiler-target| : specifying a different target format for --- 512,519 ---- and displays the errors in a |quickfix-window|. You can then scroll through the errors and press <enter> to be taken to the location of the corresponding ! error. Along with the errors being listed in the quickfix window, the ! corresponding log file is also opened in |preview| mode. It is scrolled ! automatically to keep in sync with the error being viewed in the quickfix ! window. |latex-compiler-target| : specifying a different target format for *************** *** 712,794 **** }}} =========================================================================== - CUSTOM TEMPLATES *latex-templates* {{{ - - This functionality is available via the TeX-Suite.Templates menu. - - This module provides a way to insert custom templates at the beginning of the - current file. - - When latex-suite first starts up, it scans the latex-suite/templates/ directory - and creates menu items based on the files found there. When you select a - template from this menu, the file will be read in above the first line of the - current file. - - A template file can use |placeholders| for easy cursor movement. In addition, - you can use lines such as the following for inserting dates, names - dynamically: > - % File: ¡expand("%")¡ - - This will create a line of the form: > - % File: name.tex - - if the current file name is name.tex. - - NOTE: Templates are also accessible for non-gui users with the command - |:TexTemplate|. The argument should be name of the corresponding template - file. If the command is called without arguments (preferred usage), then a - list of avaiable templates is displayed and the user is asked to choose one of - them. - - You can ofcourse place your own templates in this directory. - - }}} - =========================================================================== - CUSTOM MACROS *latex-custom-macros* {{{ - - This functionality is available via the TeX-Suite.Macros menu. - - This module provides a way of inserting customized macros into the current - file. - - When latex-suite starts up, it scans the latex-suite/macros/ directory and - creates a menu from the files found there. Each file is considered as a single - macro. You can place your own macros in this directory, using |placeholders| - if wanted. - - When you choose a macro from the menu, the corresponding file is read into the - current buffer after the current cursor position. In non-gui mode, you can - use the |TexMacro| command instead of choosing from the menu. This command - takes the macro file name as an argument. When called without arguments - (preferred usage), then a list of avaiable macro files is displayed and the - user is prompted to choose one of them). - - There are some other tools provided in this menu, namely: - - {New} Creates a new (unnamed) buffer in the latex-suite/macros/ - directory. - Use the command :TexMacroNew in non-gui mode. - - {Edit} Opens up the corresponding macro file for editing. - Use :TexMacroEdit in non-gui mode. - - {Delete} Deletes the corresponding macro. - Use the prefixed numbers for fast navigation of menus. - Use :TexMacroDelete in non-gui mode. - - {Redraw} Rescans the macros/ directory and refreshes the macros list. - - }}} - =========================================================================== - LATEX MENU CONFIGURATION *latex-menu-configuration* {{{ - - *latex-menu-configure* - - Generally latex-suite's menus should be configured by setting options in the - |texrc| file. But if you feel the need to change after startup, then use the - 'TeX-Suite.Configure Menu' menu option to turn some of the menus off and on, - control the nested-ness of some of the menus etc. - - }}} - =========================================================================== LATEX HELP *latex-help* {{{ --- 852,855 ---- *************** *** 821,824 **** --- 882,896 ---- }}} =========================================================================== + LATEX MENU CONFIGURATION *latex-menu-configuration* {{{ + + *latex-menu-configure* + + Generally latex-suite's menus should be configured by setting options in the + |texrc| file. But if you feel the need to change after startup, then use the + 'TeX-Suite.Configure Menu' menu option to turn some of the menus off and on, + control the nested-ness of some of the menus etc. + + }}} + =========================================================================== LATEX SUITE COMMANDS *latex-suite-commands* {{{ *************** *** 828,832 **** :TMacro [{macro}] *TMacro* When used without any arguments lists all available macros ! defined in latex-suite/macros/ directory and prompt you to choose one of them. With one argument |:read| this macro under cursor position. --- 900,904 ---- :TMacro [{macro}] *TMacro* When used without any arguments lists all available macros ! defined in latex-suite/macros/ directory and prompts you to choose one of them. With one argument |:read| this macro under cursor position. |
From: <sri...@us...> - 2002-12-07 02:19:08
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv16317 Modified Files: brackets.vim Log Message: . code restructuring. gathered all functions towards the end of file. Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** brackets.vim 7 Dec 2002 01:09:03 -0000 1.2 --- brackets.vim 7 Dec 2002 02:19:06 -0000 1.3 *************** *** 2,6 **** " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Fri Dec 06 05:00 PM 2002 PST " Desciption: " This ftplugin provides the following maps: --- 2,6 ---- " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Fri Dec 06 06:00 PM 2002 PST " Desciption: " This ftplugin provides the following maps: *************** *** 35,156 **** " " ============================================================================== " ============================================================================== ! " Boldface: Mapping <M-b> to insert \mathbf{} {{{ ! " Insert Mode: ! " Typing <M-b> after a character capitalizes it and encloses it in \mathbf{} ! " Visual Mode: ! " Encloses the selected portion in \mathbf{} if !hasmapto('Tex_MathBF') inoremap <buffer> <silent> <M-b> <C-r>=Tex_MathBF()<CR> endif - - " Tex_MathBF: encloses te previous letter or number in \mathbf{} {{{ - " Description: - function! Tex_MathBF() - return "\<Left>\\mathbf{\<Right>}\<Esc>hvUla" - endfunction " }}} - - vnoremap <buffer> <silent> <M-b> <C-C>`>a}<Esc>`<i\mathbf{<Esc> - " }}} - - " ============================================================================== - " Tex_MathCal: Mapping <M-c> to insert \mathcal{} or \cite{} {{{ - " Insert Mode: - " 1. If the previous character is a letter or number, then capitalize it and - " enclose it in \mathcal{} - " 2. otherwise insert \cite{«»}«» - " Visual Mode: - " 1. Enclose selection in \mathcal{} if !hasmapto('Tex_MathCal') && mapcheck('<M-c>') == '' inoremap <buffer> <silent> <M-c> <C-R>=Tex_MathCal()<CR> endif ! if !exists('*Tex_MathCal') ! ! function! Tex_MathCal() ! let line = getline(line(".")) ! let char = line[col(".")-2] ! ! if char =~ '[a-zA-Z0-9]' ! return "\<BS>".'\mathcal{'.toupper(char).'}' ! else ! return IMAP_PutTextWithMovement('\cite{«»}«»') ! endif ! endfunction ! endif vnoremap <buffer> <silent> <M-c> <C-C>`>a}<Esc>`<i\mathcal{<Esc> " }}} " ============================================================================== ! " LeftRight: Function for inserting \left and \right in front of bracket chars ! " in various ways using <M-l>. If not possible, insert \label{«»}«» ! " ============================================================================== ! " {{{ ! " ! if !hasmapto('Tex_LeftRight') ! inoremap <buffer> <silent> <M-l> <C-r>=Tex_LeftRight()<CR> ! endif ! if !hasmapto('Tex_PutLeftRight') ! nnoremap <buffer> <silent> <M-l> :call <SID>PutLeftRight()<CR> endif ! if !exists('*s:LeftRight') ! " Tex_LeftRight: maps <M-l> in insert mode. {{{ ! " This is a polymorphic function, which maps the behaviour of <M-l> in the ! " following way: ! " If the character before typing <M-l> is one of '([{|<q', then do the ! " following: ! " 1. (<M-l> \left(«»\right«» ! " similarly for [, | ! " {<M-l> \left\{«»\right\}«» ! " 2. <<M-l> \langle«»\rangle«» ! " 3. q<M-l> \lefteqn{«»}«» ! " otherwise insert \label{«»}«» ! function! Tex_LeftRight() ! let line = getline(line(".")) ! let char = line[col(".")-2] ! let previous = line[col(".")-3] ! let matchedbrackets = '()[]{}||' ! if char =~ '(\|\[\|{\||' ! let add = '' ! if char =~ '{' ! let add = "\\" ! endif ! let rhs = matchstr(matchedbrackets, char.'\zs.\ze') ! return "\<BS>".IMAP_PutTextWithMovement('\left'.add.char.'«»\right'.add.rhs.'«»') ! elseif char == '<' ! return "\<BS>".IMAP_PutTextWithMovement('langle«»\rangle«»') ! elseif char == 'q' ! return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{«»}«»') ! else ! return '\label{«»}«»' endif ! endfunction " }}} ! " Tex_PutLeftRight: maps <M-l> in normal mode {{{ ! " Put \left...\right in front of the matched brackets. ! function! Tex_PutLeftRight() ! let previous = getline(line("."))[col(".") - 2] ! let char = getline(line("."))[col(".") - 1] ! if previous == '\' ! if char == '{' ! exe "normal ileft\\\<Esc>l%iright\\\<Esc>l%" ! elseif char == '}' ! exe "normal iright\\\<Esc>l%ileft\\\<Esc>l%" ! endif ! elseif char =~ '\[\|(' ! exe "normal i\\left\<Esc>l%i\\right\<Esc>l%" ! elseif char =~ '\]\|)' ! exe "normal i\\right\<Esc>l%i\\left\<Esc>l%" endif ! endfunction " }}} ! endif ! ! " }}} " vim:fdm=marker --- 35,151 ---- " " ============================================================================== + " Avoid reinclusion. + if exists('b:did_brackets') + finish + endif + let b:did_brackets = 1 + " ============================================================================== + " Insert mode mappings + " All the insert mode mappings check to see if the function they are creating + " the map for already exists in the rhs of some map. " ============================================================================== ! " {{{ if !hasmapto('Tex_MathBF') inoremap <buffer> <silent> <M-b> <C-r>=Tex_MathBF()<CR> endif if !hasmapto('Tex_MathCal') && mapcheck('<M-c>') == '' inoremap <buffer> <silent> <M-c> <C-R>=Tex_MathCal()<CR> endif + if !hasmapto('Tex_LeftRight') + inoremap <buffer> <silent> <M-l> <C-r>=Tex_LeftRight()<CR> + endif ! " }}} ! " ============================================================================== ! " Visual/Normal Mode mappings. ! " ============================================================================== ! " {{{ + vnoremap <buffer> <silent> <M-b> <C-C>`>a}<Esc>`<i\mathbf{<Esc> vnoremap <buffer> <silent> <M-c> <C-C>`>a}<Esc>`<i\mathcal{<Esc> + nnoremap <buffer> <silent> <M-l> :call <SID>PutLeftRight()<CR> " }}} " ============================================================================== ! " Function definitions ! " ============================================================================== ! " define the funtions only once. ! if exists('*Tex_MathBF') ! finish endif + " Tex_MathBF: encloses te previous letter/number in \mathbf{} {{{ + " Description: + function! Tex_MathBF() + return "\<Left>\\mathbf{\<Right>}\<Esc>hvUla" + endfunction " }}} + " Tex_MathCal: enclose the previous letter/number in \mathcal {{{ + " Desciption: + " if the last character is not a letter/number, then insert \cite{} + function! Tex_MathCal() + let line = getline(line(".")) + let char = line[col(".")-2] ! if char =~ '[a-zA-Z0-9]' ! return "\<BS>".'\mathcal{'.toupper(char).'}' ! else ! return IMAP_PutTextWithMovement('\cite{«»}«»') ! endif ! endfunction ! " }}} ! " Tex_LeftRight: maps <M-l> in insert mode. {{{ ! " Description: ! " This is a polymorphic function, which maps the behaviour of <M-l> in the ! " following way: ! " If the character before typing <M-l> is one of '([{|<q', then do the ! " following: ! " 1. (<M-l> \left(«»\right«» ! " similarly for [, | ! " {<M-l> \left\{«»\right\}«» ! " 2. <<M-l> \langle«»\rangle«» ! " 3. q<M-l> \lefteqn{«»}«» ! " otherwise insert \label{«»}«» ! function! Tex_LeftRight() ! let line = getline(line(".")) ! let char = line[col(".")-2] ! let previous = line[col(".")-3] ! let matchedbrackets = '()[]{}||' ! if char =~ '(\|\[\|{\||' ! let add = '' ! if char =~ '{' ! let add = "\\" endif ! let rhs = matchstr(matchedbrackets, char.'\zs.\ze') ! return "\<BS>".IMAP_PutTextWithMovement('\left'.add.char.'«»\right'.add.rhs.'«»') ! elseif char == '<' ! return "\<BS>".IMAP_PutTextWithMovement('langle«»\rangle«»') ! elseif char == 'q' ! return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{«»}«»') ! else ! return '\label{«»}«»' ! endif ! endfunction " }}} ! " Tex_PutLeftRight: maps <M-l> in normal mode {{{ ! " Description: ! " Put \left...\right in front of the matched brackets. ! function! Tex_PutLeftRight() ! let previous = getline(line("."))[col(".") - 2] ! let char = getline(line("."))[col(".") - 1] ! if previous == '\' ! if char == '{' ! exe "normal ileft\\\<Esc>l%iright\\\<Esc>l%" ! elseif char == '}' ! exe "normal iright\\\<Esc>l%ileft\\\<Esc>l%" endif ! elseif char =~ '\[\|(' ! exe "normal i\\left\<Esc>l%i\\right\<Esc>l%" ! elseif char =~ '\]\|)' ! exe "normal i\\right\<Esc>l%i\\left\<Esc>l%" ! endif ! endfunction " }}} " vim:fdm=marker |
From: <sri...@us...> - 2002-12-07 01:09:07
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv14707 Modified Files: brackets.vim Log Message: Marco Aurelio Valtas Cunha writes: I'm using the latex-suite to write in Portuguese. Portuguese often has caracters like 'ã' but latex-suite maps this to \cite{}. After look around I couldn't find a simple way to 1) remap or 2) disable. Solution: Provide new globally visible functions Tex_MathBF, Tex_MathCal and Tex_LeftRight. Use mapcheck() to check whether a map exists for these functions before mapping the alt keys to trigger them. This enables people who might need the alt keys for other uses to utilize this behavior and keep the original behavior of their alt keys. Example: In order to use some other key, (say <CTRL-c>) to use Tex_MathCal(), do the following inoremap <buffer> <silent> <C-c> <C-r>=Tex_MathCal()<CR> If you do not want to use this functionality at all, do something like: inoremap <buffer> <silent> <plug>1 <C-r>=Tex_MathCal()<CR> This will never trigger the map. Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** brackets.vim 17 Nov 2002 03:45:39 -0000 1.1 --- brackets.vim 7 Dec 2002 01:09:03 -0000 1.2 *************** *** 2,7 **** " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Sat Nov 16 06:00 PM 2002 PST " Desciption: " ============================================================================== --- 2,37 ---- " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Fri Dec 06 05:00 PM 2002 PST " Desciption: + " This ftplugin provides the following maps: + " . <M-b> encloses the previous character in \mathbf{} + " . <M-c> is polymorphic as follows: + " Insert mode: + " 1. If the previous character is a letter or number, then capitalize it and + " enclose it in \mathcal{} + " 2. otherwise insert \cite{} + " Visual Mode: + " 1. Enclose selection in \mathcal{} + " . <M-l> is also polymorphic as follows: + " If the character before typing <M-l> is one of '([{|<q', then do the + " following: + " 1. (<M-l> \left(\right + " similarly for [, | + " {<M-l> \left\{\right\} + " 2. <<M-l> \langle\rangle + " 3. q<M-l> \lefteqn{} + " otherwise insert \label{} + " + " These functions make it extremeley easy to do all the \left \right stuff in + " latex. + " + " NOTE: The insert mode maps are created only if maps are no maps already to + " the relevant functions Tex_MathBF, Tex_MathCal and Tex_LeftRight. This is to + " enable people who might need the alt keys for typing to use some other + " keypress to trigger the same behavior. In order to use some other key, (say + " <C-c>) to use Tex_MathCal(), do the following + " + " inoremap <buffer> <silent> <C-c> <C-r>=Tex_MathCal()<CR> + " " ============================================================================== *************** *** 12,20 **** " Visual Mode: " Encloses the selected portion in \mathbf{} ! inoremap <buffer> <silent> <M-b> <Left>\mathbf{<Right>}<Esc>hvUla vnoremap <buffer> <silent> <M-b> <C-C>`>a}<Esc>`<i\mathbf{<Esc> " }}} " ============================================================================== ! " MathCal: Mapping <M-c> to insert \mathcal{} or \cite{} {{{ " Insert Mode: " 1. If the previous character is a letter or number, then capitalize it and --- 42,61 ---- " Visual Mode: " Encloses the selected portion in \mathbf{} ! ! if !hasmapto('Tex_MathBF') ! inoremap <buffer> <silent> <M-b> <C-r>=Tex_MathBF()<CR> ! endif ! ! " Tex_MathBF: encloses te previous letter or number in \mathbf{} {{{ ! " Description: ! function! Tex_MathBF() ! return "\<Left>\\mathbf{\<Right>}\<Esc>hvUla" ! endfunction " }}} ! vnoremap <buffer> <silent> <M-b> <C-C>`>a}<Esc>`<i\mathbf{<Esc> " }}} + " ============================================================================== ! " Tex_MathCal: Mapping <M-c> to insert \mathcal{} or \cite{} {{{ " Insert Mode: " 1. If the previous character is a letter or number, then capitalize it and *************** *** 23,30 **** " Visual Mode: " 1. Enclose selection in \mathcal{} ! inoremap <buffer> <silent> <M-c> <C-R>=<SID>MathCal()<CR> ! if !exists('*s:MathCal') ! function! s:MathCal() let line = getline(line(".")) let char = line[col(".")-2] --- 64,74 ---- " Visual Mode: " 1. Enclose selection in \mathcal{} ! if !hasmapto('Tex_MathCal') && mapcheck('<M-c>') == '' ! inoremap <buffer> <silent> <M-c> <C-R>=Tex_MathCal()<CR> ! endif ! if !exists('*Tex_MathCal') ! ! function! Tex_MathCal() let line = getline(line(".")) let char = line[col(".")-2] *************** *** 36,39 **** --- 80,84 ---- endif endfunction + endif *************** *** 41,54 **** " }}} " ============================================================================== " LeftRight: Function for inserting \left and \right in front of bracket chars " in various ways using <M-l>. If not possible, insert \label{«»}«» " {{{ " ! inoremap <buffer> <silent> <M-l> <C-r>=<SID>LeftRight()<CR> ! nnoremap <buffer> <silent> <M-l> :call <SID>PutLeftRight()<CR> if !exists('*s:LeftRight') ! " LeftRight: maps <M-l> in insert mode. {{{ " This is a polymorphic function, which maps the behaviour of <M-l> in the " following way: --- 86,105 ---- " }}} + " ============================================================================== " LeftRight: Function for inserting \left and \right in front of bracket chars " in various ways using <M-l>. If not possible, insert \label{«»}«» + " ============================================================================== " {{{ " ! if !hasmapto('Tex_LeftRight') ! inoremap <buffer> <silent> <M-l> <C-r>=Tex_LeftRight()<CR> ! endif ! if !hasmapto('Tex_PutLeftRight') ! nnoremap <buffer> <silent> <M-l> :call <SID>PutLeftRight()<CR> ! endif if !exists('*s:LeftRight') ! " Tex_LeftRight: maps <M-l> in insert mode. {{{ " This is a polymorphic function, which maps the behaviour of <M-l> in the " following way: *************** *** 61,65 **** " 3. q<M-l> \lefteqn{«»}«» " otherwise insert \label{«»}«» ! function! s:LeftRight() let line = getline(line(".")) let char = line[col(".")-2] --- 112,116 ---- " 3. q<M-l> \lefteqn{«»}«» " otherwise insert \label{«»}«» ! function! Tex_LeftRight() let line = getline(line(".")) let char = line[col(".")-2] *************** *** 82,88 **** endif endfunction " }}} ! " PutLeftRight: maps <M-l> in normal mode {{{ " Put \left...\right in front of the matched brackets. ! function! s:PutLeftRight() let previous = getline(line("."))[col(".") - 2] let char = getline(line("."))[col(".") - 1] --- 133,139 ---- endif endfunction " }}} ! " Tex_PutLeftRight: maps <M-l> in normal mode {{{ " Put \left...\right in front of the matched brackets. ! function! Tex_PutLeftRight() let previous = getline(line("."))[col(".") - 2] let char = getline(line("."))[col(".") - 1] *************** *** 102,106 **** " }}} - " ============================================================================== " vim:fdm=marker --- 153,156 ---- |
From: <sri...@us...> - 2002-12-07 00:43:44
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv31595 Modified Files: imaps.vim Log Message: Changing encoding from one locale to the next causes huge ugly screen flickers. Therefore only change encoding if the original encoding is not latin1. This will at least cause it to be smoother on machines using latin1 encoding. The problem ofcourse will still be there for other locales. Therefore, look for a more long term solution which does not require the encoding to be changed back and forth with each imap execution. If only someone had told me at the beginning not to use ascii > 127 characters!! I think in the next major rev, we will have to undertake a major overhaul of all the macros to not use any of the higher ascii characters. Maybe modify IMAP() to allow for multiple character placeholder characters... (maybe '{+' and '+}' like in cream). This will instantly remove all the internationalization and localization problems. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** imaps.vim 6 Dec 2002 16:20:00 -0000 1.7 --- imaps.vim 7 Dec 2002 00:43:41 -0000 1.8 *************** *** 5,9 **** " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " Last Change: Mon Dec 02 04:00 AM 2002 PST " " Documentation: {{{ --- 5,9 ---- " Description: insert mode template expander with cursor placement " while preserving filetype indentation. ! " Last Change: Fri Dec 06 04:00 PM 2002 PST " " Documentation: {{{ *************** *** 272,276 **** let s:oldenc = &encoding ! let &encoding='latin1' let text = a:text --- 272,278 ---- let s:oldenc = &encoding ! if &encoding != 'latin1' ! let &encoding='latin1' ! endif let text = a:text *************** *** 345,349 **** end ! let &encoding = s:oldenc return initial.text.movement --- 347,354 ---- end ! ! if s:oldenc != 'latin1' ! let &encoding = s:oldenc ! endif return initial.text.movement *************** *** 358,362 **** function! IMAP_Jumpfunc() let s:oldenc = &encoding ! setglobal encoding=latin1 let phs = '«' --- 363,370 ---- function! IMAP_Jumpfunc() let s:oldenc = &encoding ! if s:oldenc != 'latin1' ! setglobal encoding=latin1 ! endif ! let phs = '«' *************** *** 409,413 **** " Description: function! RestoreEncoding() ! let &g:encoding = s:oldenc return '' endfunction " }}} --- 417,423 ---- " Description: function! RestoreEncoding() ! if s:oldenc != 'latin1' ! let &g:encoding = s:oldenc ! endif return '' endfunction " }}} |
From: <mi...@us...> - 2002-12-06 23:55:45
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv918 Modified Files: packages.vim Log Message: Changes necessary for proper working of Tex_pack_one: now calling :TPackage returns line \usepackage{choice}. Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** packages.vim 30 Nov 2002 14:56:43 -0000 1.12 --- packages.vim 6 Dec 2002 23:55:42 -0000 1.13 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: sob lis 30 03:00 2002 C " " Description: handling packages from within vim --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: sob gru 07 12:00 2002 C " " Description: handling packages from within vim *************** *** 21,25 **** com! -nargs=* TPackage call Tex_pack_one(<f-args>) ! com! -nargs=0 TPackageUpdate :silent! call Tex_pack_one(expand("<cword>")) com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall() --- 21,25 ---- com! -nargs=* TPackage call Tex_pack_one(<f-args>) ! com! -nargs=0 TPackageUpdate :silent! call Tex_pack_updateall() com! -nargs=0 TPackageUpdateAll :silent! call Tex_pack_updateall() *************** *** 84,89 **** let pwd = getcwd() exe 'cd '.s:path.'/packages' ! let filename = Tex_ChooseFile('Choose a package: ') exe 'cd '.pwd else let i = a:0 --- 84,90 ---- let pwd = getcwd() exe 'cd '.s:path.'/packages' ! let packname = Tex_ChooseFile('Choose a package: ') exe 'cd '.pwd + call Tex_pack_check(packname) else let i = a:0 *************** *** 95,98 **** --- 96,100 ---- endwhile endif + return Tex_pack_supp(packname) endfunction " }}} |
From: <mi...@us...> - 2002-12-06 23:55:39
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv848 Modified Files: main.vim Log Message: Modification of Tex_ChooseFile() for proper work with choose list. Previously it didn't accept word value because it was calling Tex_Strntok which accepts only digital value. Now it uses Tex_Strntok only if Choice is '\s*\d\+\s*'. In other case it use GetListMatchItem from libList.vim. This is not possible to make different prompt than "Enter Choice:" because this function is called in package, template and macro context. Making it different would require adding additional argument to function. This is not much work but I doubt this is necessary. At the top of the list is information "Choose a macro", "Choose a template", "Choose a package". Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** main.vim 6 Dec 2002 09:37:51 -0000 1.14 --- main.vim 6 Dec 2002 23:55:35 -0000 1.15 *************** *** 4,8 **** " Email: sr...@fa... " URL: ! " Last Change: Fri Dec 06 01:00 AM 2002 PST " " Help: --- 4,8 ---- " Email: sr...@fa... " URL: ! " Last Change: sob gru 07 12:00 2002 C " " Help: *************** *** 397,407 **** let filenames = substitute(files, "\\v(^|\n)", "\\=submatch(0).Tex_IncrementNumber(1).' : '", 'g') echo filenames ! let num = input('Enter Choice :') ! if num == '' ! let num = 1 endif - let retval = Tex_Strntok(files, "\n", num) if retval == '' ! let ret = Tex_Strntok(files, "\n", 1) endif return retval --- 397,413 ---- let filenames = substitute(files, "\\v(^|\n)", "\\=submatch(0).Tex_IncrementNumber(1).' : '", 'g') echo filenames ! let choice = input('Enter Choice : ') ! let g:choice = choice ! if choice == '' ! return '' ! endif ! if choice =~ '^\s*\d\+\s*$' ! let retval = Tex_Strntok(files, "\n", choice) ! else ! let filescomma = substitute(files, "\n", ",", "g") ! let retval = GetListMatchItem(filescomma, choice) endif if retval == '' ! return '' endif return retval |
From: Benji F. <be...@me...> - 2002-12-06 16:33:56
|
ma...@us... wrote: > Update of /cvsroot/vim-latex/vimfiles/plugin > In directory sc8-pr-cvs1:/tmp/cvs-serv31150/plugin > > Modified Files: > imaps.vim > Log Message: > Oops: my previous commit was the wrong version of the file. This one should > work. Sorry for the cryptic log message. I guess the botched commit did not work at all. Here is, approximately, the CVS log message I meant to include: Use a (local) variable s:RemoveLastHistoryItem instead of a (global) function SAImaps_RemoveLastHistoryItem(). Also, clean up some comment lines from a previous change to this file. --Benji |
From: <ma...@us...> - 2002-12-06 16:20:21
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv31150/plugin Modified Files: imaps.vim Log Message: Oops: my previous commit was the wrong version of the file. This one should work. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** imaps.vim 2 Dec 2002 13:09:16 -0000 1.6 --- imaps.vim 6 Dec 2002 16:20:00 -0000 1.7 *************** *** 314,318 **** elseif fc == 0 let initial = "" ! let movement = "\<C-\>\<C-N>?ä\<cr>:call SAImaps_RemoveLastHistoryItem()\<cr>s" " however, if its somewhere in the middle, then we need to go back to the --- 314,318 ---- elseif fc == 0 let initial = "" ! let movement = "\<C-\>\<C-N>?ä\<cr>" . s:RemoveLastHistoryItem . "\<cr>s" " however, if its somewhere in the middle, then we need to go back to the *************** *** 331,338 **** " we needed 2 searches to get here. remove them from the search " history. ! let movement = movement.":call SAImaps_RemoveLastHistoryItem()\<cr>" ! " BNF 12 Nov 2002: Functions never add more than one item to the searcg ! " history. ! " let movement = movement.":call SAImaps_RemoveLastHistoryItem()\<cr>" " if its a ä or «», then just delete it --- 331,335 ---- " we needed 2 searches to get here. remove them from the search " history. ! let movement = movement . s:RemoveLastHistoryItem . "\<cr>" " if its a ä or «», then just delete it *************** *** 469,473 **** let @r = _r " and finally, this is to restore the search history. ! call SAImaps_RemoveLastHistoryItem() else --- 466,470 ---- let @r = _r " and finally, this is to restore the search history. ! execute s:RemoveLastHistoryItem else *************** *** 554,564 **** " }}} ! " SAImaps_RemoveLastHistoryItem: removes last search item from search history {{{ ! " Description: This function needs to be globally visible because its ! " called from outside the script during expansion. ! function! SAImaps_RemoveLastHistoryItem() ! call histdel("/", -1) ! let @/ = histget("/", -1) ! endfunction " }}} --- 551,557 ---- " }}} ! " s:RemoveLastHistoryItem: removes last search item from search history {{{ ! " Description: Execute this string to clean up the search history. ! let s:RemoveLastHistoryItem = ':call histdel("/", -1)|let @/=histget("/", -1)' " }}} |
From: <sri...@us...> - 2002-12-06 09:48:26
|
Update of /cvsroot/vim-latex/vimfiles/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv23208 Modified Files: tex.vim Log Message: . In the following error message: ! some error <some stuff> some more stuff l.12 some error notification here... include 'some more stuff' as part of the error message. Initially, it was ignored. TODO: also get 'some stuff' into the error message... Index: tex.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/compiler/tex.vim,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tex.vim 20 Nov 2002 05:53:56 -0000 1.4 --- tex.vim 6 Dec 2002 09:48:22 -0000 1.5 *************** *** 3,7 **** " Original Author: Artem Chuprina <ra...@ra...> " Customization: Srinath Avadhanula <sr...@fa...> ! " Last Change: Tue Nov 19 09:00 PM 2002 PST " Description: {{{ " This file sets the 'makeprg' and 'errorformat' options for the LaTeX --- 3,7 ---- " Original Author: Artem Chuprina <ra...@ra...> " Customization: Srinath Avadhanula <sr...@fa...> ! " Last Change: Fri Dec 06 01:00 AM 2002 PST " Description: {{{ " This file sets the 'makeprg' and 'errorformat' options for the LaTeX *************** *** 212,216 **** exec 'setlocal efm+=%'.pm.'C[]%.%#' exec 'setlocal efm+=%'.pm.'C%.%#%[{}\\]%.%#' ! exec 'setlocal efm+=%'.pm.'C<%.%#>%.%#' exec 'setlocal efm+=%'.pm.'C\ \ %m' exec 'setlocal efm+=%'.pm.'GSee\ the\ LaTeX%m' --- 212,216 ---- exec 'setlocal efm+=%'.pm.'C[]%.%#' exec 'setlocal efm+=%'.pm.'C%.%#%[{}\\]%.%#' ! exec 'setlocal efm+=%'.pm.'C<%.%#>%m' exec 'setlocal efm+=%'.pm.'C\ \ %m' exec 'setlocal efm+=%'.pm.'GSee\ the\ LaTeX%m' |
From: <sri...@us...> - 2002-12-06 09:44:09
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv21605 Modified Files: envmacros.vim Log Message: . added the function SetupHotKeys() which map <S-F1> through <S-F4> to insert new environments. . use the g:Tex_PromptedEnvironments and g:Tex_HotKeyMaps instead of some s: variables. . Code restucturing and cleanup. I found that there were many functions here which were not being used at all. I have removed them all. I seem to remember the Tex_AmsLatex() function being used for something important, but I couldnt see it being used anywhere, so I removed it. If someone knows where this was being used, let me know. Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** envmacros.vim 6 Dec 2002 06:44:03 -0000 1.10 --- envmacros.vim 6 Dec 2002 09:44:06 -0000 1.11 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 08:00 PM 2002 PST ! " Last Change: Thu Dec 05 10:00 PM 2002 PST " " Description: mappings/menus for environments. --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 08:00 PM 2002 PST ! " Last Change: Fri Dec 06 12:00 AM 2002 PST " " Description: mappings/menus for environments. *************** *** 504,514 **** " Contributions / suggestions from Carl Mueller (auctex.vim) " ============================================================================== ! let s:common_environments = 'equation,equation*,eqnarray,eqnarray*,\[,$$,align,align*' ! ! " SetUpEnvironmentsPrompt: sets up a prompt string using s:common_environments {{{ " Description: " function! SetUpEnvironmentsPrompt() ! let num_common = GetListCount(s:common_environments) let i = 1 --- 504,512 ---- " Contributions / suggestions from Carl Mueller (auctex.vim) " ============================================================================== ! " SetUpEnvironmentsPrompt: sets up a prompt string using g:Tex_PromptedEnvironments {{{ " Description: " function! SetUpEnvironmentsPrompt() ! let num_common = GetListCount(g:Tex_PromptedEnvironments) let i = 1 *************** *** 517,522 **** while i < num_common ! let env1 = Tex_Strntok(s:common_environments, ',', i) ! let env2 = Tex_Strntok(s:common_environments, ',', i + 1) let s:common_env_prompt = s:common_env_prompt.'('.i.') '.env1."\t".( strlen(env1) < 4 ? "\t" : '' ).'('.(i+1).') '.env2."\n" --- 515,520 ---- while i < num_common ! let env1 = Tex_Strntok(g:Tex_PromptedEnvironments, ',', i) ! let env2 = Tex_Strntok(g:Tex_PromptedEnvironments, ',', i + 1) let s:common_env_prompt = s:common_env_prompt.'('.i.') '.env1."\t".( strlen(env1) < 4 ? "\t" : '' ).'('.(i+1).') '.env2."\n" *************** *** 536,540 **** let inp = input(a:ask.s:common_env_prompt) if inp =~ '^[0-9]$' ! let env = Tex_Strntok(s:common_environments, ',', inp) else let env = inp --- 534,538 ---- 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 *************** *** 559,563 **** endif else ! normal! 0D return Tex_PutEnvironment(env) endif --- 557,562 ---- endif else ! " delete the word on the line into the blackhole register. ! normal! 0"_D return Tex_PutEnvironment(env) endif *************** *** 588,753 **** endif endfunction " }}} ! inoremap <F5> <C-r>=Tex_FastEnvironmentInsert()<cr> ! nnoremap <F5> i<C-r>=Tex_FastEnvironmentInsert()<cr> ! function! Tex_FastEnvironmentInsert() " {{{ ! let start_line = line('.') ! let pos = line('.').' | normal! '.virtcol('.').'|' - if search('\\documentclass', 'bW') && search('\\begin{document}') - let begin_line = search('\\begin{document}') - if start_line < begin_line exe pos return Tex_package_from_line() else exe pos return Tex_DoEnvironment() endif - elseif search('\\documentclass') - exe pos - return Tex_package_from_line() - else - exe pos - return Tex_DoEnvironment() - endif - endfunction ! " }}} ! function! Tex_package_from_line() " {{{ ! " Function Tex_PutPackage is defined in packages.vim ! let l = getline(".") ! let pack = matchstr(l, '^\s*\zs.*') ! if pack == '' ! let pack = input('Package? ') ! if pack != '' return Tex_PutPackage(pack) endif ! return 0 ! else ! normal 0D ! return Tex_PutPackage(pack) ! endif ! endfunction " }}} ! let b:DoubleDollars = 0 ! inoremap <buffer> <S-F5> <C-O>:call Tex_change_environment()<CR> ! noremap <buffer> <S-F5> :call Tex_change_environment()<CR> ! function! Tex_AmsLatex() " {{{ ! if g:Tex_package_supported =~ 'amsmath' ! let amslatex = 1 ! endif ! return amslatex ! endfunction " }}} ! "let b:searchmax = 100 ! let s:math_environment = 'eqnarray,eqnarray*,align,align*,equation,equation*,[,$$' ! let s:item_environment = 'list,trivlist,enumerate,itemize,theindex' ! function! Tex_change_environment() " {{{ ! let env_line = searchpair("\\[\\|begin{", '', "\\]\\|end{", "bn") ! if env_line != 0 ! if getline(env_line) !~ 'begin{' ! let env_name = '[' else ! let env_name = matchstr(getline(env_line), 'begin{\zs.\{-}\ze}') endif ! endif ! if !exists('env_name') ! echomsg "You are not inside environment" ! return 0 ! endif ! exe 'echomsg "You are within a '.env_name.' environment."' ! let s:change_env = PromptForEnvironment('Do you want to change it to (number or name)? ') ! if s:change_env == 'eqnarray' ! call <SID>Change('eqnarray', 1, '', 1) ! elseif s:change_env == 'eqnarray*' ! call <SID>Change('eqnarray*', 0, '\\nonumber', 0) ! elseif s:change_env == 'align' ! call <SID>Change('align', 1, '', 1) ! elseif s:change_env == 'align*' ! call <SID>Change('align*', 0, '\\nonumber', 0) ! elseif s:change_env == 'equation*' ! call <SID>Change('equation*', 0, '&\|\\lefteqn{\|\\nonumber\|\\\\', 0) ! elseif s:change_env == '' ! return 0 ! else ! call <SID>Change(s:change_env, 0, '', '') ! return 0 ! endif ! endfunction " }}} ! function! s:Change(env, label, delete, putInNonumber) " {{{ ! let start_line = line('.') ! let start_col = virtcol('.') ! if a:env == '[' if b:DoubleDollars == 0 ! let first = '\\[' ! let second = '\\]' else ! let first = '$$' ! let second = '$$' endif ! else ! let first = '\\begin{' . a:env . '}' ! let second = '\\end{' . a:env . '}' ! endif ! if b:DoubleDollars == 0 ! let bottom = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','') ! s/\\\]\|\\end{.\{-}}/\=second/ ! let top = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','b') ! s/\\\[\|\\begin{.\{-}}/\=first/ ! else ! let bottom = search('\$\$\|\\end{') ! s/\$\$\|\\end{.\{-}}/\=second/ ! let top = search('\$\$\|\\begin{','b') ! s/\$\$\|\\begin{.\{-}}/\=first/ ! end ! if a:delete != '' ! exe 'silent '. top . "," . bottom . 's/' . a:delete . '//e' ! endif ! if a:putInNonumber == 1 ! exe top ! call search('\\end\|\\\\') ! if line('.') != bottom ! exe '.+1,' . bottom . 's/\\\\/\\nonumber\\\\/e' ! exe (bottom-1) . 's/\s*$/ \\nonumber/' endif ! endif ! if a:label == 1 ! exe top ! if search("\\label", "W") > bottom exe top ! let local_label = input('Label? ') ! if local_label != '' ! put = '\label{'.local_label.'}' endif ! normal $ endif - else - exe 'silent '.top . ',' . bottom . ' g/\\label/delete' - endif - if exists('local_label') && local_label != '' - exe start_line + 1.' | normal! '.start_col.'|' - else - exe start_line.' | normal! '.start_col.'|' - endif - endfunction " }}} ! " Due to Ralf Arens <ral...@gm...> ! function! s:ArgumentsForArray(arg) " {{{ ! put! = '{' . a:arg . '}' ! normal kgJj ! endfunction " }}} ! function! s:PutInNonumber() " {{{ ! call search('\\end\|\\\\') ! if getline(line('.'))[col('.')] != "e" ! .+1,'>s/\\\\/\\nonumber\\\\/e ! normal `>k ! s/\s*$/ \\nonumber/ ! endif ! endfunction " }}} --- 587,829 ---- endif endfunction " }}} + " Mapping the <F5> key to insert/prompt for an environment/package {{{ + " and <S-F5> to prompt/replace an environment + " + " g:Tex_PromptedEnvironments is a variable containing a comma seperated list + " of environments. This list defines the prompt which latex-suite sets up when + " the user presses <F5> on an empty line. + " + " Leaving this empty is equivalent to disabling the feature. + if g:Tex_PromptedEnvironments != '' ! let b:DoubleDollars = 0 ! inoremap <F5> <C-r>=Tex_FastEnvironmentInsert()<cr> ! nnoremap <F5> i<C-r>=Tex_FastEnvironmentInsert()<cr> ! inoremap <buffer> <S-F5> <C-O>:call Tex_ChangeEnvironments()<CR> ! nnoremap <buffer> <S-F5> :call Tex_ChangeEnvironments()<CR> ! " Tex_FastEnvironmentInsert: maps <F5> to prompt for env and insert it " {{{ ! " Description: ! " This function calculates whether we are in the preamble. If we are ! " then inserts a \usepackage line by either reading in a word from the ! " current line or prompting to type in one. If not in the preamble, then ! " inserts a environment template either by reading in a word from the ! " current line or prompting the user to choose one. ! " ! function! Tex_FastEnvironmentInsert() ! ! let start_line = line('.') ! let pos = line('.').' | normal! '.virtcol('.').'|' ! ! " decide if we are in the preamble of the document. If we are then ! " insert a package, otherwise insert an environment. ! " ! if search('\\documentclass', 'bW') && search('\\begin{document}') ! ! " If there is a \documentclass line and a \begin{document} line in ! " the file, then a part of the file is the preamble. ! ! " search for where the document begins. ! let begin_line = search('\\begin{document}') ! " if the document begins after where we are presently, then we are ! " in the preamble. ! if start_line < begin_line ! " return to our original location and insert a package ! " statement. ! exe pos ! return Tex_package_from_line() ! else ! " we are after the preamble. insert an environment. ! exe pos ! return Tex_DoEnvironment() ! endif ! ! elseif search('\\documentclass') ! " if there is only a \documentclass but no \begin{document}, then ! " the entire file is a preamble. Put a package. exe pos return Tex_package_from_line() + else + " no \documentclass, put an environment. + exe pos return Tex_DoEnvironment() + endif ! endfunction ! ! " }}} ! " Tex_package_from_line: puts a \usepackage line in the current line. " {{{ ! " Description: ! " ! function! Tex_package_from_line() ! " Function Tex_PutPackage is defined in packages.vim ! let l = getline(".") ! let pack = matchstr(l, '^\s*\zs.*') ! if pack == '' ! let pack = input('Package? ') ! if pack != '' ! return Tex_PutPackage(pack) ! endif ! return 0 ! else ! normal 0D return Tex_PutPackage(pack) endif ! endfunction " }}} ! " Tex_ChangeEnvironments: calls Change() to change the environment {{{ ! " Description: ! " Finds out which environment the cursor is positioned in and changes ! " that to the chosen new environment. This function knows the changes ! " which need to be made to change one env to another and calls ! " Change() with the info. ! " ! function! Tex_ChangeEnvironments() ! let env_line = searchpair("$$\|\\[\|begin{", '', "$$\|\\]\|end{", "bn") ! if env_line != 0 ! if getline(env_line) !~ 'begin{' ! let env_name = '[' ! else ! let env_name = matchstr(getline(env_line), 'begin{\zs.\{-}\ze}') ! endif ! endif ! ! if !exists('env_name') ! echomsg "You are not inside environment" ! return 0 ! endif ! exe 'echomsg "You are within a '.env_name.' environment."' ! let s:change_env = PromptForEnvironment('Do you want to change it to (number or name)? ') ! if s:change_env == 'eqnarray' ! call <SID>Change('eqnarray', 1, '', 1) ! elseif s:change_env == 'eqnarray*' ! call <SID>Change('eqnarray*', 0, '\\nonumber', 0) ! elseif s:change_env == 'align' ! call <SID>Change('align', 1, '', 1) ! elseif s:change_env == 'align*' ! call <SID>Change('align*', 0, '\\nonumber', 0) ! elseif s:change_env == 'equation*' ! call <SID>Change('equation*', 0, '&\|\\lefteqn{\|\\nonumber\|\\\\', 0) ! elseif s:change_env == '' ! return 0 else ! call <SID>Change(s:change_env, 0, '', '') ! return 0 endif ! ! endfunction ! ! " }}} ! " Change: changes the current env to the new env {{{ ! " Description: ! " This function needs to know the changes which need to be made while ! " going from an old environment to a new one. This info, it gets from ! " Tex_ChangeEnvironments ! " ! " env : name of the new environment. ! " label : if 1, then insert a \label at the end of the environment. ! " otherwise, delete any \label line found. ! " delete : a pattern which is to be deleted from the original environment. ! " for example, going to a eqnarray* environment means we need to ! " delete \label's. ! " putInNonumber : whether we need to put a \nonumber before the end of the ! " environment. ! function! s:Change(env, label, delete, putInNonumber) ! ! let start_line = line('.') ! let start_col = virtcol('.') ! ! if a:env == '[' ! if b:DoubleDollars == 0 ! let first = '\\[' ! let second = '\\]' ! else ! let first = '$$' ! let second = '$$' ! endif ! else ! let first = '\\begin{' . a:env . '}' ! let second = '\\end{' . a:env . '}' ! endif ! if b:DoubleDollars == 0 ! let bottom = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','') ! s/\\\]\|\\end{.\{-}}/\=second/ ! let top = searchpair('\\\[\|\\begin{','','\\\]\|\\end{','b') ! s/\\\[\|\\begin{.\{-}}/\=first/ else ! let bottom = search('\$\$\|\\end{') ! s/\$\$\|\\end{.\{-}}/\=second/ ! let top = search('\$\$\|\\begin{','b') ! s/\$\$\|\\begin{.\{-}}/\=first/ ! end ! if a:delete != '' ! exe 'silent '. top . "," . bottom . 's/' . a:delete . '//e' endif ! ! if a:putInNonumber == 1 ! exe top ! call search('\\end\|\\\\') ! if line('.') != bottom ! exe '.+1,' . bottom . 's/\\\\/\\nonumber\\\\/e' ! exe (bottom-1) . 's/\s*$/ \\nonumber/' ! endif endif ! ! if a:label == 1 exe top ! if search("\\label", "W") > bottom ! exe top ! let local_label = input('Label? ') ! if local_label != '' ! put = '\label{'.local_label.'}' ! endif ! normal $ endif ! else ! exe 'silent '.top . ',' . bottom . ' g/\\label/delete' endif ! if exists('local_label') && local_label != '' ! exe start_line + 1.' | normal! '.start_col.'|' ! else ! exe start_line.' | normal! '.start_col.'|' ! endif ! endfunction " }}} ! ! endif ! " }}} ! " Map <S-F1> through <S-F4> to insert environments {{{ ! if g:Tex_HotKeyMappings != '' ! ! " SetUpHotKeys: maps <F1> through <F4> to insert environments {{{ ! " Description: ! function! <SID>SetUpHotKeys() ! let i = 1 ! let envname = Tex_Strntok(g:Tex_HotKeyMappings, ',', i) ! while envname != '' ! ! exec 'inoremap <S-F'.i.'> <C-r>=Tex_PutEnvironment("'.envname.'")<CR>' ! ! let i = i + 1 ! let envname = Tex_Strntok(g:Tex_HotKeyMappings, ',', i) ! ! endwhile ! ! endfunction " }}} ! ! call s:SetUpHotKeys() ! ! endif ! " }}} |