path: root/doc/write_mkpath.txt
blob: 341662992cd92aa84a70aed81c0c107c597b645c (plain) (tree)







*write_mkpath.txt*	For Vim version 7.0	Last change: 2019 Jun 01

DESCRIPTION				*write_mkpath*

This plugin supports creation of any missing path elements in the path to a
buffer's filename before the buffer is written.

If 'confirm' is enabled on |:write| or |:w|, the user will be prompted to
confirm that Vim should create any missing path elements.

On |:write!| or |:w!|, the path will be created automatically, ignoring the
value of 'confirm'.

The directory creation is done using the |mkdir()| command, with its {path}
argument set to 'p' to create the elements recursively.

REQUIREMENTS				*write_mkpath-requirements*

This plugin only loads if 'compatible' is not set.

CAVEATS					*write_mkpath-caveats*

In Vim 7.0 and 7.1, the path will be created relative to Vim's working
directory at the time of the write operation, which might not be the same as
the working directory when the buffer was first created, e.g. after a |:cd|
change.  This is worked around safely in Vim 7.2 and newer by calculating an
absolute path for new buffers with nonexistent relative paths, but filename
escaping bugs in earlier versions preclude the same fix in older versions.

AUTHOR					*write_mkpath-author*

Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
Inspired by Damian Conway's automkdir.vim plugin:

LICENSE					*write_mkpath-license*

Licensed for distribution under the same terms as Vim itself (see |license|).