Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which taps should I tap to make YouCompleteMe complete my code, especially snip complete? #1863

Closed
DeathPoem opened this issue Dec 28, 2015 · 4 comments

Comments

@DeathPoem
Copy link

THIS is my .vimrc

"==========================
"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

"""" We could also add repositories with a '.git' extension

"""" To get plugins from Vim Scripts, you can reference the plugin
" by name as it appears on the site

"YCM
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

set completeopt-=preview

nnoremap gl :YcmCompleter GoToDeclaration
nnoremap gf :YcmCompleter GoToDefinition
nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration

image

It was shown in this picture after my tapping of "fo". Then, what I can do is to tap to move from a choice to another, the question is what should I tap to expand the complement, especially for a "snip" one?
The other question is why I can't make youcompleteme to complete a function, a class? In this case, I suppose my youcompleteme to complete a func "fopen".
Is some collision happened, since here are to many plugins?

@vheon
Copy link
Contributor

vheon commented Dec 28, 2015

you have to hit <C-Space> for YCM to suggest you global scope functions.

@vheon vheon closed this as completed Dec 28, 2015
@DeathPoem
Copy link
Author

yes, thank you. And which option should I set in .vimrc for me to expand a function prototype ?
I just set" let g:ycm_key_invoke_completion = ''". Should I set another option for the purpose?

@vheon
Copy link
Contributor

vheon commented Dec 29, 2015

If I understood you correctly you're looking for #234 which isn't solved yet. The fix that we have in mind is summarized in #1300

On a side note, why are you setting let g:ycm_key_invoke_completion = ''? It would do nothing special, because we check for emptiness and replace it with the default (<C-Space>)

@DeathPoem
Copy link
Author

Thank you for your suggestion.

I am going to copy this statement " let g:ycm_key_invoke_completion = '' " and paste here. Maybe some error happened on this dialog.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants