YouCompleteMe: a code-completion engine for Vim
===============================================
[![Build Status](https://travis-ci.org/Valloric/YouCompleteMe.svg?branch=master)](https://travis-ci.org/Valloric/YouCompleteMe)
- [Intro](#intro)
- [Installation](#installation)
- [Mac OS X](#mac-os-x-super-quick-installation)
- [Ubuntu](#ubuntu-linux-x64-super-quick-installation)
- [Windows](#windows-installation)
- [FreeBSD/OpenBSD](#freebsdopenbsd-installation)
- [Full Installation Guide](#full-installation-guide)
- [User Guide](#user-guide)
- [General Usage](#general-usage)
- [Client-server architecture](#client-server-architecture)
- [Completion string ranking](#completion-string-ranking)
- [General semantic completion](#general-semantic-completion-engine-usage)
- [C-family semantic completion](#c-family-semantic-completion-engine-usage)
- [Semantic completion for other languages](#semantic-completion-for-other-languages)
- [Writing new semantic completers](#writing-new-semantic-completers)
- [Diagnostic display](#diagnostic-display)
- [C# diagnostic support](#c-diagnostic-support)
- [Diagnostic highlighting groups](#diagnostic-highlighting-groups)
- [Commands](#commands)
- [YcmCompleter subcommands](#ycmcompleter-subcommands)
- [Options](#options)
- [FAQ](#faq)
- [Contact](#contact)
- [License](#license)
Intro
-----
YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for
[Vim][]. It has several completion engines:
- an identifier-based engine that works with every programming language,
- a [Clang][]-based engine that provides native semantic code
completion for C/C++/Objective-C/Objective-C++ (from now on referred to as
"the C-family languages"),
- a [Jedi][]-based completion engine for Python,
- an [OmniSharp][]-based completion engine for C#,
- a [Gocode][]-based completion engine for Go,
- a [TSServer][]-based completion engine for TypeScript,
- and an omnifunc-based completer that uses data from Vim's omnicomplete system
to provide semantic completions for many other languages (Ruby, PHP etc.).
![YouCompleteMe GIF demo](http://i.imgur.com/0OP4ood.gif)
Here's an explanation of what happens in the short GIF demo above.
First, realize that **no keyboard shortcuts had to be pressed** to get the list
of completion candidates at any point in the demo. The user just types and the
suggestions pop up by themselves. If the user doesn't find the completion
suggestions relevant and/or just wants to type, they can do so; the completion
engine will not interfere.
When the user sees a useful completion string being offered, they press the TAB
key to accept it. This inserts the completion string. Repeated presses of the
TAB key cycle through the offered completions.
If the offered completions are not relevant enough, the user can continue typing
to further filter out unwanted completions.
A critical thing to notice is that the completion **filtering is NOT based on
the input being a string prefix of the completion** (but that works too). The
input needs to be a _[subsequence][] match_ of a completion. This is a fancy way
of saying that any input characters need to be present in a completion string in
the order in which they appear in the input. So `abc` is a subsequence of
`xaybgc`, but not of `xbyxaxxc`. After the filter, a complicated sorting system
ranks the completion strings so that the most relevant ones rise to the top of
the menu (so you usually need to press TAB just once).
**All of the above works with any programming language** because of the
identifier-based completion engine. It collects all of the identifiers in the
current file and other files you visit (and your tags files) and searches them
when you type (identifiers are put into per-filetype groups).
The demo also shows the semantic engine in use. When the user presses `.`, `->`
or `::` while typing in insert mode (for C++; different triggers are used for
other languages), the semantic engine is triggered (it can also be triggered
with a keyboard shortcut; see the rest of the docs).
The last thing that you can see in the demo is YCM's diagnostic display features
(the little red X that shows up in the left gutter; inspired by [Syntastic][])
if you are editing a C-family file. As Clang compiles your file and detects
warnings or errors, they will be presented in various ways. You don't need to
save your file or press any keyboard shortcut to trigger this, it "just happens"
in the background.
In essence, YCM obsoletes the following Vim plugins because it has all of their
features plus extra:
- clang_complete
- AutoComplPop
- Supertab
- neocomplcache
YCM also provides semantic go-to-definition/declaration commands for C-family
languages & Python. Expect more IDE features powered by the various YCM semantic
engines in the future.
You'll also find that YCM has filepath completers (try typing `./` in a file)
and a completer that integrates with [UltiSnips][].
Installation
------------
### Mac OS X super-quick installation
Please refer to the full Installation Guide below; the following commands are
provided on a best-effort basis and may not work for you.
Install the latest version of [MacVim][]. Yes, MacVim. And yes, the _latest_.
If you don't use the MacVim GUI, it is recommended to use the Vim binary that is
inside the MacVim.app package (`MacVim.app/Contents/MacOS/Vim`). To ensure it
works correctly copy the `mvim` script from the [MacVim][] download to your
local binary folder (for example `/usr/local/bin/mvim`) and then symlink it:
ln -s /usr/local/bin/mvim vim
Install YouCompleteMe with [Vundle][].
**Remember:** YCM is a plugin with a compiled component. If you **update** YCM
using Vundle and the ycm_support_libs library APIs have changed (happens
rarely), YCM will notify you to recompile it. You should then rerun the install
process.
**NOTE:** If you want C-family completion, you MUST have the latest Xcode
installed along with the latest Command Line Tools (they are installed when you
start Xcode for the first time).
Install CMake. Preferably with [Homebrew][brew], but here's the [stand-alone
CMake installer][cmake-download].
_If_ you have installed a Homebrew Python and/or Homebrew MacVim, see the _FAQ_
for details.
Compiling YCM **with** semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
Compiling YCM **without** semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe
./install.py
If you want semantic C# support, you should add `--omnisharp-completer` to the
install script as well. If you want Go support, you should add `--gocode-completer`.
If you want semantic TypeScript support, install the TypeScript SDK with
`npm install -g typescript`
That's it. You're done. Refer to the _User Guide_ section on how to use YCM.
Don't forget that if you want the C-family semantic completion engine to work,
you will need to provide the compilation flags for your project to YCM. It's all
in the User Guide.
YCM comes with sane defaults for its options, but you still may want to take a
look at what's available for configuration. There are a few interesting options
that are conservatively turned off by default that you may want to turn on.
### Ubuntu Linux x64 super-quick installation
Please refer to the full Installation Guide below; the following commands are
provided on a best-effort basis and may not work for you.
Make sure you have Vim 7.3.584 with python2 support. Ubuntu 14.04 and later have
a Vim that's recent enough. You can see the version of Vim installed by running
`vim --version`. If the version is too old, you may need to [compile Vim
from source][vim-build] (don't worry, it's easy).
Install YouCompleteMe wit
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
网上有一些ycm的介绍。大多数情况都需要编译,这里制作了适合win32和linux平台的ycm插件,已经编译并测试过。 win32需要gvim74,linux再ubuntu10.04,centos6.4下测试通过。 win下需要utf-8的encoding设置,如果出现乱码,请用win_utf_dll中的文件覆盖gvim的原有文件。 linux如果出现glibc不兼容(编译时使用的glib2.11,支持debian6,Fedora19,ubuntu10和redhat及以下),需要设置LD_LIBRARY_PATH到插件的third_party/ycmd目录,该目录携带了编译时使用的动态库 版本:clang3.3,官网有二进制发布版
资源推荐
资源详情
资源评论
收起资源包目录
vim的ycm插件,编译好的,适合win32和linux (7211个子文件)
cursor.104 0B
cursor.105 0B
cursor.105 0B
cursor.114 0B
cursor.120 0B
cursor.122 0B
cursor.126 0B
cursor.126 0B
cursor.129 0B
cursor.130 0B
cursor.1348 0B
cursor.138 0B
cursor.139 0B
cursor.140 0B
cursor.164 0B
cursor.174 0B
cursor.182 0B
cursor.1835 0B
cursor.191 0B
cursor.286 0B
cursor.327 0B
cursor.355 0B
cursor.359 0B
cursor.43 2B
cursor.44 0B
cursor.45 0B
cursor.47 0B
cursor.51 0B
cursor.53 0B
cursor.53 0B
cursor.53 0B
cursor.552 0B
cursor.58 0B
libc.so.6 1.34MB
cursor.62 0B
cursor.67 0B
cursor.70 0B
cursor.71 0B
cursor.72 0B
cursor.76 0B
cursor.79 0B
cursor.80 0B
cursor.82 0B
cursor.82 0B
cursor.84 0B
cursor.85 0B
cursor.87 0B
cursor.88 0B
cursor.88 0B
cursor.91 0B
cursor.96 0B
_vimrc_example 594B
configure.ac 6KB
configure.ac 3KB
requests-logo.ai 208KB
requests-logo.ai 208KB
Makefile.am 10KB
Makefile.am 7KB
app 239B
AUTHORS 1KB
all.bash 267B
make.bat 5KB
make.bat 5KB
make.bat 5KB
make.bat 3KB
lang_c.c 3KB
module.c 309B
gtest.cbproj 10KB
gtest_unittest.cbproj 9KB
gtest_main.cbproj 8KB
gtest_unittest.cc 245KB
gtest.cc 193KB
gmock-matchers_test.cc 183KB
gtest_pred_impl_unittest.cc 78KB
gmock-spec-builders_test.cc 71KB
gtest-printers_test.cc 53KB
gtest-death-test.cc 51KB
gtest-death-test_test.cc 45KB
gmock-actions_test.cc 44KB
gmock-generated-matchers_test.cc 43KB
gtest-port_test.cc 42KB
gtest-port.cc 41KB
gmock-generated-actions_test.cc 41KB
gtest-param-test_test.cc 33KB
gtest_output_test_.cc 33KB
gmock-spec-builders.cc 31KB
gmock-more-actions_test.cc 24KB
gtest-filepath_test.cc 24KB
gmock-internal-utils_test.cc 23KB
gmock-generated-function-mockers_test.cc 19KB
gmock-matchers.cc 19KB
gtest-filepath.cc 15KB
gtest-unittest-api_test.cc 13KB
gmock-nice-strict_test.cc 13KB
gtest-printers.cc 13KB
gmock-cardinalities_test.cc 12KB
gtest-typed-test_test.cc 12KB
gtest-listener_test.cc 10KB
gtest_stress_test.cc 10KB
gmock_stress_test.cc 9KB
共 7211 条
- 1
- 2
- 3
- 4
- 5
- 6
- 73
资源评论
- boyunfeng2015-10-02没有用上,还是自己进行了编译,不过还是感谢分享haomarlin2016-06-16以前忘记忘记说明,这个需要vs2012的再发布包。
haomarlin
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功