ReefPointsBlog

Introducing easydir.vim

Doug Yun

One of the things that I wish Vim had by default is the ability to create directories and files at the same time. Last month at our local OpenHack meetup, I had a conversation about it with a fellow developer and we both concluded that it wouldn't be too difficult to write something up.

Well, I'm happy to introduce easydir.vim!

It adds to the functionality of :new, :edit, :write, and more.

Here are some quick examples:

1
2
3
4
5
6
7
8
:e new_directory/new_file.txt

# Write some things to "new_file.txt" and save it.

:w

# The directory "new_directory/" and the file "new_file.txt"
# are saved!
1
2
3
4
5
6
7
:sp another_directory/another_file.txt

# Write to "another_file.txt" and save the file.

:w

# another_directory/another_file.txt is saved!
1
2
3
4
5
:n thank/you/sir/may/i/have/another.txt

# Write some things to "another.txt" and save it.

:w

The directories and files will be saved under your current project's directory.

Thanks for checking it out and enjoy!