首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何强制YouCompleteMe完成代码,特别是YouCompleteMe?

如何强制YouCompleteMe完成代码,特别是YouCompleteMe?
EN

Stack Overflow用户
提问于 2015-12-28 14:13:58
回答 1查看 1.3K关注 0票数 0

这张照片我的问题看上去像

https://cloud.githubusercontent.com/assets/13230384/12019443/3981e0f6-adab-11e5-85a7-c0ec84b1e63a.png

这是我的.vimrc

代码语言:javascript
复制
"==========================
"vundle
set nocompatible " be iMproved
filetype off " required!
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'    
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
"======================
" plugin on GitHub repo
"======================
" For GitHub repos, you specify plugins using the 'user/repository' format
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
Plugin 'bling/vim-airline'
Plugin 'SirVer/ultisnips'
Plugin 'edsono/vim-matchit'
Plugin 'elzr/vim-json'
Plugin 'honza/vim-snippets'
Plugin 'justinmk/vim-sneak'
Plugin 'kien/ctrlp.vim'
Plugin 'ludovicchabant/vim-lawrencium'
Plugin 'majutsushi/tagbar'
Plugin 'mhinz/vim-signify'
Plugin 'plasticboy/vim-markdown'
Plugin 'scrooloose/nerdcommenter'
Plugin 'sjl/gundo.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-sleuth'
Plugin 'tpope/vim-serround'
Plugin 'tyru/open-browser.vim'
Plugin 'vim-scripts/a.vim'

"color schemes
Plugin 'tomasr/molokai'
Plugin 'flazz/vim-colorschemes'

"========================
" All of your Plugins must be added before the following line
"======================
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on    
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append ! to update or just
":PluginUpdate
" :PluginSearch foo - searches for foo; append ! to refresh local cache
" :PluginClean - confirms removal of unused plugins; append ! to
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line  
"====================================

let mapleader=";"
set incsearch
set ignorecase
set wildmenu
set laststatus=2
set ruler
set number
syntax enable
syntax on
filetype indent on
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set foldmethod=syntax
set nofoldenable
set nowrap

"===========================
"colorscheme
set t_Co=256
set background=dark
"colorscheme solarized
colorscheme molokai
""colorscheme

"=============================
" the ycm_extra_conf.py
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' 
let g:UltiSnipsSnippetDirectories=["mysnippets"]

"================= 
"complete in comment
let g:ycm_complete_in_comments=1
"enable cpptags
let g:ycm_collect_identifiers_from_tags_files=1
"include stdcpp tags
set tags+=/data/misc/software/misc./vim/stdcpp.tags
"disable preview    
set completeopt-=preview

nnoremap <leader>gl :YcmCompleter GoToDeclaration
nnoremap <leader>gf :YcmCompleter GoToDefinition
nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration"

" YouCompleteMe
let g:ycm_key_list_previous_completion=['<Up>']

"" Ultisnips
let g:UltiSnipsExpandTrigger="<c-tab>"
let g:UltiSnipsListSnippets="<c-s-tab>"

这张照片是在我敲击"fo“后出现的。那么,我能做的就是点击" tab“从一个选项转移到另一个选项,问题是我应该点击什么来扩展"snip”1的补语(选项卡不能接受完成,作为什么在用户指南中说)?另一个问题是为什么我不能让你完成一个函数,一个课程?在这种情况下,我想我的你完成了一个有趣的"fopen“。是不是发生了一些碰撞,既然这里有很多插件?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-28 22:24:44

将这些变量设置为适合您的口味的变量:

代码语言:javascript
复制
let g:UltiSnipsExpandTrigger="<c-space>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"

阅读您的帮助,特别是关于语义触发器:

代码语言:javascript
复制
:help ycm_semantic_triggers 
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34495155

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档