I installed ycm with vimplug and it's working, but I have to press <C-n> to scroll through the autocompletion menu.

How can I remap that to <tab>?

my .vimrc:

call plug#begin()

Plug 'preservim/nerdtree'
Plug 'Townk/vim-autoclose'
Plug 'bfrg/vim-cpp-modern'
Plug 'simeji/winresizer'
Plug 'Valloric/YouCompleteMe'
Plug 'KarimElghamry/vim-auto-comment'

Plug 'ryanoasis/vim-devicons'
call plug#end()

let g:AutoClosePreserveDotReg = 0

let g:ycm_global_ycm_extra_conf='~/.vim/plugged/YouCompleteMe/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf=0
let g:ycm_python_binary_path='/usr/bin/python3'

set relativenumber
set tabstop=4
set paste
" let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
autocmd VimEnter * NERDTree | wincmd p
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif

syntax on
set title
set ruler
set encoding=UTF-8
set wildcharm=<tab>

set omnifunc=cppcomplete#CompleteCPP

vnoremap <silent><C-/> :AutoInlineComment<CR>
nnoremap <silent><C-/> :AutoInlineComment<CR>

nmap <F4> :silent !make <CR>

"colorscheme dracula
packadd! dracula
colorscheme dracula

  • Welcome vi.SE @C0sM1n :) Did you try inoremap?
    – gildux
    Jan 17, 2023 at 21:29

1 Answer 1


At a fist glance, I'd go for something like

inoremap Ctrl-i Ctrl-n

But there's a cleaner way to achieve it. Please have a look at https://vim.fandom.com/wiki/Autocomplete_with_TAB_when_typing_words to update your ~/.vimrc accordingly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.