Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

init.vim on Windows #436

Closed
gglanzani opened this issue May 2, 2017 · 15 comments
Closed

init.vim on Windows #436

gglanzani opened this issue May 2, 2017 · 15 comments

Comments

@gglanzani
Copy link

Hi,

I noticed that on Windows Oni.exe looks for the init file by looking at ~\oni\$MYVIMRC instead of ~\oni\init.vim (assuming Oni.exe lives in ~\oni. Is this know behavior to scare users off? :)

@bryphe
Copy link
Member

bryphe commented May 2, 2017

Hi @gglanzani ,

Thanks for the issue! Ah yes, this is related to #332 .

If you want to use an init.vim file with Oni, you need to set the oni.loadInitVim value to true. You can do this as follows:

  1. Open Oni
  2. File -> Preferences - Edit Oni Config
  3. Add an entry as follows:
...
"oni.loadInitVim": true,
...

Without this setting, $MYVIMRC isn't populated correctly.

Hope that helps!

@bryphe bryphe added the bug label May 2, 2017
@bryphe bryphe added this to the Backlog milestone May 2, 2017
@bryphe
Copy link
Member

bryphe commented May 2, 2017

It'd be nice to streamline this on Windows in the feature, by detecting this case and showing some actionable message to the user.

@gglanzani
Copy link
Author

@extr0py That is set :)

And when that is set, and I click on Edit Neovim config, it opens ~\oni\$MYVIMRC instead of ~\oni\init.vim

@bryphe
Copy link
Member

bryphe commented May 2, 2017

Weird! With that flag set, it should be able to find $MYVIMRC.

I just updated the binary for Neovim to 0.2.0 in the repo - you might want to try from the latest master. That fixes several Windows issues.

Are you using a released build, or did you build from source?

@gglanzani
Copy link
Author

@extr0py I've overwritten the neovim files (bin, share, and everything below that) with the 0.2.0 release :)

@keforbes
Copy link
Collaborator

keforbes commented May 2, 2017

@extr0py I've overwritten the neovim files (bin, share, and everything below that) with the 0.2.0 release :)

Did that resolve the issue or is $MYVIMRC still not set for you?

@gglanzani
Copy link
Author

@keforbes Yes, that worked (apparently)

@Congee
Copy link

Congee commented Jun 21, 2017

I still have the issue with "oni.useDefaultConfig": false, "oni.loadInitVim": true
BTW, I use the latest v0.2.5 release, with the binary installer Oni-0.2.5-ia32-win.exe.
:/

@bryphe bryphe reopened this Jun 21, 2017
@bryphe
Copy link
Member

bryphe commented Jun 21, 2017

Thanks for the report, @Congee . Bummer - it looks like there are still cases where somehow the $MYVIMRC variable isn't set. It might be more reliable for Oni to directly open the init.vim directly instead of relying on that variable.

@Congee
Copy link

Congee commented Jun 21, 2017

@extr0py Or make the path customizable. 🤔

@cyansprite
Copy link
Contributor

I will look into this.

@AntJanus
Copy link

AntJanus commented Sep 5, 2017

Yeah, I'm still having issues with this. I gutted my .vimrc so that it only includes stuff like keyboard shortcuts and tab width. Has anyone resolved this? $MYVIMRC doesn't seem to expand for me either on Windows.

This is an awesome editor and I'm pretty psyched to get some of my shortcuts/settings in so I can use it full time :)

@CrossR
Copy link
Member

CrossR commented Sep 5, 2017

My init.vim is stored in %LOCALAPPDATA%\nvim\init.vim which is the location that NeoVimQT wanted when I was using that. I didn't move it and its worked fine there so I've just left it there.

No idea if that will help anyone, just thought I should share my setup. This is with Windows 10, and I still have NeoVim + NeoVimQT installed normally which may be the reason for this?

@tobiaskohlbau
Copy link

Looks like a bug within Neovim as :e $MYVIMRC results in similar behavior.

Workaround

Execute the following within Powershell, restart Oni and use File->Preferences->Edit Neovim config.

New-Item $env:USERPROFILE\AppData\Local\nvim\init.vim -type file

@CrossR
Copy link
Member

CrossR commented Oct 12, 2017

In #784 I added the customisation of the init.vim path, so that should help with this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants