airblade / vim-rooter

Changes Vim working directory to project root.
MIT License
1.21k stars 72 forks source link

Search for parent as root with vim-startify #92

Closed Mte90 closed 5 years ago

Mte90 commented 5 years ago

Right now rooter set the folder only if it is the parent but not if I run vim and the file that I open it is subfolder.

let g:rooter_patterns = ['.git/']
let g:rooter_resolve_links = 1
let g:rooter_silent_chdir  = 1

Let me explain:

If I run vim with the file2.php the path is right but if I open file.php it isn't. I am configuring it badly maybe?

airblade commented 5 years ago

Is this what you have?

foo/
  +- .git/
  +-folder/
  |    +-file.php
  +-file2.php

And you are saying when you do cd foo && vim folder/file.php or cd foo/folder && vim file.php vim-rooter doesn't set the working directory to foo?

I can't reproduce the problem.

Your configuration looks fine.

airblade commented 5 years ago

At what commit is your installation of vim-rooter?

Mte90 commented 5 years ago

I am using the latest version and this is my full vim configuration file https://github.com/mte90/my-scripts/blob/master/vim/vimrc

But I understand the issue, seems that when I pick the files from Startify rooter is not executed https://github.com/mhinz/vim-startify. If I run nvim from a file in a subfolder is working fine.

Mte90 commented 5 years ago

After looking a bit seems that from the command line the path is right but not in Nerdtree. Sorry for the disturb, I have to see how update the path in nerdtree