vim-latex-cvs Mailing List for Vim-Latex (Page 29)
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...> - 2003-01-05 02:19:31
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv26387 Modified Files: packages.vim Log Message: Another great bug report from Ulrich Spoerlein. Bug: When the following .tex file is opened with latex-suite, we get a choose package prompt: -----------------------------%<----------------------------- \documentclass{report} \usepackage[a4paper, pdftex, dvips, ps2pdf, bookmarks, bookmarksopen, bookmarksnumbered, colorlinks, linkcolor=blue, urlcolor=blue]{hyperref} \usepackage{cite} \begin{document} \end{document} -----------------------------%<----------------------------- Cause: the original algorithm for finding packages failed when the \usepackage definition was split across lines as shown here. Solution: Rewrite the Tex_pack_all function to act much more robustly. This method is able to account for multiple line definitions pretty well. Just to be on the safe side, ensure that Tex_pack_one is never called with '' which causes the prompt. Index: packages.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** packages.vim 30 Dec 2002 00:16:51 -0000 1.18 --- packages.vim 5 Jan 2003 02:19:26 -0000 1.19 *************** *** 3,7 **** " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: Sun Dec 29 04:00 PM 2002 PST " " Description: handling packages from within vim --- 3,7 ---- " Author: Mikolaj Machowski " Created: Tue Apr 23 06:00 PM 2002 PST ! " Last Change: Sat Jan 04 06:00 PM 2003 PST " " Description: handling packages from within vim *************** *** 142,177 **** endif ! exe 0 let beginline = search('\\begin{document}', 'W') ! exe 0 ! let oldpack = '' ! let packname = '' ! while search('usepackage.*', 'W') if line('.') > beginline break - elseif getline('.') =~ '^\s*%' - continue - elseif getline('.') =~ '^[^%]\{-}\\usepackage[^{]\{-}[%$]' - let packname = matchstr(getline(search('^[^%]\{-}\]{', 'W')), '^.\{-}\]{\zs[^}]*\ze}') - elseif getline('.') =~ '^[^%]\{-}\\usepackage' - let packname = matchstr(getline("."), '^[^%]\{-}usepackage.\{-}{\zs[^}]*\ze}') endif ! let packname = substitute(packname, '\s', '', 'g') ! if packname =~ ',' ! let i = 1 ! while 1 ! let pname = Tex_Strntok(packname, ',', i) ! if pname == '' ! break ! endif ! let g:Tex_package_detected = g:Tex_package_detected.' '.pname ! call Tex_pack_one(pname) ! let i = i + 1 ! endwhile ! elseif oldpack != packname ! let g:Tex_package_detected = g:Tex_package_detected.' '.packname ! call Tex_pack_one(packname) endif ! let oldpack = packname endwhile --- 142,192 ---- endif ! 0 let beginline = search('\\begin{document}', 'W') ! 0 ! ! " Scan ! while search('^\s*\\usepackage\_.\{-}{\_.\+}', 'W') if line('.') > beginline break endif ! ! let saveA = @a ! ! " The following statement puts the stuff between the { }'s of a ! " \usepackage{stuff,foo} into @a. Do not use matchstr() and the like ! " because we can have things split across lines and such. ! exec "normal! /{\<CR>lv/}\<CR>h\"ay" ! ! " now remove all whitespace from @a. We need to remove \n and \r ! " because we can encounter stuff like ! " \usepackage{pack1, ! " newpackonanotherline} ! let @a = substitute(@a, "[ \t\n\r]", '', 'g') ! ! " Now we have something like pack1,pack2,pack3 with possibly commas ! " and stuff before the first package and after the last package name. ! " Remove those. ! let @a = substitute(@a, '\(^\W*\|\W*$\)', '', 'g') ! ! " This gets us a string like 'pack1,pack2,pack3' ! " TODO: This will contain duplicates if the user has duplicates. ! " Should we bother taking care of this? ! let g:Tex_package_detected = g:Tex_package_detected.@a ! ! " Finally convert @a into something like '"pack1","pack2"' ! let @a = substitute(@a, '^\|$', '"', 'g') ! let @a = substitute(@a, ',', '","', 'g') ! ! " ... so it can be used using one exec statement. Take care not to ! " call things with an empty argument otherwise, we will get a prompt ! " from the Tex_pack_one function. ! if @a != '' ! exec 'call Tex_pack_one('.@a.')' endif ! ! " restore @a ! let @a = saveA ! endwhile |
From: <sri...@us...> - 2003-01-04 00:56:59
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1:/tmp/cvs-serv2994 Modified Files: latex-suite.txt Log Message: Remove a bit of pedantic stuff from the docs. We seem to be explaining the same thing too many times... Index: latex-suite.txt =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/doc/latex-suite.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** latex-suite.txt 29 Dec 2002 23:51:30 -0000 1.11 --- latex-suite.txt 4 Jan 2003 00:56:56 -0000 1.12 *************** *** 1,5 **** *latex-suite* Tools for an enhanced LaTeX environment in Vim For Vim version 6.0 and above. ! Last Change: Sat Dec 28 09:00 PM 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: Tue Dec 31 01:00 AM 2002 PST By Srinath Avadhanula <sr...@fa...>, *************** *** 134,162 **** mappings and menu items to typeset most of the LaTeX elements. - We use a "macro" to refer to the collection of 3 objects, an insert mode - mapping, a visual mode mapping and a menu item. For example, a figure macro - refers to the insert mode mapping 'EFI', the visual mode mapping ',fi' and the - menu item Tex-Environments.figure. - - For environments, sections and fonts, the insert mode mappings are a sequence - of 3 capital letters. The visual mode mapping follows from the insert mode - mapping by replacing the first character by a comma (',') (for environments - and sections) or back-tick ('`') (for fonts) and converting the rest to lower - case. > - | Insert Mode | Visual Mode - -------------+---------------+------------- - environmnts | EFI | ,fi - fonts | FSF | `sf - - The menu item also specifies the insert and visual mode macros. The menus - behave differently from the insert mode macros in that they ask questions on - the command line in a "wizard" sort of manner and then generate a template - which includes the information gathered. By contrast, the insert mode macros - do not ask any questions and generate a template with |placeholders| at each - input location. - *placeholders* *placeholder* *place-holder* *place-holders* ! NOTE: All these macros implement Stephen Riem's bracketing system and Gergely Kontra's JumpFunc() for handling place-holders. This consists of using "place-holders" to mark off locations where the next relevant editing has to --- 134,140 ---- mappings and menu items to typeset most of the LaTeX elements. *placeholders* *placeholder* *place-holder* *place-holders* ! All these macros implement Stephen Riem's bracketing system and Gergely Kontra's JumpFunc() for handling place-holders. This consists of using "place-holders" to mark off locations where the next relevant editing has to *************** *** 177,186 **** on a lot of key presses. ! NOTE: Furthermore these mappings are are not standard mappings in the sense ! that only the last character is mapped. See plugin/imaps.vim for further ! documentation. For example, in the example above, you can press the characters ! 'E', 'F' and 'I' as slowly as you wish. The characters are visible as you type ! them and you can use the movement or backspace key to correct yourself unlike ! normal mappings. The macros can be divided into the following main categories: --- 155,163 ---- on a lot of key presses. ! NOTE: These mappings are are not standard mappings in the sense that only the ! last character is mapped. See plugin/imaps.vim for further documentation. For ! example, in the example above, you can press the characters 'E', 'F' and 'I' ! as slowly as you wish. The characters are visible as you type them and you can ! use the movement or backspace key to correct yourself unlike normal mappings. The macros can be divided into the following main categories: |
From: <sri...@us...> - 2003-01-04 00:49:57
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1:/tmp/cvs-serv1268 Modified Files: main.vim Log Message: Made the debugging statements more advanced. Each file can now call Tex_Debug as call Tex_Debug('something', 'modulename') Afterwards, we can do: call Tex_PrintDebug('modulename') This way debugging statements from various modules will not interfere with each other. These functions might seem like bloat, but the reason I am making them is that in the future when latex-suite becomes even bigger, it might be painful to find out why a user is facing problems. In such cases, we might want to tell the user to do something like, "Set g:Tex_Debug = 1, do `lv and then please tell us what g:Tex_PrintDebug('compiler') says" (if for instance the user has some compilation/viewing problems). Index: main.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** main.vim 27 Dec 2002 22:55:44 -0000 1.22 --- main.vim 4 Jan 2003 00:49:53 -0000 1.23 *************** *** 4,8 **** " Email: sr...@fa... " URL: ! " Last Change: Fri Dec 27 02:00 PM 2002 PST " " Help: --- 4,8 ---- " Email: sr...@fa... " URL: ! " Last Change: Fri Jan 03 04:00 PM 2003 PST " " Help: *************** *** 422,437 **** " Description: " ! function! Tex_Debug(str) ! if !exists('s:debugString') ! let s:debugString = '' endif ! let s:debugString = s:debugString.a:str."\n" endfunction " }}} " Tex_PrintDebug: prings s:debugString {{{ " Description: " ! function! Tex_PrintDebug() ! if exists('s:debugString') ! echo s:debugString endif endfunction " }}} --- 422,455 ---- " Description: " ! " Do not want a memory leak! Set this to zero so that latex-suite always ! " starts out in a non-debugging mode. ! if !exists('g:Tex_Debug') ! let g:Tex_Debug = 0 ! endif ! function! Tex_Debug(str, ...) ! if !g:Tex_Debug ! return endif ! if a:0 > 0 ! let pattern = a:1 ! else ! let pattern = '' ! endif ! if !exists('s:debugString_'.pattern) ! let s:debugString_{pattern} = '' ! endif ! let s:debugString_{pattern} = s:debugString_{pattern}.a:str."\n" endfunction " }}} " Tex_PrintDebug: prings s:debugString {{{ " Description: " ! function! Tex_PrintDebug(...) ! if a:0 > 0 ! let pattern = a:1 ! else ! let pattern = '' ! endif ! if exists('s:debugString_'.pattern) ! echo s:debugString_{a:pattern} endif endfunction " }}} *************** *** 439,445 **** " Description: " ! function! Tex_ClearDebug() ! if exists('s:debugString') ! let s:debugString = '' endif endfunction " }}} --- 457,468 ---- " Description: " ! function! Tex_ClearDebug(...) ! if a:0 > 0 ! let pattern = a:1 ! else ! let pattern = '' ! endif ! if exists('s:debugString_'.pattern) ! let s:debugString_{pattern} = '' endif endfunction " }}} |
From: <sri...@us...> - 2003-01-04 00:44:59
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv32279 Modified Files: imaps.vim Log Message: Since IMAP() is used so often, we do not want the Debug statements to cause a memory leak. Otherwise the debug string will get generally very huge on long usage of latex-suite/imaps. Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** imaps.vim 3 Jan 2003 08:42:16 -0000 1.19 --- imaps.vim 4 Jan 2003 00:44:56 -0000 1.20 *************** *** 8,12 **** " while preserving filetype indentation. " ! " Last Change: Fri Jan 03 12:00 AM 2003 PST " " Documentation: {{{ --- 8,12 ---- " while preserving filetype indentation. " ! " Last Change: Fri Jan 03 04:00 PM 2003 PST " " Documentation: {{{ *************** *** 630,634 **** --- 630,642 ---- " IMAP_Debug: interface to Tex_Debug if available, otherwise emulate it {{{ " Description: + " Do not want a memory leak! Set this to zero so that imaps always + " starts out in a non-debugging mode. + if !exists('g:Imap_Debug') + let g:Imap_Debug = 0 + endif function! IMAP_Debug(string, pattern) + if !g:Imap_Debug + return + endif if exists('*Tex_Debug') call Tex_Debug(a:string, a:pattern) |
From: <sri...@us...> - 2003-01-03 23:08:16
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv2795 Modified Files: smartspace.vim Log Message: Bug: Ulrich Spoerlein reports that, when we press <space> after the following line: $aaaaaaaaaaaaaaaaaa.........$ ^ line starts here. There is a space before the leading $ Then smartspace makes vim go into an infinite loop. Fix: Instead of trying to see if the first character of the line is '$', check if the first non blank character is a '$'. This seems a little like a temporary fix though.. Index: smartspace.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/smartspace.vim,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** smartspace.vim 22 Dec 2002 03:15:44 -0000 1.3 --- smartspace.vim 3 Jan 2003 23:08:13 -0000 1.4 *************** *** 3,7 **** " Author: Carl Muller " Created: Fri Dec 06 12:00 AM 2002 PST ! " Last Change: Sat Dec 21 07:00 PM 2002 PST " " Description: --- 3,7 ---- " Author: Carl Muller " Created: Fri Dec 06 12:00 AM 2002 PST ! " Last Change: Fri Jan 03 03:00 PM 2003 PST " " Description: *************** *** 47,51 **** " }}} function! s:TexFormatLine(width) " {{{ ! let first = strpart(getline(line(".")),0,1) normal! $ let length = col(".") --- 47,52 ---- " }}} function! s:TexFormatLine(width) " {{{ ! " get the first non-blank character. ! let first = matchstr(getline('.'), '\S') normal! $ let length = col(".") *************** *** 53,57 **** 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 --- 54,58 ---- while length > a:width+2 && go let between = 0 ! let string = strpart(getline('.'), 0, a:width) " Count the dollar signs let number_of_dollars = 0 *************** *** 73,77 **** " Then you are between dollars. normal! F$ ! if col(".") == 1 || strpart(getline(line(".")),col(".")-1,1) != "$" let go = 0 endif --- 74,78 ---- " Then you are between dollars. normal! F$ ! if col(".") == 1 || getline('.')[col(".")-1] != "$" let go = 0 endif *************** *** 81,85 **** else exe "normal! i\<CR>\<Esc>$" ! let first = strpart(getline(line(".")),0,1) endif let length = col(".") --- 82,87 ---- else exe "normal! i\<CR>\<Esc>$" ! " get the first non-blank character. ! let first = matchstr(getline('.'), '\S') endif let length = col(".") |
From: Srinath A. <sr...@fa...> - 2003-01-03 20:17:19
|
Hey Benji, We have a little issue here... Bartek couldn't use the macros because his vim didn't come with +iconv. Since latex-suite itself doesn't use any funky characters in the macros, could we have a way of making it work OOTB with the default placeholders (which are also unfunky) without needing +iconv? Maybe surround the iconv() functions in =09if !has('iconv') && !(&enc =3D=3D 'utf-8' || &enc =3D=3D 'latin1') =09=09let textEnc =3D iconv(text, 'latin1', &enc) =09else =09=09let textEnc =3D text =09endif and such... Maybe even have a custom s:Iconv() function which makes this check so the change looks better. Again, since I haven't been upto speed on this encoding stuff, I do not want to make changes myself. I dont even really know why our function fails when it doesn't have iconv(). Also, can I ask why the following piece of code uses phs and phe and not phsEnc and pheEnc? I asked this once before, so sorry for the repeat... Could you put a short comment there? As of now, that piece of code is kinda opaque to me.. =09" If there are no place holders, just return the text. =09if textEnc !~ '\V'.phs.'\.\{-}'.phe =09=09call IMAP_Debug('Not getting '.phs.' and '.phe.' in '.textEnc, 'imap'= ) =09=09return text =09endif Thanks! Srinath ---------- Forwarded message ---------- Date: Fri, 3 Jan 2003 12:43:11 +0100 From: "[ISO-8859-2] Bart=B3omiej Siudeja" <si...@wp...> To: Srinath Avadhanula <sr...@fa...> Subject: Odp: Re: [Vim-latex-devel] Latest Version (30 Dec 2002) Hello Srinath, You can kill me. I don't included iconv option in my linux vim compilation (this option is not default). Thus iconv() doesn't work. Everything is now ok under linux with or without changes in imaps.vim. Thanks and sorry Bartek |
From: <sri...@us...> - 2003-01-03 08:42:20
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv3970 Modified Files: imaps.vim Log Message: Bug: call IMAP('""', '"<++>"<++>', '<+', '+>') doesnt work. In general, any mapping ending in double quote doesn't work. Cause: Double quotes need to be escaped in the call to LookupCharacter(). Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** imaps.vim 3 Jan 2003 08:22:23 -0000 1.18 --- imaps.vim 3 Jan 2003 08:42:16 -0000 1.19 *************** *** 182,186 **** \ escape(lastLHSChar, '|') \ '<C-r>=<SID>LookupCharacter("' . ! \ escape(lastLHSChar, '\|') . \ '")<CR>' endfunction --- 182,186 ---- \ escape(lastLHSChar, '|') \ '<C-r>=<SID>LookupCharacter("' . ! \ escape(lastLHSChar, '\|"') . \ '")<CR>' endfunction |
From: <sri...@us...> - 2003-01-03 08:22:27
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv29222 Modified Files: imaps.vim Log Message: CVS: ---------------------------------------------------------------------- CVS: Enter Log. Lines beginning with `CVS:' are removed automatically CVS: ---------------------------------------------------------------------- Unfortunately, have to repeat Tex_Debug* functions here in case this plugin is used without latex-suite... Script bloat! Maybe when all of the imaps bugs are removed (!) we can remove these functions... Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** imaps.vim 31 Dec 2002 19:20:02 -0000 1.17 --- imaps.vim 3 Jan 2003 08:22:23 -0000 1.18 *************** *** 8,12 **** " while preserving filetype indentation. " ! " Last Change: Tue Dec 31 10:00 AM 2002 PST " " Documentation: {{{ --- 8,12 ---- " while preserving filetype indentation. " ! " Last Change: Fri Jan 03 12:00 AM 2003 PST " " Documentation: {{{ *************** *** 276,280 **** let marker = '<!---@#%_Start_Here_@#%----!>' endif - call Tex_Debug('marker = '.marker) let markerLength = strlen(marker) --- 276,279 ---- *************** *** 291,294 **** --- 290,294 ---- " If there are no place holders, just return the text. if textEnc !~ '\V'.phs.'\.\{-}'.phe + call IMAP_Debug('Not getting '.phs.' and '.phe.' in '.textEnc, 'imap') return text endif *************** *** 602,605 **** --- 602,607 ---- " Hash: Return a version of a string that can be used as part of a variable" {{{ " name. + " Converts every non alphanumeric characteer into _{ascii}_ where {ascii} is + " the ASCII code for that character... fun! s:Hash(text) return substitute(a:text, '\([^[:alnum:]]\)', *************** *** 626,629 **** --- 628,666 ---- endfun " }}} + " IMAP_Debug: interface to Tex_Debug if available, otherwise emulate it {{{ + " Description: + function! IMAP_Debug(string, pattern) + if exists('*Tex_Debug') + call Tex_Debug(a:string, a:pattern) + else + if !exists('s:debug_'.a:pattern) + let s:debug_{a:pattern} = a:string + else + let s:debug_{a:pattern} = s:debug_{a:pattern}.a:string + endif + endif + endfunction " }}} + " IMAP_DebugClear: interface to Tex_DebugClear if avaialable, otherwise emulate it {{{ + " Description: + function! IMAP_DebugClear(pattern) + if exists('*Tex_DebugClear') + call Tex_DebugClear(a:pattern) + else + let s:debug_{a:pattern} = '' + endif + endfunction " }}} + " IMAP_DebugClear: interface to Tex_DebugClear if avaialable, otherwise emulate it {{{ + " Description: + function! IMAP_DebugPrint(pattern) + if exists('*Tex_DebugPrint') + call Tex_DebugPrint(a:pattern) + else + if exists('s:debug_'.a:pattern) + let s:debug_{a:pattern} = '' + else + echo s:debug_{a:pattern} + endif + endif + endfunction " }}} " ============================================================================== |
From: Mikolaj M. <mi...@wp...> - 2003-01-01 22:34:23
|
On Tue, Dec 31, 2002 at 10:06:30AM -0500, Benji Fisher wrote: > I think we should try this. Another new branch? Personally, I > prefer the substitute() approach over iconv(), because I think I > understand it better. substitute() is in all Vims. iconv() need |+iconv|. Mikolaj |
From: <sri...@us...> - 2002-12-31 19:20:06
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv8851 Modified Files: imaps.vim Log Message: . Remove mappings for jumping back. The user can still choose to use this functionality by uncommenting lines in the texrc (that modification coming soon). Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** imaps.vim 31 Dec 2002 09:21:01 -0000 1.16 --- imaps.vim 31 Dec 2002 19:20:02 -0000 1.17 *************** *** 8,12 **** " while preserving filetype indentation. " ! " Last Change: Tue Dec 31 01:00 AM 2002 PST " " Documentation: {{{ --- 8,12 ---- " while preserving filetype indentation. " ! " Last Change: Tue Dec 31 10:00 AM 2002 PST " " Documentation: {{{ *************** *** 437,465 **** " Default maps for IMAP_Jumpfunc {{{ " map only if there is no mapping already. allows for user customization. if !hasmapto('<Plug>IMAP_JumpForward', 'i') imap <C-J> <Plug>IMAP_JumpForward endif - if !hasmapto('<Plug>IMAP_JumpBack', 'i') - imap <S-C-J> <Plug>IMAP_JumpBack - endif if !hasmapto('<Plug>IMAP_JumpForward', 'n') nmap <C-J> <Plug>IMAP_JumpForward endif - if !hasmapto('<Plug>IMAP_JumpBack', 'n') - nmap <S-C-J> <Plug>IMAP_JumpBack - endif if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders if !hasmapto('<Plug>IMAP_JumpForward', 'v') vmap <C-J> <Plug>IMAP_JumpForward endif - if !hasmapto('<Plug>IMAP_JumpBack', 'v') - vmap <S-C-J> <Plug>IMAP_JumpBack - endif else if !hasmapto('<Plug>IMAP_DeleteAndJumpForward', 'v') vmap <C-J> <Plug>IMAP_DeleteAndJumpForward - endif - if !hasmapto('<Plug>IMAP_DeleteAndJumpBack', 'v') - vmap <S-C-J> <Plug>IMAP_DeleteAndJumpBack endif endif --- 437,456 ---- " Default maps for IMAP_Jumpfunc {{{ " map only if there is no mapping already. allows for user customization. + " NOTE: Default mappings for jumping to the previous placeholder are not + " provided. It is assumed that if the user will create such mappings + " hself if e so desires. if !hasmapto('<Plug>IMAP_JumpForward', 'i') imap <C-J> <Plug>IMAP_JumpForward endif if !hasmapto('<Plug>IMAP_JumpForward', 'n') nmap <C-J> <Plug>IMAP_JumpForward endif if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders if !hasmapto('<Plug>IMAP_JumpForward', 'v') vmap <C-J> <Plug>IMAP_JumpForward endif else if !hasmapto('<Plug>IMAP_DeleteAndJumpForward', 'v') vmap <C-J> <Plug>IMAP_DeleteAndJumpForward endif endif |
From: <sri...@us...> - 2002-12-31 19:15:41
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv6417 Modified Files: brackets.vim Log Message: . Follow the <Plug>ed mappings philosophy here as well... . TODO: The meta mappings for brackets.vim might be removed by default in future revisions because they do really annoying things for european users. Only the <plugs> will be provided. A new section in texrc will contain the maps which the user can customize... Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** brackets.vim 31 Dec 2002 09:36:06 -0000 1.7 --- brackets.vim 31 Dec 2002 19:15:37 -0000 1.8 *************** *** 2,6 **** " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Sun Dec 29 11:00 PM 2002 PST " Description: " This ftplugin provides the following maps: --- 2,6 ---- " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Tue Dec 31 11:00 AM 2002 PST " Description: " This ftplugin provides the following maps: *************** *** 48,59 **** " {{{ ! 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 --- 48,69 ---- " {{{ ! " Provide <plug>'d mapping for easy user customization. ! " ! inoremap <silent> <Plug>Tex_MathBF <C-r>=Tex_MathBF()<CR> ! inoremap <silent> <Plug>Tex_MathCal <C-r>=Tex_MathCal()<CR> ! inoremap <silent> <Plug>Tex_LeftRight <C-r>=Tex_LeftRight()<CR> ! ! " Provide mappings only if the user hasn't provided a map already or if the ! " target lhs doesn't have a mapping. ! " TODO: These will be removed in future revisions. Alt mappings are a headache ! " for European users... ! if !hasmapto('<Plug>Tex_MathBF', 'i') && mapcheck('<M-b>', 'i') == '' ! imap <buffer> <silent> <M-b> <Plug>Tex_MathBF endif ! if !hasmapto('<Plug>Tex_MathCal', 'i') && mapcheck('<M-c>', 'i') == '' ! imap <buffer> <silent> <M-c> <Plug>Tex_MathCal endif ! if !hasmapto('<Plug>Tex_LeftRight', 'i') && mapcheck('<M-l>', 'i') == '' ! imap <buffer> <silent> <M-l> <Plug>Tex_LeftRight endif |
From: Srinath A. <sr...@fa...> - 2002-12-31 18:56:12
|
[Changed the subject] On Tue, 31 Dec 2002, Mikolaj Machowski wrote: > On Mon, Dec 30, 2002 at 11:16:44PM -0800, Srinath Avadhanula wrote: > > Hey Mikolaj, > > On Mon, 30 Dec 2002, Mikolaj Machowski wrote: > > > > TODO: Should we write code to make such typos get handled elegantly? > > > > > > IMO no. Better would be SDK with question, suggestions etc. > > SDK? > > Source development kit :) :) But I suggest that we leave any such thing out of the core latex-suite itself. Latex-suite should contain stuff which the end user of latex will find useful. The lay person will not be writing package files (although we would like to encourage such behavior :), so any code which is geared for package writers is bloat for the average user... In any case, splitting with the help seems like a good idea. > > I was thinking about SetUpEnvironmentsPromtp from envmacros.vim. I am > trying to do helper with labels and bibtex entries. Labels are quite > easy but I don't know how to to this with many files. Using latextags is > not perfect because it stores only \label{this} without context. In one > file you can use g/re/p which gives whole line and sometimes context. > Well, as you say, \labels{} should not be a problem, because they are identified uniquely by being a tag... I dont really completeley understand the problems you are having, so I cant be more helpful... I suggest that you take a leaf out of Bram's book and do :help design-documented (Benji suggested reading this). It has an interesting idea. Do the documentation first. First nail down the "specs" of the functionality. Write a short blurb (or even a long one), about how you expect the user to use this, how the thing will perform internally (so we can iron out any design issues) etc... I must admit that I havent done this myself yet. But I was hoping to do it henceforth... :) Anyway, is this for the new citation/label browser thing I was mentioning recently? If it is a new feature, then I think we should delay its inclusion into the main branch until we get another stable release out the door... Srinath |
From: Srinath A. <sr...@fa...> - 2002-12-31 18:36:08
|
On Tue, 31 Dec 2002, Benji Fisher wrote: > Does this work for you? For me (gvim on Linux) <C-J> and <C-S-J> > are the same. > > :nmap <C-J> :echo "foo"<CR> > :nmap <S-C-J> :echo "bar"<CR> > Yes... I checked on my gvim/cygwin combination and it seems not to work. It does work on windows though... > What I do not like about the current system is that it violates > the principle of least surprise: if the user already has a use for > <C-J>, then (s)he has to figure out how to disable this feature (or > change the key binding). > Yes... You're right... Luc was complaining about this too... Okay. I shall disable the map for jumping back by default... I suppose this could go into the texrc as a commented line... Hmm... Thats an interesting idea. Maybe have commented lines like in the Makefile. "Uncomment if you want this behavior"... Maybe we should do this for all the <Alt-*> mappings? Most European users find the <M-[cbl]> mappings annoying because they are used to enter normal language characters... Unfortunately, most english language users will find it really useful to have something like this and for them, it is almost guarenteed that they are not doing anything with their <M-*> keys... Well I suppose we will have to at one point begin to do this for all mappings anyway. Just provide <plug>'s and then let the user customize... Srinath |
From: Benji F. <be...@me...> - 2002-12-31 16:10:17
|
sri...@us... wrote: > Update of /cvsroot/vim-latex/vimfiles/doc > In directory sc8-pr-cvs1:/tmp/cvs-serv8143 > > Added Files: > imaps.txt > Log Message: > Starting the doc file for the imaps.vim plugin. This is just a quick hack > job for now. Its not in the releaseable state yet. But I will keep working > at it in the next few days when I get the time... This doc file should > describe the various imaps options for placeholders and also how to > override the mappings for jumping back and forth... It is good to get it started. I am afraid that I will not have time to help much in the near future. --Benji |
From: Benji F. <be...@me...> - 2002-12-31 16:07:07
|
sri...@us... wrote: > Update of /cvsroot/vim-latex/vimfiles/plugin > In directory sc8-pr-cvs1:/tmp/cvs-serv20482 > > Modified Files: > imaps.vim > Log Message: > 2. Problem: The <C-K> map for jumping back was interfering with the > dictionary completion mode of vim. Therefore change default mapping for > jumping back to <S-C-J> instead of <C-K>. Ofcourse this makes it > invisible to non-gui users (I think). Does this work for you? For me (gvim on Linux) <C-J> and <C-S-J> are the same. :nmap <C-J> :echo "foo"<CR> :nmap <S-C-J> :echo "bar"<CR> When I try <C-J> in Normal mode, it echoes "bar". > 3. Tried to do the "right" thing for mapping. First provide a number of > mappings using <plug>. These mappings call IMAP_Jumpfunc() in various > ways. Various <plug> mappings for various modes have been provided. > After this, we map the default keys to the <plug> mappings checking for > hasmapto() each time. This provides for a robust and easy user > customization. Initially, the user had to do something like: > inoremap <C-J> <C-r>=IMAP_Jumpfunc('', 0)<CR> > in his .vimrc to be able to override our mapping. Now he will do > inoremap <C-J> <Plug>IMAP_JumpForward > Doing this also has the advantage that changes in IMAP_Jumpfunc() will > not affect the user customization. > NOTE: This <plug> things were inspired by looking at the excellent > cvscommand.vim plugin I've begun using... This can go in texrc instead of vimrc, right? This is the system recommended in :help write-plugin . I have always used a simpler system: for most things, do not provide any key mapping by default. If the user specifies a key binding, use it (and display it in the menu). What I do not like about the current system is that it violates the principle of least surprise: if the user already has a use for <C-J>, then (s)he has to figure out how to disable this feature (or change the key binding). --Benji |
From: Benji F. <be...@me...> - 2002-12-31 14:58:58
|
Srinath Avadhanula wrote: > On Mon, 30 Dec 2002, Benji Fisher wrote: > > Yes. Positioning using movement is the best... The problem I ran across > was that if you do something like > > :set encoding=utf8 > :let bar = "?" > (where the ? character is typed using <C-v><<) > :echo strlen(bar) > 2 > > Can this problem be taken care of using the change in encoding etc? > Hmm... I see that > :echo strlen(iconv(bar, &encoding, 'latin1')) > 1 > :echo strlen(substitute(bar, '.', 'x', 'g')) > 1 > > So those two methods might work... It will be a definite improvement > over the current "hack". I think we should try this. Another new branch? Personally, I prefer the substitute() approach over iconv(), because I think I understand it better. > On a different note: > > imaps.vim now contains: > > let textEnc = iconv(text, "latin1", &enc) > [snip] > > " If there are no place holders, just return the text. > if textEnc !~ '\V'.phs.'\.\{-}'.phe > return text > endif > > Shouldn't the comparision be: > > " If there are no place holders, just return the text. > if textEnc !~ '\V'.phsEnc.'\.\{-}'.pheEnc > return text > endif > > Maybe this is why Fabio is having that problem? > > I am wary of making any changes here because I haven't thought about > this as much as you have... Well, I have experimented a lot. Remember the experiments I asked you to repeat, :let foo = "\xab" :echo foo =~ foo :echo iconv(foo, 'latin1', &enc) =~ foo Your variant may also work, but I did it this way on purpose. AFAICT it works. --Benji |
From: Mikolaj M. <mi...@wp...> - 2002-12-31 11:39:44
|
On Mon, Dec 30, 2002 at 11:16:44PM -0800, Srinath Avadhanula wrote: > Hey Mikolaj, > On Mon, 30 Dec 2002, Mikolaj Machowski wrote: > > > TODO: Should we write code to make such typos get handled elegantly? > > > > IMO no. Better would be SDK with question, suggestions etc. > SDK? Source development kit :) Writing package files I have always splitted screen with help file with explanations, but maybe something more is needed. > > you remind which function is responsible for prompt with choosing by > > numbers? Lately was so many changes I am not able to catch up with > > everything... > <F5> inserts environment. <S-F5> changes the environment... > These features have found their way into the documentation already :) :) I was thinking about SetUpEnvironmentsPromtp from envmacros.vim. I am trying to do helper with labels and bibtex entries. Labels are quite easy but I don't know how to to this with many files. Using latextags is not perfect because it stores only \label{this} without context. In one file you can use g/re/p which gives whole line and sometimes context. With bibtex entries I don't know yet. Mikolaj |
From: <sri...@us...> - 2002-12-31 10:04:28
|
Update of /cvsroot/vim-latex/vimfiles/doc In directory sc8-pr-cvs1:/tmp/cvs-serv8143 Added Files: imaps.txt Log Message: Starting the doc file for the imaps.vim plugin. This is just a quick hack job for now. Its not in the releaseable state yet. But I will keep working at it in the next few days when I get the time... This doc file should describe the various imaps options for placeholders and also how to override the mappings for jumping back and forth... --- NEW FILE: imaps.txt --- *imaps.txt* A Fluid Replacement for the imap command For Vim version 6.0 and above Last Change: Tue Dec 31 02:00 AM 2002 PST By Srinath Avadhanula <sr...@fa...>, Benji Fisher <be...@me...> =========================================================================== MOTIVATION *imap-plugin-motivation* {{{ This plugin provides a function IMAP() which emulates vims |:imap| function. The motivation for providing this plugin is that |:imap| sufffers from problems which get increasingly annoying with a large number of mappings. Consider an example. If you do imap lhs something then a mapping is set up. However, there will be the following problems: 1. the 'ttimeout' option will generally limit how easily you can type the lhs. if you type the left hand side too slowly, then the mapping will not be activated. 2. if you mistype one of the letters of the lhs, then the mapping is deactivated as soon as you backspace to correct the mistake. 3. The characters in lhs are shown on top of each other. This is fairly distracting. This becomes a real annoyance when a lot of characters initiate mappings. This script provides a function IMAP() which does not suffer from these problems. }}} =========================================================================== USAGE *imap-plugin-usage* {{{ Each call to IMAP is made using the sytax: > call IMAP (lhs, rhs, ft [, phs, phe]) This is equivalent to having <lhs> map to <rhs> for all files of type <ft>. Some characters in the <rhs> have special meaning which help in cursor placement as described in |imaps-placeholders|. The optional arguments define these special characters. 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. When you type in this sequence of letters, the following text is inserted: > \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. NOTE: Set g:Imap_UsePlaceHolders to 0 to disable placeholders altogether. Set g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd to something else if you want different place holder characters. Also, b:Imap_PlaceHolderStart and b:Imap_PlaceHolderEnd override the values of g:Imap_PlaceHolderStart and g:Imap_PlaceHolderEnd respectively. This is useful for setting buffer specific place hoders. 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. vim:tw=78:et:ts=4:ft=help:norl:fo+=2:fdm=marker |
From: <sri...@us...> - 2002-12-31 09:36:10
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/tex In directory sc8-pr-cvs1:/tmp/cvs-serv27662 Modified Files: brackets.vim Log Message: Bug: <M-c> inserts '\label{<++>}<++>' literally without using IMAP_PutTextWithMovement('\label{<++>}<++>'). Index: brackets.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/brackets.vim,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** brackets.vim 22 Dec 2002 03:01:08 -0000 1.6 --- brackets.vim 31 Dec 2002 09:36:06 -0000 1.7 *************** *** 2,6 **** " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Thu Dec 19 03:00 AM 2002 PST " Description: " This ftplugin provides the following maps: --- 2,6 ---- " Author: Carl Mueller " (incorporated into latex-suite by Srinath Avadhanula) ! " Last Change: Sun Dec 29 11:00 PM 2002 PST " Description: " This ftplugin provides the following maps: *************** *** 127,131 **** return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{<++>}<++>') else ! return '\label{<++>}<++>' endif endfunction " }}} --- 127,131 ---- return "\<BS>".IMAP_PutTextWithMovement('\lefteqn{<++>}<++>') else ! return IMAP_PutTextWithMovement('\label{<++>}<++>') endif endfunction " }}} |
From: <sri...@us...> - 2002-12-31 09:21:04
|
Update of /cvsroot/vim-latex/vimfiles/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv20482 Modified Files: imaps.vim Log Message: 1. Problem: When the user tries to trigger an abbreviation near the eol, the marker string being too long triggers a line break. Therefore, just for the time being check to see if phs != phe, and if so, then use phs.phs as the marker (improbable string). We would like ultimately to completeley get over this hack and use movement instead. 2. Problem: The <C-K> map for jumping back was interfering with the dictionary completion mode of vim. Therefore change default mapping for jumping back to <S-C-J> instead of <C-K>. Ofcourse this makes it invisible to non-gui users (I think). 3. Tried to do the "right" thing for mapping. First provide a number of mappings using <plug>. These mappings call IMAP_Jumpfunc() in various ways. Various <plug> mappings for various modes have been provided. After this, we map the default keys to the <plug> mappings checking for hasmapto() each time. This provides for a robust and easy user customization. Initially, the user had to do something like: inoremap <C-J> <C-r>=IMAP_Jumpfunc('', 0)<CR> in his .vimrc to be able to override our mapping. Now he will do inoremap <C-J> <Plug>IMAP_JumpForward Doing this also has the advantage that changes in IMAP_Jumpfunc() will not affect the user customization. NOTE: This <plug> things were inspired by looking at the excellent cvscommand.vim plugin I've begun using... Index: imaps.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/plugin/imaps.vim,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** imaps.vim 30 Dec 2002 10:54:49 -0000 1.15 --- imaps.vim 31 Dec 2002 09:21:01 -0000 1.16 *************** *** 8,12 **** " while preserving filetype indentation. " ! " Last Change: Mon Dec 30 02:00 AM 2002 PST " " Documentation: {{{ --- 8,12 ---- " while preserving filetype indentation. " ! " Last Change: Tue Dec 31 01:00 AM 2002 PST " " Documentation: {{{ *************** *** 269,273 **** " A very rare string: Do not use any special characters here. This is used " for moving to the beginning of the inserted text. ! let marker = '<!---@#%_Start_Here_@#%----!>' let markerLength = strlen(marker) --- 269,280 ---- " A very rare string: Do not use any special characters here. This is used " for moving to the beginning of the inserted text. ! " When phs != phe, we are guarenteed that unless the user has done bad ! " things, phs.phs will never occur in the file. ! if phsUser != pheUser ! let marker = phsUser.phsUser ! else ! let marker = '<!---@#%_Start_Here_@#%----!>' ! endif ! call Tex_Debug('marker = '.marker) let markerLength = strlen(marker) *************** *** 404,421 **** " }}} " Maps for IMAP_Jumpfunc {{{ " map only if there is no mapping already. allows for user customization. ! if !hasmapto('IMAP_Jumpfunc') ! inoremap <C-J> <c-r>=IMAP_Jumpfunc('', 0)<CR> ! inoremap <C-K> <c-r>=IMAP_Jumpfunc('b', 0)<CR> ! nmap <C-J> i<C-J> ! nmap <C-K> i<C-K> ! if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders ! vmap <C-J> <C-\><C-N>i<C-J> ! vmap <C-K> <C-\><C-N>i<C-K> ! else ! vmap <C-J> <Del>i<C-J> ! vmap <C-K> <Del>i<C-K> endif ! end " }}} --- 411,467 ---- " }}} " Maps for IMAP_Jumpfunc {{{ + " + " These mappings use <Plug> and thus provide for easy user customization. When + " the user wants to map some other key to jump forward, he can do for + " instance: + " nmap ,f <plug>IMAP_JumpForward + " etc. + + " jumping forward and back in insert mode. + imap <silent> <Plug>IMAP_JumpForward <c-r>=IMAP_Jumpfunc('', 0)<CR> + imap <silent> <Plug>IMAP_JumpBack <c-r>=IMAP_Jumpfunc('b', 0)<CR> + + " jumping in normal mode + nmap <silent> <Plug>IMAP_JumpForward i<c-r>=IMAP_Jumpfunc('', 0)<CR> + nmap <silent> <Plug>IMAP_JumpBack i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + + " deleting the present selection and then jumping forward. + vmap <silent> <Plug>IMAP_DeleteAndJumpForward "_<Del>i<c-r>=IMAP_Jumpfunc('', 0)<CR> + vmap <silent> <Plug>IMAP_DeleteAndJumpBack "_<Del>i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + + " jumping forward without deleting present selection. + vmap <silent> <Plug>IMAP_JumpForward <C-\><C-N>i<c-r>=IMAP_Jumpfunc('', 0)<CR> + vmap <silent> <Plug>IMAP_JumpBack <C-\><C-N>i<c-r>=IMAP_Jumpfunc('b', 0)<CR> + + " }}} + " Default maps for IMAP_Jumpfunc {{{ " map only if there is no mapping already. allows for user customization. ! if !hasmapto('<Plug>IMAP_JumpForward', 'i') ! imap <C-J> <Plug>IMAP_JumpForward ! endif ! if !hasmapto('<Plug>IMAP_JumpBack', 'i') ! imap <S-C-J> <Plug>IMAP_JumpBack ! endif ! if !hasmapto('<Plug>IMAP_JumpForward', 'n') ! nmap <C-J> <Plug>IMAP_JumpForward ! endif ! if !hasmapto('<Plug>IMAP_JumpBack', 'n') ! nmap <S-C-J> <Plug>IMAP_JumpBack ! endif ! if exists('g:Imap_StickyPlaceHolders') && g:Imap_StickyPlaceHolders ! if !hasmapto('<Plug>IMAP_JumpForward', 'v') ! vmap <C-J> <Plug>IMAP_JumpForward endif ! if !hasmapto('<Plug>IMAP_JumpBack', 'v') ! vmap <S-C-J> <Plug>IMAP_JumpBack ! endif ! else ! if !hasmapto('<Plug>IMAP_DeleteAndJumpForward', 'v') ! vmap <C-J> <Plug>IMAP_DeleteAndJumpForward ! endif ! if !hasmapto('<Plug>IMAP_DeleteAndJumpBack', 'v') ! vmap <S-C-J> <Plug>IMAP_DeleteAndJumpBack ! endif ! endif " }}} |
From: Srinath A. <sr...@fa...> - 2002-12-31 07:28:21
|
On Mon, 30 Dec 2002, Benji Fisher wrote: > Maybe we should go back to the idea of positioning the cursor with > {count}<bs> and {count}<space> (in Normal mode). The comment in the > code says that the problem is that strlen() returns different values > depending on the encoding. Does anyone remember how to produce an > example of this? Did we ever try > > :let n =3D strlen(substitute(text, ".", "x", "g")) > Yes. Positioning using movement is the best... The problem I ran across was that if you do something like :set encoding=3Dutf8 :let bar =3D "=AB" =09(where the =AB character is typed using <C-v><<) :echo strlen(bar) 2 Can this problem be taken care of using the change in encoding etc? Hmm... I see that :echo strlen(iconv(bar, &encoding, 'latin1')) 1 :echo strlen(substitute(bar, '.', 'x', 'g')) 1 So those two methods might work... It will be a definite improvement over the current "hack". On a different note: imaps.vim now contains: =09let textEnc =3D iconv(text, "latin1", &enc) =09[snip] =09" If there are no place holders, just return the text. =09if textEnc !~ '\V'.phs.'\.\{-}'.phe =09=09return text =09endif Shouldn't the comparision be: =09" If there are no place holders, just return the text. =09if textEnc !~ '\V'.phsEnc.'\.\{-}'.pheEnc =09=09return text =09endif Maybe this is why Fabio is having that problem? I am wary of making any changes here because I haven't thought about this as much as you have... Srinath |
From: Srinath A. <sr...@fa...> - 2002-12-31 07:16:55
|
Hey Mikolaj, On Mon, 30 Dec 2002, Mikolaj Machowski wrote: > > TODO: Should we write code to make such typos get handled elegantly? > > IMO no. Better would be SDK with question, suggestions etc. SDK? > Sorry, for silence but I don't have much time for lS now :( BTW. could No problem. Take your time... I get quite busy sometimes too... I have some winter holidays nowadays which gives me more time than usual :) > you remind which function is responsible for prompt with choosing by > numbers? Lately was so many changes I am not able to catch up with > everything... <F5> inserts environment. <S-F5> changes the environment... These features have found their way into the documentation already :) Srinath |
From: Mikolaj M. <mi...@wp...> - 2002-12-30 23:16:39
|
On Mon, Dec 30, 2002 at 11:11:25AM -0800, sri...@us... wrote: > Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages > In directory sc8-pr-cvs1:/tmp/cvs-serv19718 > Modified Files: > longtable > Log Message: > . BUG: typo, env:longtable was written as enb:longtable > TODO: Should we write code to make such typos get handled elegantly? IMO no. Better would be SDK with question, suggestions etc. Sorry, for silence but I don't have much time for lS now :( BTW. could you remind which function is responsible for prompt with choosing by numbers? Lately was so many changes I am not able to catch up with everything... m. |
From: <sri...@us...> - 2002-12-30 19:11:25
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages In directory sc8-pr-cvs1:/tmp/cvs-serv19718 Modified Files: longtable Log Message: . BUG: typo, env:longtable was written as enb:longtable TODO: Should we write code to make such typos get handled elegantly? . adding modeline. Index: longtable =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages/longtable,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** longtable 25 Nov 2002 23:00:26 -0000 1.2 --- longtable 30 Dec 2002 19:11:21 -0000 1.3 *************** *** 16,20 **** \.'bra:LTcapwidth,' \.'sbr:Longtable,' ! \.'enb:longtable,' \.'sep:lt,' \.'nor:endhead,' --- 16,20 ---- \.'bra:LTcapwidth,' \.'sbr:Longtable,' ! \.'env:longtable,' \.'sep:lt,' \.'nor:endhead,' *************** *** 27,28 **** --- 27,30 ---- \.'bra:caption*,' \.'nor:newpage' + + " vim:ft=vim:ts=4:sw=4:noet |
From: Benji F. <be...@me...> - 2002-12-30 13:39:35
|
Srinath Avadhanula wrote: > I just noticed another problem with the long marker string. We are > triggering line breaks unecessarily. Just doing $$ 10 spaces away from > EOL causes the $$ to slip into the next line. This will have to be fixed > too... > > Maybe Benji's original idea of using phs.phs instead of the marker > string... (maybe check to see if phs != phe before this...) > > Srinath Maybe we should go back to the idea of positioning the cursor with {count}<bs> and {count}<space> (in Normal mode). The comment in the code says that the problem is that strlen() returns different values depending on the encoding. Does anyone remember how to produce an example of this? Did we ever try :let n = strlen(substitute(text, ".", "x", "g")) to calculate the right number of <bs> or <space> characters to use? --Benji |