neovimhaskell / nvim-hs

Neovim API for Haskell plugins as well as the plugin provider
Other
267 stars 18 forks source link

Adjust to use vimL based plugin starting mechanism #71

Closed saep closed 5 years ago

saep commented 5 years ago

The general idea originally came from @tek .

Since it can be difficult/impossible with the current design to install plugins next to each other if they need different versions of the the same dependency, starting multiple nvim-hs instances seems like a good way to get around this.

Together with the scripts from the new repository nvim-hs.vim, multiple nvim-hs instance can be started next to each other. With a little bit of simple boilerplate, nvim-hs plugins can also be shipped like regular neovim plugins.

To use my ghcid plugin with vim-plugged, you will simply need the following in your neovim config:

Plug '~/src/nvim-hs.vim'
Plug 'saep/nvim-hs-ghcid', { 'for': ['haskell'], }

You can still use a personal Haskell project to combine plugins. However, since the scripts above usually start an nvim-hs plugin host faster than the sandboxed Dyre setups I used, I also remoed Dyre as a dependency. A mechanism to reload changed configuration files doesn't exist yet.

TODO

tek commented 5 years ago

do you actually use the reloading mechanism? It just seems rather exotic to implement this from the inside without sufficient demand.

tek commented 5 years ago

FYI, in my implementation I use stack build --dry-run to determine whether the project needs to be rebuilt.

Also, why not stack exec?

saep commented 5 years ago

I don't like restarting my editor all the time. A working function to compile and restart a plugin host is probably enough, though.

stack exec takes 2-3 seconds on my laptop to start executing. stack build --dry-run takes 2-3 seconds as well. I want my editor to start fast. :-)

tek commented 5 years ago

fair enough! although it's only .3 seconds for the second time, which is still a number, I guess. but I want to point out that not restarting and having immediate startup are counterintuitive requirements ;) In any case, this looks great!

saep commented 5 years ago

It's always 2-3 seconds for me. It might be my 6 year old laptop or something that has to do with the nix-integration.

Thank you for the review!

tek commented 5 years ago

FYI, I successfully started my plugins with nvim-hs.vim (using nvim-hs-1.0.0.2 though)