spf13 / spf13-vim

The ultimate vim distribution
http://vim.spf13.com
Apache License 2.0
15.55k stars 3.64k forks source link

<CR> behave strangely under neocomplete. #792

Open cofol1986 opened 9 years ago

cofol1986 commented 9 years ago

Hi all, I try the newest repository and fail to get the and correctly.

problem

while I got the pop menu and select an omni item then press , the selected candidate disappear and showing my original input. As an example, when I typing pri, I got the pop up menu:

print
printf
println

then I select println and press , I get my original pri not the expecting println. I change the CleverCr() as follows to fix the problem:

function! CleverCr()
    if pumvisible()
        let exp = "\<Plug>(neosnippet_expand)"
        return exp . neocomplete#smart_close_popup()
    else
        return "\<CR>"
    endif
endfunction

problem

seems can only be applied to neosnippet item on pop up menu, the omni and buffer item not.

aftnix commented 9 years ago

Had same problem

On Thu, Jun 11, 2015 at 2:39 PM, cofol1986 notifications@github.com wrote:

Hi all, I try the newest repository and fair to get the and correctly.

problem while I got the pop menu and select an omni item then press , the selected candidate disappear and showing my original input. As an example, when I typing _pri_, I got the pop up menu: print printf println then I select _println_ and press , I get my original _pri_ not the expecting _println_. I change the CleverCr() as follows to fix the problem: function! CleverCr() if pumvisible() let exp = "(neosnippet_expand)" return exp . neocomplete#smart_close_popup() else return "" endifendfunction problem seems can only be applied to neosnippet item on pop up menu, the omni and buffer item not. — Reply to this email directly or view it on GitHub https://github.com/spf13/spf13-vim/issues/792.
archr commented 9 years ago

Me too. :(

halfcrazy commented 9 years ago

+1

FiloSpaTeam commented 9 years ago

Try configuration in my fork

rodfersou commented 9 years ago

take a look at this issue https://github.com/Shougo/neocomplcache.vim/issues/350 and consider taking out autoclose.vim and use auto-pairs instead

rodfersou commented 9 years ago

this comment fix the problem https://github.com/Shougo/neocomplcache.vim/issues/350#issuecomment-105707520

iunmap <Esc>
qqibrow commented 9 years ago

+1. not using autoclose and iunmap <Esc> doesn't work. @rodfersou

wsdjeg commented 8 years ago

i think my config can ignore this ieeue ,can you have a try

function MyEnterfunc()                                                            
if pumvisible()
return "\<esc>a"
else
return "\<Enter>"
endif
endf
inoremap <silent> <buffer> <CR> <C-r>=MyEnterfunc()<Cr>
wsdjeg commented 8 years ago

or

inoremap <silent> <buffer> <CR> pumvisible()?  "\<esc>a" :  "\<Enter>"
JinqiangZeng commented 8 years ago

@wsdjeg , it works for me! Thank you

taxilian commented 8 years ago

I did:

iunmap <expr> <Esc>

it worked for me...

wsdjeg commented 8 years ago

@taxilian inmap to esc when you need just enter hiw do you do

qqibrow commented 8 years ago

@wsdjeg it works! Thank you!