airblade / vim-rooter

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

Add option to change current working directory manually #114

Closed f0s3 closed 4 years ago

f0s3 commented 4 years ago

I would like to have an option to manually change the cwd. Something like RooterChangeDir or whatever you'd like. I find it useful to be able to set src folder in java projects so that fzf looks into that only, and not on the files above it. I haven't found anything like this in the documentation and thought this is a nice feature to have. Nice plugin btw, like it a lot :smiley:

airblade commented 4 years ago

You can run :Rooter to manually change the current working directory.

To toggle between automatic and manual, use :RooterToggle. To make Rooter start in manual mode, add this to your vimrc:

let g:rooter_manual_only = 1
f0s3 commented 4 years ago

I don't quite understand how these commands may help me change my project root. Could you elaborate more?

airblade commented 4 years ago

Hmm, I'm not sure what you're asking. I thought you were asking how to trigger Rooter to change directory. But are you actually asking how to specify which directory it changes to?

This will make Rooter treat the src folder as a project root directory:

let g:rooter_patterns = ['=src']
f0s3 commented 4 years ago

Yes, that's what I was asking for. Sorry for writing in such a way that you didn't understand the first time you read it. Thank you for your plugin and your help.

airblade commented 4 years ago

Sorry for writing in such a way that you didn't understand the first time you read it.

No need to apologise :)

I'm glad we found a solution.