Sewdohe / NeoCode

My lean, minimal, and sensible Neovim config. VS-who now?
166 stars 5 forks source link

macOS support #2

Closed brukberhane closed 2 years ago

brukberhane commented 2 years ago

I just wanted to bring attention to the fact that NeocodeInstallerLinux does not work for macOS.

lzambarda commented 2 years ago

Facing a similar issue. I dug a bit in the code and was able to make some progress with the following steps:

  1. Install rust (https://sourabhbajaj.com/mac-setup/Rust/)
  2. Uncomment https://github.com/Sewdohe/nvim-config/blob/c4a9419aae030d4302af7822d1408b270539b059/neoCodeInstaller/src/main.rs#L37-L44
  3. Comment out https://github.com/Sewdohe/nvim-config/blob/c4a9419aae030d4302af7822d1408b270539b059/neoCodeInstaller/src/main.rs#L45 (was always trying to find scoop which is meant for Windows and not MacOS
  4. Run cargo rustc inside the neoCodeInstaller folder. This builds a binary at target/debug/NeocodeInstaller.
  5. Run ./target/debug/NeocodeInstaller --install-packer

    I can get nvim to run and install some dependencies, but then I am not sure if the installation actually went through. I hope this can help but let's wait for the repo owner :-)

brukberhane commented 2 years ago

Alright, thanks @lzambarda! I'm assuming we can use Homebrew for package management and stuff... I'll let you know if it all works out for me

Sewdohe commented 2 years ago

I haven't been able to build the MacOS binary yet, I'm waiting on a friend of mine to build it for me with his M1 and upload it

after that I will create release zips that users can just unzip and run the installer

but as a workaround you should be able to run it with cargo if you feel like installing rust ...sorry folks

Sewdohe commented 2 years ago

Facing a similar issue. I dug a bit in the code and was able to make some progress with the following steps:

  1. Install rust (https://sourabhbajaj.com/mac-setup/Rust/)
  2. Uncomment https://github.com/Sewdohe/nvim-config/blob/c4a9419aae030d4302af7822d1408b270539b059/neoCodeInstaller/src/main.rs#L37-L44
  3. Comment out https://github.com/Sewdohe/nvim-config/blob/c4a9419aae030d4302af7822d1408b270539b059/neoCodeInstaller/src/main.rs#L45 (was always trying to find scoop which is meant for Windows and not MacOS
  4. Run cargo rustc inside the neoCodeInstaller folder. This builds a binary at target/debug/NeocodeInstaller.
  5. Run ./target/debug/NeocodeInstaller --install-packer

    I can get nvim to run and install some dependencies, but then I am not sure if the installation actually went through. I hope this can help but let's wait for the repo owner :-)

and I apologize for this, I push a commit I shouldn't have. This is my first got project that anyone else is using and I should be making branches - I will fix this as soon as I get home in a few hours

lzambarda commented 2 years ago

No worries at all, there's always a first time and this is me really being too curious to not peek into the code! Thanks for creating this repo!

Sewdohe commented 2 years ago

No worries at all, there's always a first time and this is me really being too curious to not peek into the code! Thanks for creating this repo!

thanks man! I really wanna make it easier for the average user to be able to casually say, "hey, let me try Vim as my everyday editor" you know?

Sewdohe commented 2 years ago

just used this config on termux on my android to fix the issue! Can confirm it's working on OSX now?

Sewdohe commented 2 years ago

Hey guys. I just attempted to get a linker to build for OSX on windows and it's seeming impossible, or it's just beyond my knowledge of Rust. Could one of you guys be so kind as to make a build of the OSX binary and upload it? I would appreciate it greatly as I don't know when my friend would have the time to do it and he isn't even a developer and would be difficult to guide him over the phone lol

I'd be glad to help if you have any issues!

brukberhane commented 2 years ago

Sure @Sewdohe, @lzambarda's comment had basically gotten me up and running..... I've been struggling to install nvim nightly though. Keep getting build errors... But anyways I'll fork your repo and make a PR

Edit: I'm getting a bunch of linker errors that I don't really understand

error: linking with `rust-lld` failed: exit status: 1
...
note: rust-lld: error: must specify -arch
Sewdohe commented 2 years ago

Sure @Sewdohe, @lzambarda's comment had basically gotten me up and running..... I've been struggling to install nvim nightly though. Keep getting build errors... But anyways I'll fork your repo and make a PR

Edit: I'm getting a bunch of linker errors that I don't really understand

error: linking with `rust-lld` failed: exit status: 1
...
note: rust-lld: error: must specify -arch

I think this was due to me specifiying the linker in the config.toml when trying to build for windows. If you pull and try again it should work.

Sewdohe commented 2 years ago

The binary for macOS is now live! If anyone could confim that it is working I can close this.

Confirm by deleting the current symlink if there is one to your neovim config folder and then deleting the packer directory:

  1. rm -rf ~/.config/nvim
  2. rm -rf ~/.local/share/nvim/site/pack/packer/start/packer.nvim

and then running the binary with the --install-packer flag

brukberhane commented 2 years ago

Looking good. I've also updated the binary using your latest commit. So I believe we're good to go... now I just need to find a way to build Neovim nightly.... @Izambarda if you have any tricks?

Sewdohe commented 2 years ago

Looking good. I've also updated the binary using your latest commit. So I believe we're good to go... now I just need to find a way to build Neovim nightly.... @Izambarda if you have any tricks?

I should include in the docs that Neovim nightly is only required if you want to run nvim inside of Neovide, which is just a GUI wrapper that gives visual niceties that I think traditional text editor users would like

brukberhane commented 2 years ago

Reference in new issue Report content

legendary.nvim requires nvim 0.7.0 or above. I figured it out by hacking Homebrew a little bit.

Sewdohe commented 2 years ago

Reference in new issue Report content

legendary.nvim requires nvim 0.7.0 or above. I figured it out by hacking Homebrew a little bit.

you got it to install? what's the steps so we can put in the readme in case other users have issues with nightly?

brukberhane commented 2 years ago

I feel like I should also mention that I get this bug when trying to close tabs E5108: Error executing lua ...ite/pack/packer/start/bufferline.nvim/lua/bufferline.lua:164: Vim:E492: Not an editor command: Bdelete 3 This is probably a separate issue though

Sewdohe commented 2 years ago

I feel like I should also mention that I get this bug when trying to close tabs E5108: Error executing lua ...ite/pack/packer/start/bufferline.nvim/lua/bufferline.lua:164: Vim:E492: Not an editor command: Bdelete 3 This is probably a separate issue though

yes, this is an issue with the command called when clicking close button on tabs, I honestly forgot it was doing this 😱 I always use keys to close them. I will add it to my todo-list. thanks!

Sewdohe commented 2 years ago

I feel like I should also mention that I get this bug when trying to close tabs E5108: Error executing lua ...ite/pack/packer/start/bufferline.nvim/lua/bufferline.lua:164: Vim:E492: Not an editor command: Bdelete 3 This is probably a separate issue though

I think the Bdelete command should just be lowercase bdelete in the bufferline.lua if you'd like to try that and do another PR

I'd do it but I'm trying to get my daughter to sleep r n lol

edit: Do you have anything I could contact you on like telegram / discord?

it'd be nice to have another vim enthusiast to bounce ideas off of for this project

brukberhane commented 2 years ago

Yeah I emailed your commit emails with my Telegram accounts

I feel like I should also mention that I get this bug when trying to close tabs E5108: Error executing lua ...ite/pack/packer/start/bufferline.nvim/lua/bufferline.lua:164: Vim:E492: Not an editor command: Bdelete 3 This is probably a separate issue though

I think the Bdelete command should just be lowercase bdelete in the bufferline.lua if you'd like to try that and do another PR

I'd do it but I'm trying to get my daughter to sleep r n lol

edit: Do you have anything I could contact you on like telegram / discord?

it'd be nice to have another vim enthusiast to bounce ideas off of for this project

I've emailed your commit emails with my Telegram username.

lzambarda commented 2 years ago

Sorry for the delay, it was night in my time zone! Let me know if there's anything I can do, maybe testing this when you have implemented @brukberhane changes?

brukberhane commented 2 years ago

Sorry for the delay, it was night in my time zone! Let me know if there's anything I can do, maybe testing this when you have implemented @brukberhane changes?

Yeah @lzambarda, we've totally implemented them! Try out the latest commits!

lzambarda commented 2 years ago

I pulled the latest changes and now I can successfully run ./neoCodeInstaller/NeocodeInstallerMacOS --install-packer however after STEP 3 all I get is an empty nvim terminal.

If I manually try to run the installation command, I get this:

$ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'

Error detected while processing command line:
E492: Not an editor command: PackerSync
Press ENTER or type command to continue

Not sure if something is supposed to happen (vim/nvim amateur here!).

Sewdohe commented 2 years ago

can you try it with iterm instead of default Mac terminal?

When using my friends Mac I noticed the default terminal is lacking

Sent from ProtonMail mobile

-------- Original Message -------- On Feb 21, 2022, 4:40 PM, Luca Zambarda wrote:

I pulled the latest changes and now I can successfully run ./neoCodeInstaller/NeocodeInstallerMacOS --install-packer however after STEP 3 all I get is an empty nvim terminal.

If I manually try to run the installation command, I get this:

$ nvim --headless -c

'

autocmd User PackerComplete quitall

'

-c

'

PackerSync

'

Error detected

while

processing

command

line: E492: Not an editor command: PackerSync Press ENTER or

type

command

to

continue

Not sure if something is supposed to happen (vim/nvim amateur here!).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Sewdohe commented 2 years ago

also, what happens if you run nvim in your terminal after the script?

aside: I made a discord for faster support if you'd care to use that I'll help you directly and maybe we prevent future users from having issues

Sent from ProtonMail mobile

-------- Original Message -------- On Feb 21, 2022, 4:40 PM, Luca Zambarda wrote:

I pulled the latest changes and now I can successfully run ./neoCodeInstaller/NeocodeInstallerMacOS --install-packer however after STEP 3 all I get is an empty nvim terminal.

If I manually try to run the installation command, I get this:

$ nvim --headless -c

'

autocmd User PackerComplete quitall

'

-c

'

PackerSync

'

Error detected

while

processing

command

line: E492: Not an editor command: PackerSync Press ENTER or

type

command

to

continue

Not sure if something is supposed to happen (vim/nvim amateur here!).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

brukberhane commented 2 years ago

I pulled the latest changes and now I can successfully run ./neoCodeInstaller/NeocodeInstallerMacOS --install-packer however after STEP 3 all I get is an empty nvim terminal.

If I manually try to run the installation command, I get this:

$ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'

Error detected while processing command line:
E492: Not an editor command: PackerSync
Press ENTER or type command to continue

Not sure if something is supposed to happen (vim/nvim amateur here!).

I also ran into this problem when I was trying to do this. The installer requires you to be inside the neoCodeInstaller folder when you're running the installer file I just tried the command again from within it and everything worked fine

lzambarda commented 2 years ago

Thanks @brukberhane , this worked for me, I kept on running from nvim-config!

Sewdohe commented 2 years ago

Awesome! Let's close this up.