Current directory of command line tool

It would be nice if instead of setting the current directory, it was set to the directory of the file being opened when using the command line tool.

For example, if I open an existing file:

    vico existing-file.txt

and then want to re-save it:

    :w ./new-file.txt

it puts the file in my home directory instead of what should be the current directory.