Tip44: Save Files to Nonexistent Directories
January 12, 2021 ยท View on GitHub
<C-g>
echo the name and status of the current file.
When we run the :write command, Vim will attempt to write the contents of that buffer to a new file using the filepath that was specified when the buffer was created.
:!mkdir -p %:h
-p: tell
mkdirto create intermediate directories.