Oni: init.vim on Windows

Created on 2 May 2017  路  15Comments  路  Source: onivim/oni

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? :)

bug help wanted

Most helpful comment

I will look into this.

All 15 comments

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!

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

@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

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?

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

@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?

@keforbes Yes, that worked (apparently)

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.
:/

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.

@extr0py Or make the path customizable. 馃

I will look into this.

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 :)

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?

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

keforbes picture keforbes  路  19Comments

badosu picture badosu  路  24Comments

badosu picture badosu  路  20Comments

justinmk picture justinmk  路  22Comments

phaazon picture phaazon  路  21Comments