prabirshrestha / asyncomplete.vim

async completion in pure vim script for vim8 and neovim
MIT License
923 stars 60 forks source link

Preserve default behaviour of C-n and C-p when possible #27

Closed purpleP closed 3 years ago

purpleP commented 7 years ago

I've already opened similar issue on deoplete and Shougo was kind enough to implement it after I've made a pull request. The behaviour I want to preserve is when there is not popupmenu (because there's no completion yet because you haven't entered enough characters to trigger it) C-n and C-p should insert closest next/previous word. It's actually pretty useful in some cases. Consider in python Some = namedtuple('| pressing C-p here twice would insert Some. Or when passing keyword arguments in python context=context instead of retyping one could simply press C-p. Also there is a recipe that uses this behaviour to create a mapping to autoclose xml tags.

prabirshrestha commented 7 years ago

Could you point me to the PR from deoplete?

purpleP commented 7 years ago

@prabirshrestha https://github.com/Shougo/deoplete.nvim/pull/411 It may not be clear, but he hasn't merged this pull request. He have done something else to achieve the same functionality.

roxma commented 7 years ago

Looks like it's to restore user's completeopt when the plugin is not popping anything.

purpleP commented 7 years ago

@roxma yes, basically it is. This is probably the only thing preventing me to use this plugin. Not that deoplete isn't good enough, but I like portability across vim/neovim that this plugin provides.

prabirshrestha commented 5 years ago

https://github.com/prabirshrestha/asyncomplete.vim/pull/69 Would this solve or do we still need that fix. We can try fixing it in v2 branch.

prabirshrestha commented 5 years ago

It should had been solved by https://github.com/prabirshrestha/asyncomplete.vim/pull/69 let me know if you are still having issues.

roxma commented 5 years ago

FYI, ncm2 have two autocmds, Ncm2PopupOpen and Ncm2PopupClose, one can use something like this for changing completeopt when the plugin is active or inactive:

autocmd User Ncm2PopupOpen set completeopt=noinsert,menuone,noselect
autocmd User Ncm2PopupClose set completeopt=menuone
prabirshrestha commented 5 years ago

That does sound better. Will reopen it for now.

habamax commented 4 years ago

@purpleP Pls check #175

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.