title: Opening files in the same folder as the current file, in vim
body: <p>In vim, when I have a buffer open, I often need to load another file in the same directory that file is in, but since I don't usually <code>cd</code> into it, the <code>pwd</code> is a parent folder, so I have to retype the path every time. Is there a shortcut for this? or a way to change the pwd to the directory the file is in?</p>
  
  <p>example:</p>
  
  <pre><code>cd /src
  vi lib/foo/file.js
  </code></pre>
  
  <p><em>lib/foo</em> has two files: <code>file.js</code> and <code>file2.js</code></p>
  
  <p>in vi:</p>
  
  <pre><code>:e file2.js  # doesn't work
  </code></pre>