mhinz / neovim-remote

:ok_hand: Support for --remote and friends.
MIT License
1.73k stars 83 forks source link

Patches specifically for Windows platform #155

Closed ashfinal closed 2 years ago

ashfinal commented 4 years ago

These patches are based on lastest commit 1ec7c6c76a66d8d381f54570d6fdd3079c190ba5, an compilation of #135 and #136. The changes include:

  1. Use multiprocessing module for Windows platform compatibility, i.e. neovim-remote now should work flawlessly on *nix systems and Windows.

  2. Fixed --serverlist option. --serverlist arg didn't work on Windows, this fixed it.

  3. Also produce gnvr binary for GUI use. If you want to add "Edit with Neovim" to right click menu, this is your thing. Your Windows registry entry should look like this:

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\nvim-qt]
    @="Edit with Neovim"
    "Icon"="\"C:\\tools\\neovim\\Neovim\\bin\\nvim-qt.exe\""
    
    [HKEY_CLASSES_ROOT\*\shell\nvim-qt\command]
    @="\"C:\\Program Files\\Python38-32\\Scripts\\gnvr.exe\" \"%1\""
    
    [HKEY_CLASSES_ROOT\Directory\shell\nvim-qt]
    @="Edit with Neovim"
    "Icon"="\"C:\\tools\\neovim\\Neovim\\bin\\nvim-qt.exe\""
    
    [HKEY_CLASSES_ROOT\Directory\shell\nvim-qt\command]
    @="\"C:\\Program Files\\Python38-32\\Scripts\\gnvr.exe\" \"%1\""
  4. Nvr can lauch multiple neovim instances now. By default, nvr uses the address 127.0.0.1::6789 on Windows while /tmp/nvimsocket on *nix systems. But if you explicitly designate a valid --servername option, nvr will help start another neovim instance, unless --nostart option is included simultaneously.

  5. Other minor fixes. Please refer to commit messages if you are interested.

@mhinz Please merge this PR instead, now it should have no conflict. If anyone want to try this, plesse clone this repo, checkout the win_platform branch, then type python setup.py install on your Windows prompt.

mhinz commented 2 years ago

Sorry, I wasn't exactly active recently and by now nvr.py has diverged quite a bit.

If you're still interested in solving this, it's probaby easier by now to just reopen multiple small PRs that are easier to review, since I don't want to spend much time on this project.

Otherwise I'll try to cherrypick your commits (although I can't really check for Win compatibility).

ashfinal commented 2 years ago

Sorry for the late reply.

Yeah, I'm still interested. I don't use Windows much nowadays, but I do have a dual-boot machine. Just need some time to refresh my memory...

I will try to create some mergeable pr in today or tomorrow.

ashfinal commented 2 years ago

follow-up #177