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: 
If I understand your question correctly, you want :e. to show you the files in the same directory as the first file. If that's correct, and if the files are in one directory, use `:cd path-to-your-project-directory`

That will change your working directory to your project directory, and subsequently `:e.` will show the files in that directory.

Note too that once you use `:e.` (or `:Explore :Texplore or :Sexplore`), you can navigate through your directory hierarchy by navigating to subdirectories and pressing enter, or to the `..` entry and pressing enter to move up a directory.

You may also be interested in the NERDTree plugin.
I agree with other answers:

* `:e.` provides a listing of the current working directory.
* Plugins such as NERDTree build on this basic idea but also allow you to store bookmarks to commonly visited files and other cool features, [see](http://www.vim.org/scripts/script.php?script_id=1658)
* If you augment this with plugins like bufkill, and tagbar you can actually build up quite a feature rich IDE where you can edit project files within the same context. I put together an installer script you can grab from [here](http://www.vim.org/scripts/script.php?script_id=4898)