Ask to create non-existant directories upon saving a new file
If you edit a new file:
vim these/directories/dont/exist/newfile, you won't be able to save the file as the directory
vim is trying to save into does not exist.
Prompt to create directories with :w, or sliently create them with :w!
This code will prompt you to create the directory with
:w, or just do it with
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0
This website is not affiliated with Stack Overflow