alaviss / nim.nvim

Nim plugin for NeoVim
ISC License
202 stars 24 forks source link

Vim support #7

Closed zevv closed 2 years ago

zevv commented 5 years ago

Hi Leorize,

Is adding support for Vim technically possible or is there something nvim can do that vim can't?

alaviss commented 5 years ago

Adding vim8 support is possible. For any vim version lower than that I'd recommend patching up zah/nim.vim. Supporting them will complicate the codebase too much due to the lack of async facility.

Most of the plugin functionality should be able to be ported to vim8 via simple conditionals. I've added enough abstractions for nimsuggest querying for this.

One of the bad things is that semantic highlighting is slow in Vim, and doesn't follow the line, so I may have to leave that out. Bad news is that with the barebones syntax plugin in nim.nvim the code will only have their keywords highlighted.

Of course we could still try matchaddpos to see if it's performant enough to use for semantic highlighting.

I can add vim8 support, but I'd need testers and/or someone who's willing to maintain it since I personally don't use vim. Also, if you wanna try hacking vim8 support in yourself, be my guest, and feel free to ask me on IRC should there be any troubles.

alaviss commented 5 years ago

With PMunch/nimlsp capable of providing some basic functionalities to vim8, and @zevv's been persuaded to use neovim, porting to vim is of low priority.

alaviss commented 5 years ago

With the refactoring branch merged, I believe that it's a lot easier to add vim8 support now, as I've made sure to not use neovim features unless necessary.

0xACE commented 5 years ago

I can add vim8 support, but I'd need testers and/or someone who's willing to maintain it since I personally don't use vim. Also, if you wanna try hacking vim8 support in yourself, be my guest, and feel free to ask me on IRC should there be any troubles.

I can volunteer for that.

I have meant to adjust this plugin for vim8. But sofar zah/nim.vim has worked for me.

One question though is: with the "refactoring branch merge" will it be possible to get all features of nim.nvim working on vim8?

alaviss commented 5 years ago

One question though is: with the "refactoring branch merge" will it be possible to get all features of nim.nvim working on vim8?

No, you'll be missing out on the semantic highlighter. However, vim might have an answer to it already with the new textprop feature. However it's considered to be unstable as of vim 8.1.

0xACE commented 5 years ago

No, you'll be missing out on the semantic highlighter. However, vim might have an answer to it already with the new textprop feature. However it's considered to be unstable as of vim 8.1.

Okay, that's good enough for me :D I'll hit you up on irc when I'm ready :)

alaviss commented 5 years ago

I'm working on Vim8 support myself atm. Stay tuned :)

alaviss commented 5 years ago

So there are some blockers. Looks like my abstractions wasn't high level enough. Adding vim8 support will require restructuring some parts of the plugin, and I'm not sure if it's worth it.

0xACE commented 5 years ago

So there are some blockers. Looks like my abstractions wasn't high level enough. Adding vim8 support will require restructuring some parts of the plugin, and I'm not sure if it's worth it.

Fair enough. Maybe i can try adopting your plugin and slowly restructure small pieces of code until it works :-).

I will let you know if I get stuck.

Note: It will take some time until I try this project, I'm currently busy with life and such...

alaviss commented 5 years ago

I've done some restructuring that should help with adding vim8 support.

alaviss commented 2 years ago

With neovim gaining more and more features, for example the integration of LSP and Lua which I intend to use in this plugin, will certainly make vim support hard if not impossible. Thus I have decided to not support this at all.