aboutsummaryrefslogtreecommitdiff
path: root/doc/write_mkpath.txt
blob: 341662992cd92aa84a70aed81c0c107c597b645c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
*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:
<https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup/blob/cbe1fb5/plugin/automkdir.vim>

LICENSE					*write_mkpath-license*

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

 vim:tw=78:ts=8:ft=help:norl: