How to create directories in emacs

Things I learn and use from emacs, posted here as I learn about them. Note that everything posted here is using emacs 26.3 on windows 10.

First off, how to make a new directory. Reference from: https://stackoverflow.com/questions/155507/how-do-i-create-a-directory-from-within-emacs

To create the directory dir/to/create, type:

M-x make-directory RET dir/to/create RET

To create directories dir/parent1/node and dir/parent2/node, type:

M-! mkdir -p dir/parent{1,2}/node RET

It assumes that Emacs’s inferior shell is bash/zsh or other compatible shell.

To use Dired mode

Use +

C-x d *.py RET ; shows python source files in the CWD in `Dired` mode

+ test RET ; create `test` directory in the CWD

CWD stands for Current Working Directory.

Press q to get out of dired mode.

Just create a new file with non-existing parent directories using C-x C-f and then type:

M-x make-directory RET RET

All non-existent directories will be created.

Comments 0

Leave a Reply

Your email address will not be published. Required fields are marked *