In command-mode, e.g. when you do :e ~/somedir/file but before pressing enter, file completion pops up. I can press tab if I happened to enter the prefix of a valid entry, and it will complete it. For example, if there is a file called file_something.txt then this works. If there are multiple entries, tab again to select the next. But if the file is instead named something_file.txt I can see the completion result, but pressing tab does nothing. How do I select the completion?
Repro steps
touch ~/file_something.txt
nvim -u repro.vim (listed below)
:e ~/som
You can see the completion right there, but does nothing, and will edit ~/som.
repro.vim
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
augroup plug_install
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
augroup END
endif
" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
call plug#begin('~/.vim/plugged')
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-path'
call plug#end()
lua <<EOF
local cmp = require('cmp')
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})
})
EOF
In command-mode, e.g. when you do
:e ~/somedir/file
but before pressing enter, file completion pops up. I can press tab if I happened to enter the prefix of a valid entry, and it will complete it. For example, if there is a file calledfile_something.txt
then this works. If there are multiple entries, tab again to select the next. But if the file is instead namedsomething_file.txt
I can see the completion result, but pressing tab does nothing. How do I select the completion?Repro steps
:e ~/som
You can see the completion right there, but does nothing, and will edit
~/som
.repro.vim