vim-ycm-latex-semantic-completer


Ⅰ. 插件描述

This is a Latex Completer for YouCompleteMe.

Ⅱ. 基本信息

创建日期:  2015-09-14
使用用户:  1
Github星:  10
插件作者:  Corentin Ribeyre

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

vim-ycm-latex-semantic-completer

What is this?

This is a Latex Completer for YouCompleteMe.
It completes citations (\cite{}) and references to labels (\ref{}). It is based
on an old version of vim-ycm-tex
that was using Linux commands to extract labels and bibliography IDs.

How do I use it?

  • YCM completers need to be made available in your YCM directory. There's a
    subdirectory $HOME/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/completers/tex.

This completer should be added in the tex directory (create it if it does not exist)

  • The completer will look for a .bib file to determine the main directory of your
  1. When this is done, it is able to walk through every subdirectory to index
  2. and bib ids.
  • You need to add a semantic completion part in your .vimrc:
    let g:ycm_semantic_triggers = {
        \ 'tex'  : ['{']
    \}

BibTeXParser

To enhance the popup completion with part of the title and authors, we use the bibtexparser
module from this repository.

This allows YCM to display a popup like this :

turing:1935     On Computable Numbers... (Turing Alan)
knuth:1984      Literate Programming (Knuth Donald E.)

You can install the bibtexparser via easy_install or pip

sudo pip install bibtexparser

If the bibtexparser is not present on the system, the completer will fallback into
the bibid only mode displaying only bibids in the completion popup.

Are there limitations?

Of course:

  • Your .tex and .bib files should be in UTF-8.
  • You absolutely need to have a .bib file, because that is how the completer is able
  1. determine the main directory of your .tex project.

添加新评论