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).
Try :let g:startify_change_to_dir = 0
.
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.
Here is a asciinema link of the issue: https://asciinema.org/a/NZo0jp08Dau6Rvd7yGJcuB5ub
Thanks for the screencast. I see the problem but I can't reproduce it.
Please could you share your vimrc / init.vim?
Thanks @airblade .
Nvim Config: https://github.com/collegeimprovements/dotfiles/tree/master/.config/nvim
Vim-rooter Config: https://github.com/collegeimprovements/dotfiles/blob/master/.config/nvim/plug-config/vim-rooter.vim
Most of the settings: https://github.com/collegeimprovements/dotfiles/blob/master/.config/nvim/general/settings.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
Oh. That indeed sorted it. Thanks a lot @airblade 😊