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]: Support neovim #29

Closed
romgrk opened this issue May 28, 2019 · 49 comments · Fixed by #77
Closed

[Feature Request]: Support neovim #29

romgrk opened this issue May 28, 2019 · 49 comments · Fixed by #77

Comments

@romgrk
Copy link

romgrk commented May 28, 2019

I'm ready to send a PR if you're fine with this.

@puremourning
Copy link
Owner

Thanks for that!! Happy to take a look. If it’s complex and likely to break easily, then I might take a view.

@romgrk
Copy link
Author

romgrk commented May 28, 2019

Na, won't be complex, I like simple things.

Main issues I see:

  • neovim doesn't support python's vim.bindeval
  • neovim/vim job & channel API is different

@puremourning
Copy link
Owner

Does neovim support prompt buffers?

@romgrk romgrk mentioned this issue May 28, 2019
3 tasks
@romgrk
Copy link
Author

romgrk commented May 28, 2019

Prompt buffers?

@puremourning
Copy link
Owner

Yes, Vimspector uses them for the watches window and the console window

Here's the vim help on them: https://vimhelp.org/channel.txt.html#prompt-buffer

Basically, you enter insert mode and can type one line, which is then passed to a callback. handy for REPLs.

if you want to pop over to the Gitter room, happy to discuss :)

@jpfeiffer16
Copy link
Contributor

For my reference as much as anybody else's, here is the pr for some vim patches that includes prompt buffers.
neovim/neovim#10433

@puremourning
Copy link
Owner

Nice 👍

@romgrk
Copy link
Author

romgrk commented Jul 15, 2019

Tbh, prompt buffers are the easiest part to emulate. Window-toolbars are the real issue :/ But it's nice to not have to emulate them :)

@puremourning
Copy link
Owner

I think we can live without WinBars in NeoVim. People can just use the mappings. Would be satisfied with a PR that didn’t enable them if something like has( ‘winbar’ ) was false.

@jpfeiffer16
Copy link
Contributor

Cool. So far, I haven't found a patch for that submitted against neovim, but maybe we can start with this once the pr for prompt-buffers is merged.

@romgrk
Copy link
Author

romgrk commented Jul 24, 2019

Sounds good to me, I'll continue the PR when prompt-buffers are merged.

@puremourning
Copy link
Owner

👍

@stfl
Copy link

stfl commented Sep 20, 2019

I looks like prompt-buffers are scheduled for nvim 0.5 so that might take awhile as 0.4 just came out.. :(

@jpfeiffer16
Copy link
Contributor

I just saw that as well.

@amustafa
Copy link

amustafa commented Oct 15, 2019

Looks like the nightly build is tagged as 0.5: https://github.com/neovim/neovim/releases/tag/nightly

@adelarsq
Copy link
Contributor

There is no plans I think neovim/neovim#8805

@puremourning
Copy link
Owner

#76

@vn-ki
Copy link

vn-ki commented Jan 7, 2020

How much is enough people @puremourning?

@adelarsq
Copy link
Contributor

adelarsq commented Jan 7, 2020

@vn-ki some features on neovim side where dropped. So isn't a easy task to support this plugin there. I did some search on this to help, but there are so many things to do that I can't help right now.

@LinArcX

This comment has been minimized.

@adelarsq

This comment has been minimized.

@LinArcX

This comment has been minimized.

@adelarsq

This comment has been minimized.

@puremourning

This comment has been minimized.

@puremourning
Copy link
Owner

@vn-ki to be honest enough people have asked now. there's clearly a real demand. I'll have to evaluate what's required and if i can get solid CI working with neovim.

I was going to work on windows support next, but i think there's more of a demand for neovim. We can just make a gimped version that doesn't use prompt buffers, and find some workaround for the bindeval thing.

@doronbehar
Copy link

@puremourning Do you think that Creating a :VimspectorEval and :VimspectorWatch commands as I've suggested (but failed to deliver) in #52 (comment) might be a good start towards "gimping" vimspector for Neovim?

@puremourning
Copy link
Owner

@doronbehar yeah that's what i was thinking.

@puremourning puremourning pinned this issue Jan 8, 2020
@puremourning
Copy link
Owner

There is no compatibility between Vim and neovim APIs and feature sets, and the neovim maintainers have said that there's little desire to make them compatible. That includes:

  • all job APIs are different (someone wrote async.vim layer, but it's only part of the story)
  • all terminal APIs are different
  • popup and balloon APIS are different
  • channel APIs differ (I think, though channels are possibly older than the fork)
  • if_python (vim python interface) is not 100% compatible
  • prompt buffers are missing (there's a PR for it but it's stalled)
  • WinBar is missing
  • it's marginally harder to make neovim work with python plugins due to its out of process model

Possibly others not yet discovered. So while i would like to do this, it's not going to be quick, and will require a lot of effort and testing. It's going to be hard to prioritise this amount of work and ongoing maintenance.

@puremourning puremourning mentioned this issue Jan 8, 2020
11 tasks
@puremourning
Copy link
Owner

But never fear, i have a working prototype: #77

Feedback welcome. It's missing bits, but it sorta works.

@hariamoor-zz
Copy link

@puremourning Bit late to the party, but this might lighten the load on you.

I've seen lots of plugins for Neovim that only work with the master branch (not yet a stable release), but people still heavily use them and give feedback. If things like prompt buffers aren't in a stable release yet, then it shouldn't be a big deal to not support a stable release until they are.

FWIW, many Neovim users compile the master branch from source themselves (like me). The project has diverged from Vim proper and lacks the manpower to prioritize both their own roadmap and Bram's, so users tend to be happy to content themselves with unstable integrations. If you went this route, it wouldn't be a problem.

@doronbehar
Copy link

I've seen lots of plugins for Neovim that only work with the master branch (not yet a stable release), but people still heavily use them and give feedback.

I'm not familiar with any such plugins, it'd be nice to hear some examples :)

If things like prompt buffers aren't in a stable release yet, then it shouldn't be a big deal to not support a stable release until they are.

Prompt buffers are not only not in stable - they are not even merged to master, see neovim/neovim#10433. More over, even trying to merge this PR locally and then building Neovim with it is not trivial at all, - the PR needs to be rebased. I've tried doing that a while ago and I've experienced crashes unrelated to this feature.

@puremourning
Copy link
Owner

Have you tried the neovim vimspector branch? It’s feature complete now. No prompt buffers and no Winbar. I added ex commands to replace them.

@puremourning
Copy link
Owner

Oh and it works with the latest release as that’s all I have to test with.

@hariamoor-zz

This comment has been minimized.

@hariamoor-zz

This comment has been minimized.

@puremourning

This comment has been minimized.

@puremourning
Copy link
Owner

users tend to be happy to content themselves with unstable integrations.

I doubt that any user is ‘happy’ with an unstable anything. Perhaps ‘tolerant’ is more likely :)

In practice I’m going to have a quick look at what it will take to port the tests to run on neovim, but most likely I will merge neovim support as a ‘best efforts’ feature. So that sort of aligns with what you’re saying, and the experimental nature of this project

@mergify mergify bot closed this as completed in #77 Jan 19, 2020
@ovidius72
Copy link

Thanks for the effort. Can you please clarify what is missing for neovim users ?
I see no balloons/tooltip and no WinBar on neovim. Are those the only missing things ?
Is there any other way to quickly inspect a variable value (without adding it to the watches) in the code window when in pause ? Thanks.

@puremourning
Copy link
Owner

did you see this ? https://github.com/puremourning/vimspector#neovim-differences

I think balloons could be made to work. IIRC vimspector checks for has( 'balloonevalterm' ). it's possible that check should be skipped for neovim.

@puremourning
Copy link
Owner

@ovidius72 I updated the above section to be more explicit about neovim's deficiencies vs Vim-proper.

@ovidius72
Copy link

Thanks @puremourning
I saw that in the documentation. I was not sure whether they are missing in neovim or could be used with the :Vimspector* command. It would be nice to have balloons replace in neovim with the preview window, and have the change to bind some keys to show it up.
However, that's really a great plugin.

@puremourning
Copy link
Owner

puremourning commented Jan 26, 2020

I'm not going to write yet-more-code just to monkey patch yet more missing features in Neovim. But you can probably make a mapping that does something like :VimspectorEval <cexpr> which would show the value under the cursor in the Console window.

@puremourning
Copy link
Owner

Actually, this works better:

:nmap <leader>ve :<c-u>call vimspector#Evaluate( expand( '<cexpr>' ) )<CR>

I could add a <plug> mapping for that, e.g.:

nnoremap <Plug>VimspectorEvalWord
      \ :<c-u>call vimspector#Evaluate( expand( '<cexpr>' ) )<CR>

PR welcome for that

@oblitum
Copy link

oblitum commented Jan 26, 2020

It would be nice to have balloons replace in neovim with the preview window

I'd s/preview window/floating window/. There's so many plugins leveraging both vim and neovim floating windows lately, imo balloons have turned into a deprecated artifact.

@ovidius72
Copy link

ovidius72 commented Jan 26, 2020

@oblitum I just wanted to say that that to emulate the balloons thing in neovim, the preview window could be used. I missed a d. it should have been "replaced" :-)

@puremourning
Copy link
Owner

@oblitum but in neovim I have to write a load of code to achieve that feature. In vim it's like trivial. Making vim use a popup as a balloon? Trivial. There is no all-event mouse tracking in neovim, you end up with having to write a ton of code to manage the popup (whose neovim API is really complex compared to the vim one) and position it, hide it, show it, blah blah blah. I'm just not willing to invest that effort for what should be simple, and is in vim.

@oblitum
Copy link

oblitum commented Jan 26, 2020

@puremourning OK, thing is I've seen so many coc extensions relying on floating windows for widely different purposes, from displaying LSP actions list to alternative spelling display, etc, some of which I use, I thought it wouldn't be that hard. Another thing is that balloons seems tied to mouse? I'm not sure whether it's a mouse feature only, but in that case I'd really not miss it at all as I don't use mouse for nothing when editing/debugging.

@eyalk5
Copy link
Contributor

eyalk5 commented Jan 27, 2020

neovim/neovim#2544 (comment)

No intention to support balloons. Need help in implementing this feature? (hope I have the time)

@puremourning
Copy link
Owner

Well, they haven't made popups easy to use, and they haven't implement all event mouse tracking, so balloons can't be implemented using them.

I would review a PR that does something useful with popups that works in Vim and neovim. But I will not maintain a separate implementation/faeature set just for neovim's lack of certain features.

@puremourning puremourning unpinned this issue Jan 27, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.