vim-latex-devel Mailing List for Vim-Latex (Page 106)
Brought to you by:
srinathava,
tmaas
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(120) |
Dec
(118) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(145) |
Feb
(23) |
Mar
(30) |
Apr
(50) |
May
(88) |
Jun
(49) |
Jul
(41) |
Aug
(13) |
Sep
(51) |
Oct
(30) |
Nov
(80) |
Dec
(43) |
2004 |
Jan
(15) |
Feb
(25) |
Mar
(48) |
Apr
(12) |
May
(37) |
Jun
(52) |
Jul
(16) |
Aug
(10) |
Sep
(7) |
Oct
(19) |
Nov
(17) |
Dec
(19) |
2005 |
Jan
(15) |
Feb
(5) |
Mar
(7) |
Apr
(3) |
May
(2) |
Jun
(4) |
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
(16) |
Dec
(16) |
2006 |
Jan
(15) |
Feb
(27) |
Mar
(49) |
Apr
(31) |
May
(24) |
Jun
(12) |
Jul
(23) |
Aug
(13) |
Sep
(22) |
Oct
(6) |
Nov
(8) |
Dec
(10) |
2007 |
Jan
(3) |
Feb
(13) |
Mar
(19) |
Apr
(1) |
May
(5) |
Jun
(10) |
Jul
(2) |
Aug
(13) |
Sep
(10) |
Oct
(2) |
Nov
(30) |
Dec
(15) |
2008 |
Jan
(11) |
Feb
(9) |
Mar
(27) |
Apr
(27) |
May
(22) |
Jun
(29) |
Jul
|
Aug
(21) |
Sep
(6) |
Oct
(4) |
Nov
(9) |
Dec
(2) |
2009 |
Jan
(52) |
Feb
(21) |
Mar
(9) |
Apr
(41) |
May
(13) |
Jun
(8) |
Jul
(5) |
Aug
(31) |
Sep
(14) |
Oct
(10) |
Nov
(17) |
Dec
(17) |
2010 |
Jan
(25) |
Feb
(22) |
Mar
(22) |
Apr
(24) |
May
(35) |
Jun
(23) |
Jul
(22) |
Aug
(10) |
Sep
(6) |
Oct
(29) |
Nov
(8) |
Dec
(6) |
2011 |
Jan
(12) |
Feb
(89) |
Mar
(41) |
Apr
(8) |
May
(17) |
Jun
(11) |
Jul
(3) |
Aug
(13) |
Sep
(14) |
Oct
(23) |
Nov
(8) |
Dec
(9) |
2012 |
Jan
(15) |
Feb
(27) |
Mar
(6) |
Apr
(17) |
May
(29) |
Jun
(9) |
Jul
(50) |
Aug
(15) |
Sep
(11) |
Oct
(12) |
Nov
(22) |
Dec
(7) |
2013 |
Jan
(24) |
Feb
(32) |
Mar
(6) |
Apr
(5) |
May
(2) |
Jun
(15) |
Jul
(20) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
(7) |
Dec
(4) |
2014 |
Jan
(3) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(4) |
Jun
(5) |
Jul
(4) |
Aug
(3) |
Sep
(9) |
Oct
|
Nov
(2) |
Dec
(3) |
2015 |
Jan
|
Feb
(4) |
Mar
(9) |
Apr
|
May
(1) |
Jun
|
Jul
(5) |
Aug
(6) |
Sep
(2) |
Oct
|
Nov
(6) |
Dec
|
2016 |
Jan
(1) |
Feb
(11) |
Mar
(4) |
Apr
(2) |
May
(8) |
Jun
(9) |
Jul
|
Aug
(9) |
Sep
(2) |
Oct
(7) |
Nov
|
Dec
|
2017 |
Jan
(7) |
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Benji F. <be...@me...> - 2003-01-17 14:11:32
|
Srinath Avadhanula wrote: > ... of the large number of changes I made recently. > > The initial way latex-suite used to get triggered was: > > 1. tex_latexSuite.vim would get sourced everytime. > 2. It would source main.vim once for every buffer. > 3. The first time it was sourced, main.vim would source each of the > other files and from the second time on, just call SetTeXOptions(). > Components which needed to set buffer local mappings would create > globally visible functions which SetTeXOptions() would need to call. > > This had one obvious flaw because of point 2. > > It doesn't work with components which needed to do something every time > we entered a buffer irrespective of whether its the first or the n^th > time. For example, its not possible to write elegantly the > functionality where the packages menu gets updated on every Filetype > event. For example, if we do something like: > 1. open a.tex > 2. :e b.tex > 3. :e a.tex > > in the original setup, hen after step 3, the packages menu would still > show the stuff for b.tex... > > Apart from this obvious flaw which could have been solved with a little > less effort, from a "do the right thing" point of view, it was just > plainly bad design. There is too much inter dependency between the > various modules, which means main.vim would need to be modified every > time we wanted to change some other module. > > It might seem that one way to avoid interdependencies would have been to > reduce tex_latexSuite.vim to: > > execute 'so '.s:path.'/latex-suite/*.vim' > > This is however not possible because we want to source the files in a > certain order. > > There are ofcourse more obvious ways to overcome this problem. (like the > brute force way of just making package/babel scan for whether the user > uses babel with the 'german' option), but I think the present setup is > the most scalable. > > Let me know if what I've done is not too clear or if you have other > concerns. > > In summary, what I have done makes latex-suite behave like: > > 1. tex_latexSuite.vim gets sourced by vim every time a tex filetype > event occurs. > 2. It sources main.vim only once. _never again_ > 3. It then just throws a LatexSuiteFileType event every time (including > the first time). > > When main.vim gets sourced, it: > > 1. Sources each file in some nice order. > 2. Sets up an au to catch the LatexSuiteFileType event to call > SetTeXOptions() each time. Thus buffer local mappings are created for > each tex file being edited. > > Other files which also need to set buffer local mappings follow the same > procedure. > > packages.vim however does something extra > > 1. It sets up an au to call Tex_pack_updateall() on every > LatexSuiteFileType event (which means it gets called for every buffer > every time). > 2. Tex_pack_updateall throws a LatexSuitePackagesScanned event after it > is done "supporting" all the \usepackage's found. > > > Finally, packages/babel catches the LatexSuitePackagesScanned event to > customize the smart quotes setting. > > So to summarize, after about 5 hours of coding, I have a system which > enables german users to edit both english and german files in the same > vim session using some pretty nifty event handling mechanisms. I am > absolutely sure that not more than about 1 person will find this useful. > Ho well, if I was concerned with the value of my time, I wouldn't have > started this thing in the first place... Besides, my meeting tomorrow > got postponed, so I went a little overboard. I think this "little" > programming binge has eaten up my quota for the coming week :( > > Hopefully, we will have some use for all this flexibity in the future. > > > Srinath I redirected this from Vim-latex-cvs to Vim-latex-devel . I think this is going to be helpful in the long run. In the short run, I am afraid that the whle system may be unstable for a while. I would have started a new branch for this. We should document how the system works. Parts of your e-mail, quoted above, can serve as a draft. See :help syntax-loading for one model. The rest of my comments are pretty minor. You did not (yet) take my suggestion about packages/german-babel and so on. Is this because you did not like the idea, or just because you had a lot of other things on your mind? Again, the point is that packages/german does nothing more than set smart-quote options, but (1) this may change and (2) polski already does much more. If you have already declared :augroup LatexSuite then you do not have to include LatexSuite (the augroup) in the :au lines. I find it easier to read without this repetition. Do you disagree, or were you just following the cvs plugin model? If "ngerman" is given as an option to the babel package, then the "german" package will be :source'd. This will work fine. Do we want it to work this way in general? I think there are (at least) two versions of french; can they also be treated the same way? I would rather parse g:Tex_babel_options and, for each option given (Is it legal to give more than one?) :source the appropriate file if it exists. What is the format of the g:Tex_package_detected and g:Tex_{pack}_options variables? If it is something like "pack1,pack2", then it is pretty easy to parse; in particular, your match with '\<babel\>' should work reliably. --Benji |
From: Srinath A. <sr...@fa...> - 2003-01-16 23:52:20
|
I just cooked up something which shows what I mean... Note that this is still a very basic version which doesn't have the syncing capability of compiler.vim... Eventually, we would like to make the quickfix window (in this case, the '--Label Browser---' window) sync with the appropriate tex window in preview mode... I am attaching a file called labelbrowser.vim. Place that in your ftplugin/tex/ directory and then when you either type \ref{ or press <F9> in normal mode, a window with the \label matches is shown... (You must have some tex files containing \label's in the directory of the file being edited). On Thu, 16 Jan 2003, Mikolaj Machowski wrote: > Great :) The idea to use quickfix is wonderful but I have to read > something about it. Also I don't like to use IMAP here. quickfix and > preview are some kind "agressive". Making it appears automagically... I am including this agressive behavior :) just now just to show its possible. Eventually, we might make this an option which is disabled by default... > I wouldn't like this behaviour. Also mapping this to some key (let's say > <F9>) make it easier to react on prefix (write \ref{fig and you will see only > \labels for figures). This key will be "lost" but it is possible to make Thats a cool idea... Infact, I think instead of both of us just getting our hands dirty and implementing something fast, we should discuss it like this... A really professional way to approach things like this is to write the documentation first... Here's my shot: ============================================================================== Label Browser *latex-suite-label-browser* This functionality is available via the Tex-Suite.Label menu or the :TLabel command. While editing a latex file, if you press <F9> after typing \ref{, latex-suite opens up a '--Label-Browser--' window. This window contains a list of \label's found in all the tex files found in the directory containing the present file being edited. Just below this window, a |preview-window| of the tex file containing the label is shown so you can get some context. Pressing <F9> while the label browser is being shown makes the cursor jump to the label browser window. Pressing <enter> on an item in this window inserts the corresponding label in the corresponding latex file. Moving up and down in the label browser window automatically syncs the preview window's display. If you press <F9> after something like '\ref{pat' then only labels starting with 'pat' will be shown. This is useful to narrow down references if you follow a consistent labeling scheme. See |ls-maps-label-browser| for how to customize the mapping for this functionality. See |ls-options-label-browser| for various options which affect the behavior ============================================================================== I still haven't written the |ls-options-label-browser| part of it :). In the meanwhile, you are welcome to add to the help suggest new modes of behavior etc... Srinath |
From: Benji F. <be...@me...> - 2003-01-16 20:49:17
|
Srinath Avadhanula wrote: > On Thu, 16 Jan 2003, Benji Fisher wrote: > > >>" maybe off by one: >>:let line = strpart(getline("."), col(".")).a:char >>:let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') >> >>(I am not sure whether a:char should be appended before or after the >>substitute() line.) The script variable can have the form >> >>s:ProtectStrings = '\\`' . '\|' . '"`' >> >>(note that IMAP_Protect() applies escape(..., '\') before adding >>something to the script variable). Then, if the line up to the cursor >>contains either of the strings '\`' or '"`', everything up to and >>including the last occurrence will be removed by the substitute(). > > Okay, after reading this a few times, I see what you mean... Just to > clarify, when we press a letter 'a' at the end of a line like > > A quote starts `` > > then, instead of trying to find out if the string > "A quote starts ``a" matches with an LHS, we first remove the `` and > then try to see if "A quote starts a" matches with an available lhs? No: strip off '.*``' and check whether "a" matches any lhs. > That will certainly work. (Although removing s:ProtectStrings everywhere > is not necessary, only from the end no?) > > Do you think we need to do this still? The present system of creating > fake maps seems to work as of now... If you still think we need this, > please go ahead and add this... You'll also need to remove the > s:ProtectLetters() function from main.vim and add in a couple of > IMAP_Protect()'s instead.... Which version is more scalable? If the current system is working and is easy to extend, I will not try to fix it. --Benji |
From: Srinath A. <sr...@fa...> - 2003-01-16 19:52:47
|
On Thu, 16 Jan 2003, Benji Fisher wrote: > " maybe off by one: > :let line = strpart(getline("."), col(".")).a:char > :let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') > > (I am not sure whether a:char should be appended before or after the > substitute() line.) The script variable can have the form > > s:ProtectStrings = '\\`' . '\|' . '"`' > > (note that IMAP_Protect() applies escape(..., '\') before adding > something to the script variable). Then, if the line up to the cursor > contains either of the strings '\`' or '"`', everything up to and > including the last occurrence will be removed by the substitute(). > Okay, after reading this a few times, I see what you mean... Just to clarify, when we press a letter 'a' at the end of a line like A quote starts `` then, instead of trying to find out if the string "A quote starts ``a" matches with an LHS, we first remove the `` and then try to see if "A quote starts a" matches with an available lhs? That will certainly work. (Although removing s:ProtectStrings everywhere is not necessary, only from the end no?) Do you think we need to do this still? The present system of creating fake maps seems to work as of now... If you still think we need this, please go ahead and add this... You'll also need to remove the s:ProtectLetters() function from main.vim and add in a couple of IMAP_Protect()'s instead.... Srinath |
From: Benji F. <be...@me...> - 2003-01-16 17:35:21
|
Srinath Avadhanula wrote: > On Tue, 14 Jan 2003, Benji Fisher wrote: > > >> Change the defaults. Almost all Insert-mode mappings should be >>off by default. >> > > > That was not what I was looking for. I would still like German writers > to use `g for \gamma. Changing defaults only means that either we hide > the problems by default, or just ignore german users... I dont think > either is a solution. What I was looking for was ways to "solve" the > problem of things like `g getting expanded in unexpected places... OK, how about this: Introduce a new function in imaps.vim so that we can :call IMAP_Protect('\`') to protect an escaped single-open-quote. This new function will save the string '\`' in a script variable. Then, when IMAP_LookupCharacter() is deciding whether there is anything to be expanded, it will do something like " maybe off by one: :let line = strpart(getline("."), col(".")).a:char :let line = substitute(line, '\V\.\*\('.s:ProtectStrings.'\)', '', '') (I am not sure whether a:char should be appended before or after the substitute() line.) The script variable can have the form s:ProtectStrings = '\\`' . '\|' . '"`' (note that IMAP_Protect() applies escape(..., '\') before adding something to the script variable). Then, if the line up to the cursor contains either of the strings '\`' or '"`', everything up to and including the last occurrence will be removed by the substitute(). --Benji |
From: Mikolaj M. <mi...@wp...> - 2003-01-16 17:24:54
|
On Wed, Jan 15, 2003 at 04:00:31PM -0800, Srinath Avadhanula wrote: > Hey Mikolaj, > I was actually thinking of a different way of implementing this... (I > haven't even started)... Here's my take: > call IMAP('\ref{', "\<C-o>:Tex_ListLabels()\<CR>", 'tex') > And Tex_ListLabels() should actually do something like: > function! Tex_ListLabels() > " We want to search labels across files... not just the current > " file... We might cache this in some manner so we don't end up > " spawning shell commands every time the user does \label... > silent! grep \\label{ *.tex > " Open up a window showing the matches... This lets us use vim's own > " excellent quickfix capabilities. > cclose > cwindow 5 > " At this point we might even do something similar to what is done > " in RunLatex()... Open up the file corresponding to this match in a > " preview window... > wincmd p > endfunction > And if possible, we should make this function behave like RunLatex() so > that it also opens up the corresponding file in preview mode when we are > on a line in the cwindow... (So that we have some context aroudnd the > \label) Hope you are getting what I mean... Try making some $\mistake$ > in a tex file and compiling it... I was thinking that the label/citation > browser would behave similarly... > What do you think? Great :) The idea to use quickfix is wonderful but I have to read something about it. Also I don't like to use IMAP here. quickfix and preview are some kind "agressive". Making it appears automagically... I wouldn't like this behaviour. Also mapping this to some key (let's say <F9>) make it easier to react on prefix (write \ref{fig and you will see only \labels for figures). This key will be "lost" but it is possible to make it context sensitive - another function will be called after \cite, another after \ref and maybe others. m. |
From: Srinath A. <sr...@fa...> - 2003-01-16 17:08:12
|
On Thu, 16 Jan 2003, Luc Hermitte wrote: > > Sorry about that... It was some legacy code... I changed it to use > > g:Tex_Leader like the other stuff like `/. > > There was another problem with the mappings ? Yes. The greek letter mappings always used ` irrespective of the g:Tex_Leader setting... I'll put synchronizing the menus on the TODO. Srinath |
From: Benji F. <be...@me...> - 2003-01-16 16:50:13
|
Fabio Spelta wrote: > Hello > > I'm just working on my thesis and speaking about "bits" I had just > inserted ``0''. Well, what I really got was when I hit the 0 key was > `^\circ''. > It takes a little to work around it. > I know it is not a bug, but I'd like to tell it anyway, perhaps if the 0 > is put _between_ ``''<++> it should not change into that. > > Goodbye and thanx for your COOL suite. There were some recent changes to deal with this sort of problem. When you try to type ``german'' does the `g expand to \gamma ? With the latest version from CVS, I have no problem with ``0''; I am not sure if these fixes are in the posted release, yet. HTH --Benji Fisher |
From: Fabio S. <fab...@ti...> - 2003-01-16 16:10:29
|
Hello I'm just working on my thesis and speaking about "bits" I had just inserted ``0''. Well, what I really got was when I hit the 0 key was `^\circ''. It takes a little to work around it. I know it is not a bug, but I'd like to tell it anyway, perhaps if the 0 is put _between_ ``''<++> it should not change into that. Goodbye and thanx for your COOL suite. -- Fabio Spelta email: fab...@ti... jabber: fe...@ja... ecdl project: http://ecdllibre.sf.net |
From: Luc H. <her...@fr...> - 2003-01-16 13:35:52
|
* On Wed, Jan 15, 2003 at 07:50:05PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > > BTW, the mappings are not synchronized with the actual mappings for > > greek letters -- when we change, like I do, the TeX leader '`' to > > something else. Oups ! I meant the _menus_ are not synchronized with the mappings. > Sorry about that... It was some legacy code... I changed it to use > g:Tex_Leader like the other stuff like `/. There was another problem with the mappings ? -- Luc Hermitte http://hermitte.free.fr/vim/ |
From: Srinath A. <sr...@fa...> - 2003-01-16 03:50:07
|
On Wed, 15 Jan 2003, Luc Hermitte wrote: > BTW, the mappings are not synchronized with the actual mappings for > greek letters -- when we change, like I do, the TeX leader '`' to > something else. Sorry about that... It was some legacy code... I changed it to use g:Tex_Leader like the other stuff like `/. It looks like sourceforge's pserver/webcvs access is down for the moment. I'll make a release after it resumes... Srinath |
From: Srinath A. <sr...@fa...> - 2003-01-16 00:00:43
|
Hey Mikolaj, I was actually thinking of a different way of implementing this... (I haven't even started)... Here's my take: call IMAP('\ref{', "\<C-o>:Tex_ListLabels()\<CR>", 'tex') And Tex_ListLabels() should actually do something like: function! Tex_ListLabels() =09" We want to search labels across files... not just the current =09" file... We might cache this in some manner so we don't end up =09" spawning shell commands every time the user does \label... =09silent! grep \\label{ *.tex =09" Open up a window showing the matches... This lets us use vim's own =09" excellent quickfix capabilities. =09cclose =09cwindow 5 =09" At this point we might even do something similar to what is done =09" in RunLatex()... Open up the file corresponding to this match in a =09" preview window... =09wincmd p endfunction And if possible, we should make this function behave like RunLatex() so that it also opens up the corresponding file in preview mode when we are on a line in the cwindow... (So that we have some context aroudnd the \label) Hope you are getting what I mean... Try making some $\mistake$ in a tex file and compiling it... I was thinking that the label/citation browser would behave similarly... What do you think? Srinath On Thu, 16 Jan 2003, Mikolaj Machowski wrote: > Hello, > > I began to write function to view label names and have problems... > It works in this way: write \ref{ press <F9> you should see > lines with \label ;choose number and nothing. If you wrote > \ref{i you will see only list of labels which began on i. > > ---------------------- > " For making labels > " > inoremap <F9> <C-o>:call Labtest()<cr> > > > function! Labtest() > > let pos =3D line('.').' | normal! '.virtcol('.').'|' > > =09let g:curline =3D strpart(getline('.'), col('.') - 10) > =09let g:prefix =3D matchstr(g:curline, '{\zs.\{-}$') > > =09redir @a > =09exe 'silent g/\\label{'.g:prefix.'/p' > =09redir END > > =09let g:lob =3D @a > =09let g:lob =3D substitute(g:lob, "\n", '', '') > " here is first problem: I'd like to present whole lines with \label tag > " to give some context (also it would take some time to process each > " line to get only \label tag)[1] but Tex_CreatePromt and Tex_Strntok hav= e > " something against chars like \n or =A4, with , these functions don't > " have problems, but if I want to give whole lines , as separator can > " cause problems > =09let g:lob =3D substitute(g:lob, "\n", '=A4', 'g') > > > =09let g:common_label_prompt =3D Tex_CreatePrompt(g:lob, 1, '=A4') . > =09=09=09=09\ 'Enter number of label: ' > > =09let g:inp =3D input('Enter number of label:'."\n".g:common_label_promp= t) > > =09if g:inp =3D=3D '' > =09=09exe pos > =09=09return 0 > =09endif > > =09let g:labelline =3D Tex_Strntok(g:lob, '=A4', g:inp) > =09let g:labelname =3D matchstr(g:labelline, '\\label{\zs.\{-}\ze}') > > =09exe pos > " As usual I have problems with simple things :(. How put > " g:labelname.'}' after \ref{, \pageref{ or similar. > > endfunction > --------------------- > > > [1] When two \label are in one line can be easily solved with > if g:lob =3D~ "=A4.\{-}\\label{[^=A4]\{-}\\label{.\{-}=A4" > =09let g:glob =3D substitute(g:glob, "\(=A4.\{-}\\label{.\{-}}\)\([^=A4]\= {-}\\label{.\{-}=A4\)", > =09=09"\1=A4 cont -> \2", 'g') > endif > > OK, I didn't test it but problem is possible to solve and IMO faster > then iterate through whole g:glob to get only \label{..} things. > > > Mikolaj > > > ------------------------------------------------------- > This SF.NET email is sponsored by: A Thawte Code Signing Certificate > is essential in establishing user confidence by providing assurance of > authenticity and code integrity. Download our Free Code Signing guide: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0028en > _______________________________________________ > Vim-latex-devel mailing list > Vim...@li... > https://lists.sourceforge.net/lists/listinfo/vim-latex-devel > > |
From: Mikolaj M. <mi...@wp...> - 2003-01-15 23:13:49
|
Hello, I began to write function to view label names and have problems... It works in this way: write \ref{ press <F9> you should see lines with \label ;choose number and nothing. If you wrote \ref{i you will see only list of labels which began on i. ---------------------- " For making labels " inoremap <F9> <C-o>:call Labtest()<cr> function! Labtest() let pos = line('.').' | normal! '.virtcol('.').'|' let g:curline = strpart(getline('.'), col('.') - 10) let g:prefix = matchstr(g:curline, '{\zs.\{-}$') redir @a exe 'silent g/\\label{'.g:prefix.'/p' redir END let g:lob = @a let g:lob = substitute(g:lob, "\n", '', '') " here is first problem: I'd like to present whole lines with \label tag " to give some context (also it would take some time to process each " line to get only \label tag)[1] but Tex_CreatePromt and Tex_Strntok have " something against chars like \n or ¤, with , these functions don't " have problems, but if I want to give whole lines , as separator can " cause problems let g:lob = substitute(g:lob, "\n", '¤', 'g') let g:common_label_prompt = Tex_CreatePrompt(g:lob, 1, '¤') . \ 'Enter number of label: ' let g:inp = input('Enter number of label:'."\n".g:common_label_prompt) if g:inp == '' exe pos return 0 endif let g:labelline = Tex_Strntok(g:lob, '¤', g:inp) let g:labelname = matchstr(g:labelline, '\\label{\zs.\{-}\ze}') exe pos " As usual I have problems with simple things :(. How put " g:labelname.'}' after \ref{, \pageref{ or similar. endfunction --------------------- [1] When two \label are in one line can be easily solved with if g:lob =~ "¤.\{-}\\label{[^¤]\{-}\\label{.\{-}¤" let g:glob = substitute(g:glob, "\(¤.\{-}\\label{.\{-}}\)\([^¤]\{-}\\label{.\{-}¤\)", "\1¤ cont -> \2", 'g') endif OK, I didn't test it but problem is possible to solve and IMO faster then iterate through whole g:glob to get only \label{..} things. Mikolaj |
From: Bernhard W. <ber...@bw...> - 2003-01-15 19:19:28
|
On Wed, 15 Jan 2003 at 11:03 (-0800), Srinath Avadhanula wrote: > > I've uploaded the fixed version now. It looks like the CVS problem you > mentioned created problems with my last release... (I hope sf.net's CVS > shell cvs server comes back up soon... Its a royal pain to make releases > otherwise). It works fine now. Thanks for quick response! Regards, Bernhard |
From: Srinath A. <sr...@fa...> - 2003-01-15 19:03:13
|
Hello Bernhard, I've uploaded the fixed version now. It looks like the CVS problem you mentioned created problems with my last release... (I hope sf.net's CVS shell cvs server comes back up soon... Its a royal pain to make releases otherwise). Please try out the latest version... Let me know if you have more problems... On Wed, 15 Jan 2003, Bernhard Walle wrote: > No, it was insertig ``''. And "`e still expands to "`epsilon. I updated > to the most recent version > (http://vim-latex.sourceforge.net/download/latexSuite.tar.gz) and I have > no user-configuration file. Benji meant ~/.vim/ftplugin/latex-suite/texrc (use ~/vimfiles instead of ~/.vim if you are on windows) > There's no difference between ngerman and german. And you might also > consider \usepackage[ngerman]{babel} but that's less important. > We'll do these things in the next few days. As of now, there is no mechanism to change behavior based on options used in packages... I'll make this a feature request. Srinath |
From: Bernhard W. <ber...@gm...> - 2003-01-15 18:05:13
|
On Wed, 15 Jan 2003 at 11:53 (-0500), Benji Fisher wrote: > Bernhard Walle wrote: > >On Tue, 14 Jan 2003 at 20:35 (-0800), Srinath Avadhanula wrote: > >>On Tue, 14 Jan 2003, Bernhard Walle wrote: > >> > >>>in german.sty the correct quotation marks are "` and "' (instead of `` > >>>and ''). But if I type "`gut"' for example it's expanded to > >>>"\gammaut. Is there any solution for this? > >>> > >> > >>I've fixed this problem in the latest version. Also, in the present > >>version, if \usepackage{german} is detected, then " expands to "` or '" > >>depending on whether its opening or closing. As of now, editing both > >>german and english files in the same vim session is not supported, but > >>that will come soon... > > > >It does not work here with the latest version from the download page. > >And, please recognize also \usepackage{ngerman} (it's the same as german > >but with the new hypenation rules). > > > >Thanks. > > I fixed the fix (I hope). It was inserting '" instead of "', > right? No, it was insertig ``''. And "`e still expands to "`epsilon. I updated to the most recent version (http://vim-latex.sourceforge.net/download/latexSuite.tar.gz) and I have no user-configuration file. > If you are willing to get the latest (minutes-old) version from > CVS, I would appreciate further testing. Otherwise, wait unitl the next > release. If there is still a problem, please give a little more detail > than in your last note. This version also switches between ``English > quotes'' and "`German quotes"' if you switch between two files, one with > \usepackage{german} and one without. The Sourceforge CVS server seems to be down so I cannot do this. Maybe next days. > I hope someone else will add support for the ngerman package. It > is probably easy, but I have not dealt with packages before. There's no difference between ngerman and german. And you might also consider \usepackage[ngerman]{babel} but that's less important. > > >>Note that `g will still expand to \gamma (and similarly for other > >>english alphabets) if its not preceded by ", ` or \. This is for typing > >>greek letters. You cannot completeley disable this feature with an > >>option right now. In the future, I'll make this an option... If you > >>really want to disable such expansions, you'll need to comment out lines > >>96-131 of ftplugin/latex-suite/main.vim > > > > > >The feature is great but it should work with "`..."'. I think it would > >also be good to get a '"' by typing " twice as like in XEmacs if this is > >possible but it's not very important. > > You can now get "`german"' easily. We recently made it so that > typing "" will insert "`"'<++> with the cursor inside the quotation > marks. This is for those who are afraid of getting unbalanced quotes; > the same thing works for () and so on. You can then type <C-J> to go to > the <++> marker. The general vim method for inserting a character > without any mappings is to precede it with <C-V>, so if you want a " > character, and it is not one of the situations (after \ or in math mode) > that we have already thought of, you can use <C-V>". Thanks. I didn't know this. Regards, Bernhard |
From: Luc H. <her...@fr...> - 2003-01-15 17:41:30
|
* On Tue, Jan 14, 2003 at 12:35:23PM -0800, Srinath Avadhanula <sr...@fa...> wrote: > On Tue, 14 Jan 2003, Benji Fisher wrote: > > > Change the defaults. Almost all Insert-mode mappings should be > > off by default. > > > > That was not what I was looking for. I would still like German writers > to use `g for \gamma. Changing defaults only means that either we hide > the problems by default, or just ignore german users... There is a problem here with many non-English people. By default, '`' is a dead key on my system. > I dont think either is a solution. What I was looking for was ways to > "solve" the problem of things like `g getting expanded in unexpected > places... BTW, the mappings are not synchronized with the actual mappings for greek letters -- when we change, like I do, the TeX leader '`' to something else. -- Luc Hermitte http://hermitte.free.fr/vim/ |
From: Benji F. <be...@me...> - 2003-01-15 16:43:36
|
Bernhard Walle wrote: > Hello, > > On Tue, 14 Jan 2003 at 20:35 (-0800), Srinath Avadhanula wrote: > >>On Tue, 14 Jan 2003, Bernhard Walle wrote: >> >> >>>in german.sty the correct quotation marks are "` and "' (instead of `` >>>and ''). But if I type "`gut"' for example it's expanded to >>>"\gammaut. Is there any solution for this? >>> >> >>I've fixed this problem in the latest version. Also, in the present >>version, if \usepackage{german} is detected, then " expands to "` or '" >>depending on whether its opening or closing. As of now, editing both >>german and english files in the same vim session is not supported, but >>that will come soon... > > It does not work here with the latest version from the download page. > And, please recognize also \usepackage{ngerman} (it's the same as german > but with the new hypenation rules). > > Thanks. I fixed the fix (I hope). It was inserting '" instead of "', right? If you are willing to get the latest (minutes-old) version from CVS, I would appreciate further testing. Otherwise, wait unitl the next release. If there is still a problem, please give a little more detail than in your last note. This version also switches between ``English quotes'' and "`German quotes"' if you switch between two files, one with \usepackage{german} and one without. I hope someone else will add support for the ngerman package. It is probably easy, but I have not dealt with packages before. >>Note that `g will still expand to \gamma (and similarly for other >>english alphabets) if its not preceded by ", ` or \. This is for typing >>greek letters. You cannot completeley disable this feature with an >>option right now. In the future, I'll make this an option... If you >>really want to disable such expansions, you'll need to comment out lines >>96-131 of ftplugin/latex-suite/main.vim > > > The feature is great but it should work with "`..."'. I think it would > also be good to get a '"' by typing " twice as like in XEmacs if this is > possible but it's not very important. You can now get "`german"' easily. We recently made it so that typing "" will insert "`"'<++> with the cursor inside the quotation marks. This is for those who are afraid of getting unbalanced quotes; the same thing works for () and so on. You can then type <C-J> to go to the <++> marker. The general vim method for inserting a character without any mappings is to precede it with <C-V>, so if you want a " character, and it is not one of the situations (after \ or in math mode) that we have already thought of, you can use <C-V>". HTH --Benji Fisher |
From: Bernhard W. <ber...@gm...> - 2003-01-15 13:50:35
|
Hello, On Tue, 14 Jan 2003 at 20:35 (-0800), Srinath Avadhanula wrote: > On Tue, 14 Jan 2003, Bernhard Walle wrote: > > > in german.sty the correct quotation marks are "` and "' (instead of `` > > and ''). But if I type "`gut"' for example it's expanded to > > "\gammaut. Is there any solution for this? > > > I've fixed this problem in the latest version. Also, in the present > version, if \usepackage{german} is detected, then " expands to "` or '" > depending on whether its opening or closing. As of now, editing both > german and english files in the same vim session is not supported, but > that will come soon... It does not work here with the latest version from the download page. And, please recognize also \usepackage{ngerman} (it's the same as german but with the new hypenation rules). Thanks. > Note that `g will still expand to \gamma (and similarly for other > english alphabets) if its not preceded by ", ` or \. This is for typing > greek letters. You cannot completeley disable this feature with an > option right now. In the future, I'll make this an option... If you > really want to disable such expansions, you'll need to comment out lines > 96-131 of ftplugin/latex-suite/main.vim The feature is great but it should work with "`..."'. I think it would also be good to get a '"' by typing " twice as like in XEmacs if this is possible but it's not very important. Regards, Bernhard |
From: Srinath A. <sr...@fa...> - 2003-01-15 04:35:04
|
On Tue, 14 Jan 2003, Bernhard Walle wrote: > Hello, > > in german.sty the correct quotation marks are "` and "' (instead of `` > and ''). But if I type "`gut"' for example it's expanded to > "\gammaut. Is there any solution for this? > Hello Bernhard, I've fixed this problem in the latest version. Also, in the present version, if \usepackage{german} is detected, then " expands to "` or '" depending on whether its opening or closing. As of now, editing both german and english files in the same vim session is not supported, but that will come soon... Note that `g will still expand to \gamma (and similarly for other english alphabets) if its not preceded by ", ` or \. This is for typing greek letters. You cannot completeley disable this feature with an option right now. In the future, I'll make this an option... If you really want to disable such expansions, you'll need to comment out lines 96-131 of ftplugin/latex-suite/main.vim Thanks, Srinath |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 23:56:41
|
On Tue, Jan 14, 2003 at 02:11:37PM -0500, Benji Fisher wrote: > > I think it has to do with german Umlauts, as well as hyphenation and > > that stuff... > > however: I guess, every german document should have this package loaded. > > > > btw: the german quotations are like this. "`a text"' > That sounds more like it. Do the package scripts already extract > this information? yes. IMO data for creating mappings (opening quote, closing quote) should go to the package file. Function can be everywhere (most suitable is main.vim). m. |
From: Benji F. <be...@me...> - 2003-01-14 23:13:31
|
Mikolaj Machowski wrote: > On Tue, Jan 14, 2003 at 11:41:50AM -0500, Benji Fisher wrote: > >> That is the function that gets invoked when you type " . But you >>do not have to worry about that: the rest of us can handle the >>implementation. What I need to know is how to tell whether to use >>English or German quotes. Is there a \documentclass option or a >>\usepackage line that you use to tell TeX that you are writing in >>German? I think there must be something like this, because TeX uses >>different hyphenation patterns for different languages. > > > Oops. I did not understand (post about v:lang). > For Polish it will be package polski and: > opening quotes: ,, > closing quotes: '' > > Names of detected packages are stored in g:Tex_package_detected. But > this variable is created by packages.vim which is sourced at the end of > main.vim. > > Mikolaj That is good: it is quite possible that a user will edit two files, one in Polish and the other in German, during the same session. When the user types ", it triggers the s:TexQuotes() function. This function can extract matchstr(g:Tex_package_detected, 'german\|polski\|french') and then use g:Tex_SmartQuoteOpen_{lang} if it exists, and otherwise use the current default. I'll try to implement this tomorrow. --Benji |
From: Mikolaj M. <mi...@wp...> - 2003-01-14 22:00:33
|
On Tue, Jan 14, 2003 at 11:41:50AM -0500, Benji Fisher wrote: > That is the function that gets invoked when you type " . But you > do not have to worry about that: the rest of us can handle the > implementation. What I need to know is how to tell whether to use > English or German quotes. Is there a \documentclass option or a > \usepackage line that you use to tell TeX that you are writing in > German? I think there must be something like this, because TeX uses > different hyphenation patterns for different languages. Oops. I did not understand (post about v:lang). For Polish it will be package polski and: opening quotes: ,, closing quotes: '' Names of detected packages are stored in g:Tex_package_detected. But this variable is created by packages.vim which is sourced at the end of main.vim. Mikolaj |
From: Srinath A. <sr...@fa...> - 2003-01-14 20:35:26
|
On Tue, 14 Jan 2003, Benji Fisher wrote: > Change the defaults. Almost all Insert-mode mappings should be > off by default. > That was not what I was looking for. I would still like German writers to use `g for \gamma. Changing defaults only means that either we hide the problems by default, or just ignore german users... I dont think either is a solution. What I was looking for was ways to "solve" the problem of things like `g getting expanded in unexpected places... Moreover, I think if we actually have a system where `g expands to \gamma very intelligently based on context, then leaving it on by default is not a bad idea at all... "very intelligently" ofcourse depends on programming effort. Right now we only check for english quotes and diacritics, but in the future, we might be able to check if we are in math mode and only then expand... If we can do something like that, then having this feature on by default is a good thing, imo. Another thing: Although its a good thing not to get too invasive with mappings, its also necessary to make something which functions well out of the box. I dont think its good to make it necessary for the user to define lots of variables... The same thing applies to the smart quotes feature... We will definitely have a few bug reports from a few users every now and then, but we should weigh that against how probable it is that an average user would like this feature on (by default). For example, we disabled diacritics by default, because we decided mutually that most users find this too invasive... Before disabling anything by default, we should decide whether the majority would have liked it enabled by defualt... Srinath |
From: Benji F. <be...@me...> - 2003-01-14 19:24:18
|
Srinath Avadhanula wrote: > Sorry about that. The problem is due to `g being mapped to \gamma. I > will fix this now. > > [To Vim devel] > More unprotected quote maps!!! Ouch! As of now, `g doesnt get expanded > in the following scenarios: > > ``g > \`g > > Now it looks like it should also be protected in > > "`g > > As of now, the way to protect against these expansions is to define: > > call IMAP('`g', '\gamma', 'tex') > " The following fake maps are just to make `g not expand when preceded > " \ or `. > call IMAP('``g', '``g', 'tex') > call IMAP('\`g', '\`g', 'tex') > > and so on and so forth... Is this really the correct way to attack this > problem? Or can someone think of something more elegant? Change the defaults. Almost all Insert-mode mappings should be off by default. --Benji |