Question: I open up a project in Vim. Lets call it `portfolio`. I open up the `index.php` but now want to leave that and go to another file, `controller.php`. I learned that the command `:e.` will take me out but then it may lead me outside the scope of my project.

How do I stay within the scope of my project when leaving a file in vim?

Answer: 
Your initial working directory in vim is the directory you're in when you start vim. If you're in a directory other than your project directory when you start vim, :e will not change your current directory to your project directory when you open a file, so if you just use :e to open different files, you'll have to specify the path each time.

eg: say your project path is /project/foo and you cd to /project and open vim. To open /project/foo/a.txt, you'll have to :e foo/a.txt. If you then want to open file /project/foo/b.txt, you'll have to :e foo/b.txt. :e doesn't change the current working directory in vim. If you cd /project/foo then start vim, you can just do :e a.txt and :e b.txt

You could also do :cd foo from within vim in the scenario above.

Hope this helps
I would say, just open controller.php with `:sp controller.php` you can then edit both files and switch between then with: `^w k` and `^w j`