How do I open the directory of the current open file?

If I open a file with vim dir/to/my/file.c how can I easily open the directory dir/to/my in vim's filebrowser?


Solution 1:

Try :Ex[plore]. From :help Ex:

:Explore will open the local-directory browser on the current file's directory (or on directory [dir] if specified). The window will be split only if the file has been modified, otherwise the browsing window will take over that window. Normally the splitting is taken horizontally.

Solution 2:

I personally prefer the:

:Sex

command. It does the split window for you, and drops you into the current directory.

:Sex dir/to/my

works too.