airblade/vim-rooter

Doesn't change to .git - home directory when opening file from vim-startify.

Closed this issue · 11 comments

Hi airblade,

vim-rooter works great for me.
It doesn't work though when i open files from vim-startify plugin.
Running :Rooter sets the correct working directory (i.e. the directory with .git folder).

It works. Thanks a lot @airblade

Hi @airblade let g:startify_change_to_dir = 0 changes to Root directory (one with .git folder in hierarchy) only after saving the file that gets opened.
Is there a way to change to change to root directory when we open the file from startify and don't save it one time ?

I can't reproduce this. As soon as I open a file from Startify, vim-rooter changes the working directory to the file's root.

Thanks for the screencast. I see the problem but I can't reproduce it.

Please could you share your vimrc / init.vim?

I re-implemented vim-rooter in 9b1fc7a. Please could you update and let me know whether you still have this problem?

Hi @airblade I still face the same issue with latest version of vim-rooter.
On first save it changes to correct directory(the one with .git folder).

You're sourcing your startify config (with let g:startify_change_to_dir = 1) after you source your rooter config (let g:startify_change_to_dir = 0) so your rooter config is being overwritten.

source $HOME/.config/nvim/plug-config/vim-rooter.vim
source $HOME/.config/nvim/plug-config/vim-signify.vim
source $HOME/.config/nvim/plug-config/vim-startify.vim

https://github.com/collegeimprovements/dotfiles/blob/4991ff3902fa4569fbc0da58575cabf62cd841e5/.config/nvim/init.vim#L38-L40

Oh. That indeed sorted it. Thanks a lot @airblade 😊