vim+latex+\cite{}+F9 autocomplete

zz http://tex.stackexchange.com/questions/52662/getting-cite-autocompletion-to-work-in-gvim-with-latex-suite-on-windows-7

For Windows users out there, I have compiled the whole process:

1 - As Martin mentioned in one of the comments above, latex-suite requires grep to be installed on your system. You can get a Windows version here. Remember the directory of installation. If it is not available, vim just flickers when pressing F9 but doesn't open the completion window. Also check the grepprg setting in your .vimrc file which should be

set grepprg=grep\ -nH\ $*

according to the documentation of latex-suite. Just make sure to include this on a line in your .vimrc file.

2 - Once grep has been installed, you have to make it reachable via the windows environment variable PATH. (in words, grep will thereafter be able to be run with a command-line). To do so, right click on computer -> properties -> Advanced System Settings -> Environment Variables.

2.a - If there is already a PATH variable, edit it. At the beginning of the code, add C:/Program Files/GnuWin32/bin; which is the default installation folder containing the binary files of grep. If you installed it in another directory, choose the complete path to that directory. Use forward slash, not backslash. Do not forget the ; at the end, which will separate the grep path to the others already present in the PATH variable.

2.b - If there is no PATH variable, just create a new variable and name it PATH. Give it the value: C:/Program Files/GnuWin32/bin which is the default installation folder containing the binary files of grep. If you installed it in another directory, choose the complete path to that directory. Use forward slash, not backslash.

Save and quit.

3- Try out if this helped things out. On my setup, I had the list of the sources popping in a split window, but when I pressed enter, the source code was not filled in. The reason was that I did not have a proper Python version. If you have the same problem, go to point 4.

4 - On my setup, I believe vim used version 3.2.3 of Python. This version is too recent and not compatible with vim. Go here and download Python 2.7.3. Install it. On my setup, it did the trick without further settings. Now I can happily use the cite and ref autocompletion.

Thank you all for your help! I hope this post clarifies the issue and provides a useful solution!

5 - Check the file of tex.vim, should include this !!!

 let g:Tex_UsePython = 1

otherwise, when you enter, there's nothing happened. Important one. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值