YouCompleteme works, but cannot complete the use of TAB

I installed YouCompleteMe using vundle. Then install all the plugins and install YCM with

./install.sh --clang-completer 

This is what my vimrc looks like:

 syntax on set expandtab set cindent set tabstop=4 retab set shiftwidth=4 set hlsearch set paste set ic set number colorscheme molokai set t_Co=256 set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'gmarik/Vundle.vim' Plugin 'tpope/vim-fugitive' Plugin 'tpope/vim-repeat' Plugin 'kien/ctrlp.vim' Plugin 'sjl/gundo.vim' Plugin 'Valloric/YouCompleteMe' Plugin 'scrooloose/syntastic' Plugin 'Valloric/ListToggle' call vundle#end() " required filetype plugin indent on "options for syntastic" set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} set statusline+=%* let g:syntastic_python_checkers=['pep8', 'pylint', 'python'] let g:syntastic_enable_signs=1 let g:syntastic_auto_loc_list=1 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 1 let g:syntastic_error_symbol = "X" let g:syntastic_style_error_symbol = ">" let g:syntastic_warning_symbol = "!" let g:syntastic_style_warning_symbol = ">" let g:syntastic_echo_current_error=1 let g:syntastic_enable_balloons = 1 let g:syntastic_auto_jump=1 "Gundo options" nnoremap <F5> :GundoToggle<CR> "CtrlP options" let g:ctrlp_map = '<cp>' let g:ctrlp_cmd = 'CtrlP' "Powerline stuff" python from powerline.vim import setup as powerline_setup python powerline_setup() python del powerline_setup set laststatus=2 

YCM works, but I cannot switch between sentences using TAB, only using the Down and Down arrows and accepting with Enter.

Why is this happening? Is another program using the TAB key?

thanks for the help

+6
source share
2 answers

The problem was due to the "set paste" line in my .vimrc

So, I deleted it, and when I want to insert large blocks of code in vim, I simply write: set paste to enable it, or: install nopaste to disable it. This switch can also be associated with f10 or any key.

+6
source

By configuring set paste , you will actually disable all mappings and abbreviations.

You only need this set when you actually paste text into a Vim terminal! Itโ€™s best to bind this to a key. Since mappings cannot be used when the option is set, Vim provides a special option for this:

 :set pastetoggle=<F10> 

Further comments

Since ~/.vimrc sent at the start of Vim (when the files transferred to it are not loaded yet), retab not valid; just drop it. If you really want to automatically reuse open files, you will have to use :autocmd BufRead * retab for this, but I would recommend this.

+11
source

Source: https://habr.com/ru/post/981930/


All Articles