Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Asynchronous NeoVim support #85

Open
xanderdunn opened this issue Jan 18, 2015 · 23 comments
Open

Feature request: Asynchronous NeoVim support #85

xanderdunn opened this issue Jan 18, 2015 · 23 comments

Comments

@xanderdunn
Copy link

This would be a great plugin to make asynchronous because searches often take considerable time where I could be looking through my code instead of staring at ag std output.

NeoVim users could immediately benefit if ag.vim were to support NeoVim's new asynchronous plugin architecture.

@losingkeys
Copy link
Collaborator

This sounds like a good idea. Can you link me to some docs where I can read about how to add neovim support to this plugin? It might be a good idea for me (or whoever implements this) to add vim-dispatch support as well, for people who use that.

@xanderdunn
Copy link
Author

Thanks for your interest!

Start with NeoVim's wiki article on plugin architecture. It links to NeoVim's remote plugin help page, which is probably the single best source of documentation on making a NeoVim remote (asynchronous) plugin.

You might also look at the changes made to YouCompleteMe to support the NeoVim plugin architecture.

Finally, I think another good example of a NeoVim plugin is the Floobits plugin, which is a plugin built intentionally for NeoVim's plugin architecture, not supporting legacy vim plugin architecture.

I'm also trying to learn how to NeoVim-ify plugins so that I can help make a lot of plugins asynchronous.

@ghost
Copy link

ghost commented Jan 21, 2015

There's also this: junegunn/vim-plug#103

@xanderdunn
Copy link
Author

@pyrohh Ohh, that's great! Thanks! The more examples to learn from, the better!

@vhakulinen
Copy link

Any work being done with this?

@losingkeys
Copy link
Collaborator

None by me yet. I need to set up neovim and get started. Hopefully in the next couple of weeks, but I can't be sure. PRs welcome :)

@vhakulinen
Copy link

Wish I had time to stuff like this.. =/

@ches
Copy link

ches commented Feb 6, 2015

FYI, Dispatch support was added to ack.vim pretty easily: mileszs#126.

@losingkeys
Copy link
Collaborator

Hmm, I wonder if we should do something like that, and maybe have option(s) to say "use other plugins" if they're available. That way maybe it uses Dispatch by default, but you can still turn it off (to get the previous behavior, where it's not opening up other terminals/tmux splits/whatever).

I installed neovim, but had some issues with it's python usage. I think it's one of those things where they put python instead of python2 in the #! and arch users have trouble. I'll need to fix my install before starting work on this one.

@ches
Copy link

ches commented Feb 7, 2015

I actually started hacking on Dispatch support, and it's more of a can of worms than it looked. The implementation on ack.vim wasn't very good/thorough/documented, needed some follow-up fixes, and has other extant bugs and shortcomings that I'm realizing as I've tried adding it to ag.vim.

It's not that difficult, per se, it just ends up not being a very natural fit. For instance:

  • Dispatch currently aims to be a :make replacement primarily—it's actually not currently possible to use location lists instead of quickfix as far as I can tell, so that leaves :LAg and friends out of the party. I think having those commands automatically use quickfix instead when Dispatch is in use is a bad idea, they're intended to be separate for a reason. I use :LAg when I have compile/test results already in quickfix that I don't want to get bumped down the :colder stack, etc.
  • Dispatch will automatically load up the quickfix window when a task is done, but there's not really a first-class callback mechanism that lets us hook in and do stuff we'd want to cleanly do when that happens, like applying the mappings. There's an old open pull request discussing this issue, it has to do with there not being reliable ways for Dispatch to fire a callback across the different backends it supports.

I got far enough already that I'll probably open a pull request anyway once I finish and re-share these observations for discussion, but because of these and because ag is so friggin' fast already, I decided to set it aside to work on another feature I'm more interested in.

Of course this is just Dispatch. Onward and upward with discussion of NeoVim 😄

@xanderdunn
Copy link
Author

@losingkeys Since NeoVim has shed internal support for other languages, have you installed the python package for NeoVim support: pip install neovim? Just making sure.

@losingkeys
Copy link
Collaborator

@AlexDunn I didn't read the install instructions, just thought I'd install the editor and it'd work. I'll give that a shot, thanks!

@losingkeys
Copy link
Collaborator

Here's a screenshot of what I see when I open a file (opening the editor seems to work):

2015-02-10-192054_995x720_scrot

I'm thinking it's a python 2/3 issue. Do you know an obvious fix? Otherwise I'll poke around a bit myself.

@vhakulinen
Copy link

Had the same problem. Install python2 version of the neovim stuff.

@losingkeys
Copy link
Collaborator

Odd. I used the aur script to install it. I'll give that a shot though. Thanks.

@mtglsk
Copy link

mtglsk commented Mar 21, 2015

Any progress on this feature?

@losingkeys
Copy link
Collaborator

None from me, other than I found out I had both the python 2 and 3 versions of neovim installed. Not sure if I did that or the AUR script did. Either way you'd think it wouldn't be in the 3 repos if it doesn't work. Anyway it'd be nice to get dispatch/neovim support in the same pull, but like I said I haven't made any progress yet 😄

@ViViDboarder
Copy link

Found a grep plugin that uses nvim's job control and dispatch.

Here's the nvim part: https://github.com/bruno-/vim-man/blob/master/autoload/man/grep/nvim.vim

@nomasprime
Copy link

This would be ♠️

@Numkil
Copy link

Numkil commented Apr 20, 2015

I have made async support for ag.vim in my fork. Some feedback would be nice. It works atm only for :Ag and :LAg. It also supports my current running pull request for searching from root of project if you choose this.
https://github.com/Numkil/ag.nvim
I'm still working on it.

@nomasprime
Copy link

Thanks @Numkil, will check it out.

@Numkil
Copy link

Numkil commented Apr 21, 2015

👍 You are welcome, It is a very fun learning experience. A small remark though, running ag in your /home/ searching for a common word (Something that generates thousands of hits) will still crash vim, due to the way how I have to capture and save the output from the shell job(list operations are expensive in viml). Running long jobs is not a problem as long have you have a reasonable amount of hits.

@ViViDboarder
Copy link

FYI: mhinz/vim-grepper by @mhinz does async ag calls using Dispatch and Neovim. His implementation is a bit different though and it doesn't really function as an ag.vim replacement.

gilbertwyw added a commit to gilbertwyw/dotfiles that referenced this issue Jan 5, 2016
Remove 'ferret' as its current support for NeoVim is not good

Reference:

- wincent/ferret#9
- rking/ag.vim#85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants