Based on tracyone's vim configuration I have created a fork of necovim that automatically registers as vim omnifunc. Just add the plugin with your favorite vim plugin manager and it will work out of the box with YouCompleteMe.
To add to existing answers, I found empty(v:completed_item) to be unreliable, and sometimes it will be empty even though I have something selected in the pum.
What worked for me was to use complete_info() and directly get the line selected. if the selected line is -1, then we know for sure nothing is selected.
pumvisible() ? (complete_info().selected == -1 ...
It happened to be the problem with how I updated spf13-vim.
I did only
I forgot to do
vim +BundleInstall! +BundleClean +q
After doing that, spf13-vim re-installed some packages and installed following:
After openning new vim files I am now able to use Backspace again without problems with neocomplete....
The following works elegantly without the need for too many bindings.
execute "norm! i\<CR>"
inoremap <CR> <LEFT><RIGHT><C-O>:call <SID>CRComplete()<CR>
Edits: In view of Hotschke's answer, the check for v:completed_item in my function ...
Ycm can cooperate with Shougo/neco-vim
autocmd FileType vim setlocal omnifunc=te#complete#vim_complete
function! te#complete#vim_complete( findstart, base ) abort
let line_prefix = s:get_input()
let ret = necovim#get_complete_position( line_prefix )
if ret < 0
return col( '.' ) " default to current