To open new files while in vim I usually do the following:
:tabe my_newfile
However, say I want to open a new file in a NEW directory, like so:
:tabe newdir/my_newfile
leads to the error
"newdir/my_newfile" E212: Can't open file for writing
Is there a smooth way to create the newdir automatically?
Try the plugin auto_mkdir. It sounds exactly what you are searching for.
PS: I don’t have used it, and I will not (due to the comment of @Aaron_Digulla