vim-ycm-tex


Ⅰ. 插件描述

Latex Completer for YouCompleteMe

Ⅱ. 基本信息

创建日期:  2013-07-11
使用用户:  3
Github星:  18
插件作者:  Bjoern Doebel

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'bjoernd/vim-ycm-tex'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'bjoernd/vim-ycm-tex'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'bjoernd/vim-ycm-tex'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/bjoernd/vim-ycm-tex

Ⅳ. 文档说明

vim-ycm-tex

What is this?

This is a Latex Completer for YouCompleteMe.
It completes citations (\cite{}) and references to labels (\ref{}).

How do I use it?

  • YCM completers need to be made available in your YCM directory. There's a
    subdirectory python/ycm/completers. This completer should be added there

with the name tex.

  • To enable automatic completion, you need to tell YCM about the triggers that
    should run the TeX completer. These triggers are LaTeX's ref and cite comannds.

YCM provides the g:ycm_semantic_triggers option that allows adding new triggers.
Therefore, add

let g:ycm_semantic_triggers = {
\  'tex'  : ['\ref{','\cite{'],
\ }

to your .vimrc to enable automatic semantic completion. (Found by Bart Z. Yueshen)

Are there limitations?

Of course:

  • The completer uses hard-coded Linux shell commands and therefore won't work
    on Windows.
  • The BIB completion only considers BIB files in the current working directory.
  • BIB entries are assumed to start at the beginning of a line and have the format:
    \<type>{<name>, ... -- name will then be selected for completion.

添加新评论