Last Updated: October 12, 2018
· rodnaph

Change Vim Working Directory

(This might be obvious to most Vim users, but it took me ages to realise I needed it)

I usually keep Vim open at my current project root, but when switching between projects I'd close Vim and then open a new one from the new project. Ignoring the fact it's trivial to change the current working directory from within Vim itself.

:cd /new/path

Now I don't need to close Vim ever again. :D

2 Responses
Add your response

Thanks for the tip! I use the ctrlp ( plugin though, which is why I like to keep Vim at the project root.

over 1 year ago ·

Rooter is a Vim plugin which changes the working directory to the project root when you open a file. More accurately, it'll do this when you open a typical webapp file. These files are identified by their extension.

over 1 year ago ·