ncm2 / ncm2-bufword

completion words from current buffer
MIT License
20 stars 3 forks source link

feature request: complete words from other buffers as well #1

Closed cvlmtg closed 5 years ago

cvlmtg commented 6 years ago

Could it be possible to enable the completion from other buffers as well as the current one? thanks!

roxma commented 6 years ago

That's kind of a different feature.

You should fork this repo and create your own source

cvincent commented 6 years ago

Just switched to ncm2 from ncm and would also love this feature. The following ncm plugin might also help:

https://github.com/fgrsnau/ncm-otherbuf/

I'd be happy to port this but I've never written any autocomplete plugin for ncm or ncm2 or anything else, so I'm not really sure where to start.

roxma commented 6 years ago

This repo is a relatively small example of writing ncm2 source.

You could use this repo as a start, and try some modifications before porting otherbuf.

::help ncm2#register_source and :help ncm2#complete has some information on how ncm2 works.

cvincent commented 6 years ago

@roxma I did some looking into the source of each project and I think I could figure it out, but from what I can tell it looks like it might not be efficient without support for receiving autocmd events from ncm2. It looks like this was a feature in ncm, but not currently in ncm2. Are there plans to support this in ncm2?

roxma commented 6 years ago

it looks like it might not be efficient without support for receiving autocmd events from ncm2

ncm and ncm2 both have the same data flow for autocmd support, except that that ncm2 needs more code. They should have the same performance.

But ncm2's way is more customizable, you could send all required vimscript variables to the source module in one notification, without having to ask for it again in the remote process.

roxma commented 6 years ago

FWIW, I'm working on a pr for ncm2 https://github.com/ncm2/ncm2/pull/28, it will make completion for other buffers more powerful.

roxma commented 5 years ago

https://github.com/fgrsnau/ncm2-otherbuf