Thread: [Vim-latex-devel] Some issues with completion
Brought to you by:
srinathava,
tmaas
From: Dan P. <da...@lc...> - 2005-11-21 04:18:11
|
Hi there, \ref and \cite completion did not work for me out of the box with the 2005.11.19 release and vim 6.3.86 on a debian testing linux machine. The issue is with grep: curly brackets were not being correctly escaped. This is with the line set grepprg=3D/bin/grep\ -nH\ $* in $VIM/ftplugin/tex.vim. It might be my version of grep...I'm not sure. In any case, two changes to $VIMRUNTIME/ftplugin/latex-suite/texview.vim got things working for me. In both cases, I added double-quotes to expressions to fix the issue. First, I changed line 543 to call Tex_Grepadd('"@.*{'.a:prefix.'"', "%") Second, on line 625: call Tex_Grepadd('"\label{'.a:prefix.'"', "%") I wanted to express my appreciation for the work you guys put into latex-suite. It is immensely convenient. Hopefully the info above will be useful to you. cheers, Dan --=20 Daniel Pemstein Email: db...@ui..., da...@lc... Web: http://www.danpemstein.com PGP: http://www.danpemstein.com/files/pgp.txt |
From: Srinath A. <sri...@gm...> - 2005-11-21 05:11:19
|
Hi Dan, Thanks for pointing this out... I am afraid that adding doublequotes isn't a very portable solution. There are multiple ways in which the grep command finally gets to the underlying operating system. One of the most common way is: bash -c "grep -nH pattern filelist" In this invokation, having double quotes in the pattern would definitely screw things up. What would be better is escaping the characters which grep treats specially. Is this whats happening in your case? It will help if you can supply an example of when things go wrong for you.. Also, I am curious about your OS and your 'shell' setting. Thanks, Srinath On 11/20/05, Dan Pemstein <da...@lc...> wrote: > Hi there, > > \ref and \cite completion did not work for me out of the box with the > 2005.11.19 release and vim 6.3.86 on a debian testing linux machine. > The issue is with grep: curly brackets were not being correctly > escaped. This is with the line > > set grepprg=3D/bin/grep\ -nH\ $* > > in $VIM/ftplugin/tex.vim. It might be my version of grep...I'm not > sure. In any case, two changes to > $VIMRUNTIME/ftplugin/latex-suite/texview.vim got things working for > me. In both cases, I added double-quotes to expressions to fix the > issue. First, I changed line 543 to > > call Tex_Grepadd('"@.*{'.a:prefix.'"', "%") > > Second, on line 625: > > call Tex_Grepadd('"\label{'.a:prefix.'"', "%") > > I wanted to express my appreciation for the work you guys put into > latex-suite. It is immensely convenient. Hopefully the info above > will be useful to you. > > cheers, > > Dan > > -- > Daniel Pemstein > Email: db...@ui..., da...@lc... > Web: http://www.danpemstein.com > PGP: http://www.danpemstein.com/files/pgp.txt > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (GNU/Linux) > > iD8DBQFDgUmIItxEqhMqILgRAnkQAJ4hjSQ26dXgZSWgbz9UYWTKVmk0bQCfWQ/6 > fIIvrn27Uq3yxuYNFHvtjIs=3D > =3DS8Ii > -----END PGP SIGNATURE----- > > > |
From: Dan P. <da...@lc...> - 2005-11-21 15:25:50
|
Srinath, I'm surprised my little kludge worked at all, to be honest. I initially just added a let retVal =3D escape(retVal, "{") to Tex_EscapeForGrep. I thought I'd gotten things all worked out because it fixed the issue with label-searching, but bibtex was still a problem. Actually, this escape actually messes things up when used in concert with the double-quotes. My shell is tcsh. If I switch to bash in my .vimrc (or any time before loading the latex-suite stuff) the original code works fine. Interestingly, so does my double-quoted version. My OS is simply GNU/Debian Linux using the testing (etch) distribution. I originally was working with the packaged .deb (based on a late 2004 release) of latex-suite, but ran into the same difficulty and decided to upgrade to the newest snapshot before tinkering. tcsh version: tcsh 6.14.00 (Astron) 2005-03-25 (i486-intel-linux) options wide,nls,bye,al,ng,rh,nd,color,filec bash version: GNU bash, version 3.00.16(1)-release (i486-pc-linux-gnu) Copyright (C) 2004 Free Software Foundation, Inc. grep version: grep (GNU grep) 2.5.1 The short summary is, use tcsh and you should be able to reproduce this issue. Yet another reason for me to finally switch to bash. cheers, Dan On Sun, Nov 20, 2005 at 09:11:13PM -0800, Srinath Avadhanula wrote: > Hi Dan, >=20 > Thanks for pointing this out... I am afraid that adding doublequotes > isn't a very portable solution. There are multiple ways in which the > grep command finally gets to the underlying operating system. One of > the most common way is: >=20 > bash -c "grep -nH pattern filelist" >=20 > In this invokation, having double quotes in the pattern would > definitely screw things up. What would be better is escaping the > characters which grep treats specially. Is this whats happening in > your case? It will help if you can supply an example of when things go > wrong for you.. Also, I am curious about your OS and your 'shell' > setting. >=20 > Thanks, > Srinath >=20 > On 11/20/05, Dan Pemstein <da...@lc...> wrote: > > Hi there, > > > > \ref and \cite completion did not work for me out of the box with the > > 2005.11.19 release and vim 6.3.86 on a debian testing linux machine. > > The issue is with grep: curly brackets were not being correctly > > escaped. This is with the line > > > > set grepprg=3D/bin/grep\ -nH\ $* > > > > in $VIM/ftplugin/tex.vim. It might be my version of grep...I'm not > > sure. In any case, two changes to > > $VIMRUNTIME/ftplugin/latex-suite/texview.vim got things working for > > me. In both cases, I added double-quotes to expressions to fix the > > issue. First, I changed line 543 to > > > > call Tex_Grepadd('"@.*{'.a:prefix.'"', "%") > > > > Second, on line 625: > > > > call Tex_Grepadd('"\label{'.a:prefix.'"', "%") > > > > I wanted to express my appreciation for the work you guys put into > > latex-suite. It is immensely convenient. Hopefully the info above > > will be useful to you. > > > > cheers, > > > > Dan > > > > -- > > Daniel Pemstein > > Email: db...@ui..., da...@lc... > > Web: http://www.danpemstein.com > > PGP: http://www.danpemstein.com/files/pgp.txt > > > > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.2 (GNU/Linux) > > > > iD8DBQFDgUmIItxEqhMqILgRAnkQAJ4hjSQ26dXgZSWgbz9UYWTKVmk0bQCfWQ/6 > > fIIvrn27Uq3yxuYNFHvtjIs=3D > > =3DS8Ii > > -----END PGP SIGNATURE----- > > > > > > >=20 --=20 Daniel Pemstein Email: da...@lc... Web: http://www.danpemstein.com PGP: http://www.danpemstein.com/files/pgp.txt |