sponsor Vim development Vim logo Vim Book Ad

auto_mkdir2.vim : Automatically create directories

 script karma  Rating 9/3, Downloaded by 558  Comments, bugs, improvements  Vim wiki

created by
Martin Tournoij
 
script type
utility
 
description
Homepage: https://arp242.net/code/auto_mkdir2.vim/

-----------------------------------

Introduction
============
Automatically create direcories that don't exist yet when writing a file.

This allows you to do:

    vim ~/a/dir/tree/that/doesnt/exist/new-file.txt

and then just use `:w` (or `ZZ`, or `:up`, etc.) to create the directory tree.

This is basically the same as the "auto_mkdir" plugin, although it was
developed independently. This version has the option to confirm directory
creation and includes a bugfix:
http://www.vim.org/scripts/script.php?script_id=3352

Options
=======
`g:auto_mkdir2_confirm`                 (Boolean, default: 1)
Ask for confirmation before automatically creating a directory.

Commands
========
MkdirP [directory]                                                   `:MkdirP`

Like `mkdir -p` from the shell: it will create all intermediate directories
and will not show an error if the [directory] already exists and is a
directory.

The [directory] is `expand()`-ed. The parameter is optional and [%:h:p] is used
if it is empty.
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
download-from-homepage.tar.gz 1.0 2016-10-31 7.0 Martin Tournoij Download from homepage
ip used for rating: 54.160.244.62

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github