rogual / neovim-dot-app

Mac OS X GUI for Neovim
1.13k stars 62 forks source link

init.vim #208

Closed ApolloTang closed 8 years ago

ApolloTang commented 8 years ago

How do I tell neovim-dot-app to load my init.vim? I have it at:
~/.config/nvim/init.vim

rogual commented 8 years ago

init.vim loading is handled by the nvim binary itself. Does terminal nvim load your init.vim?

ApolloTang commented 8 years ago

yes, ternimal nvim's :echo $MYVIMRC point to ~/.config/nvim/init.vim but neovim-dot-app's :echo $MYVIMRC return nothing :(

0xjairo commented 8 years ago

I'm experiencing the same issue. I did a brew update and reinstalled both neovim and neovim-dot-app (brew reinstall --HEAD neovim, brew reinstall --HEAD neovim-dot-app) and still experience the same problem.

One other thing I noticed, aside from the empty $MYVIMRC is that the first path in rtp points to /.config/nvim instead of ~/.config/nvim (note the missing ~)

@ApolloTang can you confirm this? (in neovim-dot-app do :set rtp?)

0xjairo commented 8 years ago

I found my problem. In my .bashrc file I had export XDG_CONFIG_HOME=$HOME/.config. Replacing $HOME with ~ fixed it.

I'm guessing that $HOME evaluates to an empty string in the neovim environment spawned by neovim-dot-app. Which is confusing because if I run :echo $HOME it evalutaes properly to /Users/username.

@rogual Any idea what is going on here? I did notice that you're calling execve() in process.cc with an extern declared environment (environ) variable. Where is it defined? I couldn't find it anywhere else in the code...

ApolloTang commented 8 years ago

@dotjairo $HOME is not evaluated

export XDG_CONFIG_HOME=~/.config "<-------works export XDG_CONFIG_HOME=$HOME/.config "<-------will not work

Thanks so much !

rogual commented 8 years ago

@dotjairo Not quite sure, but it wouldn't be the first bit of environment weirdness to be reported. I am also not super familiar with XDG so I couldn't tell you if what you're doing there is supported, though it looks like it should be.

environ is defined in I think libc? See man environ. It should be the current process's environment.

0xjairo commented 8 years ago

well, today I leanred about environ, thanks

ApolloTang commented 8 years ago

it turns out that setting:

    export XDG_CONFIG_HOME="~/.config"

will result with conflict in other program. For example Midnight Commander will save its configuration as:

    "~/~/.config/mc/ini"

I am reverting to: export XDG_CONFIG_HOME="$HOME/.config"

Please re open this issue