Originally posted by SciYro
if you pass a directory to vi, it will not edit it, but display what files there are, and let you pick what file to edit.
If you pass a directory to vim
it will display the files and allow you to pick one to edit. If you pass a directory to vi, it opens it as a read-only file and displays the contents.
It is impossible to "edit" a directory, per say. All editing must come through the system calls (unlink(2) and all those). Now, this is not true in very odd and particular circumstances (aka, you need to work very hard at it -- unmounting a disk and reading the whole thing as a file would be one way to circumvent this... but there is no "good" reason to do this).