cknadler / vim-anywhere

Use Vim everywhere you've always wanted to
MIT License
3.67k stars 146 forks source link

Added support for windows #75

Open rahuliyer95 opened 6 years ago

rahuliyer95 commented 6 years ago

38

cknadler commented 6 years ago

Hey Rahul,

Thanks for the PR! I'm not at all familiar with Windows, so it might take me a while to merge this. My concern is that if anything breaks, I won't be able to fix it and I'll have to pull support.

To anyone with a windows machine, can you test this branch and comment here if it works / doesn't work?

To anyone with windows programming experience, can you help me review the code proposed here? Any suggestions on how to make things simple and maintainable are greatly appreciated.

deoxys314 commented 6 years ago

I'm able to get this mostly working, but for some reason the --nofork option is getting lost. As near as I can tell, the Start-Process cmdlet is being used properly, so I'm not sure where this happens.

When I run gvim -f from command prompt, it works as expected, but the arguments list (:args) is empty. When running from the script, the file is successfully written to, but by that time powershell has wiped it out and written nothing to the clipboard (it does not clobber previous data).

Anyone better at powershell than me care to take a look?

As a final note, I can get this (mostly) working on powershell 3.0, but 2.0 throws an error.

deoxys314 commented 6 years ago

Well, part of the reason this isn't working is that Set-Clipboard was not introduced until after 3.0.

I should be able to test this more fully this weekend.

giggio commented 6 years ago

You should run posh with no-profile to make it faster. Also, I couldn't see the autohotkey shortcut installation. We would have to manually install it?

ARezaK commented 5 years ago

any updates for this?

rahuliyer95 commented 5 years ago

Are any more changes needed from my end? Seems to be working fine for me

kohane27 commented 4 years ago

One little caveat: if you're using the latest vim version, remember to change the location as follows

function Find-BinaryPath() {
  $VimBinaries = @(
    "${env:ProgramFiles(x86)}\Vim\vim82\vim.exe",
    "$env:ProgramFiles\Vim\vim82\vim.exe"

Otherwise the script won't execute and powershell will just flash.

n3wjack commented 4 years ago

@cknadler any plans on merging this into main at some point? I see this has been open for quite a while, but I understand the concern of having to support this if you're not using a Windows box. Perhaps this should be moved to its own repo/project instead.

jaggujajamensan commented 9 months ago

Any updates on this?