How can I change my working directory to the path of the file that I currently have open?
Example
You can just type
:cd %:h
since %:h will be replaced by the head of the path to the current file.
%:h